// JavaScript Document
/**
  *
  *	 This function is for applying dynamic CSS to article pages 
  *
  */ 

function calculatearticleIndexImgBrdrCssProperties(article) 
{
	

	if (article=='thirdarticle')
	{
		
		document.getElementById("articalcontainer").style.height=document.getElementById("articlelinks").offsetHeight+240;
		document.getElementById("articalcontainerborder").style.height=document.getElementById("articlelinks").offsetHeight+149;
		document.getElementById("whiteborder").style.height=document.getElementById("articlelinks").offsetHeight+175;
		document.getElementById("copyart").style.height=document.getElementById("articlelinks").offsetHeight+60;
		document.getElementById("articlefooter").style.top=document.getElementById("articlelinks").offsetHeight+208;
		document.getElementById("articlefooter").style.left=480;
		
	}else if (article=='firstarticle')
	{
		
		document.getElementById("articalcontainer").style.height=635;
		document.getElementById("articalcontainerborder").style.height=549;
		document.getElementById("whiteborder").style.height=575;
		document.getElementById("copyart").style.height=460;
		document.getElementById("articlefooter").style.top=608;
		document.getElementById("articlefooter").style.left=480;
	}
}


function openPopupWindow(page, name)
	{
		newWin = window.open(page, name,'width=360, resizable=yes height=300, scrollbars=yes, left=10,top=20');
		if (window.focus) { newWin.focus() }
	}

function openWindow( URL, width, height)
{
try
		{
			popup_window.close();
		}
		catch(e)
		{
					
		}
		
		popup_window=window.open( URL,"_popover","status=no,location=no,menubar=no,toolbar=no,directories=no,resizable=yes,scrollbars=yes,width=" + width + ",height=" + height + ",screenX=100,screenY=100");	
		window.onerror = null;
} 	
	
	function openPopupWindowAB(page, name)
	{
		newWin = window.open(page, name,'width=370, resizable=yes height=300, scrollbars=yes, left=10,top=20');
		if (window.focus) { newWin.focus() }
	}
	
	
	/**
	*
	* Closes any existing popups before opening a new one
	* Any new windows will always have focus and you won't "loose" any existing windows
	*
	* Takes url for content and height and width for size of new window
	*/ 
	function popup( URL, width, height )
	{
		try
		{
			popup_window.close();
		}
		catch(e)
		{
					
		}
		
		popup_window=window.open( URL,"_popover","status=no,location=no,menubar=no,toolbar=no,directories=no,resizable=yes,scrollbars=yes,width=" + width + ",height=" + height + ",screenX=100,screenY=100");	
		window.onerror = null;
	}
	
	/* author: rushabh doshi, ABTST20898, June 30, 2005: changes made to display the next vendor button */
	function displayinfo(counters)
	{
		var i = document.getElementById('formval').value;
		//alert('initial value: '+i);
		var j;
		if (i == counters) {
			i = 1;
		}
		else {
			++i; 
		}
		//alert('final value: '+i);	
		for (j=1; j<=counters;j++) {
			if (j==i) {
				MainIDElem = document.getElementById('mainId'+j);
				MainIDElem.className= 'tshow';
				showNodeElmtfoot = document.getElementById('footerid'+j);
				showNodeElmtfoot.className= 'tshow';
				showNodeElmtfoot1 = document.getElementById('footerid1'+j);
				showNodeElmtfoot1.className= 'tshow';
			}
			else 
			{
				MainIDElem = document.getElementById('mainId'+j);
				MainIDElem.className= 'thide';
				showNodeElmtfoot = document.getElementById('footerid'+j);
				showNodeElmtfoot.className= 'thide';
				showNodeElmtfoot1 = document.getElementById('footerid1'+j);
				showNodeElmtfoot1.className= 'thide';
			}
		}
		
		if (objArr[i] == 'Sears') {
			
			a8element = document.getElementById('a8question');
			a8element.className = 'tshow';
		}
		else {
			
			a8element = document.getElementById('a8question');
			a8element.className = 'thide';
		}
		
		if ( (objArr[i] == 'HomeWorks') || (objArr[i] == 'Newpro') || (objArr[i] == 'Renewal by Andersen')){
			
			windElement = document.getElementById('windowtitle');
			windElement.className = 'tshow';
			vinylElement = document.getElementById('vinylwindowtitle');
			vinylElement.className = 'thide';
		}
		else {
			windElement = document.getElementById('windowtitle');
			windElement.className = 'thide';
			vinylElement = document.getElementById('vinylwindowtitle');
			vinylElement.className = 'tshow';
		}
		
		// change the value of the hidden field
		document.getElementById('formval').value = i;
	}
	
function doProcessing() {
	document.getElementById('submitBtn').className = 'thide';
	document.getElementById('processing').className = 'tshow';
}  

function doProcessingNothanks() {
document.getElementById('submitBtn').className = 'thide';
	document.getElementById('processing').className = 'tshow';
	document.getElementById('nothanks').className = 'thide';
}