			var profiles = {
		
				window800: {
					height:400,
					width:370,
					status:1
				},
		
				window200: {
					height:200,
					width:200,
					status:1,
					resizable:0
				}
		
		
			};
			$(function(){
				$(".newwindow").popupwindow(profiles);
			});

function openWin(page, name, width, height)
{
		var options = "scrollbars=yes, width=" + width + ", height=" + height;
		
		newWin=window.open (page,"mywindow","scrollbars=1,width=467,height=500"); 

		if (window.focus)
		{ 
			newWin.focus()
		}
}


function setFormPageCss()
{
		
	document.getElementById("form_outerleftbrd").style.height=document.getElementById("index_righttcopy").offsetHeight+164;
	document.getElementById("form_outerrightbrd").style.height=document.getElementById("index_righttcopy").offsetHeight+116;
	document.getElementById("footer").style.top=document.getElementById("index_righttcopy").offsetHeight+238;
	document.getElementById("footerdiscliamer").style.top=-50;
}

function setNonFormPageCss()
{

	document.getElementById("noform_outerleftbrd").style.height=document.getElementById("nonformcopy").offsetHeight+172;
	document.getElementById("noform_outerrightbrd").style.height=document.getElementById("nonformcopy").offsetHeight+124;
	document.getElementById("footer").style.top=document.getElementById("nonformcopy").offsetHeight+338;
	document.getElementById("footerdiscliamer").style.top=-50;
}


function showvendors(counters)
{
	var i = document.getElementById('formval').value;
	
	//alert('initial value: '+i);
	var j;
	if (i == counters)
	{
		i = 1;
	}
	else
	{
		++i; 
	}
	
	for (j=1; j<=counters;j++)
	{
		if (j==i)
		{
			MainIDElem = document.getElementById('vendorlogo'+j);
			MainIDElem1 = document.getElementById('vendorblurb'+j);
			MainIDElem2 = document.getElementById('vendorlicense'+j);
			MainIDElem3 = document.getElementById('vendordisclaimer'+j);
			
			MainIDElem.className='';
			MainIDElem1.className='';
			if(MainIDElem2!=null)
				MainIDElem2.className='';
			if(MainIDElem3!=null)
				MainIDElem3.className='';
		}
		else 
		{
			MainIDElem = document.getElementById('vendorlogo'+j);
			MainIDElem1 = document.getElementById('vendorblurb'+j);
			MainIDElem2 = document.getElementById('vendorlicense'+j);
			MainIDElem3 = document.getElementById('vendordisclaimer'+j);
			MainIDElem.className= 'thide';
			MainIDElem1.className='thide';
			
			if(MainIDElem2!=null)
				MainIDElem2.className='thide';
			if(MainIDElem3!=null)
				MainIDElem3.className='thide';	
		}
	}
	// change the value of the hidden field
	document.getElementById('formval').value = i;
}

function doProcessing() {
	   var node_elt1, node_elt2;
       node_elt1 = document.getElementById("submitBtn");
	   node_elt2 = document.getElementById("processing");
	   
	   if(node_elt2==null)
	   {
		   node_elt2 = document.getElementById("processing1");
	   }
	   
	   node_elt1.className = 'thide'; 
       node_elt2.className = 'tshow';
    
}
function doProcessing1() {
	   var node_elt1, node_elt2;
       node_elt1 = document.getElementById("preformsubmitBtn");
	   node_elt2 = document.getElementById("processing2");
	   
	   if(node_elt2==null)
	   {
		   node_elt2 = document.getElementById("processing1");
	   }
	   
	   node_elt1.className = 'thide'; 
       node_elt2.className = 'tshow';
    
}
// New Referral Net Template

function calculateNoFormImgBrdrCssPropertiesprequal()
{ 
 // Retrieve region div heights
 var headerHeight = document.getElementById("servformleftcopy1").offsetHeight;
  document.getElementById("servformleftcopy1").style.height= headerHeight-20+"px";
  document.getElementById("serviceformwhiteborder").style.height= headerHeight-20+"px";
  document.getElementById("innerbox").style.height= (headerHeight)+"px";
  document.getElementById("outerdiv").style.height= (headerHeight+220)+"px";
  document.getElementById("extremout").style.height= (headerHeight+304)+"px";
  document.getElementById("container").style.height= (headerHeight+250)+"px";
  document.getElementById("footerLinks").style.top= (headerHeight+180)+"px";
  document.getElementById("outrdivborder").style.height=(headerHeight+221)+"px";
  document.getElementById("submitnoiBtn").style.top= (headerHeight-120)+"px";
  document.getElementById("nonoithanks").style.top= (headerHeight-80)+"px";
  document.getElementById("processingnoi").style.top= (headerHeight-110)+"px";
  if(document.getElementById("required"))
  {
  	document.getElementById("required").style.top= headerHeight-125;
  }
  
   
}
function calculateNoFormImgBrdrCssPropertiesform()
{ 

 // Retrieve region div heights
  var middleHeight = document.getElementById("yelloContent").offsetHeight;
  var headerHeight = document.getElementById("servformleftcopy2").offsetHeight;
  document.getElementById("servformleftcopy2").style.height= (middleHeight+70)+"px";
  document.getElementById("serviceformwhiteborder").style.height= (middleHeight+70)+"px";
  document.getElementById("innerbox").style.height= (middleHeight+80)+"px";
  document.getElementById("outerdiv").style.height= (middleHeight+180)+"px";
  document.getElementById("container").style.height= (middleHeight+340)+"px";
  //document.getElementById("outerdiv_noformbottomborder").style.top=(middleHeight+175)+"px";
  document.getElementById("extremout").style.height= (middleHeight+370)+"px";
  document.getElementById("footerLinks").style.top= (middleHeight+300)+"px";
  //document.getElementById("outerdiv_noformrightslice").style.height= (middleHeight+170)+"px";
  document.getElementById("outrdivborder").style.height=(middleHeight+181)+"px";
  document.getElementById("submitnoiBtn").style.top= middleHeight-25;
  document.getElementById("nonoithanks").style.top= middleHeight+20;
  document.getElementById("processingnoi").style.top= middleHeight;
  if(document.getElementById("required"))
  {
  	document.getElementById("required").style.top= middleHeight-25;
  }
  
}
function doProcessingNothanks1() {
document.getElementById('submitnoiBtn').className = 'thide';
	document.getElementById('processingnoi').className = 'tshow1';
	document.getElementById('nonoithanks').className = 'thide';
	
}
function doProcessingAdd() {
document.getElementById('sumbitbutton').className = 'thide';
document.getElementById('processingnoiAdd').className = 'tshow1';
//document.getElementById('nonoithanks').className = 'thide';

}

function calculateNoFormImgBrdrCssPropertiesform1()
{ 

 // Retrieve region div heights
  var middleHeight = document.getElementById("yelloContent1").offsetHeight;
  var headerHeight = document.getElementById("servformleftcopy2").offsetHeight;
  document.getElementById("servformleftcopy2").style.height= (middleHeight+70)+"px";
  document.getElementById("serviceformwhiteborder").style.height= (middleHeight+65)+"px";
  document.getElementById("container").style.height= (middleHeight+325)+"px";
  document.getElementById("innerbox").style.height= (middleHeight+85)+"px";
  document.getElementById("outerdiv").style.height= (middleHeight+330)+"px";
  //document.getElementById("outerdiv_noformbottomborder1").style.top=(middleHeight+198)+"px";
  document.getElementById("extremout").style.height= (middleHeight+244)+"px";
  document.getElementById("footerLinks").style.top= (middleHeight+282)+"px";
  //document.getElementById("outerdiv_noformrightslice1").style.height= (middleHeight+180)+"px";
  document.getElementById("outrdivborder").style.height=(middleHeight+181)+"px";
  document.getElementById("sumbitbutton").style.top= middleHeight-15+"px";
  document.getElementById("processingnoiAdd").style.top= middleHeight;
  
}

function calculateNoFormAdSenseBrdrCssPropertiesthankyou()
{ 

 // Retrieve region div heights
  var headerHeight = document.getElementById("servformleftcopyadsense").offsetHeight;
  document.getElementById("servformleftcopyadsense").style.height= headerHeight+"px";
  document.getElementById("serviceformwhiteborderadsense1").style.height= headerHeight+"px";
  document.getElementById("innerboxadsense1").style.height= (headerHeight+10)+"px";
  document.getElementById("outerdivadsense1").style.height= (headerHeight+370)+"px";
  document.getElementById("containeradsense1").style.height= (headerHeight+270)+"px";
  document.getElementById("extremoutadsense1").style.height= (headerHeight+170)+"px";
  document.getElementById("footerLinks").style.top= (headerHeight+220)+"px";
  //document.getElementById("outerdiv_noformrightsliceadsense1").style.height= (headerHeight+95)+"px";
  document.getElementById("outrdivborderadsense1").style.height=(headerHeight+101)+"px";
}
function calculateNoFormAdSenseBrdrCssProperties()
{ 

 // Retrieve region div heights
  var headerHeight = document.getElementById("servformleftcopyadsense").offsetHeight;
  document.getElementById("servformleftcopyadsense").style.height= headerHeight+"px";
  document.getElementById("serviceformwhiteborderadsense").style.height= headerHeight+"px";
  document.getElementById("innerboxadsense").style.height= (headerHeight+10)+"px";
  document.getElementById("outerdivadsense").style.height= (headerHeight+220)+"px";
  //document.getElementById("outerdiv_noformbottomborderadsense").style.top=(headerHeight+221)+"px";
  document.getElementById("extremoutadsense").style.height= (headerHeight+284)+"px";
  document.getElementById("footerLinks").style.top= (headerHeight+190)+"px";
  //document.getElementById("footerlinksadsense").style.top= (headerHeight+239)+"px";
  //document.getElementById("outerdiv_noformrightsliceadsense").style.height= (headerHeight+208)+"px";
  document.getElementById("outrdivborderadsense").style.height=(headerHeight+221)+"px";
}

/**
  *
  *	 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';
}
