//toolset javascript library

function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.v = parseInt(navigator.appVersion)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0)
	this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0)
	if (this.ie5) this.v = 5
	this.min = (this.ns||this.ie)
}

// automatically create the "is" object
var is = new BrowserCheck()

//Globale Variablen

var selectedimgName="";
var selectedimgObj="";

function preloadImage(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()');
		eval(imgObj+'.src = "'+imgSrc+'"');
	}
}

var rollimg = Array();

for (i=0;i<=4;i++){
			rollimg['img'+i]={}
			rollimg['img'+i].hi=function (){}
			rollimg['img'+i].lo=function (){}
}
		
function RollImage_init(){
	
	for (var i=0; i < document.images.length; i++){		
		if(document.images[i].name.indexOf('img') > -1){
			rollimg[document.images[i].name] = new RollImage(document.images[i]);
		}
	}
}

function RollImage(obj){
	this.imglo = new Image();
	this.imghi = new Image();
	
	this.imglo.src = obj.src;
	this.imghi.src = obj.src.replace('_lo','_hi');
	
	this.img = obj;
	
	this.hi = RollImage_onmouseover;
	this.lo = RollImage_onmouseout;
}

function RollImage_onmouseover(){
	this.img.src = this.imghi.src;
}

function RollImage_onmouseout(){
	this.img.src = this.imglo.src;
}


function shake() { 
	if (self.moveBy){ 
		for (i = 10; i > 0; i--) { 
			for (j = 15; j > 0; j--) { 
				self.moveBy(0,i); 
				self.moveBy(i,0); 
				self.moveBy(0,-i); 
				self.moveBy(-i,0); 
			} 
		} 
	} 
} 