
function calculateNoFormImgBrdrCssPropertiesprequal()
{ 

 // Retrieve region div heights
  var headerHeight = document.getElementById("servformleftcopy1").offsetHeight;
  document.getElementById("servformleftcopy1").style.height= headerHeight+"px";
  document.getElementById("serviceformwhiteborder").style.height= headerHeight+"px";
  document.getElementById("innerbox").style.height= (headerHeight+10)+"px";
  document.getElementById("outerdiv").style.height= (headerHeight+100)+"px";
  document.getElementById("outerdiv_noformbottomborder").style.top=(headerHeight+100)+"px";
  document.getElementById("extremout").style.height= (headerHeight+160)+"px";
  document.getElementById("footerLinks").style.top= (headerHeight+120)+"px";
  document.getElementById("outerdiv_noformrightslice").style.height= (headerHeight+95)+"px";
  document.getElementById("outrdivborder").style.height=(headerHeight+100)+"px";
  if(document.getElementById("requiredMain"))
  {
  	document.getElementById("requiredMain").style.top= headerHeight-125;
  }
 for (i = 0; i < 4; i=i+2){
		var j = i+1;
		if(document.getElementById('sp'+i)!= null && document.getElementById('sp'+j) != null){
			
			if(document.getElementById('sp'+i).offsetHeight > document.getElementById('sp'+j).offsetHeight)
			{	
			 	document.getElementById('sp'+j).style.height = document.getElementById('sp'+i).offsetHeight+"px";
			 }
 			else  	
 			{
		   		document.getElementById('sp'+i).style.height = document.getElementById('sp'+j).offsetHeight+"px";
		   	}
		}
	}
}


function calculatearticleIndexImgBrdrCssProperties(article) 
{
	
	
	
	if (article=='thirdarticle')
	{
		document.getElementById("articalcontainer").style.height=document.getElementById("articlelinks").offsetHeight+235;
		document.getElementById("articalcontainerborder").style.height=document.getElementById("articlelinks").offsetHeight+175;
		document.getElementById("whiteborder").style.height=document.getElementById("articlelinks").offsetHeight+178;
		document.getElementById("outerborder").style.height=document.getElementById("articlelinks").offsetHeight+151;
		document.getElementById("copyart").style.height=document.getElementById("articlelinks").offsetHeight+60;
		document.getElementById("articlefooter").style.top=document.getElementById("articlelinks").offsetHeight+213;
		document.getElementById("articlefooter").style.left=485;
		
	}else if (article=='firstarticle')
	{
		document.getElementById("articalcontainer").style.height=635;
		document.getElementById("articalcontainerborder").style.height=575;
		document.getElementById("whiteborder").style.height=578;
		document.getElementById("outerborder").style.height=551;
		document.getElementById("copyart").style.height=460;
		document.getElementById("articlefooter").style.top=615;
		document.getElementById("articlefooter").style.left=485;
		
	}
}
/* Used in moreinfo popup */

function calculatemoreinfoCssProperties()
{
	document.getElementById("regPopCopy").style.height=document.getElementById("regPopCopy").offsetHeight+100;
}



function calculateServiceFormImgBrdrCssProperties() { 

// Retrieve region div heights
var headerHeight = document.getElementById("serviceform1").offsetHeight;
document.getElementById("serviceform1").style.height=headerHeight;
document.getElementById("serviceform").style.height=headerHeight+88;
document.getElementById("serviceform_submit").style.top=headerHeight+10;
if(document.getElementById("scefrm1").offsetHeight>document.getElementById("serviceform1").offsetHeight+100)
{
  headerHeight = document.getElementById("scefrm1").offsetHeight;
  document.getElementById("serviceformpage").style.height=headerHeight+128;
  document.getElementById("serviceformwhiteborder").style.height=headerHeight+130;
  document.getElementById("innerbox").style.height=headerHeight+140;
  document.getElementById("outerdiv").style.height=headerHeight+345;
  document.getElementById("outerdiv_bottomborder").style.top=headerHeight+360;
  document.getElementById("extremout").style.height=headerHeight+410;
  document.getElementById("footerLinks").style.top=headerHeight+365;
  document.getElementById("outerdiv_rightslice").style.height=headerHeight+335;
  document.getElementById("outrdivborder").style.height=headerHeight+340;
 }
 else
 {
  document.getElementById("serviceformpage").style.height=headerHeight+238;
  document.getElementById("serviceformwhiteborder").style.height=headerHeight+240;
  document.getElementById("innerbox").style.height=headerHeight+250;
  document.getElementById("outerdiv").style.height=headerHeight+455;
  document.getElementById("outerdiv_bottomborder").style.top=headerHeight+470;
  document.getElementById("extremout").style.height=headerHeight+520;
  document.getElementById("footerLinks").style.top=headerHeight+475;
  document.getElementById("outerdiv_rightslice").style.height=headerHeight+445;
  document.getElementById("outrdivborder").style.height=headerHeight+450;
  
 }
}


function calculateNoFormImgBrdrCssProperties()
{ 

 // Retrieve region div heights
  var headerHeight = document.getElementById("servformleftcopy1").offsetHeight;
  document.getElementById("servformleftcopy1").style.height= headerHeight+"px";
  document.getElementById("serviceformwhiteborder").style.height= headerHeight+"px";
  document.getElementById("innerbox").style.height= (headerHeight+10)+"px";
  document.getElementById("outerdiv").style.height= (headerHeight+220)+"px";
  document.getElementById("outerdiv_noformbottomborder").style.top=(headerHeight+221)+"px";
  document.getElementById("extremout").style.height= (headerHeight+284)+"px";
  document.getElementById("footerLinks").style.top= (headerHeight+239)+"px";
  document.getElementById("outerdiv_noformrightslice").style.height= (headerHeight+215)+"px";
  document.getElementById("outrdivborder").style.height=(headerHeight+221)+"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("footerlinksadsense").style.top= (headerHeight+239)+"px";
  document.getElementById("outerdiv_noformrightsliceadsense").style.height= (headerHeight+208)+"px";
  document.getElementById("outrdivborderadsense").style.height=(headerHeight+221)+"px";
}


function calculateIndexAndFormImgBrdrCssProperties() { 


  // Retrieve region div heights
  var headerHeight = document.getElementById("indexformpage").offsetHeight;
  var indexForm=headerHeight+190;
  var whiteBorder=indexForm+1;
  var innerboxBottomBrd=indexForm+175;
  var innerboxRightSlice=indexForm+1;
  var outerdivRightSlice=indexForm+15;
 
  
  document.getElementById("submitBtn").style.top=headerHeight;
  document.getElementById("whiteborder").style.height=whiteBorder;
  document.getElementById("indexform").style.height=indexForm;
  document.getElementById("innerbox_bottomborder").style.top=innerboxBottomBrd;
  document.getElementById("innerbox_rightslice").style.height=innerboxRightSlice;
  if(document.getElementById("dottedline2")!=null)
  {
  	document.getElementById("dottedline2").style.top=indexForm-115;
  }
  document.getElementById("innerbox").style.height=indexForm+210;
  document.getElementById("outerdiv").style.height=indexForm+428;
  document.getElementById("outerdiv_bottomborder").style.top=indexForm+443;
  document.getElementById("extremout").style.height=indexForm+490;
  document.getElementById("footerLinks").style.top=indexForm+445;
  document.getElementById("outerdiv_rightslice").style.height=indexForm+411;
  document.getElementById("outrdivborder").style.height=indexForm+431;
  
}


//CSS for Postqual page of Home Depot

function calculatePostqualCssProperties() { 


  // Retrieve region div heights
  var headerHeight = document.getElementById("indexformpage").offsetHeight;
  var indexForm=headerHeight+260;
  var whiteBorder=indexForm+1;
  var innerboxBottomBrd=indexForm+15;
  var innerboxRightSlice=indexForm+1;
  var outerdivRightSlice=indexForm+15;
 
//  alert(document.getElementById("form_findmebestwin").offsetLeft);
  
  document.getElementById("leftarrow").style.top=10;
  document.getElementById("form_findmebestwin").style.top=document.getElementById("leftarrow").offsetTop+30;
  document.getElementById("whiteborder").style.top=document.getElementById("leftarrow").offsetTop+11;
  document.getElementById("dottedline").style.top=document.getElementById("form_findmebestwin").offsetHeight+30;
  document.getElementById("whiteborder").style.left=document.getElementById("whiteborder").offsetLeft-1;
  document.getElementById("form_findmebestwin").style.left=document.getElementById("leftarrow").offsetLeft+document.getElementById("leftarrow").offsetWidth-2;
  document.getElementById("innerbox_rightborder").style.top=document.getElementById("leftarrow").offsetTop+10;
  document.getElementById("innerbox_rightborder").style.left=document.getElementById("innerbox_rightborder").offsetLeft+1;
  document.getElementById("innerbox_rightslice").style.left=document.getElementById("innerbox_rightslice").offsetLeft+1;
  document.getElementById("innerbox_rightslice").style.top=document.getElementById("leftarrow").offsetTop+11;
  
  document.getElementById("submitBtn").style.top=headerHeight;
  
  document.getElementById("postqual_nothanks").style.left=document.getElementById("submitBtn").offsetLeft+20;
  document.getElementById("postqual_nothanks").style.top=document.getElementById("submitBtn").offsetTop-40;
  
  document.getElementById("whiteborder").style.height=whiteBorder;
  document.getElementById("indexform").style.height=indexForm;
  document.getElementById("innerbox_bottomborder").style.top=innerboxBottomBrd;
  document.getElementById("innerbox_bottomborder").style.left=document.getElementById("whiteborder").offsetLeft-4;

  document.getElementById("innerbox_rightslice").style.height=innerboxRightSlice;
  if(document.getElementById("dottedline2")!=null)
  {
  	document.getElementById("dottedline2").style.top=indexForm-115;
  }
  document.getElementById("innerbox").style.height=indexForm+50;
  document.getElementById("outerdiv").style.height=indexForm+268;
  document.getElementById("outerdiv_bottomborder").style.top=indexForm+283;
  document.getElementById("extremout").style.height=indexForm+330;
  document.getElementById("footerLinks").style.top=indexForm+285;
  document.getElementById("outerdiv_rightslice").style.height=indexForm+251;
  document.getElementById("outrdivborder").style.height=indexForm+271;
  
}



function calculateIndexAndFormImgBrdrCssProperties1() { 


  // Retrieve region div heights
  var headerHeight = document.getElementById("indexformpage1").offsetHeight;
  var indexForm=headerHeight+190;
  var whiteBorder=indexForm+1;
  var innerboxBottomBrd=indexForm+175;
  var innerboxRightSlice=indexForm+1;
  var outerdivRightSlice=indexForm+15;
 
  
  document.getElementById("submitBtn").style.top=headerHeight;
  document.getElementById("whiteborder").style.height=whiteBorder;
  document.getElementById("indexform").style.height=indexForm;
  document.getElementById("innerbox_bottomborder").style.top=innerboxBottomBrd;
  document.getElementById("innerbox_rightslice").style.height=innerboxRightSlice;
  if(document.getElementById("dottedline2")!=null)
  {
  	document.getElementById("dottedline2").style.top=indexForm-115;
  }
  document.getElementById("innerbox").style.height=indexForm+210;
  document.getElementById("outerdiv").style.height=indexForm+428;
  document.getElementById("outerdiv_bottomborder").style.top=indexForm+443;
  document.getElementById("extremout").style.height=indexForm+490;
  document.getElementById("footerLinks").style.top=indexForm+445;
  document.getElementById("outerdiv_rightslice").style.height=indexForm+411;
  document.getElementById("outrdivborder").style.height=indexForm+431;
 
  
}


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 = '520px';
   var win_height = '350px';
   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 doProcessing() {
  document.getElementById('submitBtn').className = 'thide'; 	
  document.getElementById('processing').className = 'tshow';
}
function doProcessing1() {
  document.getElementById('submitBtn001').className = 'thide'; 	
  document.getElementById('processing').className = 'tshow';
}

function doProcessingNoForm()
{
  document.getElementById('serviceform_submit').className = 'thide'; 	
  document.getElementById('serviceform_processing').className = 'tshow';
}

// New Referral Net Template



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("outerdiv_noformbottomborder").style.top=(middleHeight+175)+"px";
  document.getElementById("extremout").style.height= (middleHeight+244)+"px";
  document.getElementById("footerLinks").style.top= (middleHeight+202)+"px";
  document.getElementById("outerdiv_noformrightslice").style.height= (middleHeight+170)+"px";
  document.getElementById("outrdivborder").style.height=(middleHeight+181)+"px";
  
  if(document.getElementById("requiredForm"))
  {
  	document.getElementById("requiredForm").style.top= middleHeight-35;
  }
  
}


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+85)+"px";
  document.getElementById("innerbox").style.height= (middleHeight+95)+"px";
  document.getElementById("outerdiv").style.height= (middleHeight+180)+"px";
  document.getElementById("outerdiv_noformbottomborder1").style.top=(middleHeight+198)+"px";
  document.getElementById("extremout").style.height= (middleHeight+244)+"px";
  document.getElementById("footerLinks").style.top= (middleHeight+202)+"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;
  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+100)+"px";
  document.getElementById("outerdiv_noformbottomborderadsense").style.top=(headerHeight+100)+"px";
  document.getElementById("extremoutadsense1").style.height= (headerHeight+170)+"px";
  document.getElementById("footerlinksadsense").style.top= (headerHeight+125)+"px";
  document.getElementById("outerdiv_noformrightsliceadsense1").style.height= (headerHeight+95)+"px";
  document.getElementById("outrdivborderadsense1").style.height=(headerHeight+101)+"px";
}

function calculateNoFormAdSenseBrdrCssPropertiesSorry()
{ 

 // 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+100)+"px";
  document.getElementById("outerdiv_noformbottomborderadsense").style.top=(headerHeight+100)+"px";
  document.getElementById("extremoutadsense").style.height= (headerHeight+170)+"px";
  document.getElementById("footerlinksadsense").style.top= (headerHeight+125)+"px";
  document.getElementById("outerdiv_noformrightsliceadsense").style.height= (headerHeight+95)+"px";
  document.getElementById("outrdivborderadsense").style.height=(headerHeight+100)+"px";
}



function doProcessingAdd() {
document.getElementById('sumbitbutton').className = 'thide';
document.getElementById('processingnoiAdd').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 submitNoThanks() {
document.getElementById('nothanks').value = 'nothanks';
//document.getElementById('nonoithanks').className = 'thide';

}
function doProcessingNothanks() {
document.getElementById('submitnoiBtn').className = 'thide';
document.getElementById('processingnoi').className = 'tshow1';
document.getElementById('nothanks').className = 'thide';
}




function submitPostQual1()
{
	document.getElementById('submitBtn').className = 'thide';
	document.getElementById('processing').className = 'tshow';
	document.getElementById('postqual_nothanks').className = 'thide';
	document.getElementById('buttonclicked').value = 'submit';	
}

function submitPostQual2()
{
	document.getElementById('submitBtn').className = 'thide';
	document.getElementById('processing').className = 'tshow';
	document.getElementById('postqual_nothanks').className = 'thide';
	document.getElementById('buttonclicked').value = 'nothanks';
}




function calculateBrdrCssProperties(vcode) {  


var leftHeight = document.getElementById("copyContent3").offsetHeight;
 var rightHeight = document.getElementById("serviceform1").offsetHeight + 59;
 var maxHeight = rightHeight;
 var headerHeight = document.getElementById("serviceform1").offsetHeight;
 var footerHeight = 40; 
 

  
 if(rightHeight > leftHeight) 
 {
   maxHeight = rightHeight+headerHeight;
  }
  else
  {
  maxHeight = leftHeight+headerHeight;
  }

  
 document.getElementById("copyContent3").style.height = rightHeight+17+"px";
 document.getElementById("servformleftcopy").style.height = rightHeight+"px";
 document.getElementById("serviceform1").style.height = rightHeight-125;
 
 if (navigator.appVersion.indexOf("MSIE")!=-1) {
 
	 document.getElementById("extremout").style.height = headerHeight+rightHeight+footerHeight-155+"px";
	/* document.getElementById("innerbox1").style.height=document.getElementById("tab1").offsetHeight+190+"px";
	 document.getElementById("serviceformpagex").style.height = document.getElementById("tab1").offsetHeight+180+"px";
	 document.getElementById("serviceformwhiteborderx").style.height = document.getElementById("tab1").offsetHeight+220+"px";
	 document.getElementById("formdottedline3").style.top =document.getElementById("tab1").offsetHeight+175+"px";
	 document.getElementById("serviceform_submit").style.top=document.getElementById("tab1").offsetHeight+40+"px";*/
	 document.getElementById("footerLinks").style.top = document.getElementById("extremout").offsetHeight-60+"px";
	 document.getElementById("outerdiv").style.height=document.getElementById("extremout").offsetHeight-60+"px"; 
	// document.getElementById("ftr-disclaimer").style.top = document.getElementById("innerbox1").offsetHeight+260+"px";; 
	 /*document.getElementById("serviceform_processing").style.top=rightHeight-40+"px";*/
	document.getElementById("innerbox1").style.height=document.getElementById("innerbox1").offsetHeight-150+"px"; 
	document.getElementById("serviceformpagex").style.height=document.getElementById("tab1").offsetHeight+135+"px"; 
	document.getElementById("serviceformwhiteborderx").style.height = document.getElementById("tab1").offsetHeight+160+"px";
	document.getElementById("formdottedline3").style.top =document.getElementById("tab1").offsetHeight+120+"px";
	}else{
	 document.getElementById("extremout").style.height = headerHeight+rightHeight+footerHeight-120+"px";
	/* document.getElementById("innerbox1").style.height=document.getElementById("tab1").offsetHeight+190+"px";
	 document.getElementById("serviceformpagex").style.height = document.getElementById("tab1").offsetHeight+180+"px";
	 document.getElementById("serviceformwhiteborderx").style.height = document.getElementById("tab1").offsetHeight+220+"px";
	 document.getElementById("formdottedline3").style.top =document.getElementById("tab1").offsetHeight+175+"px";
	 document.getElementById("serviceform_submit").style.top=document.getElementById("tab1").offsetHeight+40+"px";*/
	 document.getElementById("footerLinks").style.top = document.getElementById("innerbox1").offsetHeight+170+"px";
	 document.getElementById("outerdiv").style.height=document.getElementById("innerbox1").offsetHeight+170+"px"; 
	// document.getElementById("ftr-disclaimer").style.top = document.getElementById("innerbox1").offsetHeight+260+"px";; 
	 /*document.getElementById("serviceform_processing").style.top=rightHeight-40+"px";*/
	document.getElementById("innerbox1").style.height=document.getElementById("innerbox1").offsetHeight-150+"px"; 
	document.getElementById("serviceformpagex").style.height=document.getElementById("tab1").offsetHeight+135+"px"; 
	document.getElementById("serviceformwhiteborderx").style.height = document.getElementById("tab1").offsetHeight+170+"px";
	document.getElementById("formdottedline3").style.top =document.getElementById("tab1").offsetHeight+120+"px";
	}
}
