url=document.location.href;xend = url.lastIndexOf("/")+1;var base_url = url.substring(0,xend);	
function ajax_do(url){if(url.substring(0,4)!='http'){url=base_url+url;}var jsel=document.createElement('SCRIPT');jsel.type='text/javascript';jsel.src=url;			document.body.appendChild (jsel);} 

// JavaScript Document
function moreSnow(id) { 
	for(i=1; i<=5; i++) {
		document.getElementById('p'+i).className = 'recom';
		document.getElementById('i'+i).className = 'hide';
		document.getElementById('b'+i).className = 'hide';
	}
	setTimeout('showgames('+ id +')', 1000);
}

function showgames(id) {
	document.getElementById('i'+ id).className = '';
	document.getElementById('b'+ id).className = 'play';
	document.getElementById('p'+ id).className = 'curent';
}

/* schimba clasa unei liste */
function highlight() {
	ids = String(document.location).split("#")[1];
	if (typeof(ids) != 'undefined') {
		if (document.getElementById(ids) != null) {
			document.getElementById(ids).className = "comentariu_high";
		}
	}
}	


/* 
 * Deschide o fereastra
 */ 
 
function openWin(link, handler, width, height){ 	
	window.open(link, handler, 'location=no, resizable=no,status=yes, scrollbars=no, width='+width+', height='+height+', ScreenX=100, ScreenY=50');
}

/* 
 * Sectiunea de cautare top ( onfocus )
 */ 

function cauta(id , valu) {
	var valoare = valu;
	var cautare = document.getElementById('searchi');
	var filtru = document.getElementById('filtru');
	if(id == 'on' && cautare.value == valoare) {
		cautare.value = '';
		return;
	}
	if(id == 'of' && cautare.value == '') {
		cautare.value = filtru.value;
		return;
	}
}

/* 
 * Sectiunea avansata de cautare 
 */ 

function cautare(id) {
	if(id == "avansat") {
		document.getElementById(id).className = '';
		document.getElementById('a'+id).className = 'hide';
		document.getElementById('asimplu').className = '';
	}
	if(id == "simplu") {
		document.getElementById('avansat').className = 'hide';
		document.getElementById('a'+id).className = 'hide';
		document.getElementById('aavansat').className = '';
	}				
}

