//the divpopup code

      var posx = 0;
      var posy = 0;
      document.onmousemove = getMousePos;

      
 
function getMousePos(e)
{

e = e || window.event;
if(window.event)
  window.event.returnValue = false;

else

e.preventDefault();

// get mouse cursor XY
	if (!e) var e = window.event;
	if (e.pageX || e.pageY)
	{
		posx = e.pageX;
        posy = e.pageY;		
	}
	else if (e.clientX || e.clientY)
	{
		posx = e.clientX;
        posy = e.clientY;
}

var overlayWidth=600;
var overlayHeight=350;

var version=0
var temp;
  if (navigator.appVersion.indexOf("MSIE")!=-1){
    temp=navigator.appVersion.split("MSIE")
    version=parseFloat(temp[1])
  }


var ie5 = document.all;
//alert("11111111");
  var x,y,frameWidth,frameHeight,xOffset,yOffset;
  var overlayFrame = document.getElementById("Pixelate");
//alert(overlayFrame);
  // Get the frame width and height
  if (self.innerHeight) { // all except Explorer
    frameWidth = self.innerWidth;
    frameHeight = self.innerHeight;
   } // Explorer 6+ Strict
  else if (document.documentElement && document.documentElement.clientHeight) {
    frameWidth = document.documentElement.clientWidth;
    frameHeight = document.documentElement.clientHeight;
  } // previous IE versions
  else if (document.body) {
    frameWidth = document.body.clientWidth;
    frameHeight = document.body.clientHeight;
  }

  // Get the page offsetX and page offsetY for scroll
  if (self.pageYOffset) { // all except Explorer
    xOffset = self.pageXOffset;
    yOffset = self.pageYOffset;
  }
  else if (document.documentElement && document.documentElement.scrollTop) {
    // Explorer 6+ Strict
    xOffset = document.documentElement.scrollLeft;
    yOffset = document.documentElement.scrollTop;
  }
  else if (document.body) { // previous Explorers
    xOffset = document.body.scrollLeft;
    yOffset = document.body.scrollTop;
  }
  

  if (ie5 && (version<7)) frameWidth -= document.body.offsetLeft;
  // Get Center X and Y positions for the overlay based on input Width and Height
  x = frameWidth/2 + xOffset-(eval(overlayWidth)+5)/2;
  y = frameHeight/2 + yOffset-(eval(overlayHeight)+5)/2;

  //alert("frameWidth:::"+ xOffset-(eval(overlayWidth)+5)/2);
  //alert("frameHeight:::"+yOffset-(eval(overlayHeight)+5)/2);

  // If the value is less than 5 pixels set to 5
  if (x < 5) x = 5;
  if (y < 5) y = 5;


posx = x;

posy = y;

//alert("the x==" + x);

//alert("the y==" + y);


}
      function ShowPreview(PreviewName, PreviewNumber,newimage,img,content)
      {
        //alert("here");
        debugger;
	var PreviewPanel = document.getElementById(PreviewName);
	var oldcontent = PreviewPanel.innerHTML
	//alert(content);
	//alert("document.getElementById(img)==" + document.getElementById(img));
	//document.getElementById(img).src=newimage;	
	//PreviewPanel.innerHTML = '<a href="javascript:HidePreview()"><img src="/bh/images/close.gif" border=0></a><iframe src="http://www.news.com" border=0 width="400" height="100"></iframe>';
	oldcontent=PreviewPanel.innerHTML
	PreviewPanel.innerHTML = content;		
	PreviewPanel.style.visibility=="visible";
	
	PreviewPanel.style.visibility = "visible";
	PreviewPanel.style.left = posx+100;
	PreviewPanel.style.top = posy+30;      
      
      }
      
     function getQueryVariable(variable) { 
var query = window.location.search.substring(1); 
var vars = query.split("&"); 
for (var i=0;i<vars.length;i++) { 
var pair = vars[i].split("="); 
if (pair[0] == variable) { 
return pair[1]; 
} 
} 
alert('Query Variable ' + variable + ' not found'); 
} 
 
function HidePreview(PreviewName, PreviewNumber,newimage,img)
      {
      
      var LastPreview = document.getElementById("Pixelate");
      LastPreview.style.visibility == "hidden"
      LastPreview.style.left = '-800px';
      LastPreview.style.top = '-800px';
      
      }      
      
      
      function MovePreview(PreviewName)
      {
            var PreviewPanel = document.getElementById(PreviewName);
            PreviewPanel.style.left = posx+350;
            PreviewPanel.style.top = posy;
      }
    


function divpopup(qstring)
{


var strURL=getqstringvalue(qstring, "url");
var parenturl=getqstringvalue(qstring, "parenturl");
var requestno=getqstringvalue(qstring, "requestno");
var strWidth=getqstringvalue(qstring, "width");
var strHeight=getqstringvalue(qstring, "height");
strURL +='?requestno='+requestno +'&width='+ strWidth + '&height=' + strHeight ;
parenturl+='?requestno=' + requestno + '&width=' + strWidth + '&height=' + strHeight + '&fwdurl=' + escape(strURL)
//alert("strURL===" + parenturl);
//alert("strWidth===" + strWidth);
//alert("strHeight===" + strHeight);
   var content="";
   //content +='<table><tr><td align=right><a href="javascript:HidePreview()"><img src="/bh/images/close.gif" border=0></a></td></tr></table><br>';
   //content +='<iframe src="' + strURL + '" border="0" ';
   //content +='width="' + strWidth + '" height="';
   //content += strWidth + '"></iframe>';
   //ShowPreview('Pixelate', '106','northwest.jpg','img',content);
   top.createPopup('Details',  parenturl , strWidth, strHeight, false, false, true,true);	
	
}


function getqstringvalue(qstring, name ){  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");  var regexS = "[\\?&]"+name+"=([^&#]*)";  var regex = new RegExp( regexS );  var results = regex.exec( qstring );  if( results == null )    return "";  else    return results[1];}


//end of divpopup code




//Detect include
var sUserAgent = navigator.userAgent;
var fAppVersion = parseFloat(navigator.appVersion);

function compareVersions(sVersion1, sVersion2) {

    var arrVersion1 = sVersion1.split(".");
    var arrVersion2 = sVersion2.split(".");
    
    if (arrVersion1.length > arrVersion2.length) {
        for (var i=0; i < arrVersion1.length - arrVersion2.length; i++) {
            arrVersion2.push("0");
        }
    } else if (arrVersion1.length < arrVersion2.length) {
        for (var i=0; i < arrVersion2.length - arrVersion1.length; i++) {
            arrVersion1.push("0");
        }    
    }
    
    for (var i=0; i < arrVersion1.length; i++) {
 
        if (arrVersion1[i] < arrVersion2[i]) {
            return -1;
        } else if (arrVersion1[i] > arrVersion2[i]) {
            return 1;
        }    
    }
    
    return 0;

}

var isOpera = sUserAgent.indexOf("Opera") > -1;
var isMinOpera4 = isMinOpera5 = isMinOpera6 = isMinOpera7 = isMinOpera7_5 = false;

if (isOpera) {
    var fOperaVersion;
    if(navigator.appName == "Opera") {
        fOperaVersion = fAppVersion;
    } else {
        var reOperaVersion = new RegExp("Opera (\\d+\\.\\d+)");
        reOperaVersion.test(sUserAgent);
        fOperaVersion = parseFloat(RegExp["$1"]);
    }

    isMinOpera4 = fOperaVersion >= 4;
    isMinOpera5 = fOperaVersion >= 5;
    isMinOpera6 = fOperaVersion >= 6;
    isMinOpera7 = fOperaVersion >= 7;
    isMinOpera7_5 = fOperaVersion >= 7.5;
}

var isKHTML = sUserAgent.indexOf("KHTML") > -1 
              || sUserAgent.indexOf("Konqueror") > -1 
              || sUserAgent.indexOf("AppleWebKit") > -1; 
              
var isMinSafari1 = isMinSafari1_2 = false;
var isMinKonq2_2 = isMinKonq3 = isMinKonq3_1 = isMinKonq3_2 = false;

if (isKHTML) {
    isSafari = sUserAgent.indexOf("AppleWebKit") > -1;
    isKonq = sUserAgent.indexOf("Konqueror") > -1;

    if (isSafari) {
        var reAppleWebKit = new RegExp("AppleWebKit\\/(\\d+(?:\\.\\d*)?)");
        reAppleWebKit.test(sUserAgent);
        var fAppleWebKitVersion = parseFloat(RegExp["$1"]);

        isMinSafari1 = fAppleWebKitVersion >= 85;
        isMinSafari1_2 = fAppleWebKitVersion >= 124;
    } else if (isKonq) {

        var reKonq = new RegExp("Konqueror\\/(\\d+(?:\\.\\d+(?:\\.\\d)?)?)");
        reKonq.test(sUserAgent);
        isMinKonq2_2 = compareVersions(RegExp["$1"], "2.2") >= 0;
        isMinKonq3 = compareVersions(RegExp["$1"], "3.0") >= 0;
        isMinKonq3_1 = compareVersions(RegExp["$1"], "3.1") >= 0;
        isMinKonq3_2 = compareVersions(RegExp["$1"], "3.2") >= 0;
    } 
    
}

var isIE = sUserAgent.indexOf("compatible") > -1 
           && sUserAgent.indexOf("MSIE") > -1
           && !isOpera;
           
var isMinIE4 = isMinIE5 = isMinIE5_5 = isMinIE6 = false;

if (isIE) {
    var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
    reIE.test(sUserAgent);
    var fIEVersion = parseFloat(RegExp["$1"]);

    isMinIE4 = fIEVersion >= 4;
    isMinIE5 = fIEVersion >= 5;
    isMinIE5_5 = fIEVersion >= 5.5;
    isMinIE6 = fIEVersion >= 6.0;
}

var isMoz = sUserAgent.indexOf("Gecko") > -1
            && !isKHTML;
            
var isMinMoz1 = sMinMoz1_4 = isMinMoz1_5 = false;

if (isMoz) {
    var reMoz = new RegExp("rv:(\\d+\\.\\d+(?:\\.\\d+)?)");
    reMoz.test(sUserAgent);
    isMinMoz1 = compareVersions(RegExp["$1"], "1.0") >= 0;
    isMinMoz1_4 = compareVersions(RegExp["$1"], "1.4") >= 0;
    isMinMoz1_5 = compareVersions(RegExp["$1"], "1.5") >= 0;
}

var isNS4 = !isIE && !isOpera && !isMoz && !isKHTML 
            && (sUserAgent.indexOf("Mozilla") == 0) 
            && (navigator.appName == "Netscape") 
            && (fAppVersion >= 4.0 && fAppVersion < 5.0);

var isMinNS4 = isMinNS4_5 = isMinNS4_7 = isMinNS4_8 = false;

if (isNS4) {
    isMinNS4 = true;
    isMinNS4_5 = fAppVersion >= 4.5;
    isMinNS4_7 = fAppVersion >= 4.7;
    isMinNS4_8 = fAppVersion >= 4.8;
}

var isWin = (navigator.platform == "Win32") || (navigator.platform == "Windows");
var isMac = (navigator.platform == "Mac68K") || (navigator.platform == "MacPPC") 
            || (navigator.platform == "Macintosh");

var isUnix = (navigator.platform == "X11") && !isWin && !isMac;

var isWin95 = isWin98 = isWinNT4 = isWin2K = isWinME = isWinXP = false;
var isMac68K = isMacPPC = false;
var isSunOS = isMinSunOS4 = isMinSunOS5 = isMinSunOS5_5 = false;

if (isWin) {
    isWin95 = sUserAgent.indexOf("Win95") > -1 
              || sUserAgent.indexOf("Windows 95") > -1;
    isWin98 = sUserAgent.indexOf("Win98") > -1 
              || sUserAgent.indexOf("Windows 98") > -1;
    isWinME = sUserAgent.indexOf("Win 9x 4.90") > -1 
              || sUserAgent.indexOf("Windows ME") > -1;
    isWin2K = sUserAgent.indexOf("Windows NT 5.0") > -1 
              || sUserAgent.indexOf("Windows 2000") > -1;
    isWinXP = sUserAgent.indexOf("Windows NT 5.1") > -1 
              || sUserAgent.indexOf("Windows XP") > -1;
    isWinNT4 = sUserAgent.indexOf("WinNT") > -1 
              || sUserAgent.indexOf("Windows NT") > -1 
              || sUserAgent.indexOf("WinNT4.0") > -1 
              || sUserAgent.indexOf("Windows NT 4.0") > -1 
              && (!isWinME && !isWin2K && !isWinXP);
} 

if (isMac) {
    isMac68K = sUserAgent.indexOf("Mac_68000") > -1 
               || sUserAgent.indexOf("68K") > -1;
    isMacPPC = sUserAgent.indexOf("Mac_PowerPC") > -1 
               || sUserAgent.indexOf("PPC") > -1;  
}

if (isUnix) {
    isSunOS = sUserAgent.indexOf("SunOS") > -1;

    if (isSunOS) {
        var reSunOS = new RegExp("SunOS (\\d+\\.\\d+(?:\\.\\d+)?)");
        reSunOS.test(sUserAgent);
        isMinSunOS4 = compareVersions(RegExp["$1"], "4.0") >= 0;
        isMinSunOS5 = compareVersions(RegExp["$1"], "5.0") >= 0;
        isMinSunOS5_5 = compareVersions(RegExp["$1"], "5.5") >= 0;
    }
}
//end of detect include
//include files

function XmlDom() {
    if (window.ActiveXObject) {
        var arrSignatures = ["MSXML2.DOMDocument.5.0", "MSXML2.DOMDocument.4.0",
                             "MSXML2.DOMDocument.3.0", "MSXML2.DOMDocument",
                             "Microsoft.XmlDom"];
                         
        for (var i=0; i < arrSignatures.length; i++) {
            try {
        
                var oXmlDom = new ActiveXObject(arrSignatures[i]);
            
                return oXmlDom;
        
            } catch (oError) {
                //ignore
            }
        }          

        throw new Error("MSXML is not installed on your system."); 
              
    } else if (document.implementation && document.implementation.createDocument) {
        
        var oXmlDom = document.implementation.createDocument("","",null);

        oXmlDom.parseError = {
            valueOf: function () { return this.errorCode; },
            toString: function () { return this.errorCode.toString() }
        };
        
        oXmlDom.__initError__();
                
        oXmlDom.addEventListener("load", function () {
            this.__checkForErrors__();
            this.__changeReadyState__(4);
        }, false);

        return oXmlDom;        
        
    } else {
        throw new Error("Your browser doesn't support an XML DOM object.");
    }
}

if (isMoz) {

    Document.prototype.readyState = 0;
    Document.prototype.onreadystatechange = null;

    Document.prototype.__changeReadyState__ = function (iReadyState) {
        this.readyState = iReadyState;

        if (typeof this.onreadystatechange == "function") {
            this.onreadystatechange();
        }
    };

    Document.prototype.__initError__ = function () {
        this.parseError.errorCode = 0;
        this.parseError.filepos = -1;
        this.parseError.line = -1;
        this.parseError.linepos = -1;
        this.parseError.reason = null;
        this.parseError.srcText = null;
        this.parseError.url = null;
    };
    
    Document.prototype.__checkForErrors__ = function () {

        if (this.documentElement.tagName == "parsererror") {

            var reError = />([\s\S]*?)Location:([\s\S]*?)Line Number (\d+), Column (\d+):<sourcetext>([\s\S]*?)(?:\-*\^)/;

            reError.test(this.xml);
            
            this.parseError.errorCode = -999999;
            this.parseError.reason = RegExp.$1;
            this.parseError.url = RegExp.$2;
            this.parseError.line = parseInt(RegExp.$3);
            this.parseError.linepos = parseInt(RegExp.$4);
            this.parseError.srcText = RegExp.$5;
        }
    };
    
        
    Document.prototype.loadXML = function (sXml) {
    
        this.__initError__();
    
        this.__changeReadyState__(1);
    
        var oParser = new DOMParser();
        var oXmlDom = oParser.parseFromString(sXml, "text/xml");
 
        while (this.firstChild) {
            this.removeChild(this.firstChild);
        }

        for (var i=0; i < oXmlDom.childNodes.length; i++) {
            var oNewNode = this.importNode(oXmlDom.childNodes[i], true);
            this.appendChild(oNewNode);
        }
        
        this.__checkForErrors__();
        
        this.__changeReadyState__(4);

    };
    
    Document.prototype.__load__ = Document.prototype.load;

    Document.prototype.load = function (sURL) {
        this.__initError__();
        this.__changeReadyState__(1);
        this.__load__(sURL);
    };
    
    Node.prototype.__defineGetter__("xml", function () {
        var oSerializer = new XMLSerializer();
        return oSerializer.serializeToString(this, "text/xml");
    });

}



function getXMLDoc()
{
var xmlhttp=null
// code for Mozilla, etc.
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest()
  }
// code for IE
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
if (xmlhttp!=null)
  {
  	return xmlhttp;
  }
else
  {
  alert("Your browser does not support XMLHTTP.")
  }
}

function state_Change()
{
// if xmlhttp shows "loaded"
if (xmlhttp.readyState==4)
  {
  // if "OK"
  if (xmlhttp.status==200)
    {
    // ...some code here...
    }
  else
    {
    alert("Problem retrieving XML data")
    }
  }
}

//end of  include


function validateit(username){
	alert("validating...it");
	return true;

}

function validatetwo(username){
	alert("valiadte two");
	return true;

}

function validation_check(username){
alert("valiadte three");
return true;
}


function checkNumberOfTravelers(formName){			
	return true;

 }



//***************PRINT MY TIX *********************************************************************

function gotostep1() {
	 var reqNos=getselected();
	 //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select an event to proceed!");	
	 }else{
	         var strUrl="/printmytix/buystep2.asp?requestno="+reqNos; 
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }        	
}


function gotostep4() {
	 var reqNos=getselected();
	 //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select an event time to proceed!");	
	 }else{
	         var strUrl="/printmytix/buystep3.asp?requestno="+reqNos; 
	         //document.forms[0].action=strUrl;  
		 //document.forms[0].submit(); 
		 parent.document.location.href=strUrl;
	 }        	
}

function gotostep2() {
	 var reqNos=getselected();
	 //alert(reqNos);
	 if(reqNos==""){
	   	alert("Select items to Activate");	
	 }else{
	         var strUrl="/crmspeed/resource/pmtevents_step2.asp?requestno="+reqNos; 
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }        	
}



//***************PRINT MY TIX *********************************************************************



//***************JOB Signature*********************************************************************

function fnsavethisjob(URL) {
	 //alert("inside fnsavethisjob=="+URL);
	 var ref ; //document.forms[0].ref.value;
	 ref=top.document.location.href;
	// alert("ref" + ref);
	 top.document.location.href=URL + "&sessionURL="+escape(ref);
}


function fnemailthisjob() {
	 var reqNos=getselected();
	 //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select an event time to proceed!");	
	 }else{
	         var strUrl="/printmytix/buystep3.asp?requestno="+reqNos; 
	         //document.forms[0].action=strUrl;  
		 //document.forms[0].submit(); 
		 parent.document.location.href=strUrl;
	 }        	
}

function fnApplyNow() {
	 var reqNos=getselected();
	 //alert(reqNos);
	 if(reqNos==""){
	   	alert("Select items to Activate");	
	 }else{
	         var strUrl="/crmspeed/resource/pmtevents_step2.asp?requestno="+reqNos; 
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }        	
}

function showResume(strUrl)

{
  window.open(strUrl,'','width=435,height=400,toolbar=no,scrollbars=yes,resizable=yes');

}


function jsmakesearchable()
{
  //alert("this is a test");
  var reqNos=getselected();
      if((reqNos.indexOf(",")>=0) )
      {
	    alert("Please select only one item");
	    return ;	
      }else{  
  //alert(reqNos);
  	         var x=confirm("Are you sure you want set this resume as your searchable resume?");
               if(x){
  
			 if(reqNos==""){
			   	alert("Select items to make searchable to employers");
			   	return ;	
			 }else{
			         var strUrl="/crmspeed/resource/doyes.asp?requestno="+reqNos; 
			         document.forms[0].action=strUrl;  
				 document.forms[0].submit(); 
			 } 
	          }
	}    	
	
}

function fnresumepreview( strUrl)
{
	          	           
		window.open(strUrl,'','toolbar=no,scrollbars=yes');  
	    		
}


function activateCompany() {
	 var reqNos=getselected();
	 
	         var strUrl="/crmspeed/resource/activateobjects.asp?requestno="+reqNos; 
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
      	
}

function getjobsignaturelink(querystring) {
	 	var strUrl="";
	 	 //alert(" top:::::"+querystring);
	 	 if(querystring.indexOf("page=savedjobs")>0)
	 	 {
	         	strUrl="/jobsignature/jssavedjobsdetails.asp" + querystring;
	         	//alert("Saved jobs:::::"+querystring); 
	         } 
	         
	         else if (querystring.indexOf("page=myapps")>0)
	         {
	         	strUrl="/jobsignature/jsappliedjobsdetails.asp" + querystring; 
	         	//alert("Applied jobs:::::"+querystring); 
	         }
	         else if (querystring.indexOf("page=repsavedjobs")>0)
	         {
	         	strUrl="/jobsignature/jsrepsavedjobsdetails.asp" + querystring; 
	         	//alert("Applied jobs:::::"+querystring); 
	         }	         
 		else if (querystring.indexOf("page=resume")>0)
	         {
	         	strUrl="/jobsignature/jsresumedetails.asp" + querystring; 
	         	//alert("Applied jobs:::::"+querystring); 
	         }	         
	         top.document.location.href=strUrl;  
		 //document.forms[0].submit(); 
      	
}

function updatehiddenfield(fld_From,fld_To,maxlen)
{
  	var msg="";

	//alert("fld_From111:::"+fld_From);
	var from_elm = document.getElementById("editablediv_" + fld_From);

	if (from_elm)
	{	
		var str1 = from_elm.innerText;
		 
		var to_elm = document.getElementById("textareadiv_" + fld_From);
		 
		if (to_elm) 
		{
		    	var to_elmhidden = document.getElementById( fld_From);
			to_elmhidden.value=str1;
		    
			if(maxlen=="") {
				msg="Character count:";				
				msg += str1.length;
				to_elm.innerText = msg;
			} else {
				msg="Number of Characters Left:";
				var reso = parseInt(maxlen,10) - str1.length
				if(reso < 0 ){
				   msg += " OVER LIMIT";
				}else{
				   msg += reso;
				}
				 
				to_elm.innerText = msg;
			}		    		    
		    
		}
	}	
}


function UpdateSize(fld_From, fld_To,maxlen)
{
 
	var from_elm = document.getElementById(fld_From);
	//if (from_elm)
	//{	
		//var to_elm = document.getElementById(fld_To);
		//if (to_elm) to_elm.innerText = from_elm.value.length
	//}
	if (from_elm)
	{	
		var str1 = from_elm.value;
		 
		var to_elm = document.getElementById( fld_To);
		 
		if (to_elm) 
		{
		    
			if(maxlen=="") {
				msg="Character count:";				
				msg += str1.length;
				to_elm.innerText = msg;
			} else {
				msg="Number of Characters Left:";
				var reso = parseInt(maxlen,10) - str1.length
				if(reso < 0 ){
				   msg += " OVER LIMIT";
				}else{
				   msg += reso;
				}
				 
				to_elm.innerText = msg;
			}		    		    
		    
		}
	}	

}

function jspublish()
{
  //alert("this is a jspublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one item to publish");
	   	return ;	
	 }else{
	         var strUrl="/crmspeed/resource/jsactivate.asp?requestno="+reqNos;
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }     	
	
}

function jsunpublish()
{
  //alert("this is a jsunpublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one item to unpublish");
	   	return ;	
	 }else{
	         var strUrl="/crmspeed/resource/jsinactivate.asp?requestno="+reqNos; 
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }     	
	
}

function jsrepsave()
{
  //alert("this is a test");
  var reqNos=getselected();
  var ref ; //document.forms[0].ref.value;
	 ref=top.document.location.href;
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Select items to save!");
	   	return ;	
	 }else{
	         var strUrl="/jobsignature/jssaverepjob.asp?requestno="+reqNos + "&sessionURL="+escape(ref);; 
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }     	
	
}

function jsrepprint()
{
	         
	         var from_elm = document.getElementById("cspeedquerystring").value;	         
	         var strUrl = "/jobsignature/jsrepprint.asp?sessionurl=" + escape(from_elm);
	         //alert(strUrl);
	         window.open(strUrl + "&printerfriendly=true",'','toolbar=no,scrollbars=yes');
	             		
}

function jsprint()
{
	         
	         window.print();
	             		
}

function jscontactapplicant(strurl)
{
	         var x=confirm("Are you sure you want to contact this candidate?");
               if(x){

	           document.location.href=strurl ;	         
	         }
	             		
}

function jsviewresume(strurl)
{
	         
	         document.location.href=strurl ;
	             		
}

function jsjobpublish()
{
  //alert("this is a jspublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one item to publish");
	   	return ;	
	 }else{
	         var strUrl="/crmspeed/resource/jspublished.asp?requestno="+reqNos;
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }     	
	
}

function jsjobunpublish()
{
  //alert("this is a jsunpublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one item to unpublish");
	   	return ;	
	 }else{
	         var strUrl="/crmspeed/resource/jsunpublished.asp?requestno="+reqNos; 
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }     	
	
}

function jsjobclosed()
{
  //alert("this is a jsunpublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one item to unpublish");
	   	return ;	
	 }else{
	         var strUrl="/crmspeed/resource/jsclosed.asp?requestno="+reqNos; 
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }     	
	
}

function jscontractpaid()
{
  //alert("this is a jsunpublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one item to set status to Paid");
	   	return ;	
	 }else{
	         var strUrl="/crmspeed/resource/jspaid.asp?requestno="+reqNos; 
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }     	
	
}

function jsregistration_user_username_onBlur(suserid) {
suserid=document.forms[0].username.value;
//alert("suserid:::" + suserid );
document.body.style.cursor='wait';

// Create an instance of the XML HTTP Request object
var oXMLHTTP = new ActiveXObject( "Microsoft.XMLHTTP" );
	
// Prepare the XMLHTTP object for a HTTP POST to our validation ASP page
var sURL = "/jobsignature/validateuser.asp?username=" + suserid

oXMLHTTP.open( "POST", sURL, false );

// Execute the request
oXMLHTTP.send();
//alert("oXMLHTTP.responseText:::" + oXMLHTTP.responseText );
if (oXMLHTTP.responseText == "False") 
	alert("Please select another username. " + suserid + " already exists.");
	//document.forms[0].username.focus();
	document.body.style.cursor='auto';
	

}


function jsworkexperience_iscurrentjob_onChange(frm,obj,fieldname)
{
 //alert("this is jsworkexperience_iscurrentjob_onChange");

  
  var frmobj = eval("document.forms['" + frm + "']" );
  //alert("frmobj:::=" + frmobj);
  var selectedval = frmobj.iscurrentjob;
  //alert("selectedval:::" + selectedval);
  var select_val = selectedval.options[selectedval.selectedIndex].value;
  //alert("select_val:::" + select_val);
  if(select_val=='Yes')
  {
 	 frmobj.enddate.value="PRESENT";
 	 //frmobj.enddate.disabled=true;
 	 
  } else {
  	
  	 frmobj.enddate.value="";
 	 //frmobj.enddate.disabled=false;
  	
  	}	
	
}

function isEmail(str) {
  // are regular expressions supported?
  var supported = 0;
  if (window.RegExp) {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported) 
    return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
  var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
  return (!r1.test(str) && r2.test(str));
}


function jssms_wirelessnumber_onBlur(suserid) {
	  edit_jssms_wirelessnumber_onBlur(suserid);
	}

function edit_jssms_wirelessnumber_onBlur(suserid) {
suserid=document.forms[0].wirelessnumber.value;
var user=document.forms[0].userid.value;
//alert("suserid:::" + suserid );
//document.body.style.cursor='wait';

if(suserid !=""){
	
	   var num = document.forms[0].wirelessnumber.value.replace(/[^\d]/g,'');

   if(num.length != 10) {
   	    alert('Please enter a valid 10 digit phone number including area code');
   	    document.forms[0].wirelessnumber.value=num;
            document.forms[0].wirelessnumber.focus();
            return;                
   	}
	
// Create an instance of the XML HTTP Request object
//var oXMLHTTP = new ActiveXObject( "Microsoft.XMLHTTP" );
var oXMLHTTP = getXMLDoc();	
//alert("oXMLHTTP:::" + oXMLHTTP );
// Prepare the XMLHTTP object for a HTTP POST to our validation ASP page
var sURL = "/jobsignature/validatewireless.asp?wid=" + suserid + "&userid=" + user;
//alert("sURL:::" + sURL );
oXMLHTTP.open( "POST", sURL, false );

// Execute the request
oXMLHTTP.send();
//alert("oXMLHTTP.responseText:::" + oXMLHTTP.responseText );
if (oXMLHTTP.responseText == "False") {
	alert("The wireless number " + suserid + " you have entered is already in use by another user.");
	document.body.style.cursor='auto';
	document.forms[0].wirelessnumber.focus();
	
	
	}
   }
   

}



//Validate phone number for 10 digit US numbers.

//phoneField - The HTML input field containing the phone number to validate.

//format - Integer value that defines how to format the text field.

function validatePhone(phoneField, format) {

   var num = phoneField.value.replace(/[^\d]/g,'');

   if(num.length != 10) {

        //Alert the user that the phone number entered was invalid.

        alert('Please enter a valid phone number including area code');
            phoneField.focus();                
        return "false";
   } else {

        //Email was valid.  If format type is set, format the Phone to the desired style.

      switch(format) {

            case '0': //Format (xxx)-xxx-xxxx

               phoneField.value = "(" + num.substring(0,3) + ")-" + 

                                    num.substring(3, 6) + "-" + num.substring(6);

               break;

            case '1': //Format xxx-xxx-xxxx

               phoneField.value = num.substring(0,3) + "-" + 

                                    num.substring(3, 6) + "-" + num.substring(6);

               break;

            default: //Format xxxxxxxxxx

               phoneField.value = num;

               break;

        }

   }

return "true";

}




//*************** JOB Signature *********************************************************************
//
//st goerges episcopal chrurch
//1 court center
//durham, nh 
// ********************************BUILDHAITI*********************************************************
function dodataactive()
{
  //alert("this is a jsunpublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one item to activate");
	   	return ;	
	 }else{
	         var strUrl="/bh/dobhactivate.asp?status=Active&item=vizcities&data=datastatus&requestno="+reqNos;
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }     	
	
}

function dodatainactive()
{
  //alert("this is a jsunpublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one item to activate");
	   	return ;	
	 }else{
	         	         
	         var strUrl="/bh/dobhactivate.asp?status=Inactive&item=vizcities&data=datastatus&requestno="+reqNos; 
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }     	
	
}


function docommentpublish()
{
  //alert("this is a jsunpublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one item to publish");
	   	return ;	
	 }else{
	         var strUrl="/bh/dobhactivate.asp?status=active&item=bhcomments&data=requeststate&requestno="+reqNos;
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }     	
	
}

function docommentunpublish()
{
  //alert("this is a jsunpublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one item to unpublish");
	   	return ;	
	 }else{
	         	         
	         var strUrl="/bh/dobhactivate.asp?status=inactive&item=bhcomments&data=requeststate&requestno="+reqNos; 
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }     	
	
}

function bhacceptproject()
{
  //alert("this is a jspublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){	
	   	alert("Please select at least one to continue");
	   	return ;	
	 }else{
	       var x=confirm("Are you sure you want to accept this project?");
               if(x){	         
	           var strUrl="/bh/acceptproject.asp?requestno="+reqNos;
	           document.forms[0].action=strUrl;  
		   document.forms[0].submit(); 
		 }
	 }     	
	
}

function bhmanagerreview()
{
  //alert("this is a jspublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one to continue");
	   	return ;	
	 }else{
	       var x=confirm("Are you sure you want to set the status to Manager Review?");
               if(x){	         
	           var strUrl="/bh/setstatus.asp?requestno="+reqNos + "&status=managerreview";
	           document.forms[0].action=strUrl;  
		   document.forms[0].submit(); 
		 }
	 }     	
	
}

function bhcustomerreview()
{
  //alert("this is a jspublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one to continue");
	   	return ;	
	 }else{
	       var x=confirm("Are you sure you want to set the status to Customer Review?");
               if(x){	         
	           var strUrl="/bh/setstatus.asp?requestno="+reqNos + "&status=customerreview";
	           document.forms[0].action=strUrl;  
		   document.forms[0].submit(); 
		 }
	 }     	
	
}

function bhcompleted()
{
  //alert("this is a jspublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one to continue");
	   	return ;	
	 }else{
	       var x=confirm("Are you sure you want to set the status to Completed?");
               if(x){	         
	           var strUrl="/bh/setstatus.asp?requestno="+reqNos + "&status=completed";
	           document.forms[0].action=strUrl;  
		   document.forms[0].submit(); 
		 }
	 }     	
	
}

function submitbhad()
{
  //alert("this is a jspublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one to continue");
	   	return ;	
	 }else{
	       var x=confirm("Are you sure you want to set the status to Submitted?");
               if(x){	         
	           var strUrl="/bh/setstatussubmitted.asp?requestno="+reqNos + "&status=submitted";
	           document.forms[0].action=strUrl;  
		   document.forms[0].submit(); 
		 }
	 }     	
	
}

// ********************************BUILDHAITI*********************************************************

//vizitrip 

function vizitripregistration_username_onBlur(suserid) {
suserid=document.forms[0].username.value;
//alert("suserid:::" + suserid );
document.body.style.cursor='wait';

// Create an instance of the XML HTTP Request object
var oXMLHTTP = new ActiveXObject( "Microsoft.XMLHTTP" );
	
// Prepare the XMLHTTP object for a HTTP POST to our validation ASP page
var sURL = "/vizitrip/validateuser.asp?username=" + suserid

oXMLHTTP.open( "POST", sURL, false );

// Execute the request
oXMLHTTP.send();
//alert("oXMLHTTP.responseText:::" + oXMLHTTP.responseText );
if (oXMLHTTP.responseText == "False") 
	alert("Please select another username. The Username '" + suserid + "' already exists.");
	//document.forms[0].username.focus();
	document.body.style.cursor='auto';
	

}


function vizitripregistration_manager_username_onBlur(suserid) {
suserid=document.forms[0].username.value;
//alert("suserid:::" + suserid );
document.body.style.cursor='wait';

// Create an instance of the XML HTTP Request object
var oXMLHTTP = new ActiveXObject( "Microsoft.XMLHTTP" );
	
// Prepare the XMLHTTP object for a HTTP POST to our validation ASP page
var sURL = "/vizitrip/validateuser.asp?username=" + suserid

oXMLHTTP.open( "POST", sURL, false );

// Execute the request
oXMLHTTP.send();
//alert("oXMLHTTP.responseText:::" + oXMLHTTP.responseText );
if (oXMLHTTP.responseText == "False") 
	alert("Please select another username. The Username '" + suserid + "' already exists.");
	//document.forms[0].username.focus();
	document.body.style.cursor='auto';
	

}
//end of vizitrip


function dovizitripinactivate()
{
  //alert("this is a jspublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one item to inactivate");
	   	return ;	
	 }else{
	         var strUrl="/crmspeed/resource/dovizitripinactivate.asp?requestno="+reqNos;
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }     	
	
}

function dovizitripactivate()
{
  //alert("this is a jsunpublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one item to activate");
	   	return ;	
	 }else{
	         var strUrl="/crmspeed/resource/dovizitripactivate.asp?requestno="+reqNos; 
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }     	
	
}



function publishad()
{
  //alert("this is a jsunpublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one item to publish");
	   	return ;	
	 }else{
	         var strUrl="/crmspeed/resource/dovizitripactivate.asp?requestno="+reqNos; 
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }     	
	
}


function rejectad()
{
  //alert("this is a jsunpublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one item to reject");
	   	return ;	
	 }else{
	         var strUrl="/bh/rejectad.asp?requestno="+reqNos; 
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }     	
	
}


function completead()
{
  //alert("this is a jspublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one item to proceed");
	   	return ;	
	 }else{
	         var strUrl="/bh/completeadprocess.asp?requestno="+reqNos;
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }     	
	
}

function completead2()
{
  //alert("this is a jspublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one item to proceed");
	   	return ;	
	 }else{
	         var strUrl="/bh/completeadprocessoptions.asp?requestno="+reqNos;
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }     	
	
}

function showFullScreen(strUrl)

{
  top.document.location.href=strUrl;

}


function updateadprocess(suserid) {
//suserid=document.forms[0].username.value;
//alert("suserid:::" + suserid );
//document.body.style.cursor='wait';

// Create an instance of the XML HTTP Request object
var oXMLHTTP = new ActiveXObject( "Microsoft.XMLHTTP" );
	
// Prepare the XMLHTTP object for a HTTP POST to our validation ASP page
var sURL = "/bh/updatetopending.asp?requestno=" + suserid

oXMLHTTP.open( "POST", sURL, false );

// Execute the request
oXMLHTTP.send();
//alert("oXMLHTTP.responseText:::" + oXMLHTTP.responseText );
//if (oXMLHTTP.responseText == "False") 
	//alert("Please select another username. " + suserid + " already exists.");
	//document.forms[0].username.focus();
	//document.body.style.cursor='auto';
	

}


// ------- VMSTTP ---------

function vmsaddaccess()
{
  alert("this is a jsunpublish");
  var reqNos=getselected();
  alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one application to provide access");
	   	return ;	
	 }else{
	         var strUrl="/vms/vmsaddaccess.asp?requestno="+reqNos; 
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }     	
	
}


function vmsremoveaccess()
{
  alert("this is a jspublish");
  var reqNos=getselected();
  alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one application to remove access");
	   	return ;	
	 }else{
	         var strUrl="/vms/vmsremoveaccess.asp?requestno="+reqNos;
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }     	
	
}


function vmsback()
{
  
  history.back(-1);
	
}


function vmsaddaccessprocess()
{
  alert("this is a vmsaddaccessprocess");
  var reqNos=getselected();
  alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one application to continue!");
	   	return ;	
	 }else{
	         var strUrl="/vms/vmsaddaccessprocess.asp?requestno="+reqNos;
	         document.forms[0].action=strUrl;  
		 document.forms[0].submit(); 
	 }     	
	
}

// --- ENF OF VMSTTP --

// KARIBE //

function bhKaribeCancel()
{
  //alert("this is a jspublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one to continue");
	   	return ;	
	 }else{
	       var x=confirm("Are you sure you want to cancel this reservation?");
               if(x){	         
	           var strUrl="/karibehotel2/setstatus.asp?requestno="+reqNos + "&status=Cancelled";
	           document.forms[0].action=strUrl;  
		   document.forms[0].submit(); 
		 }
	 }     	
	
}


function khwebsitepublish()
{
  //alert("this is a jspublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one to continue");
	   	return ;	
	 }else{
	       var x=confirm("Are you sure you want to publish this content?");
               if(x){	         
	           var strUrl="/karibehotel2/setcontentstatus.asp?requestno="+reqNos + "&status=active";
	           document.forms[0].action=strUrl;  
		   document.forms[0].submit(); 
		 }
	 }     	
	
}

function bhKaribeClosed()
{
  //alert("this is a jspublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one to continue");
	   	return ;	
	 }else{
	       var x=confirm("Are you sure you want to Close this reservation?");
               if(x){	         
	           var strUrl="/karibehotel/setstatus.asp?requestno="+reqNos + "&status=Closed";
	           document.forms[0].action=strUrl;  
		   document.forms[0].submit(); 
		 }
	 }     	
	
}


function ogrgwebsitepublish()
{
  //alert("this is a jspublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one to continue");
	   	return ;	
	 }else{
	       var x=confirm("Are you sure you want to publish this content?");
               if(x){	         
	           var strUrl="/og/setcontentstatus.asp?requestno="+reqNos + "&status=active";
	           document.forms[0].action=strUrl;  
		   document.forms[0].submit(); 
		 }
	 }     	
	
}

function ogrggeneratepassword()
{
  //alert("this is a jspublish");
  var reqNos=getselected();
  //alert(reqNos);
	 if(reqNos==""){
	   	alert("Please select at least one to continue");
	   	return ;	
	 }else{
	       
	       
		if((reqNos.indexOf(",")>=0))
		{
			alert("Please select only one item");
			return ;	
		}else{
						
			var x=confirm("Are you sure you want to generate a username and password for this user?");
			if(x){	         
			   var strUrl="/og/generateuserpassword.asp?requestno="+reqNos + "&status=active";
			   document.forms[0].action=strUrl;  
			   document.forms[0].submit(); 
			 }
		 
		 
		}
	 }     	
	
}
