/*

firstsolus.js

functions for www.first-solus.de
21-07-2007

*/

// fix netscape resize bug

ns4 = (document.layers) ? true:false;

if(ns4){
	origWidth = innerWidth;
	origHeight = innerHeight;
	onresize = function() {
		if (innerWidth!=origWidth||innerHeight!=origHeight)
		location.reload()
	}
}

// detect Flash version for netscape (plugin)

var FlashInst=false;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0); if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >=  6) {FlashInst=true; } else {FlashInst=false;}
//alert(plugin.description)



// detect browser version

var agt=navigator.userAgent.toLowerCase(); 
//alert(agt);

var is_win=( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
var is_ie=(agt.indexOf("msie") != -1);
var is_mac=(agt.indexOf("mac")!=-1);
var is_mac_os9 = (agt.indexOf("mac_powerpc")!=-1 && agt.indexOf("5.1") !=-1); 
//alert (is_mac_os9);


// detect screensize for Instadia
var sw=screen.width;
var sh=screen.height;

if (sw <=800) {
	instadiaSize = 800;
} else if (sw <=1024) {
	instadiaSize = 1000;
} else {
	instadiaSize = 1025;
}

	
// screenres fuer url
//alert(sw);

if(sw<800 || sw>1300) screenres="0";
if(sw==800) screenres="1";
if(sw>1000 && sw<1280) screenres="2";
if(sw>1200 && sw<1300) screenres="3";


// resize and position window

function resizeWindow(){

	window.moveTo(0,0);
	parent.moveTo(0,0);
	window.resizeTo(400,500);
	parent.resizeTo(400,500);
	parent.resizeTo(screen.availWidth,screen.availHeight);
	self.moveTo(0,0);

}
	

// set application window to center of screen

if (screen.width>1025) {

	var myLeft = (sw-1015)/2;
	if (is_mac) { var myTop = (sh-595)/2-20; } else { var myTop = (sh-595)/2-20;	}	

} else {

	var myLeft=0;
	var myTop=50;

}

		