function showOrHideSingle(id){
	var item= document.getElementById(id);
	if (item.style.display == "none"){
		item.style.display = 'block';
		movePicSingle("img"+id, "img/minus.gif");	
	} else {
		item.style.display = 'none';
		movePicSingle("img"+id, "img/plus.gif");
	}
	resetHack();
}

function movePicSingle(id, img_src){
	var pic = document.getElementById(id);
	pic.src = img_src;
}


function resetHack()
{
	// This is a HACK to ensure that the height of the main div is set properly after 
	// each expand/collapse of an expandable block in (such as in a detailed report page).
	// This HACK is necessary for Firefox & Netscape, but not for IE.
	var mainDiv = document.getElementById("overflowDiv");
	// if there is no side nav, then skip this step
	if (mainDiv) {
		var temp = mainDiv.className;
		mainDiv.className="junk";
		mainDiv.className=temp;
	}
}

/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}

	function validateEmail(emailID){
		if ((emailID.value==null)||(emailID.value=="")){
			alert("Please Enter your Email ID")
			emailID.focus()
			return false
		}
		if (echeck(emailID.value)==false){
			emailID.focus()
			return false
		}
		return true
	}
	
	
	function validateStrField(obj){
		if ((obj.value==null)||(obj.value=="")){
			alert("Please Enter your "+obj.title+".");
			obj.focus()
			return false
		}
		return true;
	}
	
		
	function openPhoto(url) {
		newwindow=window.open(url,'name','height=800,width=870');
		if (window.focus) {newwindow.focus()}
		return false;
	}