function hidediv(divname)
{
	var obj = document.getElementById(divname);
	if(obj != null) { obj.style.display = 'none'; }
}

function showdiv(divname)
{
	var obj = document.getElementById(divname);
	if(obj != null) { obj.style.display = 'block'; }	
}
function flashNav(frameNumber) {
	New.GotoFrame(frameNumber);
	New.Play();
}


function getformdata(formname)
{
	var theform = document.getElementById(formname);
	var getstr = "";
	
	for (i=0; i<theform.elements.length; i++) 
	{
		if(theform.elements[i] != null)
		{		
		 if (theform.elements[i].tagName == "INPUT") 
		 {			   
			if (theform.elements[i].type == "checkbox") 
			{
			   if (theform.elements[i].checked) 
			   {
				  getstr += theform.elements[i].id + "=" + encodeURIComponent(theform.elements[i].value) + "&";
			   } else {
				  getstr += theform.elements[i].id + "=&";
			   }
			}
			else if (theform.elements[i].type == "radio") 
			{
			   if (theform.elements[i].checked) 
			   {
				  getstr += theform.elements[i].id + "=" + encodeURIComponent(theform.elements[i].value) + "&";
			   }
			}
			else
			{
				getstr += theform.elements[i].id + "=" + encodeURIComponent(theform.elements[i].value) + "&";	
			}
		 }   
		 else if (theform.elements[i].tagName == "SELECT") 
		 {
			var sel = theform.elements[i];
			getstr += sel.name + "=" + encodeURIComponent(sel.options[sel.selectedIndex].value) + "&";
		 } 
		 else
		 {
			 getstr += theform.elements[i].id + "=" + encodeURIComponent(theform.elements[i].value) + "&";	
		 }
      }
	}
	   
	return getstr;			
}




function findPos(obj)
{
 var curleft = 0;
 var curtop = 0;
 if (obj.offsetParent)
 {
  while (obj.offsetParent)
  {
   curleft += obj.offsetLeft-obj.scrollLeft;
   curtop += obj.offsetTop-obj.scrollTop;
   var position='';
   if (obj.style&&obj.style.position) position=obj.style.position.toLowerCase();
   if ((position=='absolute')||(position=='relative')) break;
   while (obj.parentNode!=obj.offsetParent) {
    obj=obj.parentNode;
    curleft -= obj.scrollLeft;
    curtop -= obj.scrollTop;
   }
   obj = obj.offsetParent;
  }
 }
 else {
     if (obj.x)
      curleft += obj.x;
  if (obj.y)
      curtop += obj.y;
    }
	
 return {left:curleft,top:curtop};
}


function emptydivcontents(container)
{

	while(container.firstChild)
	{
	
		container.removeChild(container.firstChild);
	}

}



function initializeXMLHTTP()
{
	
	if(typeof xmlhttp=="undefined")var xmlhttp=false; 
	
	/* running locally on IE6,IE7 */                      ;/*Gotta love IE's support for Conditional Compilation*/; /*@cc_on 
	  if(location.protocol=="file:"){ 
	   if(!xmlhttp)try{ xmlhttp=new ActiveXObject("MSXML2.XMLHTTP"); }catch(e){xmlhttp=false;} 
	   if(!xmlhttp)try{ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }catch(e){xmlhttp=false;} 
	  }                                                                                                             @cc_off @*/ 
	
	/* IE7, Firefox, Safari, Konqueror, Opera... the conventional/standard way */ 
	//Yes, standard: http://www.w3.org/TR/XMLHttpRequest/ 
	  if(!xmlhttp)try{ xmlhttp=new XMLHttpRequest(); }catch(e){xmlhttp=false;} 
	
	/* IE5, IE6 */ 
	  if(typeof ActiveXObject != "undefined"){ 
	   if(!xmlhttp)try{ xmlhttp=new ActiveXObject("MSXML2.XMLHTTP"); }catch(e){xmlhttp=false;} 
	   if(!xmlhttp)try{ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }catch(e){xmlhttp=false;} 
	  } 
	
	/* IceBrowser */ 
	  if(!xmlhttp)try{ xmlhttp=createRequest(); }catch(e){xmlhttp=false;} 
// Note IceBrowser does not support responseXML

	return xmlhttp;
}
