$actualDiv = "";
$activ = "";
strDOMAIN = "viariva.weide"

function changeNaviDiv($divName) {

	if ( $activ ) window.clearTimeout($activ);
	if ( $actualDiv != $divName ) {
		//alert($actualDiv+" : "+$divName);
		if ( $actualDiv ) {
			changeBkgColor($actualDiv, "#B4CC8F");
			//window.setTimeout("changeBkgColor('"+$actualDiv+"', '#85A653')", 60);
			//window.setTimeout("changeBkgColor('"+$actualDiv+"', '#678040')", 120);
		} else {
			changeBkgColor("regionNav", "#678040");
			if ( document.getElementById("townNav") ) changeBkgColor("townNav", "#678040");
		}
		

		window.setTimeout("changeBkgColor('"+$divName+"', '#85A653')", 60);
		window.setTimeout("changeBkgColor('"+$divName+"', '#B4CC8F')", 120);
		window.setTimeout("changeBkgColor('"+$divName+"', '#DAE7C5')", 180);
		
		$actualDiv = $divName;
	}
}

function leaveNaviDiv() {
	$activ = window.setTimeout("changeNaviDiv('main')", 50);
}

function changeBkgColor ($divName, $color) {
	document.getElementById($divName).style.backgroundColor = $color;
}

function pageload() {
	
	//document.getElementById("main").style.backgroundColor = "red";
	alert(document.getElementById("navigation").style.left);
}

function openDownloadPicWin($id,$table){
	$options = "";
	var $screenwidth = screen.availWidth;
	var $screenheight = screen.availHeight;
	var $width = 870;
	var $height= 650;
	var $name = "picWin";
	var $options =  "scrollbars=no,resizable=no,menubar=no,toolbar=no,location=no,status=no,personalbar=no,width="+$width+",height="+$height+",left="+($screenwidth - $width)/2+",top="+($screenheight - $height)/2 ;
	var $url = "http://includes."+strDOMAIN+"/download.php?id="+$id+"&table="+$table;
	picWindow = open($url, $name, $options);
}
function loglink(url,ref){
	img = new Image();
	destination_link = 'http://includes.'+strDOMAIN+'/count/count.php?url='+url+'&ref='+ref+'&app=loglink';
	img.src = destination_link;
}
