//pause js
function pausecomp(millis){
	var date = new Date();
	var curDate = null;

	do { curDate = new Date(); } 
	while(curDate-date < millis);
} 

//button hider
function ControlDivVisibility(hide,show){
   document.getElementById(show).style.display = 'block'; 
   document.getElementById(hide).style.display = 'none'; 
}

//load listener
  function addLoadListener(fn){
     if(typeof window.addEventListener != 'undefined'){
        window.addEventListener('load', fn, false);
     }
     else if(typeof document.addEventListener != 'undefined'){
        document.addEventListener('load', fn, false);
     }
     else if(typeof window.attachEvent != 'undefined'){
        window.attachEvent('onload', fn);
     }
     else{
        var oldfn = window.onload;
        
        if(typeof window.onload != 'function'){
           window.onload = fn;
        }
        else{
           window.onload = function(){
              oldfn();
              fn();                  
           }
        }
     }
  }

/* font size controls */
function setFontSize(stringRuleName, intNewSize){
   var ruleToChange = getStyleRuleByName(stringRuleName);
   if (ruleToChange != null){
      ruleToChange.style.fontSize = intNewSize+'px';
   }
}

function getStyleRuleByName(stringName){
   if (!document.styleSheets) return;
   
   var theRules = new Array();
   for (i = 0; i < document.styleSheets.length; i++){
      if (document.styleSheets[i].cssRules){
         theRules = document.styleSheets[i].cssRules
      }
      else if (document.styleSheets[i].rules){
         theRules = document.styleSheets[i].rules
      }
   
      for (j = 0; j < theRules.length; j++){
         if (theRules[j].selectorText.toLowerCase() == stringName.toLowerCase()){
      	   return theRules[j];
         }
      }
   }
   
   return null;
}

//GetXmlHttpObject
function au1_GetXmlHttpObject(){ 
	var objXMLHttp=null
	if (window.XMLHttpRequest){
		objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject){
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
}   

/*
// no right click
if (window.Event)
  document.captureEvents(Event.MOUSEUP);
function nocontextmenu()
{
	event.cancelBubble = true
	event.returnValue = false;
	return false;
}
function norightclick(e)
{
	if (window.Event)
	{
		if (e.which == 2 || e.which == 3)
			return false;
	}
	else
		if (event.button == 2 || event.button == 3)
		{
			event.cancelBubble = true
			event.returnValue = false;
			return false;
		}
}
document.oncontextmenu = nocontextmenu;
document.onmousedown = norightclick;*/