//Browserhandling (needed)
function cm_bwcheck(){
this.ver=navigator.appVersion
this.agent=navigator.userAgent.toLowerCase()
this.dom=document.getElementById?1:0
this.ns4=(!this.dom && document.layers)?1:0;
this.op=window.opera
this.moz=(this.agent.indexOf("gecko")>-1 || window.sidebar)
this.ie=this.agent.indexOf("msie")>-1 && !this.op
if(this.op){
this.op5=(this.agent.indexOf("opera 5")>-1 || this.agent.indexOf("opera/5")>-1)
this.op6=(this.agent.indexOf("opera 6")>-1 || this.agent.indexOf("opera/6")>-1)
this.op7=this.dom&&!this.op5&&!this.op6
}else if(this.moz) this.ns6 = 1
else if(this.ie){
this.ie4 = !this.dom && document.all
this.ie5 = (this.agent.indexOf("msie 5")>-1)
this.ie55 = (this.ie5 && this.agent.indexOf("msie 5.5")>-1)
this.ie6 = this.dom && !this.ie4 && !this.ie5 && ! this.ie55
}
this.mac=(this.agent.indexOf("mac")>-1)
this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.op5 || this.op6 || this.op7)
this.usedom= this.ns6||this.op7
this.reuse = this.ie||this.op7||this.usedom
this.px=this.dom&&!this.op5?"px":""
return this
}
var bw=new cm_bwcheck()
//Message (needed)
function cm_message(txt){alert(txt); return false}
//Pagesize (needed)
function cm_page(frame){
if(!frame) frame = self
this.x=0; this.x2 =(!bw.ie)?frame.innerWidth:frame.document.body.offsetWidth-20;
this.y=0; this.orgy=this.y2= (!bw.ie)?frame.innerHeight:frame.document.body.offsetHeight-6;
this.x50=this.x2/2; this.y50=this.y2/2; return this
}
//Flashhandling (needed)
function lib_flashcheck(){
var browser = navigator.userAgent.toLowerCase();
flashVersion = 0;
// NS3+, Opera3+, IE5+ Mac
if ( navigator.plugins != null && navigator.plugins.length > 0 ) {
var flashPlugin = navigator.plugins['Shockwave Flash'];
if ( typeof flashPlugin == 'object' ) {
if ( flashPlugin.description.indexOf('7.') != -1 ) flashVersion = 7;
else if ( flashPlugin.description.indexOf('6.') != -1 ) flashVersion = 6;
else if ( flashPlugin.description.indexOf('5.') != -1 ) flashVersion = 5;
else if ( flashPlugin.description.indexOf('4.') != -1 ) flashVersion = 4;
else if ( flashPlugin.description.indexOf('3.') != -1 ) flashVersion = 3;
}
} // IE4+ Win32 (VBscript)
else if ( browser.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && browser.indexOf("win")!= -1 && browser.indexOf("16bit")== -1 ) {
document.write('<scr' + 'ipt language="VBScript"\> \n');
document.write('on error resume next \n');
document.write('DIM obFlash \n');
document.write('SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.7") \n');
document.write('IF IsObject(obFlash) THEN \n');
document.write('flashVersion = 7 \n');
document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.6") END IF \n');
document.write('IF flashVersion < 7 and IsObject(obFlash) THEN \n');
document.write('flashVersion = 6 \n');
document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.5") END IF \n');
document.write('IF flashVersion < 6 and IsObject(obFlash) THEN \n');
document.write('flashVersion = 5 \n');
document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.4") END IF \n');
document.write('IF flashVersion < 5 and IsObject(obFlash) THEN \n');
document.write('flashVersion = 4 \n');
document.write('ELSE SET obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.3") END IF \n');
document.write('IF flashVersion < 4 and IsObject(obFlash) THEN \n');
document.write('flashVersion = 3 \n');
document.write('END IF');
document.write('</scr' + 'ipt\> \n');
} // no Flash
else {
flashVersion = -1;
}
return flashVersion;
}
var fv = lib_flashcheck()
//Cookiehandling (needed)
function lib_getcookieval (offset){
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
//Get Cookie (needed)
function lib_getcookie (name){
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen)
{
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return lib_getcookieval (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0)
break;
}
return null;
}
//Set Cookie (needed)
function lib_setcookie (name, value){
var argv = lib_setcookie.arguments;
var argc = lib_setcookie.arguments.length;
var expires = (2 < argc) ? argv[2] : null;
var path = (3 < argc) ? argv[3] : null;
var domain = (4 < argc) ? argv[4] : null;
var secure = (5 < argc) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
// Set expiration date to a year from now.
var expdate = new Date();
expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365));
//lib_setcookie("visits", visits, expdate , "/", null, false);
//Create a Pop-Up (Needed)
/*
function open_function(url,width,height,options){
self.msgWindow = open(url,"Jaguar","width=" + width + ",height=" + height
+ ",screenX=" + (screen.width)/2
+ ",screenY=" + (screen.height-height)/2
+ ",dependent=yes"
+ ",left=" + (screen.width-width)/2
+ ",top=" + (screen.height-height)/2
+ options
);
self.msgWindow.focus();
if (self.msgWindow.opener == null) self.msgWindow.opener = self;
}
*/
//Create a Pop-Up (Improved version for NS4.7)
function open_function(url,width,height,options){
var open_function_page = new cm_page();
self.msgWindow = open(url,"Jaguar","width=" + width + ",height=" + height
+ ",dependent=yes"
+ ",left=" + (open_function_page.x2-width)/2
+ ",top=" + (open_function_page.y2-height)/2
+ options
);
self.msgWindow.focus();
if (self.msgWindow.opener == null) self.msgWindow.opener = self;
}
//Change to a new Window
function open_site(x){
	if(x == ""){
		return;
	}else{
		//alert(x);
		window.location.href = x;
	}
}

