// JavaScript Document
function checkSearch(){
	//alert("sg");
	//alert(document.searchForm.image.value);
	if((document.searchForm.searchName.value=="")&&(document.searchForm.category.value=="")&&(document.searchForm.locId.value=="")){
	alert("Please select atleast one");
	return false;
   }
}
function checkSearch1(){
	//alert("sg");
	//alert(document.searchForm.image.value);
	if((document.searchForm.searchName.value=="")&&(document.searchForm.specId.value=="")&&(document.searchForm.locId.value=="")){
	alert("Please select atleast one");
	return false;
   }
}
function showPhotoDoc(docId) {
	sWidth = screen.availWidth;
	sHeight = screen.availHeight;
	
	winWidth =  430;
	winHeight = 430;
	
	sLeft = (sWidth - winWidth) / 2;
	sTop = (sHeight - winHeight) / 2;
	
	window.open("showShop.php?docId=" + docId, "DoctorPhoto", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0");
	return;
}
function checkpageUpdate() {
    if(!confirm("Do you really want to update the contents?")) {
		return;
	}
	else {
	 document.forms[0].frmAdd.value = "ADD";
	}
}
function deletePhotoDoc(docId) {
	if(!confirm("Do you really want to delete the photograph?")) {
		return;
	}
	else {
		document.forms[0].frmAction.value = "deletePhotoDoc";
		document.forms[0].submit();
		return;
	}
}

function checkEditDoctor(){
	document.forms[0].docName.value = trimSpaces(document.forms[0].docName.value);
	if(document.forms[0].docName.value.length <= 0) {
		alert("Please enter the name of shop");
		document.forms[0].docName.focus();
		return false;
	}
		document.forms[0].docEmail.value = trimSpaces(document.forms[0].docEmail.value);
	if(document.forms[0].docEmail.value.length <= 0) {
		alert("Please enter the email of shop");
		document.forms[0].docEmail.focus();
		return false;
	}
		document.forms[0].docEmail.value = trimSpaces(document.forms[0].docEmail.value);
	if(document.forms[0].docEmail.value.length > 0) {
		if(!isValidEmail(document.forms[0].docEmail.value)) {
			alert("Please enter a valid email");
			document.forms[0].docEmail.select();
			return false;
		}
	}
	if(document.forms[0].docAddress.value.length <= 0) {
		alert("Please enter the address of shop");
		document.forms[0].docAddress.focus();
		return false;
	}
	if(document.forms[0].docPhone.value.length <= 0) {
		alert("Please enter the phone number of shop");
		document.forms[0].docPhone.focus();
		return false;
	}
	/*	if(document.forms[0].docMobile.value.length <= 0) {
		alert("Please enter the mobile number of shop");
		document.forms[0].docMobile.focus();
		return false;
	}
		if(document.forms[0].docDetails.value.length <= 0) {
		alert("Please enter the details");
		document.forms[0].docDetails.focus();
		return false;
	}*/

    if(document.forms[0].photo1.value.length <= 0) {	
		document.forms[0].photo.value = trimSpaces(document.forms[0].photo.value);
	if(document.forms[0].photo.value.length <= 0) {
		alert("Please select a photograph");
		document.forms[0].photo.focus();
		return false;
	}
	}

		document.forms[0].frmAction.value = "process";
}
function checkLogin() {
	document.loginForm.userName.value = trimSpaces(document.loginForm.userName.value);
	if(document.loginForm.userName.value.length <= 0) {
    alert("Please enter the username");
		document.loginForm.userName.focus();
		return false;
	}
	document.loginForm.userPassword.value = trimSpaces(document.loginForm.userPassword.value);
	if(document.loginForm.userPassword.value.length <= 0) {
		alert("Please enter password");
		document.loginForm.userPassword.focus();
		return false;
	}
}

