// JavaScript Document

var x=0;
var enable=1;
function disablescrolling() {
	enable=0;
}
function scrollit() {
	
	
	
	
	if(x<99999) {
			self.scrollTo(x,0);
			x +=1;
			if (enable == 1) {
				setTimeout("scrollit()",40);
		 	}
		  
	}

}

function hald_openwin(myfile,width,height){
	if( !width ) width = 400;
	if( !height ) height = 400;
	var now=new Date()
	winname="a" + now.getTime()
	params = "width="+width+",height="+height+ ",left=" + (screen.width/2-397).toString() + ",top=" + (screen.height/2-245).toString() + ", resizable=0,status=0,scrollbars=0,toolbar=0,location=0,directories=0,menubar=0 ";
	newwin = window.open( myfile, winname , params)
	if( window.focus ) newwin.focus();
}

function hald_openwinmovie(myfile,width,height){
	if( !width ) width = 400;
	if( !height ) height = 400;
	var now=new Date()
	winname="a" + now.getTime()
	params = "width="+width+",height="+height+ ",left=" + (screen.width/2-397).toString() + ",top=" + (screen.height/2-245).toString() + ", resizable=0,status=0,scrollbars=0,toolbar=0,location=0,directories=0,menubar=0 ";
	newwin = window.open( myfile, winname , params)
	if( window.focus ) newwin.focus();
	
	return false;
}






function getE(obj) {
	return document.getElementById(obj);
}

function changeOpacity(opacity, ID) { 
	
	oElem = getE(ID);
	oElem.style.filter = "alpha(opacity=" + opacity + ")";
	oElem.style.opacity = (opacity / 101); 
	oElem.style.MozOpacity = (opacity / 101); 
	oElem.style.KhtmlOpacity = (opacity / 101); 
	
}
var img=1;
function changeImage() { 
	setTimeout("",500000);
	oElem = getE('SampleID');
	changeOpacity(0, 'SampleID');
	switch (img) {
		case 1:
			oElem.src = 'shared/images/iffa-2.jpg';
			img = 2;
			break;
		case 2:
			oElem.src = 'shared/images/iffa-3.jpg';
			img = 3;
			break;
		case 3:
			oElem.src = 'shared/images/iffa-1.jpg';
			img = 1;
			break;
	}
		

	
	var zaehler = 0;
	var geschwindigkeit = 10; 
	
	//Bild faden
	
	for(i = 0; i <= 100; i++) { 
		setTimeout("changeOpacity("+i+", 'SampleID')",(zaehler*geschwindigkeit)); 
		zaehler++; 
	}
	
}
function resize_popup() {

	var height = document.image.height;
	var width = document.image.width;
	
	if ((width == 600 || height == 500) && height != 215 ) {
			window.resizeTo(610, 585);
	}
	if (height == 215 && (width != 600 && height != 450)){
					window.resizeTo(610, 320);
	} 
	if(width != 600 && height != 500) {
			window.resizeTo(610, 395);
	} 
}





