// common definitions for creative-inflatable.ch

var PageWidth = 1020;
//var breite = 1020;

var CR = "&copy; 2010 - 2012 Creative-Inflatable GmbH";
var StrVerify = "save091109";

var ie;
if (document.all && !window.opera) ie = true;

//preload common images

if (document.images)
    {
      preload_image_object = new Image();
      // set image url
      image_url = new Array();
      image_url[0] = "../common/logo.gif";
      image_url[1] = "../common/button_a.png";
      image_url[2] = "../common/headline1.png";
      image_url[3] = "../common/headline2.png";

       var i = 0;
       for(i=0; i<=3; i++) 
         preload_image_object.src = image_url[i];
    }

function AdjustPage ()
	{
		if (window.innerWidth) {breite = window.innerWidth;}
		else if (document.body && document.body.offsetWidth) { breite = document.body.offsetWidth; }
		else { breite = 0 }
		if (breite == 0) breite = PageWidth;
		if (breite < PageWidth) breite = PageWidth;
		
		var sollpos = Math.round((breite-PageWidth) / 2);
		document.getElementById("mt").style.left = (sollpos) + "px";
		//document.getElementById("hd").style.position = "absolute";
		document.getElementById("hd").style.left = (sollpos + 20) + "px";
		document.getElementById("cr").style.left = (sollpos + 14) + "px";
        if (document.getElementById("staticlink")) {
           document.getElementById("staticlink").style.left = (breite-PageWidth)/2 + (178+592+14) + "px";
           document.getElementById("staticlink").style.top = pageHeight() + document.body.scrollTop - 62 + "px";
           }

	}
	
function setIE6 ()
	{
	    var element = document.getElementById("hl1");
		element.style.width = "450px";
		element.style.height = "33px";
		var element = document.getElementById("hl2");
		element.style.width = "450px";
		element.style.height = "33px";
		
		var aElm=document.getElementsByTagName('*');
		for(var i=0; i<aElm.length; i++) {
    			if(aElm[i].className=='menu')
        		{
				aElm[i].style.width = "130px";
				aElm[i].style.height = "28px";
        		}
		}
		
		var aElm=document.getElementsByTagName('*');
		for(var i=0; i<aElm.length; i++) {
    			if(aElm[i].className=='sidebox')
        		{
				aElm[i].style.width = "220px";
        		}
		}
		
		var aElm=document.getElementsByTagName('*');
		for(var i=0; i<aElm.length; i++) {
    			if(aElm[i].className=='spacer2')
        		{
				aElm[i].style.width = "246px";
        		}
		}
	}
    
	window.onresize = AdjustPage;
	
    function pageWidth() {return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ?       document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;}
    function pageHeight() {return  window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ?  document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;} 
