function showPicture(galleryid, photoType) { sWidth = screen.availWidth; sHeight = screen.availHeight; winWidth = 600; winHeight = 500; sLeft = (sWidth - winWidth) / 2; sTop = (sHeight - winHeight) / 2; window.open("showPictureFrame.php?galleryid=" + galleryid + "&photoType=" + photoType, "sudhirFullPicture", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0"); return; } function showInterview(newsid) { sWidth = screen.availWidth; sHeight = screen.availHeight; winWidth = 600; winHeight = 500; sLeft = (sWidth - winWidth) / 2; sTop = (sHeight - winHeight) / 2; window.open("showInterviewFrame.php?newsid=" + newsid, "fullInterview", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0"); return; } function closeWindow() { parent.window.opener.window.focus(); parent.window.close(); } function printWindow() { parent.mainFrame.focus(); window.print(parent.mainFrame); } function showNews(newsid, pagetype) { sWidth = screen.availWidth; sHeight = screen.availHeight; winWidth = 600; winHeight = 500; sLeft = (sWidth - winWidth) / 2; sTop = (sHeight - winHeight) / 2; if(pagetype == "home") { pageurl = "showNewsFrame.php?newsid=" + newsid; } else { pageurl = "newsFrame.php?newsid=" + newsid; } window.open(pageurl, "newsWindow", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0"); return; } function showMedia(newsid, pagetype) { sWidth = screen.availWidth; sHeight = screen.availHeight; winWidth = 600; winHeight = 500; sLeft = (sWidth - winWidth) / 2; sTop = (sHeight - winHeight) / 2; if(pagetype == "home") { pageurl = "showMediaFrame.php?newsid=" + newsid; //alert(pageurl); } else { pageurl = "mediaFrame.php?newsid=" + newsid; } window.open(pageurl, "mediaWindow", "width=" + winWidth + ",height=" + winHeight + ",top=" + sTop + ",left=" + sLeft + ",toolbar=0,menubar=0,status=0,scrollbars=1,resizable=0"); return; } function checkFeedBack() { document.forms[0].visitorName.value = trimSpaces(document.forms[0].visitorName.value); if(document.forms[0].visitorName.value.length <= 0) { alert("Please enter your name"); document.forms[0].visitorName.focus(); return false; } document.forms[0].emailAddress.value = trimSpaces(document.forms[0].emailAddress.value); if(document.forms[0].emailAddress.value.length <= 0) { alert("Please enter your email address"); document.forms[0].emailAddress.focus(); return false; } if(!checkEmail(document.forms[0].emailAddress.value)) { document.forms[0].emailAddress.focus(); document.forms[0].emailAddress.select(); return false; } document.forms[0].visitorComments.value = trimSpaces(document.forms[0].visitorComments.value); if(document.forms[0].visitorComments.value.length <= 0) { alert("Please enter your comments"); document.forms[0].visitorComments.focus(); return false; } document.forms[0].frmAction.value = "update"; } function checkContact() { visitorName = trimSpaces(document.forms[0].visitorName.value); visitorEmail = trimSpaces(document.forms[0].visitorEmail.value); visitorPhone = trimSpaces(document.forms[0].visitorPhone.value); visitorComments = trimSpaces(document.forms[0].visitorComments.value); if(visitorName.length <= 0) { alert("Please provide your name before submitting the form"); document.forms[0].visitorName.focus(); return false; } if(visitorEmail.length <= 0) { alert("Please provide your email address before submitting the form"); document.forms[0].visitorEmail.focus(); return false; } if(!checkEmail(visitorEmail)) { document.forms[0].visitorEmail.focus(); return false; } if(visitorComments.length <= 0) { alert("Please mention your queries or suggestions before submitting the form"); document.forms[0].visitorComments.focus(); return false; } document.forms[0].frmAction.value = "send"; } //Checking the login form for the diamond inventory and prices function checkLoginForm() { userName = trimSpaces(document.forms[0].userName.value); password = trimSpaces(document.forms[0].password.value); if(userName.length <= 0) { alert("Please provide your User Name"); document.forms[0].userName.focus(); return false; } if(password.length <= 0) { alert("Please provide your Password"); document.forms[0].password.focus(); return false; } document.forms[0].frmAction.value="login"; document.forms[0].submit(); } function checkRegistration(action) { if(action=="sub") { username = document.forms[0].username.value; if(username.length <= 0) { alert("Enter your username"); document.forms[0].username.focus(); return false; } if(username.length < 6) { alert("Enter username between 6 to 20 characters"); document.forms[0].username.focus(); return false; } password = trimSpaces(document.forms[0].password.value); if(password.length <= 0) { alert("Enter your password"); document.forms[0].password.focus(); return false; } if(password.length < 6) { alert("Enter password between 6 to 20 characters"); document.forms[0].password.focus(); return false; } repassword = trimSpaces(document.forms[0].repassword.value); if(password != repassword) { alert("Your passwords does not match"); document.forms[0].password.focus(); return false; } document.forms[0].lastName.value=trimSpaces(document.forms[0].lastName.value); if(document.forms[0].lastName.value.length<=0) { alert("Enter your Last Name"); document.forms[0].lastName.focus(); return false; } document.forms[0].firstName.value=trimSpaces(document.forms[0].firstName.value); if(document.forms[0].firstName.value.length<=0) { alert("Enter your First Name"); document.forms[0].firstName.focus(); return false; } document.forms[0].email.value=trimSpaces(document.forms[0].email.value); if(document.forms[0].email.value.length<=0) { alert("Enter Email Id"); document.forms[0].email.focus(); return false; } else { if(!checkEmail(document.forms[0].email.value)) { document.forms[0].email.focus(); return false; } } address = trimSpaces(document.forms[0].address.value); if(address.length <= 0) { alert("Enter your address"); document.forms[0].address.focus(); return false; } document.forms[0].city.value=trimSpaces(document.forms[0].city.value); if(document.forms[0].city.value.length<=0) { alert("Enter your City"); document.forms[0].city.focus(); return false; } document.forms[0].state.value=trimSpaces(document.forms[0].state.value); document.forms[0].state1.value=trimSpaces(document.forms[0].state1.value); if(document.forms[0].state.value.length<=0) { if(document.forms[0].state1.value.length <= 0) { alert("Enter your State"); document.forms[0].state1.focus(); return false; } } document.forms[0].zip.value=trimSpaces(document.forms[0].zip.value); if(document.forms[0].zip.value.length<=0) { alert("Enter your Zip Code"); document.forms[0].zip.focus(); return false; } document.forms[0].phoneC.value=trimSpaces(document.forms[0].phoneC.value); if(document.forms[0].phoneC.value.length<=0) { alert("Enter your Area Code"); document.forms[0].phoneC.focus(); return false; } document.forms[0].phoneN.value=trimSpaces(document.forms[0].phoneN.value); if(document.forms[0].phoneN.value.length<=0) { alert("Enter your Phone Number"); document.forms[0].phoneN.focus(); return false; } document.forms[0].frmAction.value="update"; document.forms[0].submit(); } } function checkOut() { document.forms[0].action="showRegForm.php"; document.forms[0].submit(); } function checkRegForm() { first_name=trimSpaces(document.forms[0].first_name.value); last_name =trimSpaces(document.forms[0].last_name.value); address =trimSpaces(document.forms[0].address.value); city =trimSpaces(document.forms[0].city.value); zip =trimSpaces(document.forms[0].zip.value); phoneC =trimSpaces(document.forms[0].phoneC.value); phoneN =trimSpaces(document.forms[0].phoneN.value); email =trimSpaces(document.forms[0].email.value); if(first_name.length<=0) { alert("Please Enter your first name"); document.forms[0].first_name.focus(); return false; } if(last_name.length<=0) { alert("Please Enter your last name"); document.forms[0].last_name.focus(); return false; } if(address.length<=0) { alert("Please Enter the address"); document.forms[0].address.focus(); return false; } if(city.length<=0) { alert("Please Enter the city"); document.forms[0].city.focus(); return false; } if(zip.length<=0) { alert("Please Enter the zip"); document.forms[0].zip.focus(); return false; } if(phoneC.length<=0) { alert("Please Fill the Area code"); document.forms[0].phoneC.focus(); return false; } if(phoneN.length<=0) { alert("Please Enter the telephone number"); document.forms[0].phoneN.focus(); return false; } if(email.length<=0) { alert("Please Enter the email"); document.forms[0].email.focus(); return false; } document.forms[0].frmAction.value="update"; }