
// JS von index 22.01.2012 ####################################################

//##############################################################################
function getCookie(name) {
   var cookie = " " + document.cookie;
   var search = " " + name + "=";
   var setStr = null;
   var offset = 0;
   var end = 0;
   if (cookie.length > 0) {
      offset = cookie.indexOf(search);
      if (offset != -1) {
         offset += search.length;
         end = cookie.indexOf(";", offset)
         if (end == -1) {
            end = cookie.length;
         }
         setStr = unescape(cookie.substring(offset, end));
      }
   }
   return setStr;
}

//##############################################################################
function change_sp(sp_cl){
	if(sp_cl=="en"){
		view_alert(250,'Sorry, but at the moment the english version is under construction!');
		return;
	}
	f = document.index_reload;
	f.sp_r.value = sp_cl;
	f.submit();
}

//##############################################################################
function menu_over(ids){
	for(i=0; i<i_ml; i++){
		id_i = menu_liste_array[i];
		if(id_i == ids) bg = x5;  else bg = x4;
		document.getElementById(id_i).style.backgroundColor=bg;
	}
}

//##############################################################################
function send_password(){
	var f = document.password_vergesen;
	f.submit();
}

//##############################################################################
function view_info(row,img_ind,ss){
	var f = document.booking;
	f.method = "POST";
	f.target = "tmp_view2_f";
	f.action = "MIKI/view_hotel_info.php?sid="+sid+"&preloader=1";
	/*
	if(ss==1)
		value_select = window.document.getElementById('hotel'+row).value;
	else
		value_select =  f.value_select_info.value;
	*/
	value_select = "row="+row;
	value_select += "&img_ind="+img_ind;		
	f.value_select_info.value = value_select;	
	f.submit();
}
//##############################################################################
function view_TC(){
	var f = document.f_without_d;
	f.target = "tmp_view2_f";
	f.action = "MIKI/terms_and_conditions.php?sid="+sid;
	f.submit();
}

//##############################################################################
function view_tour_TC(){
	var f = document.f_without_d;
	f.target = "tmp_view2_f";
	f.action = "agb.php?sid="+sid+"&layer=2";
	f.submit();
}

//##############################################################################
function view_alert(w, msg, color, time, form_submit, f_layer, ja_cl){
	var f = document.f_without_d;
	if(f_layer == undefined) f_layer = 2;
	f.target = "tmp_view"+f_layer+"_f";
	f.msg.value = msg;
	f.msg_td_w.value = w;
	f.action = "view_confirm.php?sid="+sid;
	f.action += "&layer="+ f_layer;
	if(color != undefined )
		f.action += "&color="+color;
	if(time != undefined )
		f.action += "&time="+time;
	if(form_submit != undefined )
		f.action += "&form_submit="+form_submit;
	if(ja_cl != undefined )
		f.action += "&ja_cl=1";	
	f.submit();
}
//##############################################################################
function go_to_change_booking(i){

	var f = document.check_change_booking_form;
	f.target = "tmp_view2_f";
	//f.target = "_blank";
	f.action = "check_change_booking.php?sid="+sid+"&select="+i;
	f.submit();
	/*
	if(f.t_und_c.checked){

	}
	else
	view_alert(500,"You have forgotten checked - read and accepted Terms and conditions (T&amp;C) of online booking!<br>&#1042;&#1099; &#1079;&#1072;&#1073;&#1099;&#1083;&#1080; &#1086;&#1090;&#1084;&#1077;&#1090;&#1080;&#1090;&#1100;, &#1095;&#1090;&#1086; &#1086;&#1079;&#1085;&#1072;&#1082;&#1086;&#1084;&#1083;&#1077;&#1085;&#1099; &#1080; &#1089;&#1086;&#1075;&#1083;&#1072;&#1089;&#1085;&#1099; &#1089;&#1086; &#1089;&#1088;&#1086;&#1082;&#1072;&#1084;&#1080; &#1080; &#1091;&#1089;&#1083;&#1086;&#1074;&#1080;&#1103;&#1084;&#1080; &#1086;&#1085;&#1083;&#1072;&#1081;&#1085; &#1088;&#1077;&#1079;&#1077;&#1088;&#1074;&#1080;&#1088;&#1086;&#1074;&#1072;&#1085;&#1080;&#1103;!");
	*/
}

//##############################################################################
function go_to_booking_miki(){
	var f = document.booking;
	f.target = "tmp_view_f";
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//    debug_form_elements();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

	//f.target = "_blank";
	f.action = "MIKI/booking_hotel.php?sid="+sid;
	if(f.t_und_c.checked){
		f.submit();
	}
	else
	view_alert(500,$_363);  //-- Sie haben nicht bestätigt, dass Sie die AGB der Online-Buchung gelesen und akzeptiert haben! -->
}

//##############################################################################
function go_to_payment(){
  var f = document.payment_form; 
  if(!ie)go_href=f.action;
  f.target = "payment_f"; 
  f.submit();

  h = parseInt(window.document.getElementById("tmp_view").style.height);
  w = parseInt(window.document.getElementById("tmp_view").style.width);
  //h=600; w=600; //debug
  window.document.getElementById("payment_f").width = w;
  window.document.getElementById("payment_f").height = h;
  object_view("payment_v", h, w, 20);
  scroll(0,0);
}

//##############################################################################
function child_rb(k,i){
  var f = document.booking;
  if(f.visa.checked || f.all_person_daten.value==1) return;
  if(k==1) v = 'visible'; else v = 'hidden';
  window.document.getElementById("b_day"+i).style.visibility = v;
}

//##############################################################################
function go_to_booking(){
	var f = document.booking;
	f.target = "tmp_view_f";
	var erg = new Array();
	var lead_id = new Array();
	var il=0;
	var ie=0;
	var lead_sel = false;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//    debug_form_elements();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	if(f.visa.checked)
	{
		i=8;
		if(f.elements[4].checked)
		{
			erg[ie] = check_input(6,1); ie++;
		}
		else
		{
			erg[ie] = check_input(7,1); ie++;
		}
	}
	else
		i=4;


	while(f.elements[i].name != "agency_name")
	{
		//alert(i + ">" + f.elements[i].name)
		lead = f.elements[i].checked;
		id_row = "r"+f.elements[i].value;
		lead_id[il] = "c"+f.elements[i].value; il++;

		if(lead && !lead_sel) lead_sel = true;

		ms = f.elements[i+1].checked;
		mr = f.elements[i+2].checked;
		ch = f.elements[i+3].checked;

		if(ms || mr || ch)
		{
			erg[ie] = true; ie++;
			show_no_error_byid(id_row);
		}
		else{
			erg[ie] = false; ie++;
			show_error_byid(id_row);
		}

		erg[ie] = check_input(i+4,0); ie++; //f_name
		erg[ie] = check_input(i+5,0); ie++; //s_name

        if(f.visa.checked || ch )
        	{
        		erg[ie] = check_input(i+6,3);
        		var age_error = 0;
        		if(ch && erg[ie])
        		{
        		 	age = bday_to_age(f.elements[i+6].value)
        		 	bd_name =  f.elements[i+6].name;
        		 	child_room =  bd_name.substr(5,1);
        		 	type_room  =  bd_name.substr(5,5);
        		 	i_child    =  bd_name.substr(11,1);
        		 	//alert(" >> " + age + "/"+ bd_name + " >> " + child_room + " / " +  type_room + " / " +  i_child )
        		 	if(child_room == "5" && age > 2){ age_error = 2; erg[ie] = false; }
        		 	else if(child_room == "3" && age > 12) { age_error = 12; erg[ie] = false; }
        		 		if( age_error > 0 )
        		 		{
        		 	 		view_alert(250,$_364 + " "+ age_error +" "+$_365);   //-- Fehler! Kind älter ist als + age_error  + Jahre alt! -->
                     		show_error(i+6)
                    	}
        		 }
        	}
        else
        	erg[ie] = true;
        	ie++; //b_day

		if(f.visa.checked)
		{
			erg[ie] = check_input(i+7,1); ie++; //pass
			i += 8;
		} else i += 7;
	}

	i++;
	for(i2=0; i2 < 2; i2++){
		erg[ie] = check_input(i+i2,0); ie++;
	}
	i += i2;

	erg[ie] = check_input(i,1); ie++;
	i++;
	erg[ie] = check_input(i,1); ie++;
	i++;
    erg[ie] = check_input(i,0); ie++;
    i++;
	erg[ie] = check_input(i,2); ie++;
	i++;
	erg[ie] = check_input(i,4); ie++;
	i++;
	erg[ie] = check_input(i,5);

	//card-----------------------------------------------------------------------------------------------
	/*
	i ++;
	ie++;
	erg[ie] = check_input(i,0); ie++; //type
	ind = f.elements[i].selectedIndex;
	erg[ie] = checkCreditCard (f.elements[i+1].value, f.elements[i].options[ind].text ); //valid num
	if(!erg[ie]) show_error(i+1);  else   show_no_error(i+1);
	ie++;
	//---------------------------------------------------------------------------------------------------
	i +=2;
	ind_m = f.elements[i].selectedIndex;
	m_card = parseInt(f.elements[i].options[ind_m].text)
	ind_y = f.elements[i+1].selectedIndex;
	y_card = parseInt(f.elements[i+1].options[ind_y].text);
	H = new Date();
	Y = H.getFullYear();
	M = H.getMonth() + 1;
	err_y = false;
	err_m = false;
	if(ind_m > 0 && ind_y > 0){
		if(y_card == Y && m_card <= M)
		{
			err_y = true;
			err_m = true;
		}
		if(y_card<Y)
		{
			err_y = true;
		}
	}
	if(ind_m == 0)  err_m = true;
	if(ind_y == 0)  err_y = true;
	if(err_m) { erg[ie] =  false;  show_error(i); } else {show_no_error(i); erg[ie] = true; };
	if(err_y) { erg[ie+1] =  false; show_error(i+1); }  else {show_no_error(i+1); erg[ie+1] = true;};
	ie += 2;
	i  += 2;
	*/
//------------------------------------------------------------------------------
	erg[ie] = check_input(i,2); ie++;
	i ++;
	OK =true;
	for(j=0; j<ie; j++)
	{
		if(!erg[j])
		{
			OK = false;
			break;
		}
	}

	if(!lead_sel){
		OK = false;
		for(k=0; k<il; k++)	{
			id=lead_id[k];
			show_error_byid(id);
		}
	}
	else
	{
		for(k=0; k<il; k++)
		show_no_error_byid(lead_id[k]);
	}

	f.method = "POST";
	f.target = "tmp_view_f"; //f.target = "_blank";
	//alert(OK)
	//alert(f.value_select_info.value)

	f.action = "MIKI/find_hotel.php?sid="+sid+"&step=3&order_view=1";
	if(OK) {
		//document.close_log.submit();
		f.submit();
	}
	else window.scrollTo(0,0);
}

//##############################################################################
function go_to_select(r){
	var f = document.booking;
	f.method = "POST";
	f.target = "tmp_view_f";	
	f.value_select_info.value = "row="+r;	
	f.action = "MIKI/find_hotel.php?sid="+sid+"&step=2";
	f.submit();
}

//##############################################################################
function go_to_return(i){
	var f = document.booking;
	f.method = "POST";	
	if(i==1)
	{
		f.target = "tmp_view_f";		
		f.action = "MIKI/warten_alert.php?sid="+sid+"&layer=&preloader=1";		
		f.warten_prog.value= "MIKI/find_hotel.php?step="+i;
	}
	else		
	{		
		f.target = "tmp_view_f";
		f.action = "MIKI/find_hotel.php?sid="+sid+"&step="+i;
  }	
	f.submit();
}

//##############################################################################
function go_to_next(){
	var f = document.booking;
	f.method = "POST";
	f.target = "tmp_view_f";
	f.action = "MIKI/find_hotel.php?sid="+sid+"&step=3";
	f.submit();
}

//##############################################################################
function other_room_submit(i){
	var f = document.bestellung;
	f.method = "POST";
	r_buf = "";
	for (ir=0; ir<16; ir++)
	{
		if(ir > 0) r_buf += "~";
		r_buf += window.document.getElementById("R"+ir).value;
	}

	if(i==1){
	    var f = document.bestellung;
		f.target = "tmp_view_f";
		f.action = "MIKI/other_roomselector.php?sid="+sid+"&room_select="+r_buf;
		f.submit();
	}
	else{
	var f = document.other_room;
	/*
	 n=f.elements.length;
        buf="";
        for(k=0; k<n; k++){
                buf=buf+k+":"+f.elements[k].name+":"+f.elements[k].value+":\n";
        }
        alert(buf);
	*/

		f.target = "rooms_f";
		f.action = "MIKI/roomselector_5.php?sid="+sid+"&room_select="+r_buf;
		f.submit();
	}

}

//##############################################################################
function select_rooms_change(i,id){

	ids = id+i;
	idt = "R"+i;
	v = value_select_onchange(ids);
	 r_buf = "";
		for (ir=0; ir<16; ir++)
		{
			if(ir > 0) r_buf += "~";
			r_buf += window.document.getElementById("R"+ir).value;
		}
	//alert(v)
	window.document.getElementById(idt).value = v;
	//alert(idt + "/" +	window.document.getElementById(idt).value)
	//alert(id +"/"+ v)
	if( id == "RT_select" && v=="0"){
		//alert(id + "/" + v)
	    var f = document.bestellung;
		f.target = "rooms_f";
		f.action = "MIKI/roomselector_5.php?sid="+sid+"&room_select="+r_buf;
		f.submit();
	}

}

//##############################################################################
var Timeout_hotel_submit=0;
function check_datum_room_submit(){
var f = document.bestellung;
/*
	 n=f.elements.length;
        buf="";
        for(k=0; k<n; k++){
                buf=buf+k+":"+f.elements[k].name+":"+f.elements[k].value+":\n";
        }
        alert(buf);
*/

var OK = true;
var OK_room = false;
var OK_person = true;
var err_str = "";
var err_array = "";
var t_Rooms="";

//check datum---------------------
check_in = f.ankunft.value;
check_out = f.abfahrt.value;
heute = h_day("/");
nights = datum_days(check_in,check_out)
days = datum_days(heute,check_in);
day_r = datum_plus(check_in, -check_in_days_limit);

	if(check_in=="" || check_out==""){
		OK = false;
		err_str = $_366;  //-- Ankunftsdatum? Abreisedatum? -->
		err_array += "~" + 1;
	}else
	{
		if(days < check_in_days_limit){
		OK = false;
		err_str = $_367 + " " + check_in;   //-- Für den Ankunftsdatum, das Sie angegeben haben + check_in -->
		err_str += " " + $_368 + " ";      //-- können Sie die Buchung bis  -->
		err_str += day_r + " " + $_369;   //--  day_r + um 21:00 machen! -->
		err_array += "~" + 2;
		}
		if(nights < 1 || nights > 30){
			OK = false;
			err_str =  $_370 + " " + check_in + " " + $_371 + " " + check_out + $_372;
			   //-- Ankunftsdatum + check_in + Abreisedatum + check_out + , Anzahl der Nächte? Prüfen Sie bitte die Daten! -->
			err_array += "~" + 3;
		}
	}

//check room >0 & person <10 --------------------------------------------------------------
    OK_room_select=false;
	var persons = 0;
	rooms_typ = 0;
	krs=0;
	for(i=0; i < room_js_array.length-1; i++) {
		kr = window.document.getElementById('R'+i).value;
		if(kr>0)
		{
			krs += parseInt(kr);
			rooms_typ ++;
			OK_room_select = true;
			persons += room_js_array[i] * kr;
			t_Rooms += "<br>";
			t_Rooms += kr + " x " + room_name_js_array[i];

		}
	 }

	if(persons>10){
		OK_person = false;
		err_str_person = $_373;   //-- Die maximale Anzahl der Personen für die Reservierung beträgt 10! -->
		err_array += "~" + 4;

	}
	OK_room = true;
	if(krs > 5){
		OK_room = false;
		err_str_person = $_374;   //-- Die maximale Anzahl der Zimmer ist 5! -->
		err_array += "~" + 5;

	}
	if(!OK_room_select){
		OK_room = false;
		 err_str_room = $_375;   //--  Sie haben kein Zimmer gewählt!<br>Bitte geben Sie die Anzahl der Zimmer an, die Sie buchen möchten. -->
		 err_array += "~" + 6;
	}
//------------------------------------------------------------------------------
	//alert(OK +"/"+OK_room +"/"+ OK_person);
	if(OK && OK_room && OK_person)
	{
		t_hotel_name = f.hotel_name.value;
		if(t_hotel_name=="") t_hotel_name = $_138;

		//Order-----------------------------------------------------------------

		country_t = text_select_onchange("country_code");
		city_t = text_select_onchange("city_code");
		f.country_t.value = country_t;
		f.city_t.value = city_t;
		g = "sid="+sid;
		g += "&country_t=" + country_t;
		g += "&city_t=" + city_t;
		g += "&ankunft=" + f.ankunft.value;
		g += "&abfahrt=" + f.abfahrt.value;
		g += "&star_rating=" + value_select_onchange("star_rating");
		g += "&locations=" + value_select_onchange("locations");
		g += "&hotel_name=" + f.hotel_name.value;
		g += "&krs=" + krs;
		g += "&rooms_t=" + t_Rooms;
		g += "&preloader=1";		
		f.target = "tmp_view_f"; //f.target = "_blank";
		f.action = "MIKI/find_hotel.php?"+g;		
		f.submit();
	}
	else{
		//alert(err_array);
		f.target = "tmp_view2_f";
		f.action = "MIKI/alert_roomselector.php?sid="+sid+"&err="+ err_array +"&persons=" + persons +"&check_in=" + check_in +"&check_out=" + check_out +"&day_r=" + day_r +"&rooms_typ=" + rooms_typ;
		f.submit();
	}
}
//-------------------------------------------------
 function  find_hotel_submit(){  
    var f = document.bestellung;
    var Timeout_hotel_submit=0;    
    f.target = "tmp_view_f"; // f.target = "_blank";
		f.action = "MIKI/find_hotel.php?sid="+sid;
		//alert(f.target + ">>>>"+ f.action)
		f.submit();
}
//##############################################################################
function messen_book_hotel(){
var f = document.bestellung;
f.abfahrt.value = document.find_m.v_abfahrt.value;
f.ankunft.value = document.find_m.v_ankunft.value;
change_select_date(1);
change_select_date(2);
f.method = "POST";
f.target = "country_city_f";
f.action = "MIKI/country_city.php?sid="+sid+"&m_stadt_select=" + document.find_m.m_sel_stadt.value;
f.submit();
}

//##############################################################################
function change_country_submit(){
var f = document.bestellung;
	f.method = "POST";
	f.target = "country_city_f";
	f.action = "MIKI/country_city.php?sid="+sid;
	f.submit();
}

//##############################################################################
function change_person_tab (){
    var f = document.booking;
	f.method = "POST";
	f.target = "tmp_view_f";
	if(f.visa.checked) f.action = "MIKI/find_hotel.php?sid="+sid+"&visa=1&step=3";
	else f.action = "MIKI/find_hotel.php?sid="+sid+"&step=3";
	f.submit();
}

//##############################################################################
function change_person_tab_gt(prog){
  var f = document.booking;
	f.method = "POST";
	f.target = "tmp_view_f";
	if(prog == undefined ) 
		prog = "MIKI/find_hotel_gt.php?sid=";
	else
		prog = "MIKI/" + prog + ".php?sid=";	 
	
	if(f.visa.checked) f.action = prog + sid + "&visa=1&step=3";
	else f.action = prog + sid +"&step=3";
	f.submit();
}
//##############################################################################
function ch_botschaft(){
var f = document.booking;
if(f.botschaft[0].checked)
        {
        f.andere_botschaft.value = "";
		f.andere_botschaft.disabled = true;
		f.botschaft_ort.disabled = false;
        }
else
        {
        f.andere_botschaft.disabled = false;
		f.botschaft_ort.disabled =  true;
		f.botschaft_ort.options[0].selected = true;
		}
}

//##############################################################################
function lead_name_check(i){
	var f = document.booking;
	f.f_name_lead_miki.value = window.document.getElementById('f_name'+i).value;
	f.s_name_lead_miki.value = window.document.getElementById('s_name'+i).value;
	if(f.client_firma.value == ""){
		f.f_name_lead.value = window.document.getElementById('f_name'+i).value;
		f.s_name_lead.value = window.document.getElementById('s_name'+i).value;
	}
}

//##############################################################################
function name_change(i){
	var f = document.booking;
	var res="";
	var kr = f.lead.length;
	if(kr>1)
	{
	  for(r=0; r<kr; r++)
	  {
	  	if(f.lead[r].checked)
	  	{
	  	  res  = f.lead[r].value;
	  	  break;
	  	}
	  }
	}
	  else
	    res  = f.lead.value;

	if( res == i )
	{
		lead_name_check(i);
    }
}

//##############################################################################
function def_messe_datum(){
	fm = document.find_m;
	m_value=fm.messe.value;
	buf=m_value.split("~");
	fm.v_ankunft.value=buf[0];
	fm.v_abfahrt.value=buf[1];
	fm.m_sel_stadt.value=buf[2];
}

//##############################################################################
function small_window(myurl) {
var newWindow;
var props = 'scrollBars=yes, resizable=yes, toolbar=no ,menubar=no, location=no, directories=no,width=800,height=600';
newWindow = window.open(myurl, "Add_from_Src_to_Dest", props);
}

//##############################################################################
function change_img(src,alt,img_W, img_H){
	var img = "<img src='" + src;
	img += "' alt='" + alt;
	img += "' width='" + img_W;
	img += "' height='" + img_H;	
	img += "' name='hotel_img' id='hotel_img' >";
	window.document.getElementById('img_view').innerHTML = img;
}
//##############################################################################
//katalog_bus   ################################################################

//##############################################################################
function change2(image)
	{
	if (event.srcElement.tagName=="INPUT")
	var fileName = image.toString()
	event.srcElement.src=fileName
	}

//##############################################################################
function kontakt_submit(){
	    var f = document.kontakt;
        OK = true;
        error_color=x21;
        text = f.text.value;
        name = f.name.value;
        vorname = f.vorname.value;
        email = f.email.value;
		if(f.thema.selectedIndex==0)
        {
                OK = false
                f.thema.style.backgroundColor = error_color;
        }

		if(text=="")
        {
                OK = false
                f.text.style.backgroundColor = error_color;
        }
        if(name=="")
        {
                OK = false
                f.name.style.backgroundColor = error_color;
        }
        if(vorname=="")
        {
                OK = false
                f.vorname.style.backgroundColor = error_color;
        }

        if(!check_email(email))
        {
            OK = false
                f.email.style.backgroundColor = error_color;
        }
        if(OK)document.kontakt.submit();

}

//##############################################################################
function feld_bg(id,col){
		   document.getElementById(id).style.borderStyle = "solid";
           document.getElementById(id).style.borderWidth = "1px";
           document.getElementById(id).style.backgroundColor = col;
           document.getElementById(id).style.borderColor = x17;}

//##############################################################################
//garantie tour //##############################################################

//##############################################################################
function gt_hotel_check(id){
	document.getElementById( "hotel_select_h" + id).value = "checked";
}

//##############################################################################
function go_to_table(){
	if(html_interface)
	{
  	var go_target = 'tmp_view_f';
		var go_href = 'zero.php';
  	layer_view_close();
  } 
	else
	{	
		var f = document.booking;
		f.method = "POST";
		f.target = "tmp_view_f";
		f.action = "teil_fuer_kollegen/garantie_turOffen.php?sid="+sid;
		f.submit();
	}
}

//##############################################################################
function go_to_gt_step(step){
	var f = document.booking;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//   debug_form_elements();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	OK = true;
	f.method = "POST";
	f.target = "tmp_view_f";
//------------------------------------------------------------------------------
	if( step < 3 || step == 11 ){
		f.action = "OnlineBestellung/bestellung_garantie.php?sid="+sid+"&step="+step;
		if(step == 2)
		{
            OK = false;
			for(i=0; i < f.elements.length; i++ )
			{
				if(f.elements[i].name == "R0") break;
			}

			for(i2=i; i2 < i+5 ; i2++ )
			{
				if( f.elements[i2].value >0 )
				{
					OK = true;
					break;
				}
			}
			if(OK && window.document.getElementById("button_or_image") )
			{		
			  	window.document.getElementById("button_or_image").innerHTML = '<div align="center"><img id = "warten" name="warten" src="images/warten.gif" width="32" height="32" ></div>';
			}
			
			if(!OK)
			view_alert(250,$_375); //--  Sie haben kein Zimmer gewählt!<br>Bitte geben Sie die Anzahl der Zimmer an, die Sie buchen möchten. -->
		}
			else OK = true;
				
				
	}
//---------------------------------------------------------------
	else if(step==31){
	    f.action = "MIKI/find_hotel_gt.php?sid="+sid+"&step=3";
		OK = true;
	}
//---------------------------------------------------------------
	else if(step==3){
	  	k = f.k_hotel.value;
		r = f.radio_id.value;
		if(k==0) k=1;
		if(r=="") r="1";
		r_array = r.split("~");
		ks = 0;

			for(i=0; i < r_array.length; i++)
			{		
				//alert("hotel_select_h" + r_array[i])
				if( document.getElementById( "hotel_select_h" + r_array[i]).value == "checked") ks++;
			}
		//alert(k+"/"+ ks);
		if(k == ks)
		{
			f.action = "MIKI/find_hotel_gt.php?sid="+sid+"&step=3";
			OK = true;
		}
		else
		{
			view_alert(250,$_376);    //--  Sie haben kein Hotel ausgewählt! -->
			OK = false;
		}
	}
//------------------------------------------------------------------------------
	else if(step==4) {
	var erg = new Array();
	var lead_id = new Array();
	var il=0;
	var ie=0;
	var lead_sel = false;

	if(f.visa.checked)
	{
		i=8;
		if(f.elements[4].checked)
		{
			erg[ie] = check_input(6,1); ie++;
		}
		else
		{
			erg[ie] = check_input(7,1); ie++;
		}
	}
	else
		i=4;

	while(f.elements[i].name != "agency_name")
	{
		//alert(i + ">" + f.elements[i].name)
		lead = f.elements[i].checked;
		id_row = "r"+f.elements[i].value;
		lead_id[il] = "c"+f.elements[i].value; il++;

		if(lead && !lead_sel) lead_sel = true;

		ms = f.elements[i+1].checked;
		mr = f.elements[i+2].checked;
		ch = f.elements[i+3].checked;

		if(ms || mr || ch)
		{
			erg[ie] = true; ie++;
			show_no_error_byid(id_row);
		}
		else{
			erg[ie] = false; ie++;
			show_error_byid(id_row);
		}

		erg[ie] = check_input(i+4,0); ie++; //f_name
		erg[ie] = check_input(i+5,0); ie++; //s_name
        if(f.visa.checked || ch )
        	{
        		erg[ie] = check_input(i+6,3);
        		var age_error = 0;
        		if(ch && erg[ie])
        		{
        		 	age = bday_to_age(f.elements[i+6].value)
        		 	bd_name =  f.elements[i+6].name;
        		 	child_room =  bd_name.substr(5,1);
        		 	type_room  =  bd_name.substr(5,5);
        		 	i_child    =  bd_name.substr(11,1);
        		 	//alert(" >> " + age + "/"+ bd_name + " >> " + child_room + " / " +  type_room + " / " +  i_child )
        		 	if(child_room == "5" && age > 2){ age_error = 2; erg[ie] = false; }
        		 	else if(child_room == "3" && age > 12) { age_error = 12; erg[ie] = false; }
        		 		if( age_error > 0 )
        		 		{
        		 	 		view_alert(250,$_364 + " "+ age_error +" "+$_365);   //-- Fehler! Kind älter ist als + age_error  + Jahre alt! -->
                     		show_error(i+6)
                    	}
        		 }
        	}
        else
        	erg[ie] = true;
        	ie++; //b_day

		if(f.visa.checked)
		{
			erg[ie] = check_input(i+7,1); ie++; //pass
			i += 8;
		} else i += 7;
	}

	i++;
	for(i2=0; i2 < 2; i2++){
		erg[ie] = check_input(i+i2,0); ie++;
	}
	i += i2;

	/*
	erg[ie] = check_input(i,1); ie++;
	i++;
	erg[ie] = check_input(i,1); ie++;
	i++;

	erg[ie] = check_input(i,4); ie++;
	i++;
	erg[ie] = check_input(i,2);
   */
//--------------------------------
  	erg[ie] = check_input(i,1); ie++;
	i++;
	erg[ie] = check_input(i,1); ie++;
	i++;
    erg[ie] = check_input(i,0); ie++;
    i++;
	erg[ie] = check_input(i,2); ie++;
	i++;
	erg[ie] = check_input(i,4); ie++;
	i++;
	erg[ie] = check_input(i,5);
//--------------------------------

   //????   erg[ie] = check_input(i,2); ie++;
   //????	i ++;

	OK =true;
	for(j=0; j<ie; j++)
	{
		if(!erg[j])
		{
			OK = false;
			break;
		}
	}

	if(!lead_sel){
		OK = false;
		for(k=0; k<il; k++)	{
			id=lead_id[k];
			show_error_byid(id);
		}
	}
	else
	{
		for(k=0; k<il; k++)
		show_no_error_byid(lead_id[k]);
	}
		f.action = "MIKI/find_hotel_gt.php?sid="+sid+"&step=3&order_view=1";
	}
//---------------------------------------------------------------
	else if(step==5){
	   OK = false;
		f.action = "MIKI/booking_hotel_gt.php?sid="+sid;
		if(f.t_und_c.checked)
		{
			OK = true;
		}
		else
		view_alert(500,$_363);    //-- Sie haben nicht bestätigt, dass Sie die AGB der Online-Buchung gelesen und akzeptiert haben! -->

  }
//---------------------------------------------------------------
	go_href=f.action;
	if(OK)f.submit();
	else window.scrollTo(0,0);
}
//#####################################################################################
// NEW for online-booking avia,...
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function go_to_online_step(step,deeplink){
	var f = document.booking;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~	
	 var age_child_arr = new Array();	 
	 var s_infn = f.s_infn.value;
	 var s_chld = f.s_chld.value;	 
	 k=0;	 
	 if(s_infn>0)
	 {
		 for(i=0;i<s_infn;i++)
		 {
		 		age_child_arr[k]= "5";	 		
		 		k++;
		 }
	 }
	 if(s_chld>0)
	 {
		 for(i=0;i<s_chld;i++)
		 {
		 		age_child_arr[k]= "3";
		 		k++;
		 }
	 }  
	 i_age_child=0;	
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//   debug_form_elements();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	OK = true;
	f.method = "POST";
	f.target = "tmp_view_f";
//------------------------------------------------------------------------------
	if( step < 3 || step == 11 ){
		f.action = "MIKI/lastminute_EL.php?sid="+sid+"&step="+step;
		if(step == 2)
		{		
			if(OK && window.document.getElementById("button_or_image") )
			{		
			  	window.document.getElementById("button_or_image").innerHTML = '<div align="center"><img id = "warten" name="warten" src="images/warten.gif" width="32" height="32" ></div>';
			}
			
			if(!OK)
			view_alert(250,$_375); //--  Sie haben kein Zimmer gewählt!<br>Bitte geben Sie die Anzahl der Zimmer an, die Sie buchen möchten. -->
		}
			else OK = true;
				
				
	}
//---------------------------------------------------------------
	else if(step==31){
	    f.action = "MIKI/online_booking_vpp.php?sid="+sid+"&step=3";
		OK = true;
	}
//---------------------------------------------------------------
	else if(step==3)
	{	
	 /*
	  k = f.k_hotel.value;
		r = f.radio_id.value;
		if(k==0) k=1;
		if(r=="") r="1";
		r_array = r.split("~");
		ks = 0;

			for(i=0; i < r_array.length; i++)
			{		
				//alert("hotel_select_h" + r_array[i])
				if( document.getElementById( "hotel_select_h" + r_array[i]).value == "checked") ks++;
			}
		//alert(k+"/"+ ks);
		*/
		if(true)//k == ks
		{			
			f.action = "MIKI/online_booking_vpp.php?sid="+sid+"&step=3";
			f.d_link.value = deeplink;
			OK = true;
		}
		else
		{
			view_alert(250,$_376);    //--  Sie haben kein Hotel ausgewählt! -->
			OK = false;
		}
	}
//------------------------------------------------------------------------------
	else if(step==4) {
	var erg = new Array();
	var lead_id = new Array();
	var il=0;
	var ie=0;
	var lead_sel = false;

	if(f.visa.checked )
	{
		i=8;
		if(f.elements[4].checked)
		{
			erg[ie] = check_input(6,1); ie++;
		}
		else
		{
			erg[ie] = check_input(7,1); ie++;
		}
	}
	else if( f.all_person_daten.value == 1 )
		i=5;
	else
		i=4;

	while(f.elements[i].name != "agency_name")
	{
		//alert(i + ">" + f.elements[i].name)
		lead = f.elements[i].checked;
		id_row = "r"+f.elements[i].value;
		lead_id[il] = "c"+f.elements[i].value; il++;

		if(lead && !lead_sel) lead_sel = true;

		ms = f.elements[i+1].checked;
		mr = f.elements[i+2].checked;
		ch = f.elements[i+3].checked;

		if(ms || mr || ch)
		{
			erg[ie] = true; ie++;
			show_no_error_byid(id_row);
		}
		else{
			erg[ie] = false; ie++;
			show_error_byid(id_row);
		}

		erg[ie] = check_input(i+4,0); ie++; //f_name
		erg[ie] = check_input(i+5,0); ie++; //s_name
     if(f.visa.checked || ch || f.all_person_daten.value == 1 )
     {
        		erg[ie] = check_input(i+6,3);
        		var age_error = 0;
        		if(ch && erg[ie])
        		{
        		 	age = bday_to_age(f.elements[i+6].value)
        		 	bd_name =  f.elements[i+6].name;
        		 	child_room =  bd_name.substr(5,1);
        		 	type_room  =  bd_name.substr(5,5);
        		 	i_child    =  bd_name.substr(11,1);
        		 	//alert(" >> " + age + "/"+ bd_name + " >> " + child_room + " / " +  type_room + " / " +  i_child )
        	//--------------------------------------------------------- 	
        	
        	if(child_room == "x")
        	{
        			child_room =	age_child_arr[i_age_child];	 
	 						i_age_child++;
          }          
        	//---------------------------------------------------------
        		 if(child_room == "5" && age > 2)
        		  { 
        		  	age_error = 2; 
        		  	erg[ie] = false; 
        		  }
        		 	else if(child_room == "3" && age > 12) 
        		 	{ 
        		 		age_error = 12; 
        		 		erg[ie] = false; 
        		 	}        		 	 	      		
        	}
        	//---------------------------------------------------------
         if( age_error > 0 )
         {
        		view_alert(250,$_364 + " "+ age_error +" "+$_365);   //-- Fehler! Kind älter ist als + age_error  + Jahre alt! -->
            show_error(i+6)
         } 
     }
         else
        	erg[ie] = true;
        	ie++; //b_day
    
		if(f.visa.checked || f.all_person_daten.value == 1)
		{
			if( ch && f.elements[i+7].value == "" ) 
				erg[ie] = true;
			else 
				erg[ie] = check_input(i+7,1); ie++; //pass			
			i += 8;
		} else i += 7;
	}

	i++;
	for(i2=0; i2 < 2; i2++){
		erg[ie] = check_input(i+i2,0); ie++;
	}
	i += i2;

	/*
	erg[ie] = check_input(i,1); ie++;
	i++;
	erg[ie] = check_input(i,1); ie++;
	i++;

	erg[ie] = check_input(i,4); ie++;
	i++;
	erg[ie] = check_input(i,2);
   */
//--------------------------------
  	erg[ie] = check_input(i,1); ie++;
	i++;
	erg[ie] = check_input(i,1); ie++;
	i++;
    erg[ie] = check_input(i,0); ie++;
    i++;
	erg[ie] = check_input(i,2); ie++;
	i++;
	erg[ie] = check_input(i,4); ie++;
	i++;
	erg[ie] = check_input(i,5);
//--------------------------------

   //????   erg[ie] = check_input(i,2); ie++;
   //????	i ++;

	OK =true;
	for(j=0; j<ie; j++)
	{
		if(!erg[j])
		{
			OK = false;
			break;
		}
	}

	if(!lead_sel){
		OK = false;
		for(k=0; k<il; k++)	{
			id=lead_id[k];
			show_error_byid(id);
		}
	}
	else
	{
		for(k=0; k<il; k++)
		show_no_error_byid(lead_id[k]);
	}
		f.action = "MIKI/online_booking_vpp.php?sid="+sid+"&step=3&order_view=1";
	}
//---------------------------------------------------------------
	else if(step==5){
	   OK = false;
		f.action = "MIKI/booking_booking.php?sid="+sid;
		if(f.t_und_c.checked)
		{
			OK = true;
		}
		else
		view_alert(500,$_363);    //-- Sie haben nicht bestätigt, dass Sie die AGB der Online-Buchung gelesen und akzeptiert haben! -->

  }
//---------------------------------------------------------------
	go_href=f.action;
	if(OK)f.submit();
	else window.scrollTo(0,0);
}


//#####################################################################################
function reload_messenger(s_case, s_option, s_id, s_layer,error_ohne_empfanger,error_ohne_text, frage_senden)
{
			 var f = document.form_messenger_view;
             var emp_str = "";
			 if(s_case==3 && s_option == 3)
			 {
			     emp_err=true;
			     check_emp = true;
			    //-------------------------------
				   if( f.to_all_br)
				   {
				     if(f.to_all_br.checked || f.to_all_user.checked )
				     {
				        emp_err = false;
				        check_emp = false;
				         if(f.to_all_br.checked && f.to_all_user.checked )emp_str = " all clients and managers"
				         else if(f.to_all_br.checked ) emp_str = " all managers "
				         else  if( f.to_all_user.checked )emp_str = " all clients "
				     }
				   }
			   	//-------------------------------

			   if(check_emp)
			   {
				   if(f.to_id_br.type=='hidden')
				   {
				      if(parseInt(f.to_id_br.value)>0)
				      {
				      	emp_err = false;
				      }
				   }
				   	else if(f.to_id_br.selectedIndex > 0)
				   	{
				   		emp_err = false;
				   		emp_str = f.to_id_br.options[f.to_id_br.selectedIndex].text;
				   	}
				   	
				   	if(emp_err)
				   	{				   	
					   	if(parseInt(f.to_id_user.value)>0)
					   	{
					   		emp_err = false;
					   		emp_str = f.firma_gespraechspartner.value;
					   	}
				    }
         
         }
				nachriht = f.text.value
				if(nachriht == "") text_err = true; else text_err = false;
			   //-----------------------------------------------------
			   if(emp_err && text_err )	msg = error_ohne_empfanger + "<br>"+ error_ohne_text.substr(7);
			   else if(emp_err) msg = error_ohne_empfanger;
			   else if(text_err)  msg = error_ohne_text;

			   if(emp_err || text_err)
			   {
			   		view_alert(300, msg,"", "0", "",3, 1);
			   		return;
			   }
			 }

			 if(s_option == undefined) s_option = "";
			 if(s_id == undefined) s_id = "";
			 if(s_layer == undefined) s_layer = 2;

			 f.action = mess_action(s_case, s_option, s_id, s_layer);
			 f.target = "tmp_view" + s_layer + "_f";
			 //f.target = "_blank";

			 if(s_case==3 && s_option == 3)
			 {
	            if(emp_str == "") emp_str = f.to_name.value;
	            if(emp_str == "test") emp_str = "Webmaster";
	            var pattern = /\r\n|\r|\n/g;
				nachriht = nachriht.replace(pattern,"<br>");
	            msg = "<div class=nacricht_div>" + nachriht + "</div><br>";
			    msg += frage_senden + " " + emp_str + "?<br>";

			     view_alert(600, msg, x9.substr(1,6), "0", "form_messenger_view",3, 1);
			 }
			 else f.submit();
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function mess_select(s_case, s_option, s_id, s_layer)
{
	f = document.form_messenger_view;
	f.action = mess_action(s_case, s_option, s_id, s_layer);
	//f.target = "_blank";
	f.submit();
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function mess_action(s_case, s_option, s_id, s_layer)
{
	f_action = "messenger/messenger_view.php?sid=" + sid;
	f_action += "&id=" + s_id;
	f_action += "&case=" + s_case;
	f_action += "&option=" + s_option;
	f_action += "&layer=" + s_layer;
	return f_action;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function mess_entf(msg, s_case, s_option, s_id, s_layer)
{
	f = document.form_messenger_view;
	f.action = mess_action(s_case, s_option, s_id, s_layer);
	view_alert(400, msg, x9.substr(1,6), "0", "form_messenger_view",3, 1);
}
//-----------------------------------------------------------------------------

//##############################################################################
function check_submit_rally(){
var f = document.f1Result;
	f.method = "POST";
	f.target = "tmp_view2_f";
	f.action = "";

//--dwa perwych-->
    if(check_2_grupp_radio('how2','price','0','0')){
  	//alert("flag_info48_10")
	f.action = "flag_info48_10.php?layer=2&sid="+sid;
  }
//--w perwom wtoroy i w0 wtorom perwaja -->
  else   if(check_2_grupp_radio('how2','price','1','0')){
  	//alert("flag_info300_10")
	f.action = "flag_info300_10.php?layer=2&sid="+sid;
  }
//--w perwom perwyj-->
 else  if(check_2_grupp_radio('how2','price','0',-1)){
  	//alert("flag_info48")
	f.action = "flag_info48.php?layer=2&sid="+sid;
  }
//--w perwom wtoroy-->
  else   if(check_2_grupp_radio('how2','price','1',-1)){
  	//alert("flag_info300")
	f.action = "flag_info300.php?layer=2&sid="+sid;
  }
  //--dwa wtorych-->
  else   if(check_2_grupp_radio('how2','price','1','1')){
  	//alert("flag_info300")
	f.action = "flag_info300.php?layer=2&sid="+sid;
  }

//--w0 wtorom perwaja -->
 else   if(check_2_grupp_radio('how2','price',-1,'0')){
  	//alert("flag_info10")
	f.action = "flag_info10.php?layer=2&sid="+sid;
  }
//--ni kakaja -->
  else   if(check_2_grupp_radio('how2','price',-1,-1)){
	//alert("ÏÎÆÀËÓÉÑÒÀ!!! Âûáåðèòå Âàøè âàðèàíòû îòâåòîâ!!!")
	view_alert(250,$_377);          //-- BITTE!!! Wählen Sie Ihre Antworten! -->
	return;
  }

//<!--<!--w perwom tretjja-->
//  else   if(check_2_grupp_radio('how2','price','2',-1)){
//  	alert("flag_info")
//  }
//<!--w perwom tretjja i w0 wtorom wtoraja -->
//  else   if(check_2_grupp_radio('how2','price','2','1')){
//  	alert("flag_info")
//  }
// <!--w0 wtorom wtoraja -->
// else   if(check_2_grupp_radio('how2','price',-1,'1')){
//  	alert("flag_info")
//  }  -->

  else {
  	//alert("flag_info")
  	f.action = "flag_info.php?layer=2&sid="+sid;
  }
  if(f.action != "") f.submit();

}

//##############################################################################
function check_termin_daten()
{
        var f = document.termin;
        OK = true;
        error_color=x21;
        name = f.name.value;
        email = f.email.value;
        if(name=="")
        {
                OK = false
                f.name.style.backgroundColor = error_color;
        }
        if(!check_email(email))
        {
            OK = false
                f.email.style.backgroundColor = error_color;
        }
     return OK;
}

//##############################################################################
function termin( datum, zeit ){
	if(!check_termin_daten()) return;
	f = document.termin;
	f.action = "ausstellung/termin_kalender.php";
	f.target = "tmp_view3_f";
	if(sid.length > 5) f.action += "?sid=" + sid;
	f.datum.value = datum;
	f.zeit.value = zeit;
	f.auswahl.value = "kalender";
	f.submit();
}

//##############################################################################
function termin_loeschen(datum, zeit){
	if(!check_termin_daten()) return;
	f = document.termin;
	f.action = "ausstellung/termin_kalender.php";
	f.target = "tmp_view3_f";
	//f.target = "_blank";
	if(sid.length > 5) f.action += "?sid=" + sid;
	f.datum.value = datum;
	f.zeit.value = zeit;
	f.auswahl.value = "loeschen";
	f.submit();
}

//##############################################################################
function termin_aendern(datum, zeit){
	if(!check_termin_daten()) return;
	f = document.termin;
	f.action = "ausstellung/termin_kalender.php";
	f.target = "tmp_view3_f";
	if(sid.length > 5) f.action += "?sid=" + sid;
	f.datum.value = datum;
	f.zeit.value = zeit;
	f.auswahl.value = "aendern";
	f.submit();
}

//##############################################################################
function tema_click(){
	f = document.termin;
	f.action = "ausstellung/termin_kalender.php";
	f.target = "tmp_view3_f";
	if(sid.length > 5) f.action += "?sid=" + sid;
	f.submit();
}
//##############################################################################
function PopupFenster1() {
  F = window.open("popup_spiel.htm","Popup","width=520,height=240");
}
//##############################################################################
function PopupFenster(datei,fenster,grosse) {
var datei;
var fenster;
var grosse;
  F = window.open(datei,fenster,grosse);
}
//##############################################################################
function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

//##############################################################################
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

//##############################################################################
function show(file, width, height)
{
	var file
	window.open(file, "_blank", "width="+width+",height="+height+",titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
}

//##############################################################################
function debug_form_elements(form_id){
	if(form_id == undefined)
		var f = window.document.booking;
	else
	    var f = window.document.getElementById(form_id);

	n=f.elements.length;
	buf="";
	for(i=0; i<n; i++)
	{
	     buf=buf+i+":"+f.elements[i].name+":"+f.elements[i].value+":\n";
	}
	alert(buf);
}

//##############################################################################
function MM_changePropBk(objName,x,theProp,theValue) {

  var obj = MM_findObj(objName);

  var  theValue='Ðóññêèé';

  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");

}
//##############################################################################

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

//##############################################################################

// Homepage und Favoriten  ????

  function makeHome(obj){
    if (navigator.userAgent.indexOf("MSIE ")>=0) {
      obj.style.behavior="url(#default#homepage)";
      obj.setHomePage(parent.document.location.href);
    } else
      alert("To make home page:\n\n1. Go to the web page you want to bookmark.\n\n2. Click Preferences in main menu.\n\n3. Find Home Page and choose Make Home Page.");
    return false;
  }
  function bookMark() {
    if (navigator.userAgent.indexOf("MSIE ")>=0)
      window.external.addFavorite(parent.document.location.href, "List.Gala.Net");
    else
      alert("To bookmark a web page:\n\n1. Go to the web page you want to bookmark.\n\n2. Click Bookmarks. On Mac OS, open the Bookmarks\nmenu--the green bookmark icon to the right of the Go menu.\n\n3. Choose Add Bookmark.");
    return false;
  }

//##############################################################################
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

//##############################################################################
function P7_Snap() { //v2.62 by PVII
  var x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,args=P7_Snap.arguments;a=parseInt(a);
  for (k=0; k<(args.length-3); k+=4)
   if ((g=MM_findObj(args[k]))!=null) {
    el=eval(MM_findObj(args[k+1]));
    a=parseInt(args[k+2]);b=parseInt(args[k+3]);
    x=0;y=0;ox=0;oy=0;p="";tx=1;da="document.all['"+args[k]+"']";
    if(document.getElementById) {
     d="document.getElementsByName('"+args[k]+"')[0]";
     if(!eval(d)) {d="document.getElementById('"+args[k]+"')";if(!eval(d)) {d=da;}}
    }else if(document.all) {d=da;}
    if (document.all || document.getElementById) {
     while (tx==1) {p+=".offsetParent";
      if(eval(d+p)) {x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop"));
      }else{tx=0;}}
     ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);var tw=x+ox+y+oy;
     if(tw==0 || (navigator.appVersion.indexOf("MSIE 4")>-1 && navigator.appVersion.indexOf("Mac")>-1)) {
      ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);
      }else{var w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;
      a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;
      x=document.body.scrollLeft + event.clientX + bx;
      y=document.body.scrollTop + event.clientY;}}
   }else if (document.layers) {x=g.x;y=g.y;var q0=document.layers,dd="";
    for(var s=0;s<q0.length;s++) {dd='document.'+q0[s].name;
     if(eval(dd+'.document.'+args[k])) {x+=eval(dd+'.left');y+=eval(dd+'.top');break;}}}
   if(el) {e=(document.layers)?el:el.style;
   var xx=parseInt(x+ox+a),yy=parseInt(y+oy+b);
   if(navigator.appName=="Netscape" && parseInt(navigator.appVersion)>4){xx+="px";yy+="px";}
   if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){
    xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);
    xx+="px";yy+="px";}e.left=xx;e.top=yy;}}
}

//##############################################################################
function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

//##############################################################################
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//##############################################################################
//NEW FUNCTION FOR FIND BOOKING ################################################
//##############################################################################
function sort_submit(col,ordnen){
var thisform = document.auswahl;
thisform.method = "POST";
thisform.action = "find_booking.php?sid="+sid+"&aktion=find&col="+col+"&ordnen="+ordnen;
thisform.target ="tmp_view_f";
thisform.submit();
}

//##############################################################################
function change_submit(b){
var thisform = window.document.getElementById("auswahl");
thisform.method = "POST";
thisform.action = "MIKI/change_from_find_booking.php?sid="+sid;
thisform.target = "tmp_view2_f";
//str = thisform.auftragsnummer_arr_str.value;
//auftragsnummers = str.split("~");
//n = auftragsnummers.length;
var erg = false;

n = thisform.select_order.length;
if(n==undefined)
{
	if(thisform.select_order.checked)
	{
	     v=thisform.select_order.value;
	     erg = true;
	}
}
else
{
  for(i=0; i<n; i++)
   {
	   	if (thisform.select_order[i].checked)
	   	{
		    v=thisform.select_order[i].value;
		    erg = true
		    break;
	    }
   }
}

//n = window.document.getElementById("select_order").length;
/*
	for(i=0; i<n; i++)
	{
	    if(window.document.getElementById("row"+auftragsnummers[i]).checked)
	    {
	          erg = true;
	          break;
	    }
	}
*/

if(erg)
	{
		tmp = v.split("~");
		msg = "<br>" + $_474 + " " + tmp[1];
		switch (b)
		{
		    case 1:
	          	// Save
	          	tmp = v.split("~");
				msg += "<br>" + $_461;
				view_alert(400, msg, x9.substr(1,6), "0", "auswahl");
				thisform.action += "&action=save";
		      break;
		    case 2:
                // Storno
	          	tmp = v.split("~");
				msg += "<br>" + $_459;
				view_alert(400, msg, x9.substr(1,6), "0", "auswahl");
				thisform.action += "&action=storno";
		      break;
		    case 3:
                // Senden
				msg += "<br>&nbsp;<br>" + $_477;
				view_alert(400, msg, x9.substr(1,6), "0", "auswahl");
				thisform.action += "&action=senden";
		      break;
	    }
	}
else{
	msg = $_378 + "! " +$_460;
	view_alert(400, msg);
	}
return;
}

//##############################################################################
function submit_ja_nein(form_submit, ja_close, layer_parent ){
	if( ja_close == undefined && layer_parent == undefined )
	{
		if(form_submit == undefined || form_submit == '')
			window.document.getElementById("tmp_close_f").src = "zero2.php?sid="+sid;
		else
			window.document.getElementById(form_submit).submit();
	}
	else	
	{
		if(form_submit != undefined && form_submit != '')
			window.document.getElementById(form_submit).submit();
			window.document.getElementById("tmp_close_f").src = "zero"+ layer_parent +".php?sid="+sid;
	}	
}
//##############################################################################
function print_submit(){
var thisform = document.auswahl;
thisform.method = "POST";
thisform.action = "admin/gesamtdaten_print.php?sid=" + sid;
thisform.target ="_blank";
thisform.submit();
}

//##############################################################################
function new_find_submit(){
var thisform = window.document.getElementById("auswahl");
thisform.method = "POST";
thisform.action = "find_booking.php?sid="+sid+"&aktion=";
thisform.target ="tmp_view_f";
thisform.submit();
}

//##############################################################################
function ch_botschaft_bl(auftragsnummer, v)
{
	var id_ab = "andere_botschaft_" + auftragsnummer;
	var id_bo = "botschaft_ort_" + auftragsnummer;
	if(v==1)
	{
        window.document.getElementById(id_ab).value = "";
		window.document.getElementById(id_ab).disabled = true;
		window.document.getElementById(id_bo).disabled = false;
	}
	else
	{
        window.document.getElementById(id_ab).disabled = false;
		window.document.getElementById(id_bo).disabled =  true;
		window.document.getElementById(id_bo).options[0].selected = true;
	}

}

//##############################################################################
function click_select_order(str)
{
   window.document.getElementById("select_info").innerHTML = $_474 +" " + str;
   window.document.getElementById("select_info").innerHTML += link_span("change_submit(1)", $_455, 50); // Save
   window.document.getElementById("select_info").innerHTML += link_span("change_submit(2)", $_170, 50); // Storno
   window.document.getElementById("select_info").innerHTML += link_span("change_submit(3)", $_458 ,50); // Senden
   document.getElementById('div_button').focus();
}

//##############################################################################
function link_span(f_onclick, link, margin_left, color )
{
  if(color == undefined ) color = x9;
  if(margin_left == undefined ) margin_left  = 0;
  str =  "<span  onClick='"+f_onclick+"'  style = 'margin-left:"+margin_left+"px;color:"+color+"'";
  str += " onMouseOver='this.style.textDecoration=\"underline\";this.style.cursor=\"pointer\"' ";
  str += " onMouseOut='this.style.textDecoration=\"none\"'>"+link;
  str += " </span><span style='font-weight:bold;font-size:11px; color:" + color + "'>&raquo;</span>";
   return str;
}

//##############################################################################
function check_login(){
un=document.Anmeldung.username.value;
pw=document.Anmeldung.passwd.value;
ok=true;
if(un.length<1 || un=="berliner-reisen"){
feld_bg("username",x21);
ok=false;}
if(pw.length<1){
feld_bg("passwd",x21);
ok=false;
}
if(ok) {
	document.Anmeldung.click.value="anmeldung";
	document.Anmeldung.submit();
}
}
//##############################################################################
function login_window(){
fl = document.Anmeldung;
flw = document.anmeldung_win;

un=flw.username_lw.value;
pw=flw.passwd_lw.value;
ok=true;
if(un.length<1 ){
feld_bg("username_lw",x21);
ok=false;}
if(pw.length<1){
feld_bg("passwd_lw",x21);
ok=false;
}
if(ok) {
	fl.username.value = un;
	fl.passwd.value = pw;	
	document.getElementById("tmp_close_f").src = "zero3.php";
	document.Anmeldung.click.value="anmeldung";
	document.Anmeldung.submit();
}
}
//##############################################################################
//selector_PPC 2012_01_20
var CityCode_sel="";
var PointType_sel="";
var withPoint=0;

 function radioWert(rObj) {
    for (var i=0; i<rObj.length; i++) if (rObj[i].checked) return rObj[i].value;
    return false;
  }
  
 function select_Value(id) 
 {
    	ind = document.getElementById(id).selectedIndex;				
			return document.getElementById(id).options[ind].value;		
 } 
 
 function select_Text(id) 
 {
    ind = document.getElementById(id).selectedIndex;
		return document.getElementById(id).options[ind].text;
 } 
 
 function select_ValueText(id) 
 {
   	ind = document.getElementById(id).selectedIndex;				
		str = document.getElementById(id).options[ind].value + "~";
		str += document.getElementById(id).options[ind].text;
		return str;
		
 } 

function selector_CCP(s, name_pref, n, punkt,layer, sp2, wP){
	switch (s) 
	{
	  case 1:
			var f = document.booking;
			withPoint = wP;				
    	f.action = "MIKI/selector_CCP.php?sid="+sid+"&layer="+layer+"&name_pref="+name_pref+"&n="+n+"&punkt="+punkt+"&sp="+sp2;
    	f.action += "&withPoint=" + wP;    	   	
    	f.target =  "tmp_view" + layer + "_f";    	
    	f.submit();
	    break;
	  
	  case 2:
	   	f=document.transfer_point_form;	  	
	  	id = "CityPointType";
	  	if( document.getElementById(id)== null) return;
	  	ind = document.getElementById(id).selectedIndex;				
			PointType = document.getElementById(id).options[ind].value;	  	  				
			
			id = "FROMIATA";		
			ind = document.getElementById(id).selectedIndex;				
			CityCode = document.getElementById(id).options[ind].value;
			if(CityCode_sel == CityCode && PointType_sel == PointType) return;		
			CityCode_sel = CityCode;
			PointType_sel = PointType;			
			f.action = "MIKI/selector_CCP.php?sid="+sid+"&case="+s+"&CityCode="+CityCode+"&PointType="+PointType+"&sp="+sp2;			
    	f.target =  "iata_2_f";
    	f.submit();					
	    break;
	  
	  case 3:				  	  				
			id = "FROMIATA";		
			ind = document.getElementById(id).selectedIndex;				
			CityCode = document.getElementById(id).options[ind].value;
			CityName = document.getElementById(id).options[ind].text;
				
			obj=document.getElementById("iata_country_3");
			ind = obj.selectedIndex;				
			CountryCode = obj.options[ind].value;
			CountryName = obj.options[ind].text;
			
			document.getElementById(name_pref+"Country"+n).value = CountryName
			document.getElementById(name_pref+"City"+n).value = CityName
			document.getElementById(name_pref+"CountryCode"+n).value = CountryCode
			document.getElementById(name_pref+"CityCode"+n).value = CityCode
			
						switch (name_pref+n) 
						{
						  case "PickUp1":
								return_obj_id="ziel_an";
						    break;
						    
						  case "DropOff1":								
								return_obj_id="z_ziel_an";		
						    break;
						    
						  case "PickUp2":
						   	return_obj_id="z_ziel_ab";							
						    break;
						    
						  case "DropOff2":
						   	return_obj_id="ziel_ab";							
						    break;  
						}
						
						
						return_obj= document.getElementById(return_obj_id);			
			
			if(withPoint)
			{						
				id = "CityPointType";
		  	ind = document.getElementById(id).selectedIndex;				
				PointType = document.getElementById(id).options[ind].value;	
		  	Point = document.getElementById(id).options[ind].text;				
			
				if( PointType=="A" || PointType=="S" )
				{
					obj=document.getElementById("CityPoint");
					ind = obj.selectedIndex;				
					PointCode = obj.options[ind].value;
					PointName = obj.options[ind].text;
					return_obj.value=Point+" "+PointName;
				}							
				else
				{
						switch (PointType) 
						{
						  case "H":
								PointName = document.getElementById("AddressLine1").value;
								PointCode = document.getElementById("PostCode").value;
								return_obj.value=PointName +", "+ PointCode + " " + CityName;
						    break;
						    
						  case "O":								
								PointCode = select_Value("HotelPoint");	
								PointName = select_Text("HotelPoint");
								return_obj.value=Point+" "+PointName +", " + CityName;		
						    break;
						    
						  case "P":
						   	ShipName_v = document.getElementById("ShipName").value;
						   	ShippingCompany_v = document.getElementById("ShippingCompany").value;						 
								PointCode = ShippingCompany_v;
								PointName = ShipName_v;
								PointCode = ShippingCompany_v;
								return_obj.value=Point+" "+PointName +", " + PointCode;									
						    break;
						}			
				}				
				//-------------------------------------------------------------
				document.getElementById(name_pref+n).value = Point
				document.getElementById(name_pref+"Point"+n).value = PointName		
				document.getElementById(name_pref+"Code"+n).value = PointType
				document.getElementById(name_pref+"PointCode"+n).value = PointCode;
				//-------------------------------------------------------------
		  }
			layer_view_close("tmp_view2");	
	    break;
	}
}
// AVIA 22.01.2012
function iata_city_view(n){
	  if(n==3) nf=1; else nf=n;
		tmp_id ="iata_"+nf;
		tmp_id_f = tmp_id + "_f";
		frame_location = document.getElementById(tmp_id_f).contentWindow.location.href;	
		if(frame_location=="about:blank" || frame_location.indexOf("zero")>0) return;
	    if(n==1)
	    	window.document.getElementById(tmp_id).innerHTML = iata_1_f.document.body.innerHTML;
	    else
	    	window.document.getElementById(tmp_id).innerHTML = iata_2_f.document.body.innerHTML;
        scroll(0,0);
}
		
function iata_country_submit(n,sp2){	 
		if(n == 3 ) nf=1; else nf=n;			
		tmp_id ="iata_"+nf;		
		tmp_id_f = tmp_id + "_f";		
		id='iata_country_' + n;		
		ind = document.getElementById(id).selectedIndex;
		iso = document.getElementById(id).options[ind].value;
    var f = document.link_go;
    f.action = "MIKI/aeroports_iata_select.php?sid=sid&iso="+iso+"&n="+n+"&sp="+sp2;
    f.target =  tmp_id_f;   
		f.submit();
}

function iata_country_from_to_submit(iso1,iso2,fromiata,toiata,sp2){
    var f = document.link_go;
    f.action = "MIKI/aeroports_iata_select.php?sid=sid&iso="+iso1+"&n=1&fromiata="+fromiata+"&sp="+sp2;
    f.target =  "iata_1_f";
		f.submit();
		f.action = "MIKI/aeroports_iata_select.php?sid=sid&iso="+iso2+"&n=2&toiata="+toiata+"&sp="+sp2;
    f.target =  "iata_2_f";
		f.submit();
}
function ch_baby_filter(i){
  ind = document.getElementById('s_chld').selectedIndex;
  k_chld = document.getElementById('s_chld').options[ind].value;
  ind = document.getElementById('s_infn').selectedIndex;
  k_infn = document.getElementById('s_infn').options[ind].value;
  sum = parseInt(k_chld) + parseInt(k_infn);
  if(i==1)
  {
	  if( sum > 3)
	  {
	     k_infn = 3 - k_chld;
	     if( k_infn <= 0)
	     	ind_infn = 0;
	     else
	     	ind_infn = k_infn;
	       document.getElementById('s_infn').options[ind_infn].selected=true;
	   }
  }
  else
  {
       if( sum > 3)
	  {
	     k_chld =  3 - k_infn;
	     if( k_chld <= 0)
	     	ind_ch = 0;
	     else
	     	ind_ch = k_chld;
	       document.getElementById('s_chld').options[ind_ch].selected=true;
	   }
  }

}

function check_value(o){
	if(o.checked) v = 1;  else v = 0;
	document.getElementById('nonstop_p').value = v;
}

function click_fl_type(i){
	if( i==1 )
	{
		tmp_flugsuchen_todata = window.document.getElementById('flugsuchen_todata').innerHTML;
		window.document.getElementById('flugsuchen_todata').innerHTML = "";
		window.document.getElementById('flugsuchen_todata_t').innerHTML = "";
	}
	else
	{
		window.document.getElementById('flugsuchen_todata').innerHTML = tmp_flugsuchen_todata;
		window.document.getElementById('flugsuchen_todata_t').innerHTML = tmp_flugsuchen_todata_t;
	}
}

//-----------------------------------------------------------------------------------------
function go_sort(i,i_bl,act)
 {
		var f = document.booking;
				f.method = "POST";
				f.target = "tmp_view_f";				
				f.action=act+"&sort=1&sid="+sid+"&page="+i;
				f.action +="&page_blok="+i_bl;
				f.submit();
 }
 
//--------------------------------------------------------------------------
function do_page_bloks()
{ 
	 	v = window.document.getElementById('pages_index_hidden').innerHTML;
	 	v_un = window.document.getElementById('pages_index_hidden_un').innerHTML;	 
		page_bloks = v.split("|");
		page_bloks_un = v_un.split("|");
    var k_page_bloks = page_bloks.length;
		/*
        alert(k_page_bloks);
		for (i=0; i<k_page_bloks; i++)
		{
		   alert(page_bloks[i])
		}
	    */
  
}

function go_page_blok(i)
	{
	    do_page_bloks();
	    o = window.document.getElementById('select_page_bl');
	    o_un = window.document.getElementById('select_page_bl_un');
	    
	    v=page_bloks[i];
	    v=v.replace('<!--','');
			v=v.replace('-->','');
			v=v.replace('|','');
	    window.document.getElementById('pages_index').innerHTML=v;
	    
	    v=page_bloks_un[i];
	    v=v.replace('<!--','');
			v=v.replace('-->','');
			v=v.replace('|','');
	    window.document.getElementById('pages_index_un').innerHTML=v;
	    
	    
	    if(i+1<k_page_bloks)
	    {
	    	o.selectedIndex=i+1;
	    	o_un.selectedIndex=i+1;
	    }
	    else
	    {
	    	ni=i-1;
	    	if(ni<0) ni=0;
	    	o.selectedIndex=ni;
	    	o_un.selectedIndex=ni;
	    }
	}

	function go_page_blok_select(ob)
	{
	    do_page_bloks();
	    o = window.document.getElementById('select_page_bl');
	    o_un = window.document.getElementById('select_page_bl_un');
	    //-----------------------------------------------------------
	    var k_page_bloks = page_bloks.length;
	    if(ob==1)
	    {		    	    
		    i=o.selectedIndex;
		    o_un.selectedIndex=i
	  	}
	  	else
	  	{
	  		i=o_un.selectedIndex;	  	
		    o.selectedIndex=i
	  	}		
	   
	    v=page_bloks[i];
	    v=v.replace('<!--','');
			v=v.replace('-->','');
			v=v.replace('|','');
	    window.document.getElementById('pages_index').innerHTML=v;
	    
	    v=page_bloks_un[i];
	    v=v.replace('<!--','');
			v=v.replace('-->','');
			v=v.replace('|','');
	    window.document.getElementById('pages_index_un').innerHTML=v;
	    
	}
//------------------------------------------------------------------------ 
function start_page_aktive()
{
	page_aktive=1;
}

 
function go_page(i,i_bl,act){

			ob_o = window.document.getElementById('index_o_page_' + page_aktive);
			ob_u = window.document.getElementById('index_u_page_' + page_aktive);			

			if(!act)
			{
				n_page_o = window.document.getElementById('page_nummer_oben');
				n_page_u = window.document.getElementById('page_nummer_unten');
	
				if(ob_o)
					link_style( ob_o, "page_n_na" );
				link_style( ob_u, "page_n_na" )
			}

			ob_o = window.document.getElementById('index_o_page_'+i);
			ob_u = window.document.getElementById('index_u_page_'+i);			
			
			if(act)
			{
				var f = document.booking;
				f.method = "POST";
				f.target = "tmp_view_f";
				f.action=act+"&sid="+sid+"&page="+i;			
				f.action +="&page_blok="+i_bl;
				f.submit();
			}
			else
			{				
				page = window.document.getElementById('tab_mit_index_'+i).innerHTML;
				page = page.replace('</TABLE>','');
			  	page = page.replace('</TBODY>','');
				window.document.getElementById('tab_mit_index').innerHTML=page+"\n</table>";
			}
				page_aktive = i;
				
				if(ob_o)
					link_style( ob_o, "page_n_a" );
				if(ob_u)
					link_style( ob_u, "page_n_a" );

				if(n_page_o)
					n_page_o.innerHTML=i;
				if(n_page_u)
					n_page_u.innerHTML=i;

			scroll(0,0);
}

function link_style( ob, cl )
{
	switch (cl) 
	{
  
  case "page_n_mover":
				ob.style.cursor="pointer";
				ob.style.textDecoration = "underline";
				ob.style.fontSize = "11px";				
				ob.style.fontWeight="normal";
				ob.style.color=x9;	
    		break;
  
  case "page_n_a":
				ob.style.cursor="default";
				ob.style.textDecoration = "none";
				ob.style.fontSize = "11px";
				ob.style.fontWeight="bold";	
				ob.style.color=x22;			
    		break;   
  
  case "page_n_na":
				ob.style.cursor="pointer";
				ob.style.textDecoration = "none";
				ob.style.fontSize = "11px";
				ob.style.fontWeight="normal";
				ob.style.color=x9;								
    		break;
	}

}

function link_Mover(i){		
	ob_o = window.document.getElementById('index_o_page_'+i);
	ob_u = window.document.getElementById('index_u_page_'+i);	
	if(page_aktive != i)
	{
		link_style( ob_u, "page_n_mover");		
		if(ob_o)		
			link_style( ob_o, "page_n_mover");				
	}
	else
	{
		link_style( ob_u, "page_n_a" );
		if(ob_o)
			link_style(ob_o, "page_n_a" );				
	}
}
function link_Mout(i){	
	ob_o = window.document.getElementById('index_o_page_'+i);
	ob_u = window.document.getElementById('index_u_page_'+i);
	if(page_aktive != i)
	{
		link_style( ob_u, "page_n_na" );	
		if(ob_o)
		  link_style( ob_o, "page_n_na" );	
	}
	else
	{
		link_style( ob_u, "page_n_a" );
		if(ob_o)
			link_style(ob_o, "page_n_a" );	
	}
}



var page = new Array();
var t_kopf;
var page_aktive = 1;
var page_bloks = new Array();
var page_bloks_un = new Array();
var k_page_bloks;


//-----------------------------------------------------------------------------------------

//##############################################################################
// ALT
//##############################################################################
// Homepage und Favoriten

 function makeHome(obj){
    if (navigator.userAgent.indexOf("MSIE ")>=0) {
      obj.style.behavior="url(#default#homepage)";
      obj.setHomePage(parent.document.location.href);
    } else
      alert("To make home page:\n\n1. Go to the web page you want to bookmark.\n\n2. Click Preferences in main menu.\n\n3. Find Home Page and choose Make Home Page.");
    return false;
  }
  function bookMark() {
    if (navigator.userAgent.indexOf("MSIE ")>=0)
      window.external.addFavorite(parent.document.location.href, "List.Gala.Net");
    else
      alert("To bookmark a web page:\n\n1. Go to the web page you want to bookmark.\n\n2. Click Bookmarks. On Mac OS, open the Bookmarks\nmenu--the green bookmark icon to the right of the Go menu.\n\n3. Choose Add Bookmark.");
    return false;
  }

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function P7_Snap() { //v2.62 by PVII
  var x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,args=P7_Snap.arguments;a=parseInt(a);
  for (k=0; k<(args.length-3); k+=4)
   if ((g=MM_findObj(args[k]))!=null) {
    el=eval(MM_findObj(args[k+1]));
    a=parseInt(args[k+2]);b=parseInt(args[k+3]);
    x=0;y=0;ox=0;oy=0;p="";tx=1;da="document.all['"+args[k]+"']";
    if(document.getElementById) {
     d="document.getElementsByName('"+args[k]+"')[0]";
     if(!eval(d)) {d="document.getElementById('"+args[k]+"')";if(!eval(d)) {d=da;}}
    }else if(document.all) {d=da;}
    if (document.all || document.getElementById) {
     while (tx==1) {p+=".offsetParent";
      if(eval(d+p)) {x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop"));
      }else{tx=0;}}
     ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);var tw=x+ox+y+oy;
     if(tw==0 || (navigator.appVersion.indexOf("MSIE 4")>-1 && navigator.appVersion.indexOf("Mac")>-1)) {
      ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);
      }else{var w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;
      a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;
      x=document.body.scrollLeft + event.clientX + bx;
      y=document.body.scrollTop + event.clientY;}}
   }else if (document.layers) {x=g.x;y=g.y;var q0=document.layers,dd="";
    for(var s=0;s<q0.length;s++) {dd='document.'+q0[s].name;
     if(eval(dd+'.document.'+args[k])) {x+=eval(dd+'.left');y+=eval(dd+'.top');break;}}}
   if(el) {e=(document.layers)?el:el.style;
   var xx=parseInt(x+ox+a),yy=parseInt(y+oy+b);
   if(navigator.appName=="Netscape" && parseInt(navigator.appVersion)>4){xx+="px";yy+="px";}
   if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){
    xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);
    xx+="px";yy+="px";}e.left=xx;e.top=yy;}}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//##############################################################################
//  ANEKDOT ANEKDOT ANEKDOT

function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function show(file, width, height)
        {
                        var file
                        window.open(file, "_blank", "width="+width+",height="+height+",titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
        }


function MM_changePropBk(objName,x,theProp,theValue) {

  var obj = MM_findObj(objName);

  var  theValue='Ðóññêèé';

  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");

}

//##############################################################################
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    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);


