//VK-----------------------------------------------------------------------------
function layer_h_w(){
	   tmp_id_f = tmp_id + "_f";
	   frame_location=document.getElementById(tmp_id_f).contentWindow.location.href;
	   if(frame_location=="about:blank") return;
	 //### PROG SPERRE ########################
        for(i=0; i < prog_sperre.length; i++)
        {
         	if(frame_location.indexOf(prog_sperre[i])>0)
         	{
         	  view_alert(msg_prog_sperre_w,msg_prog_sperre);
         	  return;
         	}

        }
    //########################################
     if(frame_location.indexOf("impressum")>0) layer_view(500,480);
     else if(frame_location.indexOf("about-bre")>0) layer_view(720,641);

}
//-----------------------------------------------------------------------------------------
function layer_view(h,w,t,l){
		tmp_id_f = tmp_id + "_f";
		zi=10;
		if(tmp_id_f=="tmp_view_f") zi=11; else zi=10;
        if(t)tf=t+'px'; else tf=div_top(h);
        if(l)lf=l+'px'; else lf=div_left(w);
      	window.document.getElementById(tmp_id).style.top=tf;
        window.document.getElementById(tmp_id).style.left=lf;
        window.document.getElementById(tmp_id).style.height=h+'px';
        window.document.getElementById(tmp_id).style.width=w+'px';
        window.document.getElementById(tmp_id_f).height=h;
        window.document.getElementById(tmp_id_f).width=w;
        window.document.getElementById(tmp_id).style.zIndex=zi;
		window.document.getElementById(tmp_id_f).style.zIndex=zi;
        window.document.getElementById(tmp_id).style.visibility='visible';
		window.document.getElementById(tmp_id_f).style.visibility='visible';
		var tmp_scroll = true;
        scroll(0,0);
}
//-----------------------------------------------------------------------------------------
function  fr_tmp(name,frame){
    if(frame) f=frame; else f="tmp_view_f";
    frame_location=document.getElementById(f).contentWindow.location.href;
    f_ok=frame_location.indexOf(name);
    if(f_ok>0)return true; else return false;
}
//-----------------------------------------------------------------------------------------
function layer_view_close4(){
       window.document.getElementById("tmp_view4").style.visibility='hidden';
       window.document.getElementById("tmp_view4").style.width='0px';
       window.document.getElementById("tmp_view4_f").height='0px';
       window.document.getElementById("tmp_view4_f").width='0px';
       window.document.getElementById("tmp_view4").style.height='0px';
       window.document.getElementById("tmp_view4").style.zIndex=1;
       window.document.getElementById("tmp_view4").src="zero.php";
	   var tmp_scroll = false;
}

//------------------------------------------------------------------------------------------
function layer_view_new(){
        tmp_id_f = tmp_id + "_f";
		tmp_id_t = tmp_id + "_t";
		frame_location = document.getElementById(tmp_id_f).contentWindow.location.href;
		if(frame_location=="about:blank" || frame_location.indexOf("zero")>0) return;

        //### PROG SPERRE ########################
        //alert(frame_location)
        for(i=0; i < prog_sperre.length; i++)
        {
         	if(frame_location.indexOf(prog_sperre[i])>0)
         	{
         	  view_alert(msg_prog_sperre_w,msg_prog_sperre);
         	  return;
         	}

        }
        //########################################


		if(tmp_id=="tmp_view"){
			window.document.getElementById(tmp_id).innerHTML = tmp_view_f.document.body.innerHTML;
			zi=10;
			layer3[0]="tmp_view";
		}

		if(tmp_id=="tmp_view2"){
			window.document.getElementById(tmp_id).innerHTML = tmp_view2_f.document.body.innerHTML;
			zi=14;
			layer3[1]="tmp_view2";
		}

		if(tmp_id=="tmp_view3"){
			window.document.getElementById(tmp_id).innerHTML = tmp_view3_f.document.body.innerHTML;
			zi=16;
			layer3[2]="tmp_view3";
		}

		w=document.getElementById(tmp_id_t).offsetWidth;
		h=document.getElementById(tmp_id_t).offsetHeight;



		//alert(w+"/"+h);
		object_view(tmp_id, h, w, zi);
		window.document.getElementById(tmp_id).focus();
		object_view(tmp_id+'_s', h, w, zi-1);
    /*
    if(tmp_id == "tmp_view"){
		if(h > y ){

			window.document.body.scroll="yes";
			window.document.getElementById("messen_filter").style.visibility='hidden';
	    	window.document.getElementById("hotel_filter").style.visibility='hidden';
	    }
	    else{
        	window.document.getElementById("messen_filter").style.visibility='visible';
	    	window.document.getElementById("hotel_filter").style.visibility='visible';
        	window.document.body.scroll="no";
        }
	}else if(h > y )window.document.body.scroll="yes";

        //if(frame_location.indexOf("check_bestellung_garantie.php")>0 )  window.document.body.scroll="yes";
        if(frame_location.indexOf("booking_hotel")>0 && window.document.getElementById("ih_payment_metod").innerHTML=="cc") go_to_payment();
     */
      scroll(0,0);

}
//------------------------------------------------------------------------------------------
function layer_main_view(){
	frame_location = document.getElementById("td_main_frame").contentWindow.location.href;
    if(frame_location != "about:blank" )
    {
    	//### PROG SPERRE ########################
        //frame_location = "http://www.kheifets-schwabauer.de/euro_alpen/new/Impressum.php";
        for(i=0; i < prog_sperre.length; i++){
         	if(frame_location.indexOf(prog_sperre[i])>0)
         	{
         	  view_alert(msg_prog_sperre_w, msg_prog_sperre);
         	  return;
         	}

        }
        //########################################
    	window.document.getElementById("td_main").innerHTML = td_main_frame.document.body.innerHTML;
		if(frame_location.indexOf("main_start")>0) 
		{
			i_history = 0;
			history_main[i_history] = frame_location;	
		}		
		else if(frame_location != history_main[i_history])
		{
			i_history++;
			history_main[i_history] = frame_location;			
		}
		//alert(i_history +"/"+ history_main[i_history]);
    	scroll(0,0);
    }
}
//-----------------------------------------------------------------------------------------
function  close_main(){
	i_history--;
	if(i_history<0)  i_history = 0;		
	//alert( "close:" + i_history  + "/"+ history_main[i_history] );
	if(firefox) 
		window.document.getElementById('td_main_frame').src = history_main[i_history];
	else
		history.go(history_main[i_history]);
}
//-----------------------------------------------------------------------------------------
 function layer_view_close(){
	frame_location = document.getElementById('tmp_close_f').contentWindow.location.href;
	if(frame_location=="about:blank" ) return;
	if( fr_tmp('zero','tmp_close_f') || fr_tmp('zero','tmp_close_all_f') ){
	if( fr_tmp('zero','tmp_close_f'))  tmp_id = "tmp_view";
	if( fr_tmp('zero2','tmp_close_f')) tmp_id = "tmp_view2";
	if( fr_tmp('zero3','tmp_close_f')) tmp_id = "tmp_view3";
	if( fr_tmp('zero4','tmp_close_f')) tmp_id = "main";
	tmp_id_f = tmp_id + "_f";
	tmp_id_s = tmp_id + "_s";

       window.document.getElementById(tmp_id).innerHTML = "";
       window.document.getElementById(tmp_id).style.visibility='hidden';
	   window.document.getElementById(tmp_id).style.width='0px';
	   window.document.getElementById(tmp_id).style.height='0px';
	   window.document.getElementById(tmp_id).style.zIndex=1;
	   window.document.getElementById(tmp_id_s).style.visibility = 'hidden';
	   window.document.getElementById(tmp_id_s).style.zIndex=1;
	   window.document.getElementById(tmp_id_s).width = '0px';
	   window.document.getElementById(tmp_id_s).height = '0px';
       window.document.getElementById(tmp_id_f).src = "zero.php";
       window.document.getElementById(tmp_id_f).width = '0px';
	   window.document.getElementById(tmp_id_f).height = '0px';
      window.document.body.scroll="yes";
      scroll(0,0);
	  /*
	  if(tmp_id == "tmp_view")
	  {
	  	window.document.getElementById("messen_filter").style.visibility='visible';
	  	window.document.getElementById("hotel_filter").style.visibility='visible';
	  }
	  */
    }
}
//------------------------------------------------------------------------------------------
function fensterauf_m(url) {
  fenster = window.open(url,"f","fullscreen=1,toolbar=1,location=1,directories=0,status=1,menubar=1,top=0,left=0,resizable=yes,scrollbars=yes,status=no,alwaysRaised=yes");
  fenster.focus();
}
//-----------------------------------------------------------------------------------------
function object_view(tmp_id, h, w, zi) {
	    window.document.getElementById(tmp_id).style.height=h+"px";
        window.document.getElementById(tmp_id).style.width=w+"px";
		w_wh();
		if(w > x) { ml = 0; l = "0px";} else {l="50%"; ml=-w/2;}
		if(h > y) { mt = 0; t = "0px";} else {t="50%"; mt=-h/2;}
		window.document.getElementById(tmp_id).style.top = t;
        window.document.getElementById(tmp_id).style.left = l;
        if(tmp_id.indexOf("_s")>0)
        {
        	 if(w >=600) dm =1; else dm =4;
        	 ml = ml+dm;
        	 mt = mt+dm;
        }
		window.document.getElementById(tmp_id).style.marginLeft = ml + "px";
		window.document.getElementById(tmp_id).style.marginTop = mt + "px";
        window.document.getElementById(tmp_id).style.zIndex=zi;
        window.document.getElementById(tmp_id).style.visibility='visible';
}

function object_view_hwtl(tmp_id, h, w, t, l, zi) {
	    window.document.getElementById(tmp_id).style.height=h+"px";
        window.document.getElementById(tmp_id).style.width=w+"px";
		window.document.getElementById(tmp_id).style.top = t+"px";
        window.document.getElementById(tmp_id).style.left = l+"px";
        window.document.getElementById(tmp_id).style.zIndex=zi;
        window.document.getElementById(tmp_id).style.visibility='visible';
}
//-----------------------------------------------------------------------------------------
function view_alert(w, msg){
	var f = document.f_without_d;
	f.target = "tmp_view2_f";
	f.msg.value = msg;
	f.msg_td_w.value = w;
	f.action = "alert.php?sid="+sid;
	f.submit();
}
//-----------------------------------------------------------------------------------------
function change_img(src,alt,w,h){
	var img = "<img src='" + src + "' alt='" + alt  + "' name='hotel_img' id='hotel_img'  width='" + w + "' height=' " + h + "' >";
	window.document.getElementById('img_view').style.height = "420px";
	window.document.getElementById('img_view').innerHTML = img;
	scroll(0,0);
}
//-----------------------------------------------------------------------------------------
function video_play_alt(src, w, h){
	var img = "<embed src='" + src + "'  width='" + w + "' height=' " + h + "' ></embed>";
	window.document.getElementById('img_view').style.height = "308px";
	window.document.getElementById('img_view').innerHTML = img;
	scroll(0,0);
}

function video_play(src, w, h){
var src	= src.replace("wmv","flv");
var img = "<object type='application/x-shockwave-flash' data='uflvplayer_500x375.swf' height='"+h+"' width='"+w+"'>";
var img = img + "<param name='bgcolor' value='#FFFFFF' />";
var img = img + "<param name='allowFullScreen' value='true' />";
var img = img + "<param name='allowScriptAccess' value='always' />";
var img = img + "<param name='movie' value='uflvplayer_500x375.swf' />";
var img = img + "<param name='FlashVars' value='way="+src+"&swf=uflvplayer_500x375.swf&w="+w+"&h="+h+"&pic=&autoplay=1&replay=1&tools=1&skin=white&volume=70&q=&comment=' />";
var img = img + "</object>";
window.document.getElementById('img_view').style.visibility='hidden';
window.document.getElementById('img_view').style.height = "308px";
window.document.getElementById('img_view').innerHTML = img;
window.setTimeout('video_visible()', 1000);
scroll(0,0);
}
//----------------------------------------------------------------------------------------
function  video_visible(){ window.document.getElementById('img_view').style.visibility='visible'; }
//----------------------------------------------------------------------------------------
function menu_over(ids){
	for(i=0; i<i_ml; i++){
		id_i = menu_liste_array[i];
		if(id_i == ids) bg = '#FBEA88';  else bg = '#FCFDC6';
		document.getElementById(id_i).style.backgroundColor=bg;
	}
}
function lock(){
	view_alert(msg_prog_sperre_w, msg_prog_sperre);
}
//----------------------------------------------------------------------------------------
