function pause(millis) 
{
  var date = new Date();
  var curDate = null;
  
  do { curDate = new Date(); } 
  while(curDate-date < millis);
} 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
}
function resize(size){
	document.getElementById("main_content").style.width=size;
}
function disableSelection(target){
if (typeof target.onselectstart!="undefined") //IE route
	target.onselectstart=function(){return false}
else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
	target.style.MozUserSelect="none"
else //All other route (ie: Opera)
	target.onmousedown=function(){return false}
target.style.cursor = "default"
}
function clear_title(){
	document.getElementById("title").innerHTML='';
}
function clear_top_content(){
	document.getElementById("top_content").innerHTML='';
}
function get_main_content(option){
	file='indexajax.php';
	new Ajax.Request(file,{ 
	method:'get',
	parameters: "?opt=get_content"+option,
		onLoaded:
			function(){
				document.getElementById("main_content").innerHTML='<img src="/ajax/loading.gif" alt="">';
			},
		onSuccess: 
			function(transport){      
  			var res = transport.responseText;
				document.getElementById("main_content").innerHTML=res;
				//alert(res);
			},	
		onFailure: 
			function(){ 
				alert('Cannot retrieve content...') 
			}			
	});
}
function get_left_content(option){
	file='indexajax.php';
	new Ajax.Request(file,{ 
	method:'get',
	parameters: "?opt=get_left_content"+option,
		onLoaded:
			function(){
				document.getElementById("left_content").innerHTML='<img src="/ajax/loading.gif" alt="">';
			},
		onSuccess: 
			function(transport){      
  			var res = transport.responseText;
				document.getElementById("left_content").innerHTML=res;
				//alert(res);
			},	
		onFailure: 
			function(){ 
				alert('Cannot retrieve content...') 
			}			
	});
}
function get_top_content(option){
	file='indexajax.php';
	new Ajax.Request(file,{ 
	method:'get',
	parameters: "?opt=get_content"+option,
		onLoaded:
			function(){
				document.getElementById("top_content").innerHTML='<img src="/ajax/loading.gif" alt="">';
			},
		onSuccess: 
			function(transport){      
  			var res = transport.responseText;
				document.getElementById("top_content").innerHTML=res;
				//alert(res);
			},	
		onFailure: 
			function(){ 
				alert('Cannot retrieve content...') 
			}			
	});
}
function get_title(option){
	file='indexajax.php';
	new Ajax.Request(file,{ 
	method:'get',
	parameters: "?opt=get_title"+option,
		onSuccess: 
			function(transport){      
  			var res = transport.responseText;
  			//alert(res);
  			document.getElementById("title").innerHTML=res;
			},	
		onFailure: 
			function(){ 
				alert('Cannot retrieve content...') 
			}			
	});
}
function get_menu(option,menu_name){
	file='indexajax.php';
	new Ajax.Request(file,{ 
	method:'get',
	parameters: "?opt=get_menu&mclass="+menu_name+option,
		onSuccess: 
			function(transport){      
  			var res = transport.responseText;
  			//alert(res);
  			document.getElementById(menu_name).innerHTML=res;
			},	
		onFailure: 
			function(){ 
				alert('Cannot retrieve content...') 
			}			
	});
}
function get_v_menu(option){
	file='indexajax.php';
	new Ajax.Request(file,{ 
	method:'get',
	parameters: "?opt=get_v_menu"+option,
		onSuccess: 
			function(transport){      
  			var res = transport.responseText;
  			//alert(res);
				document.getElementById("v_menu").innerHTML=res;
			},	
		onFailure: 
			function(){ 
				alert('Cannot retrieve content...') 
			}			
	});
}
