

function openWindow( URL, width, height, resizable, scrollbars)
{
  try
	{
		newWindow.close(); 
	}
	catch(e)
	{
				
	}

	newWindow=window.open( URL,'page',"status=no,location=no,menubar=no,toolbar=no,directories=no,resizable=" + resizable + ",scrollbars=" + scrollbars + ",width=" + width + ",height=" + height + ",screenX=100,screenY=100");	
    window.onerror = null;
} 

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(URLtoOpen) {
		
		bName = navigator.appName;
		bVer = parseInt(navigator.appVersion);
		if((bName == "Netscape" && bVer >= 3) || (bName == "Microsoft Internet Explorer" && bVer >= 4))
			br = "n3";
		else
			br = "n2";
		
		if(br == "n3") {
			if(URLtoOpen.indexOf("pop_") != -1){
				newWindow=window.open(URLtoOpen, 'lilone','toolbar=no,width=516,height=470,left=500,top=300,directories=0,status=0,scrollbars=yes,resizable=yes,menubar=0,location=0,copyhistory=0');
			} else {
			newWindow=window.open(URLtoOpen, 'lilone','toolbar=no,width=370,height=373,left=500,top=300,directories=0,status=0,scrollbars=yes,resizable=yes,menubar=0,location=0,copyhistory=0');
			}
		}
	}


/* Display mouse over copy on index page */	


var tipwidth='150px' //default tooltip width
var tipbgcolor='lightyellow'  //tooltip bgcolor
var disappeardelay=10  //tooltip disappear speed onMouseout (in miliseconds)
var vertical_offset="0px" //vertical offset of tooltip from anchor link
var horizontal_offset="0px" //horizontal offset of tooltip from anchor link

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="fixedtipdiv" style="visibility:hidden;width:'+tipwidth+';background-color:'+tipbgcolor+'" ></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, tipwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (tipwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=tipwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
return edgeoffset
}

function fixedtooltip(menucontents, obj, e, tipwidth){


if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidetip()
dropmenuobj=document.getElementById? document.getElementById("fixedtipdiv") : fixedtipdiv
dropmenuobj.innerHTML=menucontents

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", tipwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}
}

function hidetip(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}
//Function for setting form flag that will decide the answer for ContactMe answer. 
function setContactAttribOnSubmit(submitFormFlag) {
	if(submitFormFlag){
		document.getElementById("submitFlagForm").value = "Y";
	} else {
		document.getElementById("submitFlagForm").value = "N";
	}
}
function delayhidetip(){
if (ie4||ns6)
delayhide=setTimeout("hidetip()",disappeardelay)
}

function clearhidetip(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}


function getHeight(box) {
	var h;
	for(var x=0;x<box.length;x++){
	 	// set outer table		
	 		h = document.getElementById(box[x]).offsetHeight;			
      		for(var y=0;y<box.length;y++){
        		var test_h = document.getElementById(box[y]).offsetHeight;
        		if(h<test_h) h = test_h;
      		}  
		}
	return h;		
}		

function adjustHeight(box,h) {
	//set the height of all divs to the tallest
   	for(var x=0;x<box.length;x++) {
		document.getElementById(box[x]).style.height = h +"px";
	}
}


function setHeight(){
		var outerbox = new Array("lt-content","rt-content"); 		
		var outbox1 =new Array("formInner");		
		var outbox2 =new Array("formBody");		
		
		
	var h=getHeight(outerbox);
	 adjustHeight(outerbox, h);	
	 adjustHeight(outbox1, h-18);	
	 adjustHeight(outbox2, h-16);	
	 
}			

function setPopHeight(){
		var outerbox = new Array("wht-bk","txt"); 		

	var h=getHeight(outerbox);
	if (h<190){
	 adjustHeight(outerbox, 190);	
	} else {
	 adjustHeight(outerbox, h);	
	}
}			
		
	
function doProcessing() {
   if(document.getElementById('submitBtn')!=null)
   {
   		document.getElementById('submitBtn').className = 'thide'; 
   }
   
   if(document.getElementById('submitBtn1')!=null)
   {
   		document.getElementById('submitBtn1').className = 'thide'; 
   }
   
   if(document.getElementById('processing')!=null)
   {
   		document.getElementById('processing').className = 'tshow'; 
   }
   
   if(document.getElementById('processing1')!=null)
   {
   		document.getElementById('processing1').className = 'tshow'; 
   }
   
}
function doProcessing1() {
   
   if(document.getElementById('submitbtn')!=null)
   {
   		document.getElementById('submitbtn').className = 'thide'; 
   }
   if(document.getElementById('submitbtn1')!=null)
   {
   		document.getElementById('submitbtn1').className = 'thide'; 
   }
   if(document.getElementById('processing1')!=null)
   {
   		document.getElementById('processing1').className = 'tshow';
   }
   if(document.getElementById('processing2')!=null)
   {
   		document.getElementById('processing2').className = 'tshow';	
   }
}


function doProcessing2() { 

	 if(document.getElementById('submitbtn3')!=null)
	   {
			document.getElementById('submitbtn3').className = 'thide'; 
	   }
	  if(document.getElementById('submitbtn2')!=null)
	   {
			document.getElementById('submitbtn2').className = 'thide'; 
	   }
	
	  if(document.getElementById('processing3')!=null)
	   {
			document.getElementById('processing3').className = 'tshow';	
	   }
}

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

// JavaScript Document

function calculateFooter()
{

	document.getElementById("index_righttcopy").style.height=(document.getElementById("index_righttcopy").offsetHeight+20)+"px";
	document.getElementById("footer1").style.top=(document.getElementById("index_righttcopy").offsetHeight+270)+"px";
	document.getElementById("formInner2").style.height=(document.getElementById("index_righttcopy").offsetHeight)+"px";
	document.getElementById("formBody2").style.height=(document.getElementById("index_righttcopy").offsetHeight+2)+"px";
	document.getElementById("rt-content2").style.height=(document.getElementById("index_righttcopy").offsetHeight+30)+"px";
	
}

function formcopy()
{

	document.getElementById("formInner").style.height=(document.getElementById("formInner").offsetHeight+35)+"px";
	document.getElementById("formBody").style.height=(document.getElementById("formInner").offsetHeight+2)+"px";
	document.getElementById("rt-content").style.height=(document.getElementById("formInner").offsetHeight+30)+"px";
	
}

