var jobCounter=0;
var resumeCounter=0;

function displayNewForm(formLocation) {
    document.location.href=formLocation;
}

function openWindow(theURL,target, h, w) {
  if (h==null && w==null) 
     window.open(theURL,target);
  else
  {
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+'resizable=0, scrollbars=yes'
    window.open(theURL, target, winprops)
  }
}

function printThisPage() 
{
    window.focus(); 
	window.print(); 
}

function checkBoxChecked(fieldName, functionType){
  var allow= false;
  var maxIndex = eval("document.forms[0]."+fieldName+".length");
  if (maxIndex==null || maxIndex==undefined)
  {
    if(eval("document.forms[0]."+fieldName+".checked")==true){
        if(confirm("Are you sure you want to "+functionType+"?")){       
            allow= true;
            return allow;
       }
       else 
        return allow;
    }
  }
  else {
	  for(i=0;i<maxIndex;i++){
	    if(eval("document.forms[0]."+fieldName+"[i].checked")==true){
	        if(confirm("Are you sure you want to "+functionType+"?")){       
	            allow= true;
	            return allow;
	       }else return allow;
	    }
	  }
  }
  if(!allow) 
    alert("No Record Selected");
  return allow;
}

function removeData(fieldName)
{
    if (checkBoxChecked(fieldName, 'delete')) {
        document.forms[0].submit();
    }
}

function disableData(fieldName)
{
    if (checkBoxChecked(fieldName, 'disable')) {
        document.forms[0].submit();
    }
}

function doQuery(formName){
    eval("document.forms['"+formName+"'].submit()");
}

function validate(temp) {
    alert(temp);
}

function createJobPopup(url) {
    jobCounter++;
    popupWindow = new popUp(250, 100, 600, 400, "divjob"+jobCounter, url, "white", "#00385c", "16pt serif", "View Job", "#7695AA", "white", "lightgrey", "#00568c", "black", true, true, true, true, true, false,'images/min.gif','images/max.gif','images/close.gif','resize.gif');
}

function createResumePopup(url) {
    resumeCounter++;
    popupWindow = new popUp(250, 100, 700, 500, "divresume"+resumeCounter, url, "white", "#00385c", "16pt serif", "View Resume", "#7695AA", "white", "lightgrey", "#00568c", "black", true, true, true, true, true, false,'images/min.gif','images/max.gif','images/close.gif','resize.gif');
}
