function URLencode(sStr)
 {
    return escape(sStr).replace(/\+/g, '%2C').replace(/\"/g,'%22').replace(/\'/g, '%27');
 }
					
function ruta_print(){
		lat=800;
	lung=500;
	var TopPos=45;
	var LeftPos=(screen.width)?(screen.width-lat)/2:10;
	temp=window.open('ruta_print.php?text1='+URLencode(document.getElementById('text1').value)+'&text2='+URLencode(document.getElementById('text2').value)+'&l=1',"detalii","height="+lung+",width="+lat+",top="+TopPos+",left="+LeftPos+",toolbar=no,statusbar=no,scrollbars=yes,resizable=yes,menubar=1");
	temp.window.focus();
}





function submit_local_search() {
	s = 'http://www.e-transport.ro/module.php?trimite=Cauta&a_cautat=1&module=rezcautare&cuvant='+document.getElementById('qstring').value;
	
	
			top.location.href=s;
			
		}
		
		
		
		
		function submit_google_search() {
			document.getElementById('form_search').onsubmit = null;
			document.getElementById('form_search').submit();
		}
		
	function submitCautare()
	{
		//alert(document.form_search.cauta[0].checked);
		if(document.form_search.cauta[0].checked == true)
		{
			submit_google_search();
		}
		else
		{
			submit_local_search();
		}
		
		

	
		
	}
	


function setPointer(theRow, thePointerColor)	{
    if (typeof(theRow.style) == 'undefined' || typeof(theRow.cells) == 'undefined') {
        return false;
    }

    var row_cells_cnt = theRow.cells.length;
    for (var c = 0; c < row_cells_cnt; c++) {
        theRow.cells[c].bgColor = thePointerColor;
    }

    return true;
}

function About(){
	iLeft = (screen.width/2) - 250;
	iTop = (screen.height/2) - 150;	
	window.open("common/wce.about.php","Popup","width=300,height=210,top="+iTop+",left="+iLeft+",dependent=yes,titlebar=no,scrollbars=no");		
}

/*
PositionX = (screen.width/2) - 250;
PositionY = (screen.height/2) - 150;
*/
PositionX = 200;
PositionY = 200;


defaultWidth  = 500;
defaultHeight = 500;

var AutoClose = true;

if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;


function popImage(imageURL,imageTitle,imageDescr) {
	if (isNN){imgWin=window.open('about:blank','',optNN);}
	if (isIE){imgWin=window.open('about:blank','',optIE);}
	with (imgWin.document){
	writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');

	
	writeln('<script language="JavaScript" type="text/javascript" src="inc/extras.js"></script>');
	
	writeln('<sc'+'ript>');
	writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
	writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
	writeln('function reSizeToImage(){');
	writeln('if (isIE){');
	writeln('window.resizeTo(100,100);');
	writeln('width=100-(document.body.clientWidth-document.images[0].width);');
	writeln('height=100-(document.body.clientHeight-document.images[0].height);');
	writeln('window.resizeTo(width+5,height+50);}');
	writeln('if (isNN){');       
	writeln('window.innerWidth=document.images["George"].width+5;');
	writeln('window.innerHeight=document.images["George"].height+55;}}');
	writeln('function doTitle(){document.title="View Image: '+imageTitle+'";}');writeln('</sc'+'ript>');
	if (!AutoClose) writeln('</head><body scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
	else writeln('</head><body scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');

	//writeln('<iframe style="display:none" sr'+'c="trafic_script.html"></iframe>');
	
	
	writeln('<img onmouseover="javascript:document.getElementById(\'div_descr\').innerHTML=\'Vezi descriere\'" title="'+imageTitle+'" name="George" src='+imageURL+' style="display:block" onclick= "window.close();">');
	writeln('<div id="div_descr" onmouseover="javascript:this.innerHTML=\''+imageDescr+'\'" style="width:100;position:absolute;padding:3px;z-index:2;top:10px;left:10px;color:black;background-color:#FACE9B;font-size:11px;cursor:pointer">Vezi descriere</div>');
	//writeln('<iframe frameborder=0 style="border:0px;overflow:visible;height:55;" sr'+'c="trafic_script_logo.html"></iframe>');

	writeln('</body></html>');
	
	close();
	}
}


var bikky = document.cookie;
function getCookie(name) { 
	var index = bikky.indexOf(name + "=");
	if (index == -1) return null;
	index = bikky.indexOf("=", index) + 1;
	var endstr = bikky.indexOf(";", index);
	if (endstr == -1) endstr = bikky.length;
	return unescape(bikky.substring(index, endstr));
}

function setCookie(name, value) {
   if (value != null && value != "")
     document.cookie=name + "=" + escape(value) + ";";
 bikky= document.cookie;
}