/* www.soweco.de */



var bName = navigator.appName;
var bVer  = parseInt(navigator.appVersion);

var bNS4   = ((bName == "Netscape") && (bVer >= 4));
var bIE4   = ((bName == "Microsoft Internet Explorer") && (bVer >= 4));
var bOP	  = navigator.userAgent.indexOf("Opera");
  
  
/* Rechtsklickschutz */
  
function cu(){
  	return false
}

document.oncontextmenu = cu;


  
/* Add to Favorites */

function addToFavorite(){
  var favTitle = "Kamin- und Fliesenhaus"
  if ((navigator.appVersion.indexOf("MSIE") > 0) && (parseInt(navigator.appVersion) >= 4))
 {
    window.external.AddFavorite(location.href, unescape(favTitle));
  }
}


/* Lauftext in Statusleiste */

var text = "Kamin- und Fliesenhaus       ";
var anzeige = "";
var t = 0;
function textRoll(){
	t=t+1;
	anzeige = text.substring(0,t);
	window.status=anzeige;
	if (t == text.length) t=0;
	scrolltext();
}
function scrolltext(){

	setTimeout('textRoll()',100);
}


  /* Funktionen */ 
  
  function showPic(bild_name) {
  	var Bild = new Image(); 
  	Bild.src = "images/" + bild_name;
    	if (bIE4) {
    		var thisspan = window.document.getElementById("modelle");    		
  		thisspan.innerHTML = "<img src=\"" + Bild.src + "\">";
	}
	else {
		setCont("index",0,null,"<img src=\"" + Bild.src + "\">");
	}
  }
  
    
  function openPage(pageIndex){
  	apageList = new Array(
  	'about.htm',
  	'kamine.htm',
  	'fliesen.htm',
  	'angebot.htm',
  	'links.htm',
  	'impressum.htm');
  	
  	var wohin = (apageList[pageIndex]);
  	parent.frames['content'].location.href = wohin;
  }
  
      
  function openFile(fileName){
  	var afile = fileName;
  	window.open((afile), 'archiv', 'toolbar=no,status=no,resizable=yes,menubar=no,scrollbars=no');
  }
  
  
    
  function openMyPopup(pageURL,pageName,pageFeatures){
      	window.open(pageURL,pageName,pageFeatures);
  }
  

 /* Absprung zu anderen Websites */
  
  function MM_jumpMenu(selObj,restore){ //v3.0
    eval("top.location='"+selObj.options[selObj.selectedIndex].value+"'");
    if (restore) selObj.selectedIndex=0;
  }
  
  
  
/* Mouseovers */
  
function mOver(cell,movcolor) {
       cell.style.cursor = 'default';
       cell.bgColor = movcolor;
}
  
  
function mOut(cell,moucolor) {
       cell.style.cursor = 'default';
       cell.bgColor = moucolor;
}
  
  
function changeStyle(p_button,p_action) {
    if(p_action=='on')
        {
        p_button.className ="rightBarHover";
        }
    else
        {
        p_button.className ="rightBar";
        }
    }
  

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_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v3.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); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


  
/* Formularabfrage */

function popup() {
      	window.open('deformularok.htm', 'contact', 'toolbar=no,status=no,resizable=no,menubar=no,scrollbars=no,width=210,height=180');
} 

function IsEmpty(myField) {
  	var retVal = true;
  	var aField = eval('document.contact.' + myField + '.value');
  	if (aField.length != 0) {
  		for (var i = 0; (i < aField.length) ; i++) {
  			if (aField.charAt(i) != " ") retVal = false;
  		}
  	}
  	return retVal;
}
  
function verify(f) {
 	var retVal = true;
  	var aFocus = "";
  	var myAlert = "Bitte geben Sie noch folgende Daten an:";
  	var pRequired = new String(document.contact.iqrequired.value);
  	if (pRequired.length > 0) {
  		var pRequiredName = new String(document.contact.iqrequiredname.value);
  		var aRequired = pRequired.split(",");
  		var aRequiredName = pRequiredName.split(",");
  		for (i = 0; i < aRequired.length; i++) {
  			if (IsEmpty(aRequired[i])) {
  				myAlert += "\n " + aRequiredName[i];
  				retVal = false;
  				if (aFocus.length == 0) {
  					aFocus = aRequired[i];
  				}
  			}
  		}
  
  	}
  
  	if (!retVal) {
  		alert(myAlert);
  		if (aFocus.length != 0) {
  			eval("document.contact." + aFocus + ".focus()");
  		}
  	}
  	return retVal;
}
  
function letsSubmit() {
  	if (verify(document.contact)) {
  		document.contact.submit();
		setTimeout('popup()',2000);
  	}
}
  

 
  
  
 
  
  
  
  
  
  
  
  
  
  
  

/* ----------------------------------------------------------------------------------------*/
 
  function abfrage() {
  	
  	var bName = navigator.appName;
  	var bVer  = parseInt(navigator.appVersion);
  	var NS4   = ((bName == "Netscape") && (bVer >= 4));
  	var IE4   = ((bName == "Microsoft Internet Explorer") && (bVer >= 4));
  
  	
  
}
  
  /* Quick Search */
  
  function activateQuickSearch(){
  
  	var QueryString=document.search.quickSearchField.value
  	//return top.pages.getPageURL("Search") + "&SearchType=quick&QueryString=" + queryStr;
  	if (QueryString=="" || QueryString.length==0){
  		alert("Query string should be specified")
  		return
  	}
  
  	letsSubmit();
}
  
  
  /* Check Formular */
  
  function chkFormular(){
  
     if(document.contact.firstname.value == "")
      {
       alert("Please enter your Firstname!");
       document.contact.firstname.focus();
       return false;
      }
      
      if(document.contact.surname.value == "")
          {
           alert("Please enter your Surname!");
           document.contact.surname.focus();
           return false;
      }
      
      if(document.contact.company.value == "")
          {
           alert("Please enter your Organisation!");
           document.contact.company.focus();
           return false;
          }
  
      
      if(document.contact.address.value == "")
          {
           alert("Please enter your Address!");
           document.contact.address.focus();
           return false;
      }
      
      if(document.contact.town.value == "")
          {
           alert("Please enter your City!");
           document.contact.town.focus();
           return false;
          }
          
      if(document.contact.postcode.value == "")
          {
           alert("Please enter your Zip/Postal!");
           document.contact.postcode.focus();
           return false;
          }
      
      
      if(document.contact.country.value == "")
              {
               alert("Please enter your State/Prov!");
               document.contact.country.focus();
               return false;
              }
     /* window.setTimeout("popup()",3); */
  }
 
 function menu_down(nr){
 
 
 	y = nr;
 	var iqthisspan = eval("menu" + (y) + ".style");
 	var iqBreite = iqthisspan.width;
 	var iqHoehe = iqthisspan.height;
 	
 	var iAnfang = 0;
 	var iEnde = iqHoehe.length - 2;
 	var nurhoehe = iqHoehe.substring(iAnfang,iEnde);
 	var iHoehe = nurhoehe - 0;
 
 	iqh = iHoehe;
 
 	var iAnfang2 = 0;
 	var iEnde2 = iqBreite.length - 2;
 	var nurbreite = iqBreite.substring(iAnfang2,iEnde2);
 	var iBreite = nurbreite - 0;
 	
 	iqb = iBreite;
 	
 	if(document.all){
 		if(aktuelleHoehe <= iqh) {
 			iqthisspan.visibility="visible";
 			iqthisspan.clip="rect(0 " + iqb + " "+ aktuelleHoehe + " 0)";
 			aktuelleHoehe = aktuelleHoehe + Geschwindigkeit;
 			window.setTimeout("menu_down(y)",10);
 		}
 		else 
 			aktuelleHoehe = iqh;
 	}
 	 		
 	else {
 	alert("geht");
 		lay[y].visibility = "visible";
 		lay[y].clip.height = iqh;
 		lay[y].clip.width = iqb;
 	}
 	
 }
 
 function menu_right(nr){
 
 
 	y = nr;
 	var iqthisspan = eval("menu" + (y) + ".style");
 	var iqBreite = iqthisspan.width;
 	var iqHoehe = iqthisspan.height;
 	
 	var iAnfang = 0;
 	var iEnde = iqHoehe.length - 2;
 	var nurhoehe = iqHoehe.substring(iAnfang,iEnde);
 	var iHoehe = nurhoehe - 0;
 
 	iqh = iHoehe;
 
 	var iAnfang2 = 0;
 	var iEnde2 = iqBreite.length - 2;
 	var nurbreite = iqBreite.substring(iAnfang2,iEnde2);
 	var iBreite = nurbreite - 0;
 	
 	iqb = iBreite;
 	
 	
 		if(aktuelleBreite <= iqb) {
 	
 	   		if(document.all){
 	   			iqthisspan.visibility="visible";
 				iqthisspan.clip="rect(0 " + aktuelleBreite + " "+ aktuelleHoehe + " 0)";
 	   		}
 	   		else if(navigator.appName=="Netscape") {
 	   			lay[y].visibility = "show";
 	   			lay[y].clip.height = aktuelleBreite;
 	   			lay[y].clip.width = iqh;
 	   		}
 	
 		aktuelleBreite = aktuelleBreite + Geschwindigkeit;
 		aktuelleHoehe = aktuelleHoehe + Geschwindigkeit;
 		window.setTimeout("menu_right(y)",10);
 	 	}
 	 	else {
 	 		aktuelleBreite = iqb;
 	 		aktuelleHoehe = iqh;
 	 	}
 	
}
 
 
 /* Untermenues ausblenden (wird nicht verwendet)*/
  	
  function menu_up(nr){
  
  y = nr;
  var rqthisspan = eval("menu" + (y) + ".style");
  var rqBreite = rqthisspan.width;
  var rqHoehe = rqthisspan.height;
  
  
  var iAnfang = 0;
  var iEnde = rqHoehe.length - 2;
  var nurhoehe = rqHoehe.substring(iAnfang,iEnde);
  var iHoehe = nurhoehe - 0;
  
  rqh = iHoehe;
  
  var iAnfang2 = 0;
  var iEnde2 = rqBreite.length - 2;
  var nurbreite = rqBreite.substring(iAnfang2,iEnde2);
  var iBreite = nurbreite - 0;
  
  rqb = iBreite;
  
  	if(aktuelleHoehe >= 0) {
  
     		if(document.all){
  			rqthisspan.visibility="visible";
  			rqthisspan.clip="rect(0 " + rqb + " "+ aktuelleHoehe + " 0)";
     		}
     		else if(document.layers)
     			rqthisspan.clip.height = aktuelleHoehe;
     			rqthisspan.clip.width = rqb;
  
  	aktuelleHoehe = aktuelleHoehe - Geschwindigkeit;
  	window.setTimeout("menu_up(y)",10);
   	}
  
  
  
  
}

