function wiggle() {
	//sx = window.screenX;
	//sy = window.screenY;
	window.innerWidth +=1; 
	window.innerWidth -=1;
	//window.screenX = sx;
	//window.screenY = sy;
}

function doSubmit(theForm){
	theForm.submit();
}

function openPopup(url,titel,w,h)
{
	w = parseInt(w);
	h = parseInt(h);
	popup=window.open("","","width=200,height=200,status=no,scrollbars=no,resizable=no");		popup.document.write("<html><head><title>"+titel+"</title></head><body></body></html>");
	
	/*	
	msgWindow=window.open("","displayWindow","menubar=yes") 
	msgWindow.document.write ("<HEAD><TITLE>Messagewindow</TITLE></HEAD>") 
	msgWindow.document.write ("<CENTER><BIG><B>Hello,world!</B></BIG></CENTER>")
	*/
}

function checkIfLoaded(t) {
	t.style.visibility="visible";
	if (t.complete) {
		document.getElementById("loadingMsg").style.display="none";
		t.style.visibility="visible";
		window.innerWidth +=1; 
		window.innerWidth -=1;
		window.clearInterval(intID);
	}
	// this is for safari. it doesn't understand complete. :(
	else if (t.complete == undefined) {
		window.clearInterval(intID);
	}
}

function replacePhoto(url,target) {
	var t = document.getElementById(target);
	document.getElementById("loadingMsg").style.display="block";
	t.style.visibility="hidden";
	t.src = url;
	
	t.onload = function() {
		//alert("loaded!");
		this.style.visibility="visible";
		document.getElementById("loadingMsg").style.display="none";
		//wiggling window for FireFox 1.0.2. 
		//it has a bug in that it doesn't adjust div's dimensions when replacing content via js
		window.innerWidth +=1;
		window.innerWidth -=1;
		window.clearInterval(intID);
		//location.hash = "bilder";
		//window.scrollTo(window.pageXOffset,400);
	}
	window.intID = window.setInterval(checkIfLoaded,500,t);
}

// mac IE5 fix for floats
function fixmacie(classname){        
var divs=document.getElementsByTagName("DIV");   
  for(var d=0; d < divs.length;d++){     
 if(divs[d].className.indexOf(classname)==0){    
 divs[d].innerHTML+= "<div class='mac-clearfix'> </div>"; 
/* The above html tags get added to the end of 
the cleared container if the browser is IE/mac. */  
 } } }
function init(){
/* Check if the browser is IE5 Mac */
   if( navigator.appVersion.indexOf('Mac')!=-1 && document.all){     
/* Pass the class name on the container to fixmacie 
(must be the FIRST classname if multiple classnames 
are used on the div!) */    
/* changes by cmyk: 
	the following line could be changed to macclearfix.
	because DW2004 and Contribute choke on the cleafix:after method.
*/
 fixmacie("clearfix");  
 } }
/* start the ball rolling when the page loads */
window.onload=init;

