function newadr(){document.links[7].href="mailto:studiopinknoise@googlemail.com";};
//function init () {
//window.document.getElementById("nojava").style.visibility = "hidden";
//}


function jsIsAktive(){
  if(window.document.getElementById("nojava")){
  window.document.getElementById("nojava").style.visibility = "hidden";
  }
    document.links[7].onload= newadr();
}
function getWidth() {
         var de = document.documentElement;
         var myWidth = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
         return myWidth;
         }
function getHeight() {
         var de = document.documentElement;
         var myHeight = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
         return myHeight;
}
function changeCssKlein(){
   var i, a, main;
    for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
      if(a.getAttribute("rel").indexOf("style") != -1) {
      //-------------------------------------------------------------------
        if(a.getAttribute("href") == "css1.css" || a.getAttribute("href") == "printcss1.css"){
          a.disabled = true;
          if(a.getAttribute("media") == "screen"){ a.disabled = false;
            a.href = "minicss1.css";       }
          if(a.getAttribute("media") == "print"){ a.disabled = false;
           a.href = "nullcss1.css";        }
        }
        //---------------------------------für die landingpages
        if(a.getAttribute("href") == "../css1.css" || a.getAttribute("href") == "../printcss1.css"){
          a.disabled = true;
          if(a.getAttribute("media") == "screen"){ a.disabled = false;
            a.href = "../minicss1.css";       }
          if(a.getAttribute("media") == "print"){ a.disabled = false;
           a.href = "../nullcss1.css";        }
        }
        //---------------------------------für die landingpages Ende
     }
   }
}
function changeCssGross(){
var i, b, main;
    for(i=0; (b = document.getElementsByTagName("link")[i]); i++) {
     // if(b.getAttribute("rel").indexOf("style") != -1 && b.getAttribute("title")) {   //-wofür???
     if(b.getAttribute("rel").indexOf("style") != -1 ) {
     //-----------------------------------------------
        if(b.getAttribute("href") == "minicss1"|| b.getAttribute("href") == "nullcss1.css"){
         b.disabled = true;
          if(b.getAttribute("media") == "screen"){ b.disabled = false;
           b.href = "css1.css";
          }
          if(b.getAttribute("media") == "print"){ b.disabled = false;
           b.href = "printcss1.css";       }
        }
        //-----------------------für die landingpages
        if(b.getAttribute("href") == "../minicss1"|| b.getAttribute("href") == "../nullcss1.css"){
         b.disabled = true;
          if(b.getAttribute("media") == "screen"){ b.disabled = false;
           b.href = "../css1.css";
          }
          if(b.getAttribute("media") == "print"){ b.disabled = false;
           b.href = "../printcss1.css";       }
        }
        //-----------------------für die landingpages Ende
     }
   }
}
var i;
function detectSmartphones(){
var allBrowsers=new Array("iphone","ipod","series60","symbian","android","windows ce","blackberry","palm")
var uagentLow = navigator.userAgent.toLowerCase();
         for(i=0;i<allBrowsers.length;i++){
                 if (uagentLow.search(allBrowsers[i]) > -1 || getWidth() <= 600 || getHeight()<= 400){
                 //alert(allBrowsers[i]);
                 changeCssKlein();
                 return 0;
                 break;
                 }
                 else{
                  changeCssGross();
                   return 1;
                 }
         }
}
var whichview;
whichview=detectSmartphones();
