/* Job.com Main Scripts */

// Popup Window
function popWin(htURL) 
{
    window.open('/load.job/pop/inc='+htURL,'JobPop','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=600,height=450');
}

// Help Window Popup
htPage = "";
function helpWin(htPage) {
    window.open('/content/help/?ht='+htPage+'','JobHelp','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=550,height=450');
}

// Popup Print Window
function printWin(htURL) 
{
    var prtwin = window.open('/load.job/pop/inc='+htURL,'JobPop','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=650,height=450');
	prtwin.print();
}

//Text field counter
function textCounter(field, countfield, maxlimit) 
{
	if (field.value.length > maxlimit) // if too long...trim it!
		field.value = field.value.substring(0, maxlimit);
	// otherwise, update 'characters left' counter
	else 
		countfield.value = maxlimit - field.value.length;
}

// Toggle DIV display property
function showDIV(objDiv)
{
   var myElement = document.getElementById(objDiv); 
   if (objDiv)
   {
	   if (myElement.style.display == "none")
	       myElement.style.display = "";
	   else
	       myElement.style.display = "none";
   }
}

//  Toggle Block Element with Folder (open/close) Icons
function togFldBlock(objBlock,objImage)
{
   var myElement = document.getElementById(objBlock,objImage);    
   if (myElement.style.display == "none")
   {
       myElement.style.display = "block";
       objImage.src = "/images/icons/ico-sm-fldopen.gif";
   }
   else
   {
       myElement.style.display = "none";
       objImage.src = "/images/icons/ico-sm-fldclose.gif";
   }
}
