

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 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() {
   document.getElementById('submitBtn').className = 'thide'; 
   document.getElementById('processing').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 formcopy()
{

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


