function doProcessing() {
  document.getElementById('submitBtn').className = 'thide'; 	
  document.getElementById('processing').className = 'tshow';

}

function calculateFormImgBrdrMctoggleProperties() 
{ 
	displayinfo(vendorcount,'no');
	adjustHeightforIframe();
}
function adjustHeightforIframe()
{
	 if(document.getElementById('Formcontent').offsetHeight > document.getElementById('border').offsetHeight)
	 {
	   document.getElementById('border').style.height=document.getElementById('Formcontent').offsetHeight+"px";
	 }
	 else
	 {
	 document.getElementById('border').style.height=0 + "px";
	 }
}

function adjustHeight()
{
	 if(document.getElementById('Formcontent').offsetHeight > document.getElementById('border').offsetHeight)
	 {
	  
	   document.getElementById('border').style.height=document.getElementById('Formcontent').offsetHeight+"px";
	 }
	 else
	 {
	 
	 document.getElementById('border').style.height=10+"px";
	 }
}



function displayContent(counters)
{
	displayinfo(counters,'yes');
}

function calculateNonFormCssProperties() {

 	var headerHeight = document.getElementById("header").offsetHeight;
	var copyHeight = document.getElementById("nonFormCopy").offsetHeight;

	document.getElementById("nonFormCopy").style.top=headerHeight;
	document.getElementById("nonFormFooter").style.top=headerHeight+copyHeight;
	document.getElementById("footerLinks").style.top=headerHeight+copyHeight+98;
    	
    
} 


function displayinfo(counters,increment)
	{
		
		var h;			
		var i = document.getElementById('formval').value;		

		var j;
	
		if (i == counters) {
			if(increment == 'yes')
			{
		 	i=1;
			}
		}
		else {
		if(increment == 'yes')
			{
		 	i++;
			}
		}
		for (j=1; j<=counters;j++) {
		
			if (j==i) {
				
				MainIDElem = document.getElementById('mainId'+j);
				MainIDElem.className= 'tshowinline';
				showNodeElmtfoot = document.getElementById('footerid'+j);
				showNodeElmtfoot.className= 'tshowinline';
				showNodeElmtfoot1 = document.getElementById('footerid_'+j);
				showNodeElmtfoot1.className= 'tshowinline';
			}
			else 
			{
				MainIDElem = document.getElementById('mainId'+j);
				MainIDElem.className= 'thide';
				
				
				showNodeElmtfoot = document.getElementById('footerid'+j);
				showNodeElmtfoot.className= 'thide';
				
				showNodeElmtfoot1 = document.getElementById('footerid_'+j);
				showNodeElmtfoot1.className= 'thide';
				
			}
			
		}
		// Sears
		if (objArr[i] == '3024'){
			
			if(document.getElementById('AgreeToReceiveEmail')!=null)
			{
				wpelement = document.getElementById('AgreeToReceiveEmail');
				wpelement.className = 'tshowinline1';
				document.getElementById("AgreeToReceiveEmail").style.width=100+'px';
			}
			if(document.getElementById('ContactMe')!=null && tservcode!=null)
			{
				if(tservcode=='CABINET_INSTALL')
				{
					wpelement = document.getElementById('ContactMe');
					wpelement.className = 'tshowinline1';
					document.getElementById("ContactMe").style.width=100+'px';
				}
			}
			
		}
		else
		{
			
			if(document.getElementById('AgreeToReceiveEmail')!=null)
			{
				wpelement = document.getElementById('AgreeToReceiveEmail');
				wpelement.className = 'thide';
			}
			if(document.getElementById('ContactMe')!=null)
			{
				wpelement = document.getElementById('ContactMe');
				wpelement.className = 'thide';
			}
		}
		
		
		// change the value of the hidden field
		document.getElementById('formval').value = i;
}

function openWin(page,win_width,win_height) {

    try {
    	popup_window.close();
    } catch(e) {
					
    }

    if ( page.indexOf("mailto") == -1 ) {
    	var options = "scrollbars=yes, width=" + win_width + ", height=" + win_height;
    	var win = window.open(page, 'MyWin', options);
    	if (window.focus) { win.focus() }
    }
}


function openPopupWindow(page) {

    try {
    	popup_window.close();
    } catch(e) {
					
    }
   var win_width = '517px';
   var win_height = '460px';
   if (page=='popups/options.jsp')
   {
   	win_width = '630px';
	win_height = '700px';
   }

    if ( page.indexOf("mailto") == -1 ) {
    	var options = "scrollbars=yes, width=" + win_width + ", height=" + win_height;
    	var win = window.open(page, 'MyWin', options);
    	if (window.focus) { win.focus() }
    }
}


function test()
{
	alert ("dsadd");
} 

/*
	 * Purpose: Open footer urls in separate window
	 */
	function openNewUrlWindow(url) {	// scroll needs to be a 1 or 0
		width = 450;
		height = 445;
		bName = navigator.appName;
		bVer = parseInt(navigator.appVersion);
		if((bName == "Netscape" && bVer >= 3) || (bName == "Microsoft Internet Explorer" && bVer >= 4))
			br = "n3";
		else
			br = "n2";
		
		if(br == "n3") {
			prop = 'toolbar=no,width=' + width + ',height=' + height + ',left=430,top=200,directories=0,status=0,scrollbars=' + scroll + ',resizable=yes,menubar=0,location=0,copyhistory=0';
			newWindow=window.open(url, 'lilone', prop);
		}
	}