// ----------------------------------------------------------------------------------------------------------------------------------
// PROGRAM
// PAGE            custom.js
// AUTHOR          Peter Le
// LANGAUGE        JavaScript
// PURPOSE         Customer JavaScript functions
//
// REVISION HISTORY
// Date			Progammer	Purpose 
// ----------	--------	--------------------------------------------------------------------------------------------
// 07/09/2009	Peter Le	Initial write
// 23/10/2009	Sameeran    Moving scripts from master page to custom.js file
// 26/02/2010	Sameeran    Added ontxtblur() function for the JVC registration form watermark
// 24/03/20010	Sameeran    Added GrabRes() function for the JVC registration
// 04/08/20010	Sameeran    Added ontxtfocus() function to resolve the text box clearing issue
//---------------------------------------------------------------------------------------------->

function openWind(url,windName) {
    var winWidth = window.screen.width - 50;
    var winHeight = window.screen.height - 200;
    var newWind = window.open(url,windName,"menubar=1,resizable=1,toolbar=1,scrollbars=1,location=1,status=1,width=" + winWidth + ",height=" + winHeight + "'");
    newWind.focus();
}

function goToPage(url) {
    location = url;
}

function showImage(imgId, rollMode, btnName) 
        {
               var objImg = document.getElementById(imgId);
               btnName = btnName.replace("~/", "");
               btnName = btnName.replace(".gif", "");
               btnName = btnName.replace(".jpg", "");
               btnName = btnName.replace("_off", "");
               btnName = btnName.replace("_on", "");
               if (objImg) 
               {
                   if (rollMode == "on") 
                   {
                       // var tempName = "uploadedimages/save_on.gif";
                       objImg.src = btnName + "_on.gif"; //  btnName + "_on.gif";

                   }
                   else if (rollMode == "off") 
                   {
                       objImg.src = btnName + "_off.gif";
                   }
               }
           }
function GrabRes() 
  {
       var PastedResume=document.getElementsByTagName("textarea");
       if(PastedResume.item(0).value == "Simply copy and paste your resume here and we'll do the rest.")
       {
	 return false;
         
       }
       else
       {
       if (PastedResume.item(0).value.length > 15000)
	 {
       		PastedResume.item(0).focus();
	        alert('Please limit the size of your Resume to 15000 characters');
	        PastedResume.item(0).value.value='';
       		return false;
       	  }
       else 
          {
               if (PastedResume.item(0).value.length < 25)
                 {
	
                 return false;
       
                 }
                 else
                    {
                       setTimeout("document.getElementsByTagName('textarea').item(0).value= 'Please Wait While we Parse your Resume!'",1000);
                       document.forms[0].action='http://ca100uatssl02.volt.com/JVC02/Profiles/ExpressRegistrationResults.cfm';
                       document.forms[0].submit();    	
                    }
          }       
	}
   }
function ontxtblur()
{
	var txtele=document.getElementById("Pasted_resume");
	if(txtele.value=="")
	{
		txtele.value="Simply copy and paste your resume here and we'll do the rest."; 
		txtele.className='resume';
	}
}
function ontxtfocus()
{
    var txtele=document.getElementById("Pasted_resume");
    if(txtele.value=="Simply copy and paste your resume here and we'll do the rest.")
	{
		txtele.value=""; 
		txtele.className='copyFont';
	}
}
// EOF -->
