 
var sections = Array('DealerRewards','GiftCheckOut','catalogMenu','GiftCatalogProcess','DealerCatalog','changePwdForm','DealerApplications','homeCare','automotive','vacationPackages','giftCertificates','sports','tools','electronics','view_admin_passwords','admin_options','div_promotion_tracker_details','div_promotion_tracker','NewApplicationUsers','div_create_new_employee','div_view_employee_logins','div_view_employee_levels','div_emp_change_my_pass','div_view_app_mod_history','div_register_app_nums');
var popups   = Array('DealerSignInForm','ExistingMembersForm','DealerRewards');
var sectionsSize = 25, popupsSize = 3;
var catalogsSize = 8;
var catalogs = Array('officeDealership','homeCare','automotive','vacationPackages','giftCertificates','sports','tools','electronics');
DAYS_PER_MONTH = [31,29,31,30,31,30,31,31,30,31,30,31];

/***
 [function description]
 @PARAMETERS
 	[@parameter1]
 	...
 	[@parameterX]
 @RETURN VALUE
	[description]
 ***/
function fix_if2(heit)
{
	if(heit && heit > 0)
	{
		var obj1 = window.parent.document.getElementById('iframe');
		obj1.style.height=heit + 'px';
		//alert("Heit is: "+heit + " and Object Height is: "+obj1.style.height);
		window.parent.scrollTo(0, 0);
	}
}


function openPage3(banner,frame){
	var newImg = new Image();
	var heit = 0;
	var width = 0;
	if(	window.parent.document.getElementById('bannerFrame').src != "Images/"+banner)
	{
		newImg.src = "Images/"+banner;
		heit = newImg.height;
		wid = newImg.width;
		if (heit >0)
		{
			//alert("height is: "+heit);
			window.parent.document.getElementById('bannerFrame').style.height =heit+20+'px';
		}
		window.parent.document.getElementById('bannerFrame').src="Images/"+banner; //"banner3.png"
	}
	window.parent.document.getElementById('iframe').src=frame; //"roadAllowance.html"
	window.parent.document.getElementById('iframe').src.style.visibility="visible";
}



function redirect(Site)
{
	window.location = Site;
}

function openPagesh(frame){
	window.parent.document.getElementById('iframe').src=frame; 
}

function FixI(heit)
{
	var obj1 = window.parent.document.getElementById('iframe');
	if (obj1)
	{
		h = heit+"px";
		obj1.style.height = h;
	}
}
/*************/
function fieldcheck( oEl, ln, nxt ) { 
	if( oEl.value.length >= ln ) 
	{ 
		eval( 'oEl.form.'+nxt+'.focus()' ); 
	} 
} 


	function changet(obj)
	{
		obj.src="images/Dealer_Login2.jpg";
	}
	function change2t(obj)
	{
		obj.src="images/Dealer_Login_Main.jpg";
	}
	function change3t(obj)
	{
		obj.src="images/Dealer_Login3.jpg";
	}
	function changeth(obj)
	{
		obj.src="images/Dealer_Home2.jpg";
	}
	function change2th(obj)
	{
		obj.src="images/Dealer_Home.jpg";
	}
	function change3th(obj)
	{
		obj.src="images/Dealer_Home2.jpg";
	}

/***
 [function description]
 @PARAMETERS
 	[@parameter1]
 	...
 	[@parameterX]
 @RETURN VALUE
	[description]
 ***/
function setFocus(id)
{
  //document.mainForm.txt_appnum1.focus();
  id.focus();
}

function pdft9()
{
	window.open("/pdfs/TERMS_AND_COND_T9.pdf");
}

function pdft8()
{
	window.open("/pdfs/Terms_And_Conitions_T8.pdf")
}

/***
 [function description]
 @PARAMETERS
 	[@parameter1]
 	...
 	[@parameterX]
 @RETURN VALUE
	[description]
 ***/
function upperCase(obj)
{
	obj.value=obj.value.toUpperCase();
}

/***
 function ShowCatalog() will display a specific catalog
 @PARAMETERS
 	@catalogID : the id of the catalog to show
 @RETURN VALUE
 ***/
function ShowCatalog(catalogID)
{
	// hide all catalogs first:
	var obj = null;
	for (i = 0; i < catalogsSize; i=i+1) {
	obj = document.getElementById(catalogs[i]);
		if(obj) 
			obj.style.display = "none"
}
	if (catalogID)
	{
		obj = document.getElementById(catalogID);
		if (obj)
			obj.style.display = "inline";
	}
}

/***
 [function description]
 @PARAMETERS
 	[@parameter1]
 	...
 	[@parameterX]
 @RETURN VALUE
	[description]
 ***/
function showQty(id)
{
    	var obj = document.getElementById(id);
    	if (obj.style.display == 'inline')
    	{
    		obj.style.display = 'none';
		}
    	else
    	{
    		obj.style.display = 'inline';
		}
} 

/***
 [function description]
 @PARAMETERS
 	[@parameter1]
 	...
 	[@parameterX]
 @RETURN VALUE
	[description]
 ***/
function hid2(show1,show2)
{
	Show('','');
    if(show1  && show1 !="")
	{
		showObj1 = document.getElementById(show1);
	  	showObj1.style.display = 'none';
	}
	if(show2 && show2 != "")  
	{
		showObj2 = document.getElementById(show2);
		if (showObj2.style.display == 'none')
		{
			showObj2.style.display = 'inline';
		}
		else
		{
			showObj2.style.display = 'none';
		}
	}
}

function Show2(show1,show2)
{
	Show('','');
    if(show1  && show1 !="")
	{
		showObj1 = document.getElementById(show1);
	  	showObj1.style.display = 'inline';
	}
	if(show2 && show2 != "")  
	{
		showObj2 = document.getElementById(show2);
		if (showObj2.style.display == 'inline')
		{
			showObj2.style.display = 'none';
		}
		else
		{
			showObj2.style.display = 'inline';
		}
	}
}

/***
 function Show() will display a new page represented by variable 'showID'
 and hide a page represented by variable 'hideID' @PARAMETERS
 @PARAMETERS
 	showID : the content to show
 	hideID : the content to hide
 @RETURN VALUE
 ***/
function Show(showID, hideID)
{
	var showObj = null;
	
	// hide all objects first, if hideID is null:
	if (hideID == '')
	{
		for (i = 0; i < sectionsSize; i=i+1)
		{
			var hideObj = document.getElementById(sections[i]);
			if (hideObj)
				hideObj.style.display = "none";
		}
	}
	
	if (hideID)
	{
		var hideObj = document.getElementById(hideID);
		if (hideObj)
			hideObj.style.display = "none";
	}
	
	if (showID)
	{
		showObj = document.getElementById(showID);
		if (showObj)
			showObj.style.display = "inline";
	}
	
	// show dealer's sign in and existing members:
	showObj = document.getElementById('mainlinks');
	if (showObj)
		showObj.style.display = "inline";
}

/***
 function Show() will display a new page represented by variable 'showID'
 and hide a page represented by variable 'hideID' @PARAMETERS
 @PARAMETERS
 	showID : the content to show
 	hideID : the content to hide
 @RETURN VALUE
 ***/
function ShowInParent(showID, hideID)
{
	var showObj = null;
		
	if (hideID)
	{
		var hideObj = window.parent.document.getElementById(hideID);
		
		// if hideObj does not exist in the parent document,
		// check if it exists in the current document:
		if (!hideObj)
			hideObj = document.getElementById(hideID);
		
		// if the object exists, hide it:
		if (hideObj)
			hideObj.style.display = "none";
	}
	
	if (showID)
	{
		showObj = window.parent.document.getElementById(showID);
		
		// if showObj does not exist in the parent document,
		// check if it exists in the current document:
		if (!showObj)
			showObj = document.getElementById(showID);
			
		// if the object exists, display it:
		if (showObj)
			showObj.style.display = "inline";
	}
}

/***
 function ShowPopUp() will display a popup centered to the user's screen
 @PARAMETERS
 	showID : the id of a popup to show
 	hideID : the id of a popup to hide
 @RETURN VALUE
 ***/
function ShowPopUp(showID, hideID, x, y)
{
	var obj;

	// hide all popups first:
	for (i = 0; i < popupsSize; i=i+1)
	{
		obj = document.getElementById(popups[i]);
		if (obj)
			obj.style.display = "none";
	}
		
	if (showID)
	{
		obj = document.getElementById(showID);
		if (obj)
		{
			obj.style.display = "inline";

			if (x == 1)
				obj.style.left = (document.body.clientWidth - (obj.offsetWidth ? obj.offsetWidth : 0)) * 0.5;
			
			if (y == 1)
				obj.style.top = document.body.scrollTop + (document.body.clientHeight - (obj.offsetHeight ? obj.offsetHeight : 0)) * 0.5;
		}
	}
	if (hideID)
	{
		obj = document.getElementById(hideID);
		if (obj)
			obj.style.display = "none";
	}
}

/***
 this function will select all checkboxes in a <select></select> tag
 @PARAMETERS
 	checkbox : the <select></select> object
 @RETURN VALUE
 ***/
function SelectAll(checkbox)
{
	var frm = checkbox.form;
	for (var i = 0; i < frm.length; i++)
	{
		if(frm[i].type == 'checkbox' && frm[i].name != 'chk_All')
		{
			frm[i].checked = checkbox.checked;
		}
 	}
}

/***
 this function will select/unselect the "check all" checkbox
 in a <select></select> tag
 @PARAMETERS
 	checkbox : the <select></select object
 @RETURN VALUE
 ***/
function CheckSelected(checkbox)
{
	var frm = checkbox.form,
		check = true;
	
	// if all boxes are not selected, make sure the chk_All checkbox is not selected
	for (var i = 0; i < frm.length; i++)
	{
		if (check && frm[i].type == 'checkbox' && frm[i].name != 'chk_All' && !frm[i].checked)
			check = false;
			
		if (frm[i].name == 'chk_All')
		{
		/*	if (!check)
				frm[i].checked = false;
			else
				frm[i].checked = true;
		*/
			frm[i].checked = false;
		}
 	}
}

/***
 this function will open a new window for the comparison chart
 @PARAMETERS
 	object : the checkbox list (<select></select> tag) object
 @RETURN VALUE
 ***/
function ComparePlans(object)
{
	var frm = object.form;
	var url = "ComparisonChart.php?";
	
	for (var i = 0; i < frm.length; i++)
	{
		if (frm[i].type == 'checkbox')
		{
			url += frm[i].name + "=" + (frm[i].checked ? 1 : 0) + "&";
		}
	}
	
	window.open(url, "ComparisonChart", "width=800,height=600,resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no");
}

function ComparePlans5(object)
{
	var frm = object.form;
	var url = "ComparisonChart_Arc.php?";
	
	for (var i = 0; i < frm.length; i++)
	{
		if (frm[i].type == 'checkbox')
		{
			url += frm[i].name + "=" + (frm[i].checked ? 1 : 0) + "&";
		}
	}
	
	window.open(url, "iframe", "width=800,height=600,resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no");
}

function ComparePlans2()
{
	var url="ComparisonChartT10.php?chk_All=1&chk_basic600=1&chk_basic800=1&chk_basic1000=1&chk_standard1500=1&chk_premium2000=1&chk_extravalue3500=1&chk_xpsuperior=1&chk_xpgoldseal=1&chk_xpplatinum=1&chk_powertrain=1&chk_factory=1&";
	window.open(url, "ComparisonChart", "width=800,height=600,resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no");
}

/***
 this function will open a new window for the additional options 
 @PARAMETERS
 	object : the checkbox list (<select></select> tag) object
 @RETURN VALUE
 ***/
function AdditionalOptionsPage(object)
{
	var frm = object.form;
	var url = "AdditionalOptions.php?";
	
	for (var i = 0; i < frm.length; i++)
	{
		if (frm[i].type == 'checkbox')
		{
			url += frm[i].name + "=" + (frm[i].checked ? 1 : 0) + "&";
		}
	}
	
	window.open(url, "AdditionalOptions", "width=800,height=600,resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no");
}

function AdditionalOptionsPage2(object)
{
	var frm = object.form;
	var url = "AdditionalOptions_Arc.php?";
	
	for (var i = 0; i < frm.length; i++)
	{
		if (frm[i].type == 'checkbox')
		{
			url += frm[i].name + "=" + (frm[i].checked ? 1 : 0) + "&";
		}
	}
	
	window.open(url, "iframe", "resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no");
}

/***
 function ShowHideAnswer will show or hide an answer depending on the value
 of answerOn. if answerOn == 0, show the answer and display the downarrow 
 gif; if it is equal to 1 then hide the answer and display the leftarrow gif.
 this function is used by the Frequently Asked Question (faq.php) page.
 @PARAMETERS
 	id       : the area that contains the answer to the question to be displayed.
 	img1 	 : the left arrow gif to be hidden/displayed
 	img2 	 : the down arrow gif to be hidden/displayed
 	answerOn : the value that determines if an answer should be displayed or hidden.
 			   if answerOn == 1, hide the answer; otherwise display it.
 @RETURN VALUE
 ***/
function ShowHideAnswer(id,img1,img2,answerOn)
{
	var obj = document.getElementById(id),
		on = document.getElementById(answerOn),
		img1 = document.getElementById(img1),
		img2 = document.getElementById(img2);
	
	if (obj && on && img1 && img2)
	{
		onVal = parseInt(on.value); // gets the value which will be either 0 or 1
		
		obj.style.display  = (!onVal ? 'inline' : 'none');
		img1.style.display = (!onVal ? 'none' : 'inline');
		img2.style.display = (!onVal ? 'inline' : 'none');
		
		on.value = (!onVal? 1 : 0);
	}
}

/***
 this function will move the screen to the bottom of the page.
 @PARAMETERS
 @RETURN VALUE
 ***/
function GoDown()
{
	document.getElementById('body').scrollTop = document.getElementById('body').scrollHeight;
}

/***
 opens a popup window.
 @PARAMETERS
	url : the address
	w   : the width of the popup window
	h   : the height of the popup window
 @RETURN VALUE
 ***/
function PopUp(url, w, h)
{
	window.open(url, "New", "width=" + w + ",height=" + h + ",resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no");
}

/***
 opens a popup window.
 @PARAMETERS
	url : the address
	w   : the width of the popup window
	h   : the height of the popup window
 @RETURN VALUE
 ***/
function PopUp2(url)
{
	window.open(url, "_newwindow_", "width=900,height=400,resizable=yes,scrollbars=yes,toolbar=yes,location=yes,directories=no,status=no,menubar=yes,copyhistory=yes");
}

/***
 This function will display the driver's license text and textbox only if the
 user selected the "Ontario" option in the drop down list.
 @PARAMETERS
 	ddlObj : the <select></select> drop down list object.
 @RETURN VALUE
 ***/
function CheckProvince(ddlObj)
{
	for (i = 0; i < ddlObj.length; i++)
	{
		if (ddlObj[i].selected)
		{
			var objtxt = document.getElementById('DriversLicenseText'), 
				objbox = document.getElementById('DriversLicenseBoxes');
			if (ddlObj[i].value == "ON")
			{
				if (objtxt)
					objtxt.style.display = "inline";
				if (objbox)	
					objbox.style.display = "inline";
			}
			else
			{
				if (objtxt)
					objtxt.style.display = "none";
				if (objbox)	
					objbox.style.display = "none";
			}
		}
	}
}

/***
 [function description]
 @PARAMETERS
 	[@parameter1]
 	...
 	[@parameterX]
 @RETURN VALUE
	[description]
 ***/
function ShowFormObjects()
{
	var obj = document.getElementById('ddl_province');
	if (obj && obj.value == "ON")
	{
		var objtxt = document.getElementById('DriversLicenseText'), 
			objbox = document.getElementById('DriversLicenseBoxes');
		if (objtxt && objbox)
		{
			objtxt.style.display = 'inline';
			objbox.style.display = 'inline';
		}
	}
	
	obj = document.getElementById('ddl_make');
	if (obj && obj.value != '-1')
	{
		var obj = document.getElementById('ddl_' + obj.value);
		if (obj)
			obj.style.display = 'inline';
		obj = document.getElementById('modeltxt');
		if (obj)
			obj.style.display = 'inline';
	}
}

/***
 [function description]
 @PARAMETERS
 	[@parameter1]
 	...
 	[@parameterX]
 @RETURN VALUE
	[description]
 ***/
function ShowModel(ddlObj)
{
	var x = true;
	
	for (i = 0; i < ddlObj.length; i++)
	{
		if (ddlObj[i].selected && ddlObj[i].value != -1)
		{
			obj = document.getElementById('modeltxt');
			if (obj) 
				obj.style.display = 'inline';
				
			obj = document.getElementById('ddl_' + ddlObj[i].value);
			if (obj)
				obj.style.display = 'inline';
				
			x = false;	
		}
		if (!ddlObj[i].selected)
		{
			obj = document.getElementById('ddl_' + ddlObj[i].value);
			if (obj)
				obj.style.display = 'none';
		}
	}
	
	if (x)
	{
		var obj = document.getElementById('modeltxt');
		if (obj) 
			obj.style.display = 'none';
	}
}

/***
 [function description]
 @PARAMETERS
 	[@parameter1]
 	...
 	[@parameterX]
 @RETURN VALUE
	[description]
 ***/
function showQty(id)
{
    	var obj = document.getElementById(id);
    	if (obj.style.display == 'inline')
    	{
    		obj.style.display = 'none';
		}
    	else
    	{
    		obj.style.display = 'inline';
		}
} 

/***
 [function description]
 @PARAMETERS
 	[@parameter1]
 	...
 	[@parameterX]
 @RETURN VALUE
	[description]
 ***/
function removeItem(id,target)
{
    	var obj = document.getElementById(id);
    	if (obj.value != "0") {
    		obj.value = '0';
    		target.checked = true;
		}
} 

/***
 [function description]
 @PARAMETERS
 	[@parameter1]
 	...
 	[@parameterX]
 @RETURN VALUE
	[description]
 ***/
function valid(id)
{ 
	if(!id.value.match(/^\d+$/)) 
	{
    	id.value = "0";
    	alert("Quantity value must be a number");
    }
}

/***
 this function is used to adjust the iframe height to the 
 height of it's contained data from the document that contains the
 iframe
 @PARAMETERS:
 @id 		: This is the id that represents the iframe to be resized
 @idContent : This is the id of the content contained within the iframe
 			  whose height will be used to adjust the height of iframe.
 			  If this parameter is zero the height of the iframe will 
 			  be set to zero.
 ***/
function FixIFrameHeight(id, idContent)
{
	var obj1 = document.getElementById(id), h = 0;
	if (obj1)
	{
		var obj2 = frames[0].document.getElementById(idContent);
		if (obj2 && idContent)
		{
			h = (obj2.offsetHeight ? obj2.offsetHeight : obj2.scrollHeight) + "px";
		}
		obj1.style.height = h;
	}
}

/***
 this function is used by the data within iframe to adjust the iframe 
 object using "parent"
 @PARAMETERS
	 @id 		: This is the id that represents the iframe to be resized
	 @idContent : This is the id of the content contained within the iframe
	 			  whose height will be used to adjust the height of iframe.
	 			  If this parameter is zero the height of the iframe will 
	 			  be set to zero.
 @RETURN VALUE
 ***/
function FixIFrameHeightInParent(id, idContent)
{
	var obj1 = window.parent.document.getElementById(id), h = 0;
	if (obj1)
	{
		var obj2 = this.document.getElementById(idContent);
		if (obj2)
		{
			h = (obj2.offsetHeight ? obj2.offsetHeight : obj2.scrollHeight)+ 80 + "px";
		}
		obj1.style.height = h;
	}
}

/***
 This function will show the details for a specific PlanFeature and hide all others.
 @PARAMETERS
 	coll  : the collection that contains the features
 	count : the number of objects in the collection (number of planfeatures)
 	ind   : the number of the feature to show
 	objID : the ID of the object we are showing the details for.
 @RETURN VALUE
 ***/
function ShowPlanFeatureDetails(coll, count, ind, objID)
{
	var obj1;
	for (i = 0; i < count; i++)
	{
		obj1 = document.getElementById(coll + i);
		if (obj1)
		{
			if (ind == i)
			{		
				obj1.style.top  =  document.body.scrollTop + ((document.body.clientHeight - 100) * 0.5);
				obj1.style.left = (document.body.clientWidth - 75) * 0.5;
				obj1.style.display = "inline";
			}
			else
				obj1.style.display = "none";
		}
	}
}

function ShowPlanFeatureDetails2(coll, count, ind, objID)
{
	var obj1;
	for (i = 0; i < count; i++)
	{
		obj1 = document.getElementById(coll + i);
		if (obj1)
		{
			if (ind == i)
			{		
				if(i == count-2 || i== count-3)
				{
				  obj1.style.top=yy-200+'px'; // -1920
				}
				else
				{
				  obj1.style.top=yy-40+'px'; // -1920
				}
				obj1.style.left = (document.body.clientWidth - 75) * 0.5;
				obj1.style.display = "inline";
			}
			else
				obj1.style.display = "none";
		}
	}
}

/***
 redirects the page to the specified url
 @PARAMETERS
 	@url : the url to redirect the page to
 	@t   : the time in milliseconds to redirect the page in
 @RETURN VALUE
 ***/
function redirect(url, t)
{
	setTimeout("location.href='" + url + "'", t);
}

/***
 Shows a specific Drop Down Menu based on the id number
 Hides all other menus just in case
 @PARAMETERS
 	@id : the id of the drop down menu to display
 @RETURN VALUE
 ***/
function ShowMenu(id)
{
	var obj;
	
	// there are 5 menu options, hide all except for
	// the one that equals 'id':
	for (i = 1; i <= 5; i=i+1)
	{
		obj = document.getElementById('DropDownMenu_' + i);
		if (obj)
		{
			if (i == id)
				obj.style.display = 'inline';
			else
				obj.style.display = 'none';
		}
	}
}

/***
 Changes the text of an object
 @PARAMETERS
 	@id   : the id of the object whose text is to be altered.
 	@text : the text we are changing to.
 @RETURN VALUE
 ***/
function ChangeText(id, text)
{
	var obj = document.getElementById(id);
	
	// if the object does not exist in this document
	// check if it exists in the parent document:
	if (!obj)
		obj = window.parent.document.getElementById(id);
		
	if (obj)
		obj.innerHTML = text;
}

/***
 Sets focus to the specified object
 @PARAMETERS
 	@id   : the object ID to set focus to
 @RETURN VALUE
 ***/
function SetFocus(id)
{
	var obj = document.getElementById(id);
	if (obj)
		obj.focus();
}

/***
 Changes an objects class to the new class name
 @PARAMETERS
 	@objID	  : the object id who's class i want to change
 	@newClass : the name of the new class.
 	@oldClass : the name of the old class
 @RETURN VALUE
 ***/
function ChangeClass(objID, newClass, oldClass)
{
	var obj = document.getElementById(objID);
	if (obj)
	{
		if (obj.className == newClass)
			obj.className = oldClass;
		else if (obj.className == oldClass)
			obj.className = newClass;
	}
}

/***
 this function will show or hide a section depending on whether the "yes" or "no"
 radio button was selected. if "yes" show; if "no", hide.
 @PARAMETERS
 	radio : the radio button to check
 	objID : the object to show or hide
 	val   : the value of the radio button - is this a "yes" or "no" radio?
 @RETURN VALUE
 ***/
function CheckRadioOnOff(radio, objID, val)
{
	var obj = document.getElementById(objID);
	if (obj)
	{
		if (radio.checked && val == 'yes')
			obj.style.display = "inline";
		else if ((radio.checked && val == 'no') || (!radio.checked && val == 'yes'))
			obj.style.display = "none";
	}
}

function openPage3(banner,frame){
	//self.frames['bannerFrame'].location.href = 'bannerPage2.html'; 
	//self.frames['iframe'].location.href = 'roadAllowance.html'; 
	var newImg = new Image();
	var heit = 0;
	var width = 0;
	if(	window.parent.document.getElementById('bannerFrame').src != "Images/"+banner)
	{
		newImg.src = "Images/"+banner;
		heit = newImg.height;
		wid = newImg.width;
		if (heit >0)
		{
			window.parent.document.getElementById('bannerFrame').style.height =heit+20+'px';
		}
		window.parent.document.getElementById('bannerFrame').src="Images/"+banner; //"banner3.png"
	}
	window.parent.document.getElementById('iframe').src=frame; //"roadAllowance.html"
	window.parent.document.getElementById('iframe').src.style.visibility="visible";
}

function openArchTerms9() {
window.open('pdfs/TERMS_AND_COND_T9.pdf', 'Description', 'width=600, height=600, left=28, top=60, menubar=0, toolbar=0, scrollbars=1, location=0, directories=0, resizable=1, status=0');
}

function openArchTerms8() {
window.open('pdfs/Terms_And_Conitions_T8.pdf', 'Description', 'width=600, height=600, left=28, top=60, menubar=0, toolbar=0, scrollbars=1, location=0, directories=0, resizable=1, status=0');
}

function FixIFrameHeightInParent3(id, idContent)
{
	var obj1 = window.parent.document.getElementById(id), h = 0;
	if (obj1)
	{
		var obj2 = this.document.getElementById(idContent);
		if (obj2)
		{
			h = (obj2.offsetHeight ? obj2.offsetHeight : obj2.scrollHeight)+100+ "px";
			//alert(h);
		}
		obj1.style.height = h;
	}
}

function openAdditionalOptionsArch()
{
	url="AdditionalOptions_Arc.php?chk_All=1&chk_PartsCoverage0=1&chk_PartsCoverage1=1&chk_PartsCoverage2=1&chk_PartsCoverage3=1&chk_PartsCoverage4=1&chk_PartsCoverage5=1&chk_PartsCoverage6=1&chk_PartsCoverage7=1&chk_PartsCoverage8=1&chk_PartsCoverage9=1&chk_PartsCoverage10=1&chk_PartsCoverage11=1&chk_PartsCoverage12=1&chk_PartsCoverage13=1&chk_PartsCoverage14=1&chk_PartsCoverage15=1&chk_PartsCoverage16=1&chk_PartsCoverage17=1&chk_PartsCoverage18=1&chk_PartsCoverage19=1&chk_PartsCoverage20=1&chk_OtherCoverage21=1&chk_OtherCoverage22=1&chk_OtherCoverage23=1&chk_OtherCoverage24=1&chk_OtherCoverage25=1&chk_OtherCoverage26=1&chk_OtherCoverage27=1&chk_OtherCoverage28=1&chk_OtherCoverage29=1&chk_OtherCoverage30=1&chk_OtherCoverage31=1&chk_OtherCoverage32=1&chk_OtherCoverage33=1&chk_OtherCoverage34=1&chk_OtherCoverage35=1&chk_OtherCoverage36=1"
	window.open(url, "iframe", "resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no");
}


function FixIFrameHeightInParent3(id, idContent)
{
	var obj1 = window.parent.document.getElementById(id), h = 0;
	if (obj1)
	{
		var obj2 = this.document.getElementById(idContent);
		if (obj2)
		{
			h = (obj2.offsetHeight ? obj2.offsetHeight : obj2.scrollHeight)+100+ "px";
			//alert(h);
		}
		obj1.style.height = h;
	}
}

////////////////////////
function Resize_Frame()
{
    var obj1 = document.getElementById('sh_iframe');
    var h = 150;
	var h2=0;
    if (obj1) {
        if (obj1.contentWindow.document && obj1.contentWindow.document != null)
		{
            h = obj1.contentWindow.document.body.scrollHeight;
			h2=obj1.contentWindow.document.body.innerHeight;
			alert("h= "+h +" and h2 is: "+h2+" For Obj1 = " + obj1.style.height);		
		}
        if (h < 10) 
		{
			h = 150;
			alert("Second h= "+h);		
		}
        obj1.style.height = h + 20 + "px";
    }
}
////////////////////////
