var isIE = document.all?true:false;
function $(id){
	return document.getElementById(id);	
}
function _onLoad(){
	//var obj=$('content');
	//createDiv(obj);
}
function setContent(id,text){
	$(id,text).innerHTML = text;
}
function expandToggle(id){
		var object = $(id);
		if (object.style.display == '') object.style.display = 'none';
		 else  object.style.display = '';	
	}
function createDiv(obj){
	if (!obj) {obj=document.body;}
	var div = document.createElement('div');
	div.id = 'loading';
	div.className = 'loading';
	div.style.display = 'none';
	div.style.width = '100%';
	div.align = 'right';
	setOpacity(div,9);
	obj.appendChild(div);
	div.innerHTML = '<table cellpadding="0" cellspacing="0" border="0"><tr><td><img src="img/ajax-loader.gif" border="0" /></td><td>&nbsp;Se incarca continutul paginii</td></tr></table>';
}
function _NodeRemover(id){
	var oNodeToRemove = $(id);
	if (oNodeToRemove) oNodeToRemove.parentNode.removeChild(oNodeToRemove);
}
function setOpacity(obj,value) {
	obj.style.opacity = value/10;
	obj.style.filter = 'alpha(opacity='+value*10+')';
}
function getInfo(id){
		var object = $(id);
		if (object.style.display == '') object.style.display = 'none';
		 else  object.style.display = '';
}
function evalNode(node){
	var cells = node.getElementsByTagName("div"); 	
	for (var i = 0; i < cells.length; i++) { 
		if ( cells[i].id == "script" ){ 
			try{window.eval(cells[i].innerHTML);}
			catch(e){}
			if (cells[i]) cells[i].innerHTML = '';
		}
	}
	$('loading').style.display='none';
}
function ajax_url(url,target){
	if (lastUrl!=url){
		//setLoading(target);
		new Ajax.Updater(target,url, {asynchronous:true, evalScripts:true})
	}
	lastUrl=url;
}
function ajax_update(className,action,vars,target){
	//setLoading(target);
	args = 'args[]='+vars.join('&args[]=');
	var url = 'index.php?mod='+className+'&action='+action+'&'+args;
	if (target == 'content'){		
		lastUrl=url;
		$('dummie').src=url+'&history=add';
		
	}
	new Ajax.Updater(target,url, {asynchronous:true, evalScripts:true})
}
