/*  $URL$  $Date$  $Revision$  $Author$  */

Array.prototype.contains = function (element) {
	for (var i = 0; i < this.length; i++) {
		if (this[i] == element) {
			return true;
		}
	}
	return false;
};


function getParamStr( avoidKeys ) {
	var paramStr = "";
	//var firstParam = true;
	var query = window.location.search.substring(1);
	var params = query.split('&');
	for (var i=0; i<params.length; i++) {
		var pos = params[i].indexOf('=');
		if (pos > 0) {
			var key = params[i].substring(0,pos);
			var val = params[i].substring(pos+1);
			if(!avoidKeys.contains(key)) {
				paramStr = paramStr + "&" + key + "=" + val;
			}
		}
	}
	return paramStr;
	
}


function openPopUp(popurl, width, height) {
	winpops = window.open(popurl,"","width=" + width + ",height=" + height + ",scrollbars,resizable,toolbar=no,menu=no")
}


function showhide( elementID ){
	//alert("elementID="+elementID);
	if (document.layers){
		current = (document.layers[elementID].display == 'none') ? 'block' : 'none';
		document.layers[elementID].display = current;
		//alert("current="+current);
		if(current == "none") {
			document.layers['hideMsg'].display = 'none';
			document.layers['showMsg'].display = 'inline';
		}
		else {
			document.layers['hideMsg'].display = 'inline';
			document.layers['showMsg'].display = 'none';
		}
	}else if (document.all){
		current = (document.all[elementID].style.display == 'none') ? 'block' : 'none';
		document.all[elementID].style.display = current;
		if(current == "none") {
			document.all['hideMsg'].style.display = 'none';
			document.all['showMsg'].style.display = 'inline';
		}
		else {
			document.all['hideMsg'].style.display = 'inline';
			document.all['showMsg'].style.display = 'none';
		}
	}
	else if (document.getElementById){
		obj = document.getElementById(elementID);
		hideMsgStyle = document.getElementById('hideMsg').style;
		showMsgStyle = document.getElementById('showMsg').style;
		if (obj.style.display == "none"){
			hideMsgStyle.display = "inline";
			showMsgStyle.display = "none";
			obj.style.display = "block";
		} else {
			showMsgStyle.display = "inline";
			hideMsgStyle.display = "none";
			obj.style.display = "none";
		}
	}
	
}

function clearForm() {
	self.location = location.pathname;
	return false;
}


