////////
// dutchmoney common scripts:
// nothing fancy, just useful. use as you see fit.
//
// www.dutchmoney.com
////////
function rollOver(imgId,imgSrc) {	
	var rollImg = document.getElementById(imgId);
	rollImg.src = imgSrc;
}

function show(obj,disp) {
	var theObj = document.getElementById(obj);
	if(arguments.length != show.length) {
		theObj.style.visibility = 'visible';
	} else {
		theObj.style.display = disp;
	} 
}

function hide(obj,disp) {
	var theObj = document.getElementById(obj);
	if (disp) {
		theObj.style.display = 'none';
	} else {
		theObj.style.visibility = 'hidden';
	}
}

function showOrHide(obj) {
	var theObj = document.getElementById(obj);
	if(theObj.style.visibility=='visible') {
		theObj.style.visibility = 'hidden';
	} else {
		theObj.style.visibility = 'visible';
	}
}

var preimages=new Array()
function preloadImages(){
	for (i=0;i<preloadImages.arguments.length;i++){
	preimages[i]=new Image();
	preimages[i].src=preloadImages.arguments[i];
	}
}

function openPopUp(popUrl,popWidth,popHeight) {
	window.open(popUrl,'dmpopup','location=no,scrollbars=yes,width=' + popWidth + ',height=' + popHeight + ',menubar=yes,toolbar=no');
}

function poppedUp(popWidth,popHeight) {
	if (popWidth && popHeight) {
		window.resizeTo(popWidth,popHeight);
	}
	window.focus();
}

function setCookie(name,value) {
	document.cookie = name + '=' +escape(value) + ';path=/;';
}

function getCookie(name) {
	var start = document.cookie.indexOf( name + '=' );
	var len = start + name.length + 1;
	if ((!start) && (name != document.cookie.substring(0,name.length ))) {
		return null;
	}
	if (start==-1) return null;
	var end = document.cookie.indexOf(';',len);
	if (end==-1) end=document.cookie.length;
	return unescape(document.cookie.substring(len,end));
}

function showOrHideByClass(srchClName,showHide) {
	var divs=document.getElementsByTagName('div'); 
	var spans=document.getElementsByTagName('span'); 
	var ps=document.getElementsByTagName('p'); 
	if (showHide==0) {
		for(var i=0;i<divs.length;i++){  
			if(divs[i].className==srchClName){
				divs[i].style.visibility='hidden';
			}
		}
		for(var i=0;i<spans.length;i++){  
			if(spans[i].className==srchClName){
				spans[i].style.visibility='hidden';
			}
		}
		for(var i=0;i<ps.length;i++){  
			if(ps[i].className==srchClName){
				ps[i].style.visibility='hidden';
			}
		}
	} else {
		for(var i=0;i<divs.length;i++){  
			if(divs[i].className==srchClName){
				divs[i].style.visibility='visible';
			}
		}
		for(var i=0;i<spans.length;i++){  
			if(spans[i].className==srchClName){
				spans[i].style.visibility='visible';
			}
		}
		for(var i=0;i<ps.length;i++){  
			if(ps[i].className==srchClName){
				ps[i].style.visibility='visible';
			}
		}
	}
}

function pngRollOver(id,newsrc) {
	tmpId = document.getElementById(id+'s');
	if (tmpId.style.filter) {
		tmpId.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src=\''+ newsrc +'\',sizingMethod=\'crop\')'
	} else {
		rollOver(id,newsrc);
	}
}