
/* Used in moreinfo popup */

function calculatemoreinfoCssProperties()
{
	document.getElementById("regPopCopy").style.height=document.getElementById("regPopCopy").offsetHeight+100;
}

function calculatearticleIndexImgBrdrCssProperties(article) 
{
	
	
	
	if (article=='thirdarticle')
	{
		document.getElementById("articalcontainer").style.height=document.getElementById("articlelinks").offsetHeight+260;
		document.getElementById("articalcontainerborder").style.height=document.getElementById("articlelinks").offsetHeight+173;
		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+228;
		document.getElementById("articlefooter").style.left=455;
		
	}else if (article=='firstarticle')
	{
		document.getElementById("articalcontainer").style.height=655;
		document.getElementById("articalcontainerborder").style.height=573;
		document.getElementById("whiteborder").style.height=575;
		document.getElementById("copyart").style.height=460;
		document.getElementById("articlefooter").style.top=630;
		document.getElementById("articlefooter").style.left=455;
		
	}
}

function calculateServiceFormImgBrdrCssProperties1() { 
	var leftHeight = document.getElementById("copyContent3").offsetHeight;
	var rightHeight = document.getElementById("serviceform1").offsetHeight + 59;
	var maxHeight = leftHeight;
	var headerHeight = 190;
	var footerHeight = 40;	
	if(rightHeight > leftHeight) maxHeight = rightHeight+headerHeight;
	
	document.getElementById("copyContent3").style.height = maxHeight+"px";
	document.getElementById("servformleftcopy").style.height = maxHeight+"px";
	document.getElementById("serviceform").style.height = rightHeight-57+"px";
	
	document.getElementById("extremout").style.height = headerHeight+maxHeight+footerHeight+70+"px";
	document.getElementById("serviceformwhiteborder").style.height = maxHeight+20+"px";
	document.getElementById("serviceformpage").style.height = maxHeight+19+"px";
	document.getElementById("outerdiv_rightslice").style.height=headerHeight+maxHeight+28+"px";
	document.getElementById("outerdiv").style.height=headerHeight+maxHeight+39+"px";
	document.getElementById("outerdiv_bottomborder").style.top = headerHeight+maxHeight+60+"px";
	document.getElementById("footerLinks").style.top = headerHeight+maxHeight+70+"px";
	document.getElementById("innerbox").style.height=+maxHeight+footerHeight-10+"px";
	document.getElementById("serviceform_submit").style.top=rightHeight+75+"px";	
	document.getElementById("serviceform_processing").style.top=rightHeight+75+"px";
}

function calculateServiceFormImgBrdrCssProperties() { 

// Retrieve region div heights
  var leftHeight = document.getElementById("copyContent3").offsetHeight;
  var rightHeight = document.getElementById("serviceformpage").offsetHeight;
  var footerLink = document.getElementById("footerLinks").offsetHeight;
  var outeMainDiv = document.getElementById("outerdiv").offsetHeight;
    
  if (leftHeight > rightHeight)
  {	
	  var headerHeight = document.getElementById("serviceform1").offsetHeight;
 	  document.getElementById("serviceform1").style.height=headerHeight;
	  document.getElementById("serviceform").style.height=headerHeight+1;
	  
	  document.getElementById("serviceformpage").style.height=leftHeight-1;
	  document.getElementById("serviceformwhiteborder").style.height=rightHeight+300;
	  
	  document.getElementById("innerbox").style.height=rightHeight+350;
	  document.getElementById("outerdiv").style.height=headerHeight+600;
	  document.getElementById("outerdiv_bottomborder").style.top=outeMainDiv;
	  document.getElementById("extremout").style.height=headerHeight+660;
	  document.getElementById("footerLinks").style.top=headerHeight+620;
	  document.getElementById("outerdiv_rightslice").style.height=headerHeight+590;
	  document.getElementById("outrdivborder").style.height=headerHeight+410;
	  document.getElementById("serviceform_submit").style.top=headerHeight+30;
  }
  else
  {
  	  var headerHeight = document.getElementById("serviceform1").offsetHeight;
 
	  document.getElementById("serviceform1").style.height=headerHeight;
	  document.getElementById("serviceform").style.height=headerHeight+1;
	  
	  document.getElementById("serviceformpage").style.height=headerHeight+230;
	  document.getElementById("serviceformwhiteborder").style.height=headerHeight+232;
	  
	  document.getElementById("innerbox").style.height=headerHeight+243;
	  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;
	  document.getElementById("serviceform_submit").style.top=headerHeight+10;
  }	
}


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_noformbottomthankyou1").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 calculateNoFormImgBrdrCssPropertiesprequal()
{ 

 // Retrieve region div heights
  var mainheader = 190;
  var middleservices = document.getElementById("outerservices").offsetHeight;
 
  //var lookingservices = document.getElementById("lookingservices").offsetHeight;
  var middleservices = document.getElementById("middleservices").offsetHeight;
  var maxmiddleHeight = middleservices;
    
  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+450)+"px";
  document.getElementById("outerdiv").style.height= (headerHeight+662)+"px";
  document.getElementById("outerdiv_noformbottomthankyou").style.top=(headerHeight+680)+"px";
  document.getElementById("extremout").style.height= (headerHeight+730)+"px";
  document.getElementById("footerLinks").style.top= (headerHeight+688)+"px";
  document.getElementById("outerdiv_noformrightsliceprequal").style.height= (headerHeight+655)+"px";
  document.getElementById("outrdivborder").style.height=(headerHeight+221)+"px";
  document.getElementById("bottomborder_services").style.top = maxmiddleHeight+96;
  document.getElementById("service_rightslice").style.height = maxmiddleHeight+90;
  document.getElementById("submitnoiBtn").style.top = middleservices-67;
  document.getElementById("processingnoi").style.top = middleservices-47;
  //document.getElementById("required").style.top = middleservices-67;
}


function calculateNoFormImgBrdrCssPropertiesform()
{ 

 // Retrieve region div heights
  var mainheader = 190;
  //var middleservices = document.getElementById("outerservices").offsetHeight;
 
  //var lookingservices = document.getElementById("lookingservices").offsetHeight;
  var middleservices = document.getElementById("middleformservices").offsetHeight;
  var maxmiddleHeight = middleservices;
    
  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+450)+"px";
  document.getElementById("outerdiv").style.height= (headerHeight+662)+"px";
  document.getElementById("outerdiv_referralnoformbottom").style.top=(headerHeight+660)+"px";
  document.getElementById("extremout").style.height= (headerHeight+730)+"px";
  document.getElementById("footerLinks").style.top= (headerHeight+688)+"px";
  document.getElementById("outerdiv_noformrightsliceform").style.height= (headerHeight+660)+"px";
  document.getElementById("outrdivborder").style.height=(headerHeight+221)+"px";
  document.getElementById("bottomborder_formservices").style.top = maxmiddleHeight-3;
  document.getElementById("service_formrightslice").style.height = maxmiddleHeight+90;
  document.getElementById("submitnoiBtn").style.top = middleservices-67;
  document.getElementById("processingnoi").style.top = middleservices-47;
  //document.getElementById("required").style.top = middleservices-67;
}





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+209;
  var innerboxRightSlice=indexForm+1;
  var outerdivRightSlice=indexForm+15;
 
  if(document.getElementById("submitBtnindex")!=null)
	  document.getElementById("submitBtnindex").style.top=headerHeight-10;
  if(document.getElementById("submitBtn")!=null)	  
  document.getElementById("submitBtn").style.top=headerHeight-10;
  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+155;
  }
    if(document.getElementById("dottedline3")!=null)
  {
  	document.getElementById("dottedline3").style.top=indexForm+10;
	document.getElementById("dottedline3").style.left=100;
  }
  document.getElementById("innerbox").style.height=indexForm+285;
  document.getElementById("outerdiv").style.height=indexForm+493;
  document.getElementById("outerdiv_bottomborder").style.top=indexForm+508;
  document.getElementById("extremout").style.height=indexForm+555;
  document.getElementById("footerLinks").style.top=indexForm+512;
  document.getElementById("outerdiv_rightslice").style.height=indexForm+476;
  document.getElementById("outrdivborder").style.height=indexForm+431;
 
  setJSFunctions();
}


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 doProcessingIndex3() {
  document.getElementById('submitBtnindex').className = 'thide'; 	
  document.getElementById('processing').className = 'tshow';
}

function doProcessingservice() {
  document.getElementById('submitnoiBtn').className = 'thide'; 	
  document.getElementById('processingnoi').className = 'tshow';
}


function doProcessing1() {
  document.getElementById('submitBtn001').className = 'thide'; 	
  document.getElementById('processing').className = 'tshow';
}

function doProcessingNoForm()
{
  document.getElementById("serviceform1").style.height = document.getElementById("serviceform1").offsetHeight+"px";
  document.getElementById('serviceform_submit').className = 'thide'; 	
  document.getElementById('serviceform_processing').className = 'tshow';
}
function calculatethankyou()
{ 

 // Retrieve region div heights
  var mainheader = 190;
  var middleservices = document.getElementById("outerservices").offsetHeight;
 
  //var lookingservices = document.getElementById("lookingservices").offsetHeight;
  var middleservices = document.getElementById("middleservices").offsetHeight;
  var maxmiddleHeight = middleservices;
    
  var headerHeight = document.getElementById("servformleftcopy1").offsetHeight;
  document.getElementById("innerbox").style.height= (headerHeight+640)+"px";
  document.getElementById("outerdiv").style.height= (headerHeight+850)+"px";
  document.getElementById("extremout").style.height= (headerHeight+950)+"px";
   if(document.getElementById("thankblurb").offsetHeight > document.getElementById("thankimg").offsetHeight )
   {
    document.getElementById("referralblurb").style.height=document.getElementById("thankblurb").offsetHeight + 50 + "px";
    document.getElementById("referralimage").style.height=document.getElementById("referralblurb").offsetHeight;
	document.getElementById("noiservices").style.top=document.getElementById("referralimage").style.top + 390 + "px";
   }
else{
    document.getElementById("referralimage").style.height=document.getElementById("thankimg").offsetHeight + 40 + "px";
    document.getElementById("referralblurb").style.height=document.getElementById("referralimage").offsetHeight;
	document.getElementById("noiservices").style.top=document.getElementById("referralimage").style.top + 370 + "px";
   }   
  document.getElementById("outerdiv_noformbottomthankyou1").style.top=(headerHeight+870)+"px";
  document.getElementById("outerdiv_noformrightthankyou").style.height= 874+"px";
}

function doProcessingNothanks() {
document.getElementById('submitnoiBtn').className = 'thide';
	document.getElementById('processingnoi').className = 'tshow';
	document.getElementById('nothanks').className = 'thide';
	
}

var servicematched=0;
function changevendors(currval,totalservices,j)
{
  
	for (i=1;i<=servicematched;i++)
	{
		if(i==currval)
		{
			document.getElementById("display"+i).className='tshow';
			//document.getElementById("selectedbuttons"+i).style.backgroundImage="url('../images/selectedbutton.gif')" ;
			document.getElementById("selectedbuttons"+j).className='showbuttoncolor';
		}
		else
		{	
			document.getElementById("display"+i).className='thide';
			//document.getElementById("selectedbuttons"+i).style.backgroundImage="url('../images/selectednobutton.gif')" ;
			document.getElementById("selectedbuttons"+j).className='hidebuttoncolor';
		}
		
		
	}
	
   
}
function setJSFunctions(){
}