'); getResumeFiles(resumeid, "chosenFiles", "popup"); } var inputs = jQuery("#fileSelectionButton").children("input").length; if (inputs == 0) { var postMaxSize = 250; var memoryLimit = 256; var maxResumeFiles = '5'; var maxDocumentSize = '500'; var fileTypes = 'txt,doc,docx,Pdf,opt,rtf'; var clearFilesLang = "Clear files"; var juriPath = "http://pipingdesigners.com/"; var fileRejLang = "This file will be rejected"; var errorLang = "Error"; var extMissLang = "File extension mismatched"; var sizeExceedLang = "Maximum size limit exceeded"; var andSizeExceedLang = "And file size exceeded"; var filesLimitExceedLang = "Maximum resume files limit occurred"; var noFileLang = "No File Selected"; addNewResumeInput(postMaxSize, memoryLimit, maxResumeFiles, maxDocumentSize, fileTypes, fileRejLang, clearFilesLang, errorLang, extMissLang, sizeExceedLang, andSizeExceedLang, filesLimitExceedLang, noFileLang, juriPath); } }); } function getResumeFiles(resumeid, src, filesfor) { jQuery.post('http://pipingdesigners.com/index.php?option=com_jsjobs&c=resume&task=getresumefiles', {resumeid: resumeid, filesfor: filesfor}, function (data) { if (data) { if (jQuery.trim(data).length == 0) { if (resumeid == -1) { jQuery('#' + src).remove(); } else { jQuery('#' + src).append("No uploaded file found"); } } else { jQuery("#" + src).append(data); } } else { //alert("Error occurred while getting resume uploaded resume files"); } }); } function deleteResumeFile(fileid, resumeid) { var confirmDelete = confirm("Confirm to delete resume file?"); if (confirmDelete == false) { return false; } jQuery("#ajax-loader").show(); jQuery.post('http://pipingdesigners.com/index.php?option=com_jsjobs&c=resume&task=deleteresumefiles', {fileid: fileid, resumeid: resumeid}, function (data) { if (data) { jQuery("#existingFiles span#" + fileid).remove(); jQuery("#chosenFiles div#" + fileid).remove(); } else { alert("Error occurred while deleting resume file"); } }); jQuery("#ajax-loader").hide(); } function getTokenInput(datafor, cityid, cityname) { var inputfor = datafor[0]; var sectionid = datafor[1]; var city = jQuery("#" + inputfor + "cityforedit_"+sectionid).val(); if (city != "") { jQuery("#" + inputfor + "_city_"+sectionid).tokenInput('http://pipingdesigners.com/index.php?option=com_jsjobs&c=cities&task=getaddressdatabycityname', { theme: "jsjobs", preventDuplicates: true, hintText: "Type In A Search", noResultsText: "No Results", searchingText: "Searching...", tokenLimit: 1, prePopulate: [{id: cityid, name: cityname}], onResult: function (item) { if (jQuery.isEmptyObject(item)) { return [{id: 0, name: jQuery("tester").text()}]; } else { //add the item at the top of the dropdown item.unshift({id: 0, name: jQuery("tester").text()}); return item; } }, onAdd: function (item) { if (item.id > 0) { return; } if (item.name.search(",") == -1) { var input = jQuery("tester").text(); msg = "Location format is not correct please enter city in this format
City Name, Country Name
or
City Name, State Name, Country Name"; jQuery("#" + inputfor + "_city_"+sectionid).tokenInput("remove", item); jQuery("div#warn-message").find("span.text").html(msg).show(); jQuery("div#warn-message").show(); jQuery("div#black_wrapper_jobapply").show(); return false; } else { var location_data = jQuery("tester").text(); var geocoder = new google.maps.Geocoder(); geocoder.geocode( { 'address': location_data}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { var n_latitude = results[0].geometry.location.lat(); var n_longitude = results[0].geometry.location.lng(); jQuery.post("http://pipingdesigners.com/index.php?option=com_jsjobs&task=cities.savecity&9e64fff5547ac951f7785cf517b9c7d4=1", {citydata: location_data,latitude: n_latitude,longitude: n_longitude}, function (data) { if (data) { try { var value = jQuery.parseJSON(data); jQuery('#' + inputfor + '_city_'+sectionid).tokenInput('remove', item); jQuery('#' + inputfor + '_city_'+sectionid).tokenInput('add', {id: value.id, name: value.name,latitude:value.latitude,longitude:value.longitude}); } catch (e) { // string is not the json its the message come from server msg = data; jQuery("div#warn-message").find("span.text").html(msg).show(); jQuery("div#warn-message").show(); jQuery("div#black_wrapper_jobapply").show(); jQuery('#' + inputfor + '_city_'+sectionid).tokenInput('remove', item); } } }); } else { alert("Something got wrong"+status); } }); } } }); } else { jQuery("#" + inputfor + "_city_"+sectionid).tokenInput('http://pipingdesigners.com/index.php?option=com_jsjobs&c=cities&task=getaddressdatabycityname', { theme: "jsjobs", preventDuplicates: true, hintText: "Type In A Search", noResultsText: "No Results", searchingText: "", tokenLimit: 1, onResult: function (item) { if (jQuery.isEmptyObject(item)) { return [{id: 0, name: jQuery("tester").text()}]; } else { //add the item at the top of the dropdown item.unshift({id: 0, name: jQuery("tester").text()}); return item; } }, onAdd: function (item) { if (item.id > 0) { return; } if (item.name.search(",") == -1) { var input = jQuery("tester").text(); msg = "Location format is not correct please enter city in this format
City Name, Country Name
or
City Name, State Name, Country Name"; jQuery("#" + inputfor + "_city_"+sectionid).tokenInput("remove", item); jQuery("div#warn-message").find("span.text").html(msg).show(); jQuery("div#warn-message").show(); jQuery("div#black_wrapper_jobapply").show(); return false; } else { var location_data = jQuery("tester").text(); var geocoder = new google.maps.Geocoder(); geocoder.geocode( { 'address': location_data}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { var n_latitude = results[0].geometry.location.lat(); var n_longitude = results[0].geometry.location.lng(); jQuery.post("http://pipingdesigners.com/index.php?option=com_jsjobs&task=cities.savecity&9e64fff5547ac951f7785cf517b9c7d4=1", {citydata: location_data,latitude: n_latitude,longitude: n_longitude}, function (data) { if (data) { try { var value = jQuery.parseJSON(data); jQuery('#' + inputfor + '_city_'+sectionid).tokenInput('remove', item); jQuery('#' + inputfor + '_city_'+sectionid).tokenInput('add', {id: value.id, name: value.name,latitude:value.latitude,longitude:value.longitude}); } catch (e) { // string is not the json its the message come from server msg = data; jQuery("div#warn-message").find("span.text").html(msg).show(); jQuery("div#warn-message").show(); jQuery("div#black_wrapper_jobapply").show(); jQuery('#' + inputfor + '_city_'+sectionid).tokenInput('remove', item); } } }); } else { alert("Something got wrong"+status); } }); } } }); } } function loadMap( sectionid ) { var default_latitude = "31.5166667"; var default_longitude = "74.3833333"; var latitude = document.getElementById('latitude_'+sectionid).value; var longitude = document.getElementById('longitude_'+sectionid).value; var marker_flag = 0; if ((latitude != '') && (longitude != '')) { default_latitude = latitude; default_longitude = longitude; marker_flag = 1; } var latlng = new google.maps.LatLng(default_latitude, default_longitude); zoom = 10; var myOptions = { zoom: zoom, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_container_"+sectionid), myOptions); var lastmarker = new google.maps.Marker({ postiion: latlng, }); var marker = new google.maps.Marker({ position: latlng, }); if(marker_flag == 1){ marker.setMap(map); } lastmarker = marker; google.maps.event.addListener(map, "click", function (e) { var latLng = new google.maps.LatLng(e.latLng.lat(), e.latLng.lng()); geocoder = new google.maps.Geocoder(); geocoder.geocode({'latLng': latLng}, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { if (lastmarker != '') lastmarker.setMap(null); var marker = new google.maps.Marker({ position: results[0].geometry.location, map: map, }); marker.setMap(map); lastmarker = marker; document.getElementById('latitude_'+sectionid).value = marker.position.lat(); document.getElementById('longitude_'+sectionid).value = marker.position.lng(); } else { alert("Geocode was not successful for the following reason: " + status); } }); }); } function showdiv(sectionid) { document.getElementById('map_'+sectionid).style.visibility = 'visible'; } function hidediv(sectionid) { document.getElementById('map_'+sectionid).style.visibility = 'hidden'; } function myValidate(f) { var msg = new Array(); if (document.formvalidator.isValid(f)) { f.check.value = '9e64fff5547ac951f7785cf517b9c7d4'; } else { msg.push("Some values are not acceptable, please retry"); alert(msg.join('\n')); return false; } return true; }