function showmenu(id,type,color){
	if (type==1){
		document.getElementById('menu'+id).style.display = "block";
		document.getElementById('item'+id).style.background = color;
	} else {
		document.getElementById('menu'+id).style.display = "none";
		document.getElementById('item'+id).style.background = color;
	}
}
function PopupPic(sPicURL) {
	 window.open( "popup.html?"+sPicURL, "",  
	 "menubar=0,location=0,directories=0,status=0,toolbar=0,resizable=1,scrollbars=1,HEIGHT=200,WIDTH=200");
}
function openwin(url){
	openWinDyn(url,600,800);
}

function openWinDyn(url,wi,he){
	open(url,"pag", "width=" + wi + ",height="+he+",location=0,menubar=0,resizable=1,scrollbars=1,status=1,titlebar=1,toolbar=0,screenX=100,left=100,screenY=30,top=60");
}

function isInteger(s)
{   var i;
	for (i = 0; i < s.length; i++)
	{   
		// Check that current character is number.
		var c = s.charAt(i);
		if (((c < "0") || (c > "9"))) return false;
	}
	// All characters are numbers.
	return true;
}

// return the value of the radio button that is checked
// return an empty string if none are checked, or
// there are no radio buttons
function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}
