var locationi = window.location;
locationi = locationi.toString();
var locationi_splited = locationi.split("?");
function ch_mouseover(idja1,idja2){
	document.getElementById(idja1).src='inc/images/topnav_img_left_hov.gif';
	document.getElementById(idja2).src='inc/images/topnav_img_right_hov.gif';


}
function ch_mouseout(idja1,idja2){	
	document.getElementById(idja1).src='inc/images/topnav_img_left.gif';
	document.getElementById(idja2).src='inc/images/topnav_img_right.gif';
}

var countsat1=0;
function get_tpl(pagi,countsat){
	ajaxRequest = GetXmlHttpObject('ajaxRequest');
	var URL = 'fw/ajax/banner_1.php?page=<? echo $lid.",".$sid.",".$fid; ?>';
	ajaxRequest.onreadystatechange = call_tplja;
	countsat = parseInt(countsat);
	countsat1 = parseInt(countsat1);

	var stringquery = "&page="+pagi+"&countsat="+countsat1;
	ajaxRequest.open("GET", URL+stringquery, true);
	ajaxRequest.send(null); 
	function call_tplja(){
		if(ajaxRequest.readyState == 4){
				document.getElementById('second_flash_img').innerHTML = ajaxRequest.responseText;
				setTimeout( "get_tpl('"+pagi+"','"+countsat+"')",10000 );
					if(countsat1==(countsat-1))
	{
		countsat1=0;
	}else{
		countsat1++;
	}
				
		}
	}
}


function get_tpl1(pagi){
	ajaxRequest1 = GetXmlHttpObject('ajaxRequest1');
	var URL = 'fw/ajax/banner_2.php?page=<? echo $lid.",".$sid.",".$fid; ?>';
	ajaxRequest1.onreadystatechange = call_tplja1;
	var stringquery1 = "&page="+pagi;
	ajaxRequest1.open("GET", URL+stringquery1, true);
	ajaxRequest1.send(null); 
	
	function call_tplja1(){
		if(ajaxRequest1.readyState == 4){
				document.getElementById('second_flash_img1').innerHTML = ajaxRequest1.responseText;
		}
	}
}
function get_tpl2(pagi){
	ajaxRequest2 = GetXmlHttpObject('ajaxRequest2');
	var URL = 'fw/ajax/banner_3.php?page=<? echo $lid.",".$sid.",".$fid; ?>';
	ajaxRequest2.onreadystatechange = call_tplja2;
	var stringquery2= "&page="+pagi;
	ajaxRequest2.open("GET", URL+stringquery2, true);
	ajaxRequest2.send(null); 
	
	function call_tplja2(){
		if(ajaxRequest2.readyState == 4){
				document.getElementById('rightnav_flash1').innerHTML = ajaxRequest2.responseText;
		}
	}
}
function get_tpl3(pagi){
	ajaxRequest3 = GetXmlHttpObject('ajaxRequest3');
	var URL = 'fw/ajax/banner_4.php?page=<? echo $lid.",".$sid.",".$fid; ?>';
	ajaxRequest3.onreadystatechange = call_tplja3;
	var stringquery3= "&page="+pagi;
	ajaxRequest3.open("GET", URL+stringquery3, true);
	ajaxRequest3.send(null); 
	
	function call_tplja3(){
		if(ajaxRequest3.readyState == 4){
				document.getElementById('rightnav_flash2').innerHTML = ajaxRequest3.responseText;
		}
	}
}



