function checkSkyScraper(){
	var actDims = getWindowDims();
	var skyScraperLink = 'http://www.krueger-automaten.de/html/produkte/merkur_ideal_aktion.php';
	var pathSkyScraper = '/html/flash/sky_160x600.swf' ; // "/html/flash/skyscraper.swf"
	var widthSkyScraper = 160;
	var heightSkyScraper = 600;
	var setLink = true; 
	
	if (actDims.X > (870 + widthSkyScraper)){
		if (setLink){
			document.getElementById('skyLink').style.display = 'block';
			document.getElementById('skyContainer').style.width = widthSkyScraper;
			document.getElementById('skyContainer').style.height = heightSkyScraper;
			document.getElementById('skyLink').style.width = widthSkyScraper;
			document.getElementById('skyLink').style.height = heightSkyScraper;
			document.getElementById('skyHref').href = skyScraperLink;
		}
		 
		 // Flash
	 	var flashvars = {};
		var params = {wmode: 'transparent'};
		var attributes = {};		 
		swfobject.embedSWF(pathSkyScraper, "skyContent", widthSkyScraper, heightSkyScraper, "7","expressInstall.swf", flashvars, params, attributes);
		
//		var so = new SWFObject( pathSkyScraper, "skyContent", widthSkyScraper,  heightSkyScraper, "7", "expressInstall.swf", flashvars, params, attributes); // don't modify!
//		 so.write("skyContent"); // don't modify!
		 
		 // Gif/JPG
		 // document.getElementById('skyContainer').innerHTML = '<a href="' + skyScraperLink + '"><img src="' + pathSkyScraper + '" /></a>'; 
		 
		 // Adjust Layer Width
		 document.getElementById('skyWrapper').style.width = (1002 + widthSkyScraper) + 'px';
	}  
	document.write('<!-- ' + actDims.X + ' -->');
	
	
	
}


function loadjscssfile(filename, filetype){
 if (filetype=="js"){ //if filename is a external JavaScript file
  var fileref=document.createElement('script')
  fileref.setAttribute("type","text/javascript")
  fileref.setAttribute("src", filename)
 }
 else if (filetype=="css"){ //if filename is an external CSS file
  var fileref=document.createElement("link")
  fileref.setAttribute("rel", "stylesheet")
  fileref.setAttribute("type", "text/css")
  fileref.setAttribute("href", filename)
 }
 if (typeof fileref!="undefined")
  document.getElementsByTagName("head")[0].appendChild(fileref)
}


function TDim(pX, pY){
  this.X = pX;
  this.Y = pY;
}

function getWindowDims(){
  var dims = new TDim(0, 0);
  if (self.innerHeight) // all except Explorer
  {
	  dims.X = self.innerWidth;
  	dims.Y = self.innerHeight;
  }
  else if (document.documentElement && document.documentElement.clientHeight)
	  // Explorer 6 Strict Mode
  {
	  dims.X = document.documentElement.clientWidth;
  	dims.Y = document.documentElement.clientHeight;
  }
  else if (document.body) // other Explorers
  {
    dims.X = document.body.clientWidth;
    dims.Y = document.body.clientHeight;
  }
  return dims;
}


function goVorschau (){
	/*var Str = '';
	if( document.getElementById('insertForm').action.indexOf('?vorschau') > -1 || document.getElementById('insertForm').action.indexOf('&vorschau') > -1 )
	{
		Str = '';
	}
	else
	{
		if ( document.getElementById('insertForm').action.indexOf('?') > -1 )
		{
			Str = '&vorschau'
		} 
		else
		{
			Str = '?vorschau';
		}
	}
	document.getElementById('insertForm').action += Str ;
	document.getElementById('insertForm').submit();
	*/
	var myINPUT = document.createElement("input");
	myINPUT.name = 'sichern_x';
	document.getElementById('insertForm').appendChild(myINPUT);
	document.getElementById('insertForm').submit();
}


function openImagePopup(url, width, height){
	if(width==NaN && height==NaN){
		width=640;
		height=480;
	}
	options = 'scrollbars=no,status=no,toolbar=no,location=no,directories=no,resizable=yes,menubar=no';
	options = options + ',width=' + width + ',height=' + height;
	window.open(url, "imagePopup", options);
}


function openBrWindow(theURL,winName,options, myWidth, myHeight, isCenter) { //v3.0
	if(window.screen)if(isCenter)if(isCenter=="true"){
		var myLeft = (screen.width-myWidth)/2;
		var myTop = (screen.height-myHeight)/2;
		features = (options!='') ? options : 'scrollbars=yes,status=no,toolbar=no,location=no,directories=no,resizable=yes,menubar=no';
		features+=(features!='')?',':'';
		features+=',left='+myLeft+',top='+myTop;
	}
	window.open(theURL,winName,features+((features!='' )?',':'')+'width='+myWidth+',height='+myHeight);
}





