function handleError()
{
return true;
}
function checkreview() 
{
		var cname=document.review.companyname
		var clocation=document.review.location
		var curl=document.review.companyurl
		var comment=document.review.comments
		
		if((cname.value=="")||(cname.value==' ')||(cname.value=='Company Name')||(cname.value==null))
		{
		   document.getElementById("lblcompanyname").style.color="red"
		   cname.focus()	
		   return false
		}
		else{document.getElementById("lblcompanyname").style.color="black"}
		if((clocation.value=="")||(clocation.value==' ')||(clocation.value=='City')||(clocation.value==null))
		{
		   document.getElementById("lbllocation").style.color="red"
		   clocation.focus()	
		   return false
		}
		else{document.getElementById("lbllocation").style.color="black"}
		if((curl.value=="")||(curl.value==' ')||(curl.value=='Company URL')||(curl.value==null))
		{
		   document.getElementById("lblcompanyurl").style.color="red"
		   curl.focus()	
		   return false
		}
		else{document.getElementById("lblcompanyurl").style.color="black"}
		if((comment.value=="")||(comment.value==' ')||(comment.value==null))
		{
		   document.getElementById("lblcomments").style.color="red"
		   comment.focus()	
		   return false
		}
		else{document.getElementById("lblcomments").style.color="black"}
return true					
}
function checkresponse()
{
	var rname=document.frmresponse.ResponderName
	var resp=document.frmresponse.Response
	if((rname.value=="")||(rname.value==' ')||(rname.value==null))
	{
	   document.getElementById("lblResponderName").style.color="red"
	   rname.focus()	
	   return false
	}
	else{document.getElementById("lblResponderName").style.color="black"}
	if((resp.value=="")||(resp.value==' ')||(resp.value==null))
	{
	   document.getElementById("lblResponse").style.color="red"
	   resp.focus()	
	   return false
	}
	else{document.getElementById("lblResponse").style.color="black"}
return true						
}



function isAlpha(evt)
{
 var charCode = (evt.which) ? evt.which : event.keyCode
 if ((charCode > 32 && charCode < 65)||(charCode > 90 && charCode < 97)||(charCode > 122 && charCode < 127))
	return false;

 return true;
}


function isNumberKey(evt)
{
 var charCode = (evt.which) ? evt.which : event.keyCode
 if (charCode > 31 && (charCode < 48 || charCode > 57))
	return false;

 return true;
}
//Function that prompts for confirmation tro delete Albums
function confirmdelalbum()
{
		var r=confirm("This would delete the selected album(s) and any photos in the shopping cart!")
  if (r==true)
    {
    return true;
    }
  else
    {
    	return false;
    }
}
function confirmdelpics()
{
			var r=confirm("This would delete the selected picture(s) from the album and your shopping cart!")
			if (r==true)
					{
					return true;
					}
			else
					{
						return false;
					}
}
function confirmcancelorder()
{
			var r=confirm("Are you sure you want to cancel this order?")
			if (r==true)
					{
					return true;
					}
			else
					{
						return false;
					}
}
function confirmdelpicsfromcart()
{
			var r=confirm("This would remove the selected picture(s) from your shopping cart!")
			if (r==true)
					{
					return true;
					}
			else
					{
						return false;
					}
}
function confirmdelcard()
{
		var r=confirm("This would delete the selected card(s). It will be removed from the shopping cart if present!")
  if (r==true)
    {
    return true;
    }
  else
    {
    	return false;
    }
}
function confirmdelcalendar()
{
  var r=confirm("This would delete the selected calendar(s). It will be removed from the shopping cart if present!")
  if (r==true)
    {
    return true;
    }
  else
    {
    	return false;
    }
}
function confirmdelbook()
{
		var r=confirm("This would delete the selected book(s). It will be removed from the shopping cart if present!")
  if (r==true)
    {
    return true;
    }
  else
    {
    	return false;
    }
}
//Function that verifies the Number of prints in the Qquick order section of Orderprints1.php is not Null
function isNop(val) 
{
if((val=="")||(val==' ')||(val==null))
{
	return false
}
else
{
	return true
}
}
//Function that verifies an address has been selected from teh addressbook listing
function valaddbook()
{
if (addressbook.addressradiobutton.checked)
{		
			//alert( addressbook.addressradiobutton.value );
			return true
}
for (i = 0;  i < addressbook.addressradiobutton.length;  i++)
{
   if (addressbook.addressradiobutton[i].checked)
			{
			//alert( addressbook.addressradiobutton[i].value );
			return true
			}
}
return false
}
///to check if pics are selected before order
function valpicselection()
{

if (document.showalbum.filename.checked)
			{
			return true
   //alert(document.showalbum.filename[i].value );
			}
for (i = 0;  i < document.showalbum.filename.length;  i++)
{
   if (document.showalbum.filename[i].checked)
			{
			return true
   //alert(document.showalbum.filename[i].value );
			}
}
return false
}

//Function that Album Name is not empty in Create Album utility
function checkalbum(val)
{
if((val=="")||(val==' ')||(val=='/')||(val=='-')||(val=='_')||(val==null))
{
///[A-Za-z0-9]/
		document.getElementById("lblalbum").style.color="red"
		alert("Invalid Album Name");
 	return false
}
}

//Function to validate teh changepassword utility in Personal.php
function checkpass() 
{
	var opwd=document.changepass.oldpwd
	var npwd=document.changepass.newpwd
	var pwd=document.changepass.cfmpwd
	if((opwd.value=="")||(opwd.value==' ')||(opwd.value==null))
	{
	   document.getElementById("lbloldpwd").style.color="red"
	   return false
	}
	else
		document.getElementById("lbloldpwd").style.color="black"
	if((npwd.value=="")||(npwd.value==' ')||(npwd.value==null))
	{
	   document.getElementById("lblnewpwd").style.color="red"
	   return false
	}
	else
		document.getElementById("lblnewpwd").style.color="black"
	if((pwd.value=="")||(pwd.value==' ')||(pwd.value==null))
	{
	   document.getElementById("lblcpwd").style.color="red"
	   return false
	}
	else
		document.getElementById("lblcpwd").style.color="black"
}

//Function that validates shipping address 
function check() 
{
	var add1=document.address.add1
	var city=document.address.city
	var state=document.address.state
	var pincode=document.address.pincode
	var phone=document.address.phone
	
	if((add1.value=="")||(add1.value==' ')||(add1.value==null))
	{
	   document.getElementById("lbladd1").style.color="red"
	   add1.focus()	
	   return false
	}
	else{document.getElementById("lbladd1").style.color="black"}
	
	if((city.value=="")||(city.value==' ')||(city.value==null))
	{
	   document.getElementById("lblcity").style.color="red"
	   city.focus()	
	   return false
	}
	else{document.getElementById("lblcity").style.color="black"}
	
	if((state.value=="")||(state.value==' ')||(state.value==null))
	{
	   document.getElementById("lblstate").style.color="red"
	   state.focus()	
	   return false
	}
	else{document.getElementById("lblstate").style.color="black"}
	
	if((pincode.value=="")||(pincode.value==' ')||(pincode.value==null))
	{
	   document.getElementById("lblpincode").style.color="red"
	   pincode.focus()	
	   return false
	}
	else{document.getElementById("lbladd1").style.color="black"}
	
	if((add1.value=="")||(add1.value==' ')||(add1.value==null))
	{
	   document.getElementById("lbladd1").style.color="red"
	   add1.focus()	
	   return false
	}
	else{document.getElementById("lbladd1").style.color="black"}
	
	return true
}