function morph(elem,className) {
	var myEffect = new Fx.Morph(elem, {duration: 500, transition: Fx.Transitions.Sine.easeOut});
	myEffect.start(className);
}


function swapImg(el,which){
 	el.src=el.getAttribute(which||"origsrc");
}

function swapImgSetup(){
	var x = document.getElementsByTagName("img");
	for (var i=0;i<x.length;i++){
		var origsrc = x[i].getAttribute("origsrc");
		if (!origsrc) x[i].setAttribute("origsrc",x[i].src);
		var oversrc = x[i].getAttribute("oversrc");
		if (!oversrc) continue;
		// preload image
		x[i].oversrc_img = new Image();
		x[i].oversrc_img.src=oversrc;
		// set event handlers
		x[i].onmouseover =function() { swapImg(this,'oversrc'); }// new Function("swapImg(this,'oversrc');");
		x[i].onmouseout = function() { swapImg(this,'origsrc'); }//new Function("");
	}
}

var PreswapImgOnload =(window.onload)? window.onload : function(){};
window.onload = function(){PreswapImgOnload(); swapImgSetup();}

// AJAX CALLS
function do_ajax_HTML(options) {
	if (options['cache']!=true) {
		var i=options['url'].indexOf('?',0)+options['url'].indexOf('&',0); // komt er een & of ? voor?
		if (i>-2){
			options['url']=options['url']+'&';
		} else options['url']=options['url']+'?';
		options['url']=options['url']+'randcachevar='+(new Date()).getTime();
		options.url
	}
	var myHTMLRequest = new Request.HTML(options);
	myHTMLRequest.setHeader('X-Request','text/xhtml');
	myHTMLRequest.get();
}

function do_ajax_HTML_post(options,formID) {
	var myHTMLRequest = new Request.HTML(options);
	myHTMLRequest.post($(formID));
}

function expand(thistag)
{
	styleObj = document.getElementById(thistag).style;
	if (styleObj.display=='none')
	{
		styleObj.display ='block';
	} else
	{
		styleObj.display ='none';
	}
}

function setBookmark(url,str){
	if(str=='')str=url;
	if (document.all)window.external.AddFavorite(url,str);
	else alert('Press CTRL and D to add a bookmark to:\n"'+url+'".');
}
