// Navigation Menues #################################################
  var ID; var TO2;
  function einklappen(ebene){
  	eval("ID = setTimeout(\"einklapp('" + ebene + "')\" ,300)");
  }

  function einklapp(ebene){
	window.document.getElementById(ebene).style.display='none';
	}

  function ausklappen(ebene){
	window.document.getElementById(ebene).style.display='block';
	if (ID) {clearTimeout(ID);}
	hide_rest(ebene);
}

function hide_rest(ebene){
	//var myall=new Array("subnavi01","subnavi02","subnavi03");
	var myall=new Array("subnavi02","subnavi03","subnavi04", "subnavi05", "introtext02","introtext04");
	for (i=0;i<myall.length;i++){
	if (ebene != myall[i] && window.document.getElementById(myall[i]) ){
	   window.document.getElementById(myall[i]).style.display='none';
	}
	}
}
// - Navigation Menues #################################################



//Page: fragrences.php
function tooltip_1(evnt){
	// find out if IE runs in quirks mode
   	var docEl = (typeof document.compatMode != "undefined" && document.compatMode != "BackCompat" )? "documentElement" : "body";
        msg= " " + docEl + " ";

	// if (!evnt) evnt = window.event;
 	var my_fra=new Array("avorio", "rubino","scuro","calla", "lilia", "malva", "legno", "sfera", "cielo", "oceano","estate","mondo", "luce", "sogno", "luce", "onice", "senso", "puro", "menta", "natale");
 	for (i=0;i < my_fra.length; i++){
	  if (window.document.getElementById(my_fra[i]+"_tip")){
		  ytob = window.document.getElementById(my_fra[i]+"_tip");
		  // nachstehende event.x/y liefert die Pos rel. zum Div. -> unbrauchbar.
		  //    var xPos = evnt? evnt.pageX : window.event.x;
		  //    var yPos = evnt? evnt.pageY : window.event.y;
		  // event.client liefert die richtige Pos. im IE!
		  var xPos = evnt? evnt.pageX : window.event.clientX;
		  var yPos = evnt? evnt.pageY : window.event.clientY;
		  //   window.status =msg + "X: " + xPos + " Y: " + yPos;
		  	if (document.all && !document.captureEvents) {
				xPos    += document[docEl].scrollLeft;
				yPos    += document[docEl].scrollTop;
				ytob.style.left =  xPos -650 + "px";
				ytob.style.top = yPos -100 + "px";
			} else {
				ytob.style.left =  xPos - 250  + "px";
				ytob.style.top = yPos - 100 + "px";
			}
	  }
	}
}

function show_tooltip(id,stat){
	if(stat==1) window.document.getElementById(id).style.display='block';
	if(stat==0) window.document.getElementById(id).style.display='none';
}
//######################################
//Page: overview.php, roomspray.php, diffusoren.php, kerzen.php ###############################################
function imgchange(a,img){
	var a, img;
	window.document.images[a].src=img.src;
	window.document.images[a].style.display='block';
	//fade_in_img('mitteimg',1);
	}
function imgclear(a,img) {
	var a,img;
	window.document.images[a].src="";
	window.document.images[a].style.display='none';
}
//################################################

function show_rs (){
	var wingif;
	wingif=window.open ("preview.php","LINARI_RS_preview","width=470,height=650,resizeable=no,scrollbars=no,dependent=yes");
	wingif.moveTo(10,10);
}
//#############################################  -Page: Fragrances.php

// Page: kontakt ###############################################
function agb(lang){
		var win;
		switch (lang){
		case 'de':
			{
			win=window.open("../shop/agb_popup.html","LINARI","width=600,height=700,resizeable=no,scrollbars=yes,dependent=yes")
			break;
			}
		case 'eng':
			{
			win=window.open("../shop/agb_popup_en.html","LINARI","width=600,height=700,resizeable=no,scrollbars=yes,dependent=yes")
			break;
			}
		}
}

function muster(lang){
		var win2;
		win2=window.open("../shop/muster.php?lang="+lang,"LINARI","width=600,height=500,resizeable=no,scrollbars=yes,dependent=yes")
}
//###################################################-Page kontakt

// Page: F.A.Q. ###################################################
 	function init_ran(){
	var z=Math.ceil(10*Math.random());
	if (z<10){z="0"+z;}
	//window.status='showing image: '+ z;

	faq_img=new Image();
	faq_img.src="../images/logo_faq_0"+z+".jpg";
	imgchange_faq();
	setTimeout('init_ran()',2500)
	}
	function imgchange_faq()
	{
	window.document.images[1].src=faq_img.src;
	}
//####################################################-F.A.Q.


//## Page: bezug_reg ################################################
function start_reg(lang,SID) {
	var lang;
	var win=window.open('bezug_reg_2.php?action=new&lang='+lang+'&'+SID,'LINARI',"width=700,height=600,resizeable=no,scrollbars=yes,dependent=yes");
	}

function cancel_reg(lang) {
   var lang;
   switch (lang){
   case "eng" :
      var con=confirm("Are you sure you want to quit?");
      if(con == true) {self.close();}
      break;
   case "de" :
      var con=confirm("Wollen Sie wirklich abbrechen?");
      if(con == true) {self.close();}
      break;
   }
}
function g_feld(lang) {
                 var i;
                 var me_index=window.document.getElementById('gfeld').selectedIndex;
		var gfeld=window.document.getElementById('gfeld').options[me_index].value;
		var elem_h = new Array('fs1');
		var elem_s = new Array('fs2');
		if (gfeld =="Hotel"|| gfeld=="hotel"){
		   for (i=0;i<elem_h.length;i++)
		   	{window.document.getElementById(elem_h[i]).style.display='block';}
		   for (i=0;i<elem_s.length;i++)
		   	{window.document.getElementById(elem_s[i]).style.display='none';}
		   }
		else if (gfeld=="sonstige"|| gfeld=="Others"){
		   for (i=0;i<elem_h.length;i++)
		   	{window.document.getElementById(elem_h[i]).style.display='none';}
		   for (i=0;i<elem_s.length;i++)
		   	{window.document.getElementById(elem_s[i]).style.display='block';}
		   }
		else {
		   for (i=0;i<elem_h.length;i++)
		  	{window.document.getElementById(elem_h[i]).style.display='none';}
		   for (i=0;i<elem_s.length;i++)
		   	{window.document.getElementById(elem_s[i]).style.display='none';}
		}
}
//####################################################bezug_reg

// products.php
function show_buy(onoff){
	if (onoff==1){
		window.document.getElementById('fs3').style.display='block';
		window.document.getElementById('buybutton').focus();
	}
	else if (onoff==0){
		window.document.getElementById('fs3').style.display='none';
	}
}

//####################################################products.php


// press.php
 function openarticle(article){
  	if (article.indexOf(".jpg")>-1){
  	var winjpg;
	winjpg=window.open ("press_article.php?img="+article,"LINARIArticle","width=900,height=700,resizeable=no,scrollbars=yes,dependent=yes");
	}

	if (article.indexOf(".mpg")>-1){
	var winmpg;
	winmpg=window.open ("","LINARIVideo","width=90,height=30,resizeable=no,scrollbars=no,dependent=yes");
	winmpg.document.write ("open video...<br>");
	winmpg.document.write ("please close.");
	winmpg.document.location=article;
	//winmpg.setTimeout ('window.close()',1000);
	}
  }
 //#######################################################press.php

 //shop.php ###############################################
 function openshortinfo(article,lang,SID,prod_group){
 	var shortinfo;
	shortinfo=window.open ("shortinfo.php?"+SID+"&lang="+lang+"&product="+article+"&prod_group="+prod_group,"LINARIArticle","width=800,height=400,resizeable=no,scrollbars=yes,dependent=yes");
 }

 function goback(target){
		document.forms[0].action.value=target;
		document.forms[0].submit();
  }
 function agb2(){
		var win2;
		win2=window.open("./agb_popup2.html","LINARI","width=600,height=300,resizeable=no,scrollbars=yes,dependent=yes");
 }
 function agb2_en(){
		var win2;
		win2=window.open("./agb_popup2_en.html","LINARI","width=600,height=300,resizeable=no,scrollbars=yes,dependent=yes");
 }
 function cvc(){
		var win2;
		win2=window.open("./kk_cvc.html","LINARI","width=500,height=700,resizeable=no,scrollbars=yes,dependent=yes");
 }
 function prf(){
		var win2;
		win2=window.open("./kk_prf.html","LINARI","width=500,height=700,resizeable=no,scrollbars=yes,dependent=yes");
 }
/*
  Lauftextanzeige als Werbeeinblendung
  Wird nicht mehr verwendet. 2007
*/
function banntext(saisontext, pos) {
           txt = saisontext;
           ausgabe = txt.substr(0,pos);
           if (txt.substr(pos, 1)==' ') {
            ausgabe=txt.substr(0,pos+1);
            pos=pos+1;
            }
           document.getElementById('banntext').firstChild.nodeValue = ausgabe;
           pos=pos +1;

	     function container(){
           	banntext(saisontext,pos);
             }

           if (pos <= txt.length){
	   	window.setTimeout(container, 80);
	   }
}
//####################################################################shop.php

function show_smallblend(id) {
	window.document.getElementById(id).style.visibility='visible';
	window.document.getElementById(id).style.display='block';
}

function fade_in_img(imgid, i){
	steps=10;
	obj=window.document.getElementById(imgid);
	if(i==1) {
		w=obj.width;
		h=obj.height;
		sc=h/w;
		j=1;
	}
	window.status='Breite: ' + w +' Hoehe: ' + h + ' Scale: ' +sc+' // ' +i +'  x ' + j;
	obj.style.visibility='visible';
	obj.width = i;
	obj.height= j;
	i+=steps;
	j+=(sc*steps);
	function container() {
		fade_in_img(imgid,i)
	}
	if (i < w+steps) {
	   window.setTimeout(container,50);
	}
}

function close_hinweis(id){
	obj=window.document.getElementById(id);
	obj.style.visibility='hidden';
}

function showdebugwin(debug) {
	win=window.open("#","LINARI","width=600,height=700,resizeable=no,scrollbars=yes,dependent=yes");
	var out="<html><body><p>" + debug + "</p></body></html>";
	win.document.write(out);
}


// USED IN Overview.php
function resize_flashmovie(id1, id2, id3){
	_size=new Array();
	_size=getSize();
	var def_height=700; var def_width=800;					// Defaultwerte
	var _min_height=550;						// RTFM
	var scale=def_width/def_height; 				// Seitenverhaeltnis
	var newheight=0; var newwidth=0;
	var _height=_size[1] - 100;				// Anzeigehoehe abzgl. oberer Rand
	if (_height < 700) {
		newheight=_height;
		if (newheight < _min_height) newheight=_min_height;	// Mindesth&#246;he beachten !!
	} else {
		newheight=def_height; // default
	}
	var sizediff=700-newheight; 				// merke die Reduzierung
	newheight= Math.round(newheight);
	newwidth = Math.round(newheight*scale);
	with (document.getElementById(id1)) {
		width=newwidth;
		height=newheight;
	}
	with (document.getElementById(id2)) {
		style.width = newwidth+'px';
		style.height = newheight+'px';
	}
 	with (document.getElementById(id3)) {
 		_top=720;						// Textblock
 		newtop=(_top - sizediff)+'px';
 		style.top=newtop;
 		style.width=newwidth+'px';
 	}
}
// following function ist to get the viewable browser sizes
function getSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  _retval=new Array(myWidth, myHeight);
return _retval;
}