var browserDet = navigator.userAgent; //Login message function createStatusDiv(message){ var bodyObj = document.getElementsByTagName("body")[0]; var loginBoxObj = document.getElementById('login-box'); var errDivObj = document.getElementById('errDiv'); var posX = findPosX(loginBoxObj); var posY = findPosY(loginBoxObj); var divObj = document.createElement('DIV'); divObj.id = 'dispStatus'; if(errDivObj){ bodyObj.removeChild(errDivObj); } if(browserDet.indexOf('MSIE') > 0){ divObj.style.left = (posX + 120) + 'px'; }else{ divObj.style.left = (posX + 130) + 'px'; } divObj.style.top = (posY - 50) + 'px'; divObj.className='gryphonMsgBox'; var innerDiv = document.createElement('DIV'); innerDiv.innerHTML = message; innerDiv.className = 'innerMsgDiv'; divObj.appendChild(innerDiv); bodyObj.appendChild(divObj); } //Auth failed DIV function authFailedDiv(data){ var bodyObj = document.getElementsByTagName("body")[0]; var statusDiv = document.getElementById('dispStatus'); var loginBoxObj = document.getElementById('login-box'); var errDivObj = document.createElement('DIV'); bodyObj.removeChild(statusDiv); var posX = findPosX(loginBoxObj); var posY = findPosY(loginBoxObj); errDivObj.id='errDiv'; errDivObj.className = 'authFailedDiv' errDivObj.style.left = (posX + 380)+ 'px'; errDivObj.style.top = (posY + 50) + 'px'; var innerDivObj = document.createElement('DIV'); innerDivObj.className = 'authFailedInnerDiv'; innerDivObj.innerHTML = data; errDivObj.appendChild(innerDivObj); if(data.indexOf('inactive') < 0 ){ var imgObj = document.createElement('IMG'); imgObj.src = '/images/form-sep.gif'; imgObj.align = 'center'; errDivObj.appendChild(imgObj); var outerDivObjFP = document.createElement('DIV'); if(browserDet.indexOf('MSIE') > 0){ outerDivObjFP.style.textAlign = 'center'; }else{ outerDivObjFP.style.paddingLeft = '53px'; } outerDivObjFP.style.paddingTop = '5px'; var forgotPasswordObj = document.createElement('DIV'); forgotPasswordObj.className = 'forgotPassBut'; forgotPasswordObj.innerHTML = "Forgot your password?"; forgotPasswordObj.onclick = function(e){ errDivObj.style.visibility = 'hidden'; errDivObj.style.display = 'none'; show_forpass_div(); } outerDivObjFP.appendChild(forgotPasswordObj); errDivObj.appendChild(outerDivObjFP); } bodyObj.appendChild(errDivObj); } //After validating user data function returnAuthenication(data){ EnableDisableForm('user_login',2); document.user_login.password.value=""; if(data != "true"){ authFailedDiv(data); }else{ createStatusDiv("Logged in successfully"); if(document.user_login.gryphon_level.value ==3){ location.href="candidate_payment.php"; }else{ location.href="candidate_profile.php"; } //document.user_login.submit(); } } //Enabling and Disabling form function EnableDisableForm(frmName,flag){ var frmObj = eval('document.' + frmName); switch(flag){ case 1: for(i=0;i 1){ candidateKey = 'short_candidate_profile' + fnVars['profile_no']; profileKey = 'text_remaining_div'+ fnVars['profile_no']; }else{ candidateKey = 'short_candidate_profile'; profileKey = 'text_remaining_div'; } profileBoxObj.innerHTML = data; profileConObj.appendChild(profileBoxObj); showRemainingText(candidateKey,profileKey); if(!fnVars['showDefault']){ showHideDiv(profileBoxObj.id,0); } } function closePreviousProfile(notClose){ for(var i=1;i<=3;i++){ if(i!=notClose){ var profileBoxObj = document.getElementById('profileBox' + i); showHideDiv('profileBox'+ i,0); } } } function getavailableProfile(){ var profileBoxObj = document.getElementById('profileUploads'); var pLen = profileBoxObj.childNodes.length; var totProfile=0; for(var i=0;i -1){ totProfile++; } } return (totProfile); } function showProfileUploadBox(profile_no,addnew,showDefault){ showHideDiv('imgPreview',0); var profileBoxObj = document.getElementById('profileBox' + profile_no); var profileMsg = document.getElementById('profileMsg'); closePreviousProfile(profile_no); if(!profileBoxObj){ profileMsg.className = 'ajaxMsg roundCorners'; profileMsg.style.width = '200px'; if(addnew){ profile_no = getavailableProfile() + 1; } if(profile_no <= 3){ profileMsg.innerHTML = 'Please wait.. loading profile'; var ajaxVar = new ajaxVars(); ajaxVar.vars['profile_no'] = profile_no; ajaxVar.vars['addnew'] = addnew; ajaxVar.vars['action'] = 'runFunction'; ajaxVar.vars['func'] = 'getProfileUploadData'; ajaxVar.fnVars['profile_no'] = profile_no; ajaxVar.fnVars['showDefault'] = showDefault; ajaxVar.gotoFunction = 'returnProfileUploadBox'; ajaxVar.AjaxPostSQL(); }else{ profileMsg.style.width = '300px'; profileMsg.innerHTML = 'You cannot upload more than three profiles.'; } }else{ profileMsg.className = 'hidden'; profileBoxObj.style.visibility = 'visible'; profileBoxObj.style.display = 'block'; } } function uploadUserProfile(profileID){ showHideDiv('imgPreview',0); showHideDiv('profileBox'+ profileID,0); var profileBoxObj = document.getElementById('profileUploads'); var profileMsg = document.getElementById('profileMsg'); var profileRowObj = document.getElementById('profileDiv-' + profileID); var shortProfileKey = (profileID > 1) ? "short_candidate_profile" + profileID : "short_candidate_profile"; var txtBoxObj = document.getElementById(shortProfileKey); if(profileRowObj){ var tmpCellObj = profileRowObj.childNodes[1]; tmpCellObj.innerHTML = " " + profileID; tmpCellObj = profileRowObj.childNodes[2]; tmpCellObj.innerHTML = " " + txtBoxObj.value.substr(0,50)+'...'; profileMsg.className = 'ajaxMsg visible roundCorners'; profileMsg.innerHTML = 'Please click on submit button inorder to save the profile.'; profileMsg.style.width = '350px'; }else{ //Adding new profiles var profileRowObj = document.createElement('DIV'); profileRowObj.id = 'profileDiv-' + profileID; profileRowObj.onmouseover= function (e){ profileRowObj.style.backgroundColor = '#f2d9ec'; } profileRowObj.onmouseout= function (e){ profileRowObj.style.backgroundColor = '#ffffff'; } var divObj = document.createElement('DIV'); divObj.className = 'left profileItem'; divObj.style.width = '20px'; divObj.style.textAlign= 'center'; divObj.innerHTML = " "; profileRowObj.appendChild(divObj); divObj = document.createElement('DIV'); divObj.className = 'left profileItem'; divObj.style.width = '160px'; divObj.innerHTML = " " + profileID; profileRowObj.appendChild(divObj); divObj = document.createElement('DIV'); divObj.className = 'left profileItem'; divObj.style.width = '330px'; divObj.innerHTML = " " + txtBoxObj.value.substr(0,50); profileRowObj.appendChild(divObj); divObj = document.createElement('DIV'); divObj.className = 'left profileItem'; divObj.style.width = '90px'; divObj.style.textAlign= 'center'; divObj.innerHTML = "Edit"; profileRowObj.className = 'left profilCont'; profileRowObj.appendChild(divObj); profileBoxObj.appendChild(profileRowObj); var spacerObj = document.createElement('DIV'); spacerObj.className = 'spacerDiv'; spacerObj.style.height = '1px'; spacerObj.innerHTML = ""; spacerObj.id = 'profileSpacer-' + profileID; profileBoxObj.appendChild(spacerObj); } } function returnDeleteProfile(data,fnVars){ var profileBoxObj = document.getElementById('profileUploads'); alert(fnVars['profile_no']); var profileRowObj = document.getElementById('profileDiv-' + fnVars['profile_no']); var profileSpacerObj = document.getElementById('profileSpacer-' + fnVars['profile_no']); profileBoxObj.removeChild(profileRowObj); profileBoxObj.removeChild(profileSpacerObj); var profileMsg = document.getElementById('profileMsg'); profileMsg.style.width = '300px'; profileMsg.innerHTML = 'Profile has been deleted sucessfully.'; } function deleteCandProfile(profileId){ if(confirm('Are you sure you want to delete this profile?')){ closePreviousProfile(0); var profileMsg = document.getElementById('profileMsg'); profileMsg.innerHTML = 'Please wait.. deleting profile'; profileMsg.style.width = '200px'; profileMsg.className = 'ajaxMsg visible'; var ajaxVar = new ajaxVars(); ajaxVar.vars['profile_no'] = profileId; ajaxVar.vars['action'] = 'runFunction'; ajaxVar.vars['func'] = 'deleteUserProfile'; ajaxVar.fnVars['profile_no'] = profileId; ajaxVar.gotoFunction = 'returnDeleteProfile'; ajaxVar.AjaxPostSQL(); } } function returnContactForm(data){ var divObj = document.getElementById('contactForm'); divObj.innerHTML = "

Thank you very much for your message. We will be in touch as soon as possible.

"; } function sendContactEmail(inlineObj){ var ajaxVar = new ajaxVars(); var frmObj = eval('document.' + inlineObj.formName); ajaxVar.vars['first_name'] = frmObj.first_name.value; ajaxVar.vars['last_name'] = frmObj.last_name.value; ajaxVar.vars['email'] = frmObj.email.value; ajaxVar.vars['message'] = frmObj.message.value; ajaxVar.vars['action'] = 'runFunction'; ajaxVar.vars['func'] = 'sendContactEmail'; ajaxVar.gotoFunction = 'returnContactForm'; ajaxVar.AjaxPostSQL(); }