
function openwindw(obj,properties){
	window.open(obj.href,'',properties,false);
	return false;
}

/* 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 = 460;
	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;
  alert("Officet height"+outeMainDiv);
    
  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+275)+"px";
  document.getElementById("outerdiv_noformbottomborder").style.top=(headerHeight+221+275)+"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+271;
  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;
  if(document.getElementById("innerbox_rightslice")!=null)
  	document.getElementById("innerbox_rightslice").style.height=innerboxRightSlice;
  if(document.getElementById("dottedline2")!=null)
  {
  	document.getElementById("dottedline2").style.top=indexForm+80;
  }
  document.getElementById("innerbox").style.height=indexForm+310;
  document.getElementById("outerdiv").style.height=indexForm+528;
  document.getElementById("outerdiv_bottomborder").style.top=indexForm+543;
  document.getElementById("extremout").style.height=indexForm+590;
  document.getElementById("footerLinks").style.top=indexForm+545;
  document.getElementById("outerdiv_rightslice").style.height=indexForm+511;
  document.getElementById("outrdivborder").style.height=indexForm+431;
 
  
}
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("submitBtn002").style.top=headerHeight;
  document.getElementById("whiteborder001").style.height=whiteBorder;
   document.getElementById("indexformpage1").style.height=headerHeight;
  document.getElementById("indexform001").style.height=indexForm;
  document.getElementById("innerbox_bottomborder001").style.top=innerboxBottomBrd;
  document.getElementById("innerbox_rightslice001").style.height=innerboxRightSlice;
  if(document.getElementById("formdottedline2")!=null)
  {
  	document.getElementById("formdottedline2").style.top=indexForm-115;
  }
  
  if(document.getElementById("submitBtn001")!=null)
  {
  
  	document.getElementById("submitBtn001").style.top=indexForm-105;	
  }
  
  document.getElementById("innerbox001").style.height=indexForm+210;
  document.getElementById("outerdiv001").style.height=indexForm+428;
  document.getElementById("outerdiv_bottomborder001").style.top=indexForm+443;
  document.getElementById("extremout001").style.height=indexForm+490;
  document.getElementById("footerLinks").style.top=indexForm+445;
  document.getElementById("outerdiv_rightslice001").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('submitBtn002').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';
}


// New Referral Net Template

function calculateNoFormImgBrdrCssPropertiesprequal()
{ 
 var browser=navigator.appName;
 // 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+500)+"px"; //220
  document.getElementById("outerdiv_noformbottomborder").style.top=(headerHeight+501)+"px";
  document.getElementById("extremout").style.height= (headerHeight+284+275)+"px";
  document.getElementById("footerLinks").style.top= (headerHeight+525)+"px";
  //document.getElementById("outerdiv_noformrightslice").style.height= (headerHeight+489)+"px";//215 
  if(document.getElementById("submitnoiBtn")){
  document.getElementById("submitnoiBtn").style.top= (headerHeight-120)+"px";
  }
  if(document.getElementById("required"))
  {
  	document.getElementById("required").style.top= headerHeight-125;
  }
  if(document.getElementById("feedbacklink")){
  	document.getElementById("feedbacklink").style.position = 'absolute';
  	document.getElementById("feedbacklink").style.top = headerHeight - 30;
  }
  
 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;
		   	else  	
				document.getElementById('sp'+i).style.height = document.getElementById('sp'+j).offsetHeight;
		}
	}
	if (browser=="Microsoft Internet Explorer"){
   if(document.getElementById("phoneno")!= null)
  document.getElementById("phoneno").style.top=0+"px";
  }
  
}

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";
  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 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()
{ 
var hqsitelinkHeight=+document.getElementById("improvementlinkid").offsetHeight;
 // Retrieve region div heights
  var headerHeight = document.getElementById("servformleftcopyadsense").offsetHeight - 0 + 10;  
  document.getElementById("ein_serviceformwhiteborderadsense1").style.height= headerHeight+"px";
  document.getElementById("ein_innerboxadsense1").style.height= (headerHeight+10+hqsitelinkHeight)+"px";
  document.getElementById("ein_outerdivadsense1").style.height= (headerHeight+100)+"px";
  document.getElementById("ein_extremoutadsense1").style.height= (headerHeight+150+hqsitelinkHeight)+"px";
 // document.getElementById("footerLinks").style.top= (headerHeight+140)+"px";  
	document.getElementById("ein_outrdivborderadsense1").style.height=(document.getElementById("ein_extremoutadsense1").offsetHeight-50)+"px";
	document.getElementById("ein_outerdivadsense1").style.height=(document.getElementById("ein_extremoutadsense1").offsetHeight-50)+"px"; 
  if(document.getElementById("feedbacklink")){
  		document.getElementById("feedbacklink").style.top = (headerHeight - 30)+"px";
	 	document.getElementById("feedbacklink").style.position = 'absolute';
	}	  
}

function calculateNoFormAdSenseBrdrCssPropertiesthankyou1()
{ 

 // Retrieve region div heights
  var headerHeight = document.getElementById("servformleftcopyadsense").offsetHeight - 0 + 10;  
  document.getElementById("serviceformwhiteborderadsense1").style.height= headerHeight+"px";
  document.getElementById("innerboxadsense1").style.height= (headerHeight+10)+"px";
  document.getElementById("outerdivadsense1").style.height= (headerHeight+105)+"px";
   document.getElementById("outrdivborderadsense1").style.height= (headerHeight+100)+"px";  
  document.getElementById("extremoutadsense1").style.height= (headerHeight+155)+"px";
  document.getElementById("footerlinksadsense").style.left = '60px';
  //document.getElementById("footerLinks").style.top= (headerHeight+140)+"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 doProcessingNothanks() {
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 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 calculateNoFormImgBrdrCssPropertiesthankyou()
{ 
 var browser=navigator.appName;
 // 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+275)+"px";
  document.getElementById("outerdiv_noformbottomborder").style.top=(headerHeight+221+275)+"px";
  document.getElementById("extremout").style.height= (headerHeight+284+275)+"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";
  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";
  }
 }
 if (browser=="Microsoft Internet Explorer"){
   if(document.getElementById("phoneno")!= null)
  document.getElementById("phoneno").style.top=0+"px";
  }
    
  
}
function calculateNoFormImgBrdrCssProperties1()
{ 
 // Retrieve region div heights for session ended page
  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+229)+"px";
  document.getElementById("outerdiv_noformbottomborder").style.top=(headerHeight+229)+"px";
  document.getElementById("extremout").style.height= (headerHeight+290)+"px";
  document.getElementById("footerLinks").style.top= (headerHeight+247)+"px";
  document.getElementById("outerdiv_noformrightslice").style.height= (headerHeight+219)+"px";
  document.getElementById("outrdivborder").style.height=(headerHeight+221)+"px";
}
function calculateNoFormAdSenseBrdrCssPropertiesthankyou2()
{ 
 // Retrieve region div heights
  var headerHeight = document.getElementById("servformleftcopyadsense").offsetHeight - 0 + 10;  
  var hqsitelinkHeight=+document.getElementById("improvementlinkid").offsetHeight;
  document.getElementById("ein_serviceformwhiteborderadsense1").style.height= (headerHeight)+"px";
  document.getElementById("ein_innerboxadsense1").style.height= (headerHeight+10+hqsitelinkHeight)+"px";
  document.getElementById("ein_outerdivadsense1").style.height= (headerHeight+100+hqsitelinkHeight)+"px";
  document.getElementById("ein_extremoutadsense1").style.height= (headerHeight+150+hqsitelinkHeight)+"px";
 // document.getElementById("footerLinks").style.top= (headerHeight+140)+"px";  
  document.getElementById("ein_serviceformwhiteborderadsense1").style.position='relative';
  if(document.getElementById("feedbacklink")){
	  document.getElementById("feedbacklink").style.position = 'relative';
	  document.getElementById("feedbacklink").style.top = (headerHeight - 30)+"px";
	}	  
}