/* author: Against */
/* Creation date: 27.08.2002 */
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==5)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->

var ns = navigator.appName == "Netscape";
var ns4 = (ns && parseInt(navigator.appVersion) == 4);
var ns5 = (ns && parseInt(navigator.appVersion) > 4);

//alert(ns + " & " + ns4 + " & " + ns5);

// Get params
var ex_url=location.search.substring(1);
var param=ex_url.split('&');
var values = new Array();
for(i=0; i<param.length;i++) {
	var b = param[i].split('=');
	values[b[0]] = unescape(b[1]);
}
var menu_id = 0;
if (values["go"] != null){
	 if (values["go"] <= 9 && values["go"] >= 1){
	 	var menu_id = values["go"]-1;
	 }
}

var pos = new Array(0,0,28,56,83,110,136,163,163);
var y_offset = 10;
var start_y = y_offset + pos[menu_id];
var fps = 18;
var step = 4;
var TimeOutID = -1;
var menu_img_count = 11
var menu_mid_img_count = 6
var menu_img_name = "";


function set_menu_img(){

	img_i = menu_id;
	mid_img_i = menu_id;

	img_name = "../img/i_"+img_i+".gif";
	mid_img_name = "../img/i_"+mid_img_i+".gif";

	lft = 0;
	if (!ns){
		lft = 0
	}
	else if(ns5){
		lft = 60
	}

	if (menu_id > 0 && menu_id < 3){
		document.write('<div id="div_mi" style="position:relative; left:'+(lft+23)+'px; top: 60px; width:100px; height:100px; z-index:1;"><a href="foto.shtml?go=3"><img name="mi" src="'+img_name+'"  border="1" align="right" hspace="30" style="border-color: #E2E8FF"></a></div>');
	}
	else if(menu_id == 3 || menu_id == 4){
		document.write('<div id="div_mi" style="position:relative; left:'+(lft+65)+'px; top: -218px; width:100px; height:50px; z-index:1;"><a href="foto.shtml?go=3"><img name="mi" src="'+mid_img_name+'"  border="1" align="right" hspace="30" style="border-color: #E2E8FF"></a></div>');
		document.write('<div id="div_mi_2" style="position:relative; left:'+(lft+23)+'px; top: 45px; width:100px; height:50px; z-index:1;"><a href="foto.shtml?go=3"><img name="mi_2" src="'+mid_img_name+'"  border="1" align="right" hspace="30" style="border-color: #E2E8FF"></a></div>');
	}
	else if(menu_id > 4){
		document.write('<div id="div_mi" style="position:relative; left:'+(lft+65)+'px; top: -218px; width:100px; height:100px; z-index:1;"><a href="foto.shtml?go=3"><img name="mi" src="'+img_name+'"  border="1" align="right" hspace="30" style="border-color: #E2E8FF"></a></div>');
	}

	if (!ns4 && !ns5 && !ns){
     	document.all["item"+menu_id]["style"]["color"] = "#FFFFFF";
	}
	else if (ns5){
		ahr = document.getElementById("item"+menu_id);
		ahr["style"]["color"] = "#FFFFFF";
	}
}



function rand(n1,n2){
	n=n1+parseInt(Math.random()*(n2-n1+1));
	return n;
}

function init(){
	if (ns4){
		obj = document["Menu"];
	}
	else if (ns5){
		obj = document.getElementById("Menu");
	}
	else if (!ns){
		obj = document.all ? document.all["Menu"] : null;
	}
}

function go(id,link,t){
	cur_pos = getObjCoord(obj,"top");
	if (t != TimeOutID) clearTimeout(TimeOutID);
	dest_pos = pos[id] + y_offset;
	if (cur_pos != dest_pos){
		if (!ns && (menu_id > 0)){
			document.all["div_mi"]["style"]["visibility"] = "hidden";
   	    	if (menu_id == 3 || menu_id == 4){
				document.all["div_mi_2"]["style"]["visibility"] = "hidden";
			}
		}
		else if (ns5 && (menu_id > 0)){
			pic1 = document.getElementById("div_mi");
			pic1["style"]["visibility"] = "hidden";
			if (menu_id == 3 || menu_id == 4){
				pic2 = document.getElementById("div_mi_2");
				pic2["style"]["visibility"] = "hidden";
			}
		}
		s = parseInt(distance(cur_pos,dest_pos) / step +1);
		cur_pos =  approach(cur_pos,dest_pos,s);
		setObjCoord(obj,"top",cur_pos);
		TimeOutID = setTimeout("go("+id+",'"+link +"',"+TimeOutID+")", 1000/fps);
	}
	else{
		clearTimeout(TimeOutID);
		TimeOutID = -1
		location.href = link + "?go=" + (id+1) ;
	}
}

function approach(cur_value,dest_value,step){
	dist = distance(cur_value, dest_value);
	if (dist > step){
		if (cur_value > dest_value)cur_value = cur_value - step
		else cur_value = cur_value + step
	}
	else {
		cur_value = dest_value
	}
	return cur_value;
}

function distance(cur_value,dest_value){
	dist = cur_value - dest_value;
	if (dist < 0) dist = dist * -1;
	return dist;
}

function setObjCoord(_obj,param_name,value){
	if (!ns4){
		if (ns5){
			obj["style"][param_name] = String(value)+"px";
		}
		else {
			obj["style"][param_name] = value;
		}
	}
	else{
		obj[param_name] = value;
	}
}

function getObjCoord(_obj,param_name){
	var p_value = -1;
	if (!ns4){
		p_value = parseInt(_obj["style"][param_name]);
	}
	else {
		p_value = _obj[param_name];
	}
	return p_value;
}
//-->