//vars
var form_type;
var end=".html";
//========var search
var sear_num=0;
var sear_val="";
//========var news
var news_num=1;
//========var common
var comm_num=1;
//========var menu
var name_div="div";
var n_div=1;
var por_n=0;
var div_col=0;
var imag="../cities/countries/city1.gif";
var adres="default";
//========Na?in ianeaa o?aeiia
var id_ac = top.document.location.href.substr(top.document.location.href.indexOf("id_ac=") + 6);
//opredelenie brovser
if(navigator.userAgent.indexOf("Mozilla/5.0") != -1 || document.all){
ie=1;
}else if (navigator.userAgent.indexOf("Mozilla/4.") != -1 && navigator.userAgent.indexOf("Macintosh") != -1){
ie=2;
}else {ie=0;}
parent.work.location.href="/servlets/mp.maps?id_ac=" + id_ac;
//Create Frame structure
//=======================================
function cr_fr_struc(key){
switch (key){
	case (1):{
		if (ie==0){//top.work.stop();
				}
		//alert("Create");
		parent.work.location.href="/servlets/mp.maps?id_ac=" + id_ac;
		break;
		}	
	case (2): {if (ie==0){
		form_type="searchn";
		}else if (ie==2){
		form_type="searchm";
		}else {form_type="search";}
		parent.work.location.href=form_type+end;
		break;
		}
	case (3):{
		if (ie==0){//top.work.stop();
				}
		if ( adres=="default"){
			parent.work.location.href="/servlets/mp.cities?id_ac=" + id_ac; // dswift - added missing id_ac to url
		}else {
			parent.work.location.href=adres;
		}
		break;
		}	
	}
}

//-----------Restore Search--------
function rest_search (){
top.work.document.search.word.value=sear_val;
	num_sear=parseInt(sear_num);
	top.work.init(num_sear+1);
}
//-----------Restore News--------
function rest_news (){
	num_news=parseInt(news_num);
	top.work.init(num_news);
}
//-----------Restore Common--------
function rest_comm (){
num_comm=parseInt(comm_num);
top.work.init(num_comm);
}
//-----------Restore Previous step Menu
function restore(){
	num_a=parseInt(por_n);
	num_b=parseInt(div_col);
	num_c=parseInt(n_div);
	if (adres=="default"){top_menu=1;}else{top_menu=0;}
	top.work.init(name_div, num_c, num_a, num_b, imag, top_menu);
	
}
//===========================
function save (adr){
	adres= adr;
if ( adres=="default"){

	}else {
		parent.work.location.href=adres;
	}
}
//=============================
function myback(){top.close();}

