// javascript DHMTL - funktionen
// author: daniel kremin
// datum: 23.08.2002

var land = ".de"
var domain = "kosmetik-sasse"
var bei = "@"
var SubName = "0";
var SubNr = "0";

var url = document.URL;
if(url.lastIndexOf("\\") == -1){
		var DocName = url.substring(url.lastIndexOf('/')+1,url.lastIndexOf('.')); // for windows 
	}else{
		var DocName = url.substring(url.lastIndexOf('\\')+1,url.lastIndexOf('.')); // for windows 
	}
	if(DocName.lastIndexOf('-') != -1){
		SubName = DocName.substr(DocName.lastIndexOf('-')+1);
		DocName = DocName.substring(0, DocName.lastIndexOf('-'));
}

function postSchutz(derName){
	document.write('<a href=\"mailto:'+ derName + bei + domain + land + '\">'+ derName + bei + domain + land + '</a>');
}

function setMenu(){
	
	if(DocName != "index"){
			switchDiv(DocName + "-1", DocName + "-2");
	}
	if(SubName != "0"){
			switchDiv(SubName + "-1", SubName + "-2");
	}
}
function setSubName(){
	
	var url = document.URL; 
	if(url.lastIndexOf("\\") == -1){
		var DocName = url.substring(url.lastIndexOf('/')+1,url.lastIndexOf('.')); // for windows 
	}else{
		var DocName = url.substring(url.lastIndexOf('\\')+1,url.lastIndexOf('.')); // for windows 
	}
	
	if(DocName.lastIndexOf('_') != -1){
		SubName = DocName.substr(DocName.lastIndexOf('_')+1);
		DocName = DocName.substring(0, DocName.lastIndexOf('_'));
	}
	if(SubName != "0"){
		if(SubName.lastIndexOf('-') != -1){
			SubNr = SubName.substring(SubName.lastIndexOf('-')+1); 
			SubName = SubName.substring(0, SubName.lastIndexOf('-'));
		}
	}
	//alert(SubName)
}


// wechlse der menupunkte
function switchDiv(divID1, divID2)
{
	
   if (document.layers){
      //Netscape 4 specific code
      myLayer1 = document.layers[divID1];
	  // myLayer1.moveTo(603,0)
      myLayer2 = document.layers[divID2];
	  // myLayer2.moveTo(603,0)
	  status_1 = "hide";
	  status_2 = "show";
	}
   
   if (document.getElementById){
      //Netscape 6 specific code
      myLayer1 = eval('document.getElementById("' + divID1 +'").style');
      myLayer2 = eval('document.getElementById("' + divID2 +'").style');
	  status_1 = "hidden";
	  status_2 = "visible";
   }
   
   if (document.all){
      //IE4+ specific code
      myLayer1 = eval('document.all.' + divID1 +'.style');
      myLayer2 = eval('document.all.' + divID2 +'.style');
	  status_1 = "hidden";
	  status_2 = "visible";
   }
//  alert(myLayer1  + " "  + myLayer2);
  with (myLayer1)
  visibility = (visibility.indexOf(status_1) != -1) ? visibility.replace(status_1, status_2) : visibility.replace(status_2, status_1);
  with (myLayer2)
  visibility = (visibility.indexOf(status_2) != -1) ? visibility.replace(status_2, status_1) : visibility.replace(status_1, status_2);
  
}
function showDiv(divID)
{
	//alert(divID);
	hideAll("layer");
   if (document.layers){
      //Netscape 4 specific code
      myLayer = document.layers[divID];
	  status = "show";
	}
   
   if (document.getElementById){
      //Netscape 6 specific code
      myLayer = eval('document.getElementById("' + divID +'").style');
      status = "visible";
   }
   
   if (document.all){
      //IE4+ specific code
      myLayer = eval('document.all.' + divID +'.style');
      status = "visible";
   }
	myLayer.visibility = status;
}

function hideAll(idpart){
    // alert(idpart);
	if (document.layers){
      	//Netscape 4 specific code
	  	var status_1 = "hide"
	}
	
   	if (document.getElementById){
      	//Netscape 6 specific code
	  	var status_1 = "hidden"
		
  	 }
	 
   	if (document.all){
      	//IE4+ specific code
	  	var status_1 = "hidden"
	}
	
	var tmp = document.getElementsByTagName('div');
	var i;
  	
	for (i=0; i<tmp.length; i++)
 	   {
        	 if (tmp[i].id.indexOf(idpart) != -1){ 
 			tmp[i].style.visibility = status_1;}
    	}
}

function rollover(Bild)
{
	with (document.images[Bild])
	src = (src.indexOf("1") != -1) ? src.replace(/1/, "2") : src.replace(/2/, "1");
}

function link()
{
	var link = "<a href='mailto:mail@kosmetik-sasse.de' onMouseOver='rollover("+ "'link'" +")' onMouseOut='rollover("+ "'link'"+ ")'>";
	document.write(link);
}



