
var F1;
function pop(_nam,_newy){
	var _name= _nam+'.shtml';
	var _x=screen.width-500;
	var _yy=(screen.height*0.8);
	var _y=(_newy)?_newy:_yy;
	_sc =(_newy)?'no':'yes';
	if (_newy && _yy<_newy) {
		_y = _yy;
		_sc = 'yes';
	}
	F1 = window.open(_name,"Popup","width=330,height="+_y+",left="+_x+",top=20,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no");
}
function email(){
	var ema = "info";
	var emb = "&#064;"
	var emc = "emamidesign.de";
	var emd = ema+emb+emc;
	document.write("<a href=\"mailto:"+emd+"\">"+emd+"</a>");
}

//################REZIZING##############
function getWindowWidth(win) {    
    if (win == undefined) win = window;    
    if (win.innerWidth) {    
        return win.innerWidth;    
    }    
    else {    
        if (win.document.documentElement &&    
            win.document.documentElement.clientWidth) {    
            return win.document.documentElement.clientWidth;    
        }    
        return win.document.body.offsetWidth;    
    }    
}    
  
function getWindowHeight(win) {    
    if (win == undefined) win = window;    
    if (win.innerHeight) {    
        return win.innerHeight;    
    }    
    else {    
        if (win.document.documentElement    
            && win.document.documentElement.clientHeight) {    
            return win.document.documentElement.clientHeight;    
        }    
        return win.document.body.offsetHeight;    
    }    
}



window.onload = checkSize;
window.onresize = checkSize;



var oldbig = true;
var newbig = true;
var hgrenze = 985;
var vgrenze = 585;

var StilA = "Standard";
var StilB = "Klein";

var Stil = StilA;

var Tage = 30;

function checkSize(){
	
	var xhe=-1;
	var yhe=-1;
	yhe = getWindowHeight();
	xhe = getWindowWidth();
	if (xhe >-1 && yhe>-1) {
		newbig = (xhe<hgrenze || yhe<vgrenze)?false:true
	}
	
	var neustil = (newbig==true)?StilA:StilB;
	oldbig = newbig;
	setStyle(neustil);
	//setzWerte(xhe,yhe,neustil);
	
}



// Style Switcher

function switchStyle(s) {
  if (!document.getElementsByTagName) return;
  var el = document.getElementsByTagName("link");
  for (var i = 0; i < el.length; i++ ) {
    if (el[i].getAttribute("rel").indexOf("style") != -1 && el[i].getAttribute("title")) {
      el[i].disabled = true;
      if (el[i].getAttribute("title") == s) el[i].disabled = false;
    }
  }
}

function setStyle(s) {
  if (s != Stil) {
    
    switchStyle(s);
    Stil = s;
  }
}
//TESTING STYLESWITCH FIFO *ONLY FOR INDEX2.SHTML
function setzWerte(a,b,c){
  document.getElementById('xhe').value=a;
  document.getElementById('yhe').value=b;
  document.getElementById('style').value=c;
}



