$(document).ready(function(){  
	if (getCookie('feedback')==null || getCookie("feedback")!="yes"){
		stinky();
		$(window).resize(stinky).scroll(stinky);
		$("#fixme").click(function(){ binky(); });
	} else {
		$("#fixme").hide();
	}
	
	//ToggleLeftNav();						//hide/Show leftNav
});

function setCookie( name, value, expires, path, domain, secure ) 
{
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );

	/*
	if the expires variable is set, make the correct 
	expires time, the current script below will set 
	it for x number of days, to make it for hours, 
	delete * 24, for minutes, delete * 60 * 24
	*/
	if ( expires )
	{
	expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );

	document.cookie = name + "=" +escape( value ) +
	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
	( ( path ) ? ";path=" + path : "" ) + 
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );	
	alert(document.cookie);
}
function getCookie( name ) 
{		
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) )
	{
		return null;
	}
	if ( start == -1 ) return null;
	var end = document.cookie.indexOf( ";", len );
	if ( end == -1 ) end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
}
//**************** g_GetCookie (work with Server side too Response.Cookies["USER.Prefs"]["YRF_Cookie_name"] = "YRF Cookie Value";)*******************************************
function g_GetCookie(sName)
{
  var doc = window.document;	//g_GetOwnerDoc();
  var sAllCookie = doc.cookie;
  var aCookie = sAllCookie.split(/(&|; )/);
  for (var i=0;i<aCookie.length;i++){
    var sCookieChunk = unescape(aCookie[i]);
    sCookieChunk=sCookieChunk.replace(/\+/g,' ');
    var aCrumb = sCookieChunk.split(/(=|:)/g);
    if(aCrumb.length>1){
		var sCookieName = aCrumb[aCrumb.length-2];
		if(sCookieName==sName){
			var vRetVal = aCrumb[aCrumb.length-1];
			return vRetVal;
		}
	}
  }
  return '';
}
function g_SetCookie(sName, sValue)
{ 
  //write user pref as a one big Cookie Crumb
  var sUserPrefs = "USER.Prefs";
  var datFar = new Date(2100,1,1);
  var sDate = datFar.toUTCString();
  var doc = window.document;		//g_GetOwnerDoc();
  var sAllCookie = unescape(doc.cookie);
  var aCookies = sAllCookie.split(/; /g);
  var sCookieValue = '';  
  //get old cooke value
  for (var i=0;i<aCookies.length;i++){
    var aCrumb = aCookies[i].split('=');
	var sCookieName = aCrumb[0];
	if(sCookieName==sUserPrefs){
		sCookieValue = aCrumb[1];
		break;
	}
  }  
  //parce old cookie value
  var bFound = false;
  var aOldCookieValues = sCookieValue.split(/&/g);
  for (var i=0;i<aOldCookieValues.length;i++){
    var aCrumb = aOldCookieValues[i].split(':');
	var sCName = aCrumb[0];
	var sCValue = aCrumb[1];
	if(sCName==sName){
		bFound=true;
		aOldCookieValues[i] = sName+':'+sValue;
		break;
	}
  }
  if(bFound){
	sCookieValue=aOldCookieValues.join('&');
  }else{
	sCookieValue+='&'+sName+':'+sValue;
  }
  //write cookie back
  doc.cookie = sUserPrefs + "=" + escape(sCookieValue)+ "; expires=" + sDate;
}

function delCookie( name, path, domain ) {
	if ( getCookie( name )!=null) document.cookie = name + "=" +
	( ( path ) ? ";path=" + path : "") +
	( ( domain ) ? ";domain=" + domain : "" ) +
	";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
function stinky() {
	var l = $(window).scrollTop() + $(window).height() - ($("#fixme").height() + 5);
	$("#fixme").css('top',l+'px').css('left','55%').css('margin-left','400px');         //1/4/11: Feedback position changed 50% -> 55%
}
function binky() {
	//alert(document.cookie);
	show_window_content(550,850,'webstat.aspx','feedback','yes');	
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////                                                                           /////////////	
///////////////////////                     Chris JS Functions                            /////////////
///////////////////////                                                                           /////////////	
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
function addEvent(elm, evType, fn)
{
	if (elm.addEventListener){
	    var useCapture = false;
		elm.addEventListener(evType, fn, useCapture);
	} else if (elm.attachEvent){
		var r = elm.attachEvent("on"+evType, fn);
	} 
};


function fLoadXmlDoc(source){
    if(!source)return null;
    var xmlDoc = fGetXmlDoc();

    if(typeof source == 'string'){
        xmlDoc.loadXML(source);
        if(xmlDoc.xml)return xmlDoc;
        source = document.getElementById(source);
    }
    var sXml = (source.xml)?source.xml:source.innerHTML;      
    xmlDoc.loadXML(sXml);
    return xmlDoc;
};

function fLoadXmlDocCash(source, fileId) {
    if (!fileId) return fLoadXmlDoc(source);
    if (!window.top[fileId]) window.top[fileId] = fLoadXmlDoc(source);
    var xmlDoc = fGetXmlDoc();
    xmlDoc.load(window.top[fileId]);
    return xmlDoc;
};


function fGetXmlDoc(){
    var xmlDoc;
    if (window.ActiveXObject){
      try{xmlDoc = new ActiveXObject("Msxml2.DOMDocument.6.0");return xmlDoc;}catch(e){};
      try{xmlDoc = new ActiveXObject("Msxml2.DOMDocument.5.0");return xmlDoc;}catch(e){};
      try{xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");return xmlDoc;}catch(e){};
      try{xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0");return xmlDoc;}catch(e){};
      try{xmlDoc = new ActiveXObject("Msxml.DOMDocument");return xmlDoc;}catch(e){};
    }else if(document.implementation){
      try{xmlDoc=document.implementation.createDocument("","",null);return xmlDoc}catch(e){};
    }
	alert("XMLDocument not supported!");
    return null;
};


function getXmlHttpObject(){

    var xReq;
	if (window.XMLHttpRequest.create){
	    try{xReq = window.XMLHttpRequest.create();return xReq;}catch(e){};
	}else if (window.XMLHttpRequest){
	    try{xReq = new XMLHttpRequest();return xReq;}catch(e){};
	}else if (window.ActiveXObject){
	  try{xReq = new ActiveXObject("MSXML2.XMLHTTP.6.0");return xReq;}catch(e){};
	  try{xReq = new ActiveXObject("MSXML2.XMLHTTP.5.0");return xReq;}catch(e){};
	  try{xReq = new ActiveXObject("MSXML2.XMLHTTP.4.0");return xReq;}catch(e){};
	  try{xReq = new ActiveXObject("MSXML2.XMLHTTP.3.0");return xReq;}catch(e){};
      try{xReq = new ActiveXObject("Microsoft.XMLHTTP");return xReq;}catch(e){};
	}
	alert("XMLHttpRequest not supported!");
	return null;
};



function fLoadXmlFile(fname){
    var xmlDoc = fGetXmlDoc();
    if(document.getElementById(fname))fname = document.getElementById(fname);
    xmlDoc.async=false;
    xmlDoc.load(fname);
    fIsErrorXml(xmlDoc);
    return xmlDoc;
};

function fLoadXmlFileCash(fname, fileId) {
    if (!fileId) fileId = fname;
    if (!window.top[fileId]) window.top[fileId] = fLoadXmlFile(fname);
    var xmlDoc = fGetXmlDoc();
    xmlDoc.load(window.top[fileId]);
    return xmlDoc;
};


function fLoadXmlFileAsync(fname){
    var xmlDoc = fGetXmlDoc();
    xmlDoc.async=true;
    xmlDoc.load(fname);
    return xmlDoc;
};

function fLoadAsync(post_url, post_data, callback){
	var http = getXmlHttpObject();
	if(!http)return;
	http.onreadystatechange = function(){if(http.readyState == 4)callback(http.responseText)};
	http.open("POST", post_url);
	http.send(post_data);
	return false;
};


function fShowTransform(xmlDoc,xslDoc,targetId)
{
    if(typeof xmlDoc == 'string'){
        var xDoc = fGetXmlDoc();
        xDoc.loadXML(xmlDoc);
        xmlDoc = xDoc;
    }
    
    var target = document.getElementById(targetId);
    // code for IE
    if (window.ActiveXObject){
      xslDoc.resolveExternals = true;
      xslDoc.setProperty('AllowXsltScript','true');
      var ex=xmlDoc.transformNode(xslDoc);
      target.innerHTML=ex;
    }
    // code for Mozilla, Firefox, Opera, etc.
    else if (document.implementation && document.implementation.createDocument){
      var xsltProcessor=new XSLTProcessor();
      xsltProcessor.importStylesheet(xslDoc);
      var resultDocument = xsltProcessor.transformToFragment(xmlDoc,document);
      target.innerHTML = "";
      target.appendChild(resultDocument);
    }
};


function fSetParamValue(xDoc, sParmName, sParmValue){
    if (!xDoc.xml) return null;
    var xConfig = xDoc.selectSingleNode('//config');
    if (!xConfig) return null;
    var xParm = xConfig.selectSingleNode('param[@name="'+sParmName+'"]');
    if(!xParm){
        xParm = xDoc.createElement('param');
        xParm.setAttribute('name',sParmName);
        xConfig.appendChild(xParm);
    }
    xParm.setAttribute('value', sParmValue);

    if (!sParmValue) {
        xConfig.removeChild(xParm);
    }
    
    return xDoc;
};


//*****ccai(11/10/09) Generic function to get XML xDoc field value ***************
function fGetXmlFieldValue(xDoc, sParmName) {
    sReturnValue = xDoc.selectSingleNode("//field[@name='" + sParmName + "']/@value");
    if (sReturnValue)
        return sReturnValue ? sReturnValue.nodeValue : null;
};

//*****ccai(11/10/09) Generic function to get XML xDoc rowset/rows count***************
function fGetXmlRowsCount(xDoc, rowsetID) {
    if (rowsetID)
        sReturnValue = xDoc.selectSingleNode("//rowset[@id='" + rowsetID + "']/@rows");
    else
        sReturnValue = xDoc.selectSingleNode("//rowset[@id='1']/@rows");

    if (sReturnValue)
        return sReturnValue ? sReturnValue.nodeValue : null;
};

//***************ccai 10/6/09 Returns DropDown-Option Text (parameter=Value) ******************
// eg. <select><option value='1'>Routine</option><option value='2'>Emergency</option></select>
function gGetXMLDropDownText(sOptions, pValue) {
    if (!sOptions || !pValue) return pValue;     //return if blank values
    var xmlDoc = fGetXmlDoc();
    xmlDoc.async = "false";
    var sXML = "<select>" + sOptions + "</select>";
    if (!xmlDoc.loadXML(sXML)) return pValue;    //Return pValue if XML-Parsing error
    var xParm = xmlDoc.selectSingleNode('//option[@value="' + pValue + '"]');
    return xParm ? xParm.text : pValue;     //return Text if found, else return pValue
};

function fJqSortTable(sTableID) {

    var tSorted = $('#' + sTableID).tablesorter();
    tSorted.addClass('tablesorter');

    var thHeadCells = $('#' + sTableID + ' thead tr th');

    thHeadCells.attr('title', 'Sort');

    thHeadCells.hover(function() {
        $(this).addClass('in');
    }, function() {
        $(this).removeClass('in');
    });


    var arrTrs = $('#' + sTableID + ' tbody tr');

    $(arrTrs.selector + ':odd').addClass('odd');

    $(arrTrs.selector + ':even').addClass('even');

    arrTrs.hover(function() {

        $(this).addClass('in');
    }, function() {
        $(this).removeClass('in');
    });

    arrTrs.click(function() {
        var oSelectedRow = tSorted[0].selectedRow;
        if (oSelectedRow) {
            oSelectedRow.removeClass('selected');
        };

        tSorted[0].selectedRow = $(this);
        $(this).removeClass('in');
        $(this).addClass('selected');

    })
};


function fGetTimeArray() {
    var dt = new Date();
    var arrTimes = new Array();
    
    for (var h=0;h<23;h++){
        for (var m = 0; m < 59; m+=15) {
            dt.setHours(h, m, 0, 0);
            arrTimes.push(fFormatTime(dt));
        }
    }
    return arrTimes;
};

//******** 12/02/2011  (with leading zeros)
function fFormatDate(dat) {
    var vRetVal = '';
    try {
        var da = new Date(dat); // Create a Date Object set to parm date
        if (isNaN(da)) return '';
        var dy = da.getFullYear(); // Get full year (as opposed to last two digits only) 
        var dm = da.getMonth() + 1; // Get month and correct it (getMonth() returns 0 to 11) 
        var dd = da.getDate(); // Get date within month 
        var ys = new String(dy); // Convert year, month and date to strings 
        var ms = new String(dm);
        var ds = new String(dd);
        if (ms.length == 1) ms = "0" + ms; // Add leading zeros to month and date if required 
        if (ds.length == 1) ds = "0" + ds;
        vRetVal = ms + '/' + ds + '/' + ys; // Combine year, month and date in ISO format 
    } catch (ex) { };
    return vRetVal.toString();
};
//******** 12/2/2011 (no leading zeros)
function fFormatDate2(dat) {
    var vRetVal = '';
    try {
        var da = new Date(dat); // Create a Date Object set to parm date
        if (isNaN(da)) return '';
        var dy = da.getFullYear(); // Get full year (as opposed to last two digits only) 
        var dm = da.getMonth() + 1; // Get month and correct it (getMonth() returns 0 to 11) 
        var dd = da.getDate(); // Get date within month 
        var ys = new String(dy); // Convert year, month and date to strings 
        var ms = new String(dm);
        var ds = new String(dd);
        vRetVal = ms + '/' + ds + '/' + ys; // Combine year, month and date in ISO format 
    } catch (ex) { };
    return vRetVal.toString();
};


function fFormatTime(dat) {
    var vRetVal = '';
    try {
        if (dat.length < 12) return '';
        var da = new Date(dat);
        if (isNaN(da)) return '';

        var iHour = da.getHours();

        var a_p = (iHour < 12) ? 'AM' : 'PM';

        if (iHour == 0) {
            iHour = 12;
        }
        if (iHour > 12) {
            iHour -= 12;
        }
        var h = new String(iHour);
        var m = new String(da.getMinutes());

        if (m.length == 1) m = '0' + m;

        vRetVal = h + ':' + m + ' ' + a_p;
    } catch (ex) { }
    return vRetVal.toString();
};

function fFormatSsnKeyPress() {
    var inp = event.srcElement;
    if (event.keyCode > 57 || event.keyCode < 48) return false;
    var num = inp.value.replace(/\D/g, '') + String.fromCharCode(event.keyCode); 
    var v03 = num.substring(0, 3);
    var v36 = num.substring(3, 5);
    if (v36) v36 = '-' + v36;
    var v59 = num.substring(5, 9);
    if (v59) v59 = '-' + v59;
    num = v03 + v36 + v59;
    inp.value = num;
    return false;
};


function fFormatPhoneKeyPress() {
    var inp = event.srcElement;
    if (event.keyCode > 57 || event.keyCode < 48) return false;
    var num = inp.value.replace(/\D/g,'');
    if (num.length >= 3) {
        var vArea = '(' + num.substring(0, 3) + ') ';
        var vPart1 = num.substring(3, 6);
        var vPart2 = (num.substring(5, 10)) ? '-' + num.substring(6, 10) : '';
        var vExt = (num.substring(9)) ? ' x' + num.substring(10) : '';
        num = vArea + vPart1 + vPart2 + vExt;
    }
    inp.value = num;
};
//*********CCai: PhoneNumbers only (212) 5435-2422 536 onkeypress="return fFormatNumberKeyPress2();" **************
/*
function fFormatNumberKeyPress2() {
    var unicode = event.charCode ? event.charCode : event.keyCode;
    if (unicode == 44 || unicode == 46 || unicode == 8) return true;  //allowed .=46 and ,=44 //if the key isn't the backspace key (which we should allow)
    if (unicode < 48 || unicode > 57) return false; //disable key press
    return true;
};
*/


function fFormatPhoneKeyUp() {
    var inp = event.srcElement;
    var keyCode = event.keyCode;

    if (keyCode == 8 || keyCode == 46) return true;
    var num = inp.value.replace(/\D/g, '');
    if (num.length >= 3) {
        var vArea = '(' + num.substring(0, 3) + ') ';
        var vPart1 = num.substring(3, 6);
        var vPart2 = (num.substring(5, 10)) ? '-' + num.substring(6, 10) : '';
        var vExt = (num.substring(9)) ? ' x' + num.substring(10) : '';
        num = vArea + vPart1 + vPart2 + vExt;
    }
    inp.value = num;
};

//**** Cai updated  11/4/2010 (usage: onkeypress="return gFormatDateKeyPress();")************
function gFormatDateKeyPress() {
    oEvent = window.event;
    if (oEvent.keyCode > 57 || oEvent.keyCode < 47) return false;       //47=/
    var inp = oEvent.srcElement;
    //$.datepicker._hideDatepicker(inp);
    var num = inp.value.replace(/\D/g, '') + String.fromCharCode(oEvent.keyCode);
    if(num.length<5){                    //if great than 01/21/, don't do anything
        var sMon = num.substring(0, 2);
        if (num.substring(1, 2) == '/') sMon = '0' + sMon;  //  prepend 0
        if (sMon.length == 2) sMon += '/';
        var sDay = num.substring(2, 4);
        if (num.substring(3, 4) == '/') sDay = '0' + sDay;  //  prepend 0
        if (sDay.length == 2) sDay += '/';
        var sYear = num.substring(4, 8);
        inp.value = sMon + sDay + sYear 
        return false;          
    }        
};

function fFormatDateKeyUp() {
    var inp = event.srcElement;
    var keyCode = event.keyCode;

    if (keyCode == 8 || keyCode == 46) return true;
    var num = inp.value.replace(/\D/g, '');

    $.datepicker._hideDatepicker(inp);
    
    var num = inp.value.replace(/\D/g, '')
    var sMon = num.substring(0, 2);
    if (sMon.length == 2) sMon += '/';
    var sDay = num.substring(2, 4);
    if (sDay.length == 2) sDay += '/';
    var sYear = num.substring(4, 8);

    inp.value = sMon + sDay + sYear
};




//*********CCai: Numbers only 123,2234.22 onkeypress="return fFormatNumberKeyPress();" **************
function fFormatNumberKeyPress() {
    //var inp = event.srcElement;
    var unicode = event.charCode ? event.charCode : event.keyCode;
    if (unicode == 44 || unicode == 46 || unicode == 8) return true;  //allowed .=46 and ,=44 //if the key isn't the backspace key (which we should allow)
    if (unicode < 48 || unicode > 57) return false; //disable key press
    return true;
};
//*********CCai: Full Numbers only 001234567 onkeypress="return fFormatNumberKeyPress2();" **************
function fFormatNumberKeyPress2() {
    //var inp = event.srcElement;
    var unicode = event.charCode ? event.charCode : event.keyCode;
    if (unicode == 8) return true;  //if the key isn't the backspace key (which we should allow)
    if (unicode < 48 || unicode > 57) return false; //disable key press
    return true;
};

function fFormatMoney2(amount) {
    var i = parseFloat(amount);
    if (!i) i = 0.00;
    var minus = i < 0 ? '-' : '';
    i = parseInt((Math.abs(i) + .005) * 100) / 100;
    s = new String(i);
    if (s.indexOf('.') < 0) { s += '.00'; }
    if (s.indexOf('.') == (s.length - 2)) { s += '0'; }
    return minus + s;
};

function fFormatMoney(amount) {
    var sign = '$';
    try {
        amount = parseFloat(amount.toString().replace(/[^-.\d]/g, ''));
        sign = amount < 0 ? '-$' : '$';
        amount = Math.abs(amount).toFixed(2);
        var re = /(-?[0-9]+)([0-9]{3})/;
        while (re.test(amount)) amount = amount.replace(re, '$1,$2');
    } catch (ex) {
        amount = '0.00';
    };
    return (sign + amount).toString();
};

function fUnformatMoney(amount) {
    try{
        amount = amount.toString().replace(/[^-.\d]/g, '');
        amount = parseFloat(amount);
        if (!amount) amount = 0;
    } catch (ex) { return 0; }
    return amount;
};

//********** Add Thousand seperators for money/currency  **************
function addCommas(sValue) {
	sValue = String(sValue)
    var sRegExp = new RegExp('(-?[0-9]+)([0-9]{3})');
    while (sRegExp.test(sValue)) {
        sValue = sValue.replace(sRegExp, '$1,$2');
    }
    return sValue;
};
//******** Make sure 2 decimals are in place **********
function add2Decimals(amount) {
    s = String(amount);
    if (s.indexOf('.') < 0) { s += '.00'; }
    if (s.indexOf('.') == (s.length - 2)) { s += '0'; }
    return s;
};

/*
function isDate(dat) {
    try {
        var da = new Date(dat);
        if (isNaN(da)) return false;
        window.g_dtNow = window.g_dtNow ? window.g_dtNow : new Date();
        window.g_dtFrom = window.g_dtFrom ? window.g_dtFrom : (new Date()).setFullYear(window.g_dtNow.getFullYear() - 100);
        window.g_dtTo = window.g_dtTo ? window.g_dtTo : (new Date()).setFullYear(window.g_dtNow.getFullYear() + 10);
        if (da < window.g_dtFrom || da > window.g_dtTo) return false;
    } catch (e) {
        return false;
    }
    return true;
};

function isDate2(dat) {
    dat = fFormatDate(dat);
    var dob = /(0[1-9]|1[012])+\/(0[1-9]|[12][0-9]|3[01])+\/(19|20)\d\d/;
    if (dat.match(dob)) {
        return true;
    } else {
        return false;
    };
};*/
//********cai 10/27/2010: Generic Date Validator  ********* var toTest = "2/29/2010";
function isDate(toTest) {
    if(toTest=="" || toTest==null) return true;     //bypass blank dates
    var regex=/((^(10|12|0?[13578])([/])(3[01]|[12][0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(11|0?[469])([/])(30|[12][0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(0?2)([/])(2[0-8]|1[0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(0?2)([/])(29)([/])([2468][048]00)$)|(^(0?2)([/])(29)([/])([3579][26]00)$)|(^(0?2)([/])(29)([/])([1][89][0][48])$)|(^(0?2)([/])(29)([/])([2-9][0-9][0][48])$)|(^(0?2)([/])(29)([/])([1][89][2468][048])$)|(^(0?2)([/])(29)([/])([2-9][0-9][2468][048])$)|(^(0?2)([/])(29)([/])([1][89][13579][26])$)|(^(0?2)([/])(29)([/])([2-9][0-9][13579][26])$))/;
    return (regex.test(toTest));
};

function trim(str) {
   return str.replace(/^\s+|\s+$/g, ''); // trim
};

function isEmail(str) {
    str = str.replace(/^\s+|\s+$/g, ''); // trim
    var re = /^[\w-_\.+]*[\w-_\.]\@([\w]+\.)+[\w]+[\w]$/;
    return re.test(str);
};
// returns true if the string only contains characters A-Z or a-z
function isAlpha(str) {
    var re = /[^a-zA-Z]/g;
    return (re.test(str)) ? false : true;
};
// returns true if the string only contains characters 0-9
function isNumeric(str) {
    var re = /[\D]/g;
    return (re.test(str)) ? false : true;
};
// returns true if the string only contains characters A-Z, a-z or 0-9
function isAlphaNumeric(str) {
    var re = /[^a-zA-Z0-9]/g
    return (re.test(str)) ? false : true;
};

function isPhone(str) {
    var stripped = str.replace(/[\(\)\.\-\ x]/g, '');
    //strip out acceptable non-numeric characters
    if (isNaN(parseInt(stripped))) return false;
    if(!isNumeric(stripped)) return false;		//cai: must be numbers only
    if (stripped.length > 13 || stripped.length < 10) return false;
    return true;
};

function isSSN(str) {
    var re = /^\d{3}-\d{2}-\d{4}$/
    return re.test(str);
};

function isMoney(str) {
    return /^\$?([0-9]{1,3},([0-9]{3},)*[0-9]{3}|[0-9]+)(.[0-9][0-9])?$/.test(str);
};

function fDateDiff(date1, date2, sPeriod) {
    // sets difference date to difference of first date and second date
    var diff = new Date();
    var iRetval = null;
    
    diff.setTime(Math.abs(date1.getTime() - date2.getTime()));

    var timediff = diff.getTime();

    var weeks = Math.floor(timediff / (1000 * 60 * 60 * 24 * 7));
    //timediff -= weeks * (1000 * 60 * 60 * 24 * 7);

    var days = Math.floor(timediff / (1000 * 60 * 60 * 24));
    //timediff -= days * (1000 * 60 * 60 * 24);

    var hours = Math.floor(timediff / (1000 * 60 * 60));
    //timediff -= hours * (1000 * 60 * 60);

    var mins = Math.floor(timediff / (1000 * 60));
    //timediff -= mins * (1000 * 60);

    var secs = Math.floor(timediff / 1000);
    //timediff -= secs * 1000;

    switch (sPeriod) {
        case 'months':
            iRetval = fMonthsBetween(date1, date2);
            break;
        case 'weeks':
            iRetval = weeks;
            break;
        case 'days':
            iRetval = days;
            break;
        case 'hours':
            iRetval = hours;
            break;
        case 'mins':
            iRetval = mins;
            break;
        case 'secs':
            iRetval = secs;
            break;
        default:
            iRetval = days;
            break;
    };
    return iRetval;
};

function fMonthsBetween(date1, date2) {
    var y1 = date1.getFullYear();
    var y2 = date2.getFullYear();
    var m1 = date1.getMonth();
    var m2 = date2.getMonth();
    var iMonths = (y2 - y1) * 12 + m2 - m1;
    return iMonths < 0 ? -iMonths : iMonths;
};

function fDaysInMonth(year, month) {
    //month is from 1 to 12
    var dd = new Date(year, month, 0);
    return dd.getDate();
}; 



function fLoadArray(inputID) {
    var arrEmps = new Array();
    var arrEmpsRow = $('#' + inputID).val().split('|');

    for (var i = 1; i < arrEmpsRow.length; i += 2) {
        var sEmpID = arrEmpsRow[i - 1];
        var sEmpName = arrEmpsRow[i]
        arrEmps.push({ id: sEmpID, name: sEmpName });
    }
    return arrEmps;

};

function fLoadOptions(sPipeDelimText) {
    sOpts = '';
    arrOptsRow = sPipeDelimText.split('|');

    for (var i = 1; i < arrOptsRow.length; i += 2) {
        var sOptVal = arrOptsRow[i - 1];
        var sOptText = arrOptsRow[i]
        sOpts += "<option value='" + sOptVal + "'>" + sOptText + "</option>\n";
    }
    return sOpts;

};


///////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////                                                                           /////////////	
///////////////////////                     Error Handling Functions                              /////////////
///////////////////////                                                                           /////////////	
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
function fClearInfo() {
    $('#uiInfoMsg').html('');
    $('#uiInfoButtons').hide();
    $('#uiInfo').hide();
};

function fAddMessage(sMsg) {
    if (!window.arrErrs) window.arrErrs = new Array();
    window.arrErrs.push('<span class="errMsg">' + (window.arrErrs.length + 1) + '. ' + sMsg + '</span>');
};


function fShowInfo() {
    if (window.arrErrs)if (window.arrErrs.length) {
        $('#uiInfoMsg').html(window.arrErrs.join('<br/>'));
        window.arrErrs = null;
        $('#uiInfo').show('slow');
        $('#uiInfoButtons').hide();
        return false;
    };
    return true;
};


function fAddWarning(sMsg) {
    if (!window.arrWarns) window.arrWarns = new Array();
    window.arrWarns.push('<span class="wrnMsg">' + (window.arrWarns.length + 1) + '. ' + sMsg + '</span>');
};

function fShowWarning(fOkCallback) {

    if (fOkWarnings()) {
        window.arrWarns = null;
        return true;
    };

    if (window.arrWarns) if (window.arrWarns.length) {
        $('#uiInfoOk').unbind().click(fClearInfo).click(fOkWarnings);
        if (fOkCallback) $('#uiInfoOk').click(fOkCallback);
        $('#uiInfoCancel').unbind().click(fClearInfo);

        $('#uiInfoMsg').html(window.arrWarns.join('<br/>'));
        window.arrWarns = null;
        
        $('#uiInfo').show('slow');
        $('#uiInfoButtons').show();
        return false;
    };
    return true;
};

function fOkWarnings(oEvent) {
    var bOk = window.okWarnings ? true : false;
    window.okWarnings = oEvent ? true : false;
    return bOk;
}

//**********ccai 11/12/2009 generic Required validation function ***************
function fRequireValidation() {
    $('.required').each(function() {
        if (!$(this).val()) {
            var sFldTitle = $(this).parent().prev().html();
            fAddMessage(sFldTitle + ' must be defined.');
        }
    });

    $('input.phone[value!=]').each(function() {
        var sFldTitle = $(this).parent().prev().html();
        if (!isPhone($(this).val())) fAddMessage('Invalid ' + sFldTitle);
    });

    $('input.date[value!=]').each(function() {
        var sFldTitle = $(this).parent().prev().html();
        if (!isDate($(this).val())) fAddMessage('Invalid ' + sFldTitle);
    });
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////                                                                           /////////////	
///////////////////////        fAsyncResponse being called from pseudo AJAX response clallback    /////////////
///////////////////////                                                                           /////////////	
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
function fLoadAsync(sAction) {
    if (!window.form1) window.form1 = document.getElementById("form1");
    form1.target = "ifmLoadResp";
    if (sAction) $('#uiAction').val(sAction);
    form1.submit();
};

function fAsyncResponse(respBody) {
    var action;
    var xResponseXml;
    var xDoc = fGetXmlDoc();

    try {
        if (typeof (respBody) == 'string') {
            xResponseXml = respBody;
            xDoc.loadXML(xResponseXml);
            action = xDoc.selectSingleNode("//param[@name='mode']/@value");
            if (action) action = action.nodeValue;
        } else {
            action = respBody.document.getElementById('uiAction').value;
            xResponseXml = respBody.document.getElementById('xdata').xml;
            xDoc.loadXML(xResponseXml);
        }   
    } catch (e) {
        fAddMessage('Error in functions.js method fAsyncResponse(): '+ e.message);
        $('#uiInfo').show('slow');
        return false;
    }

    if (!fIsErrorXml(xDoc)) return false;    
    
    if (window.fAsyncResponseXdoc) return fAsyncResponseXdoc(xDoc, action);   
    return false;
};

function fIsErrorXml(xDoc) {
    if (!xDoc) {
        fAddMessage('Error in functions.js method fIsErrorXml(): Invalid XML Document');
        $('#uiInfo').show('slow');
        return false;
    }
    var xResponseXml = "";
    try{
        if(xDoc.xml)xResponseXml = xDoc.xml;
        if (!xResponseXml) xResponseXml = xDoc.toString();
     }catch(e){};
    
    if (!xResponseXml) {
        fAddMessage('Error in functions.js method fIsErrorXml(): Invalid XML Document');
        $('#uiInfo').show('slow');
        return false;
    }
    if (xResponseXml.indexOf('<error>') > 0) {
        if (!window.XslErr) window.XslErr = fLoadXmlFile('../../App_Script/functions.xslt');
        fShowTransform(xResponseXml, XslErr, "uiInfoMsg");
        $('#uiInfo').show('slow');
        return false;
    }
    if (xResponseXml.indexOf('<field name="Error"') > 0) {
        var err = xDoc.selectSingleNode("//field[@name='Error']/@value");
        if (err) err = err.nodeValue;
        fAddMessage(err);
        fShowInfo();
        return false;
    }
    return true;
};

function fSubmitAjaxForm(sAction) {
    if (sAction) $('#uiAction').val(sAction);
    $('#uiLocalDate').val(new Date());
    $('#form1').ajaxSubmit({
        type: 'POST',
        success: fAsyncResponse
    });
    return false;
};



function fLoadXmlFileJq(fname) {
    var xmlDoc = fGetXmlDoc();
    if (window.ActiveXObject) {
        xmlDoc.async = false;
        xmlDoc.load(fname);
    } else {
        xmlDoc = $.ajax({
            url: fname,
            async: false,
            dataType: 'xml'
        }).responseXML;
    }
    if (!fIsErrorXml(xmlDoc)) return null;
    return xmlDoc;
};



function fLoadFile(fname) {
    var sText = $.ajax({
        url: fname,
        async: false
    }).responseText;
    if (sText) if (!fIsErrorXml(sText)) return null;
    return sText;
};

function fLoadFileCash(fname, fileId) {
    if (!fileId) fileId = fname;
    if (!window.top[fileId]) window.top[fileId] = fLoadFile(fname);
    var sText = window.top[fileId];
    return sText;
};


function fAjaxWait(fCallbackName, iTimes) {
    if (!window.timers) window.timers = new Array();
    if (timers.length > iTimes) {
        for (var timer in timers) window.clearTimeout(timer);
        fAddMessage('Ajax load data problem: ' + fCallbackName);
        fShowInfo();
    } else {
        timers.push(window.setTimeout(fCallbackName, 200));
    };
};


////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Start Group of All Query String Functions
//**************** global Javascript QueryString***************************
function g_Querystring() {
    var querystring = location.search.substring(1, location.search.length); // get the query string, ignore the ? at the front.
    var args = querystring.split('&'); // parse out name/value pairs separated via &
    for (var i = 0; i < args.length; i++)		// split out each name = value pair
    {
        var pair = args[i].split('=');
        temp = unescape(pair[0]).split('+'); // Fix broken unescaping
        temp0 = temp.join(' ');
        temp = unescape(pair[1]).split('+');
        temp1 = temp.join(' ');
        this[temp0] = temp1;
    }
    this.get = g_Querystring_get;
}

function g_Querystring_get(strKey, strDefault) {
    var value = this[strKey];
    if (value == null) { value = strDefault; }
    return value;
}


//***********11/03/05 VP: 1. Replace the existing querystring with a new querystring value; 2. if the new querystring doesn't exist, Add it
function g_GetFreshUrl(sOldUrl, sName, sValue) {
    var sReturn = "";
    var n = sOldUrl.indexOf("?");
    if (n == -1) {
        sReturn = sOldUrl + "?" + sName + "=" + escape(sValue);
    } else {
        var found = false;
        var host = sOldUrl.substring(0, n + 1);
        var qs = sOldUrl.substring(n + 1);
        var params = qs.split("&");
        for (i = 0; i < params.length; i++) {
            var pair = params[i].split("=");
            if (pair[0].toLowerCase() == sName.toLowerCase()) { params[i] = pair[0] + "=" + escape(sValue); found = true; break; }
        }
        if (found == false) params[params.length] = sName + "=" + escape(sValue);
        for (var j = 0; j < params.length; j++) {
            var pair = params[j].split("=");
            if (pair[1]) {	//CC:9/12/06 Remove any blank values from QueryString.
                host += pair[0] + "=" + pair[1] + "&";
            }
        }
        sReturn = host.substring(0, host.length - 1);
    }
    return sReturn;
}


//******************ccai 12/8/09: JQuery DatePicker class="date-pick" is required (eg. <input name="dtDate" id="dtDate" class="date-pick">) ***************************
function g_JQuery_DatePicker() {
    Date.firstDayOfWeek = 0;
    Date.format = 'mm/dd/yyyy';
    // $('.date-pick').datePicker({ startDate: '01/01/1996' });
    //$('.date-pick').datePicker({ clickInput: true })
    //$('.date-pick').datePicker();     //can't select past dates
    //$('.date-pick').datePicker({ startDate: '01/01/1996' });
    //$('.date-pick').dpSetPosition($.dpConst.POS_TOP, $.dpConst.POS_RIGHT);    //Position

    $('.date-pick').datePicker({ startDate: '01/01/1900' }).dpSetPosition($.dpConst.POS_TOP, $.dpConst.POS_RIGHT);


}

//******************ccai 12/21/09:  Prevent Copy/Paste ******************
function noCopyMouse(e) {
    var isRight = (e.button) ? (e.button == 2) : (e.which == 3);

    if (isRight) {
        //alert('You are prompted to type this twice for a reason!');
        alert("Please don't copy and paste here!");
        return false;
    }
    return true;
}

//******************ccai 12/21/09:  Prevent Copy/Paste ******************
function noCopyKey(e) {
    var forbiddenKeys = new Array('c', 'x', 'v');
    var keyCode = (e.keyCode) ? e.keyCode : e.which;
    var isCtrl;

    if (window.event)
        isCtrl = e.ctrlKey
    else
        isCtrl = (window.Event) ? ((e.modifiers & Event.CTRL_MASK) == Event.CTRL_MASK) : false;

    if (isCtrl) {
        for (i = 0; i < forbiddenKeys.length; i++) {
            if (forbiddenKeys[i] == String.fromCharCode(keyCode).toLowerCase()) {
                //alert("Please don't copy and paste here!");
                return false;
            }
        }
    }
    return true;
}

//******************ccai 5/11/10: ToggleLeftNav******************
function ToggleLeftNav() {
	$('#divLeftNavToggle').show();				//Show if hidden Remove this code once available to all
	//***** Default=Hide **********
	/*if(hide=="hide"){
		$('#tdLeftNav').width('10px');		//$('#tdLeftNav').hide('slow'); 		
		$('#Navigator_navigator_placeholder, #facebook').hide();
		$(this).attr('src','images/ui/nav_arrow.gif');	
		
		$('#leftNavToggle').toggle(function() {
			$('#tdLeftNav').width('204px');		//$('#tdLeftNav').show('slow'); 	
			$('#Navigator_navigator_placeholder, #facebook').show('slow');	
			$(this).attr('src','images/ui/nav_arrow_left.gif');
		}, function() {		
			$('#tdLeftNav').width('10px');		//$('#tdLeftNav').hide('slow'); 		
			$('#Navigator_navigator_placeholder, #facebook').hide('slow');
			$(this).attr('src','images/ui/nav_arrow.gif');	
		});
	}else{*/	
		$('#leftNavToggle').toggle(function() {
			$('#tdLeftNav').width('10px');		//$('#tdLeftNav').hide('slow'); 		
			$('#Navigator_navigator_placeholder, #facebook').hide('slow');
			$(this).attr('src','images/ui/nav_arrow.gif');	
		}, function() {		
			$('#tdLeftNav').width('204px');		//$('#tdLeftNav').show('slow'); 	
			$('#Navigator_navigator_placeholder, #facebook').show('slow');	
			$(this).attr('src','images/ui/nav_arrow_left.gif');
		});
	//}

}
//******************ccai 5/11/10: Hide Left Nav completely******************
function HideLeftNav(){
	$('#tdLeftNav').hide();
}
//******* ccai 6/17/10: Remember Scroll Position ****************
function gScrollTop()
{
	var scrollPos = g_GetCookie("scrollPos");
	if(scrollPos>0){		
		$('html, body').animate({scrollTop:scrollPos});	
		g_SetCookie("scrollPos",0);						//reset back to 0
	}
}

//******* ccai 5/25/10: AutoSave **** Sample Usage: <a href="TalentProfile.aspx?mode=desiredpostions&#38;action=edit&#38;fundid=1234" onclick="return gAutoSave(this);">
function gAutoSave(objThis)
{
	g_SetCookie("scrollPos",$(window).scrollTop());	//save current scroll position
	gAjaxSubmit(objThis);
	return false;	//default= false, AjaxSubmit will redirect correctly if success.
}
//*******ccai 5/25/10: AJAX Submit CURRENT page (Post) ***************
function gAjaxSubmit(objThis)
{
	$.ajax({
		type: "POST",		
        url: document.location.href,            //url: $(location).attr('href'),		//Fix FireFox Issue
		dataType: "html",
        cache: false,
		data:  $('form').serialize(),           //data:  $('form :input').serialize(),    Fix FireFox Issue
		success: function(xml) {
			//alert("Ajax Success: "+ xml);
			document.location.href=objThis.href;		//redirect to href if success
		},
		error: function(XMLHttpRequest, textStatus, errorThrown) {
			//alert("Save Failed: "+ textStatus + " errorThrown: "+ errorThrown);
			alert("Bad input data: Please correct data and try again.");
		}
	});			
}

//addEvent(window, 'load', fMoveTraceDiv);
function fMoveTraceDiv()
{
    $('#__asptrace').css('position','relative').css('top','1300px');
}

//************CAI/JA 2010_07_01: Prevent Copy and Paste (Not needed?)*************************
//**** just add onpaste="return false;"  into any input boxes ***************
//** Sample usage:  <input name="txtEmail" type="text" value="* Email Address"   onpaste="return false;"  />
function gPreventCopyPaste()
{
    var fields = [];
    var inputs = document.getElementsByTagName("input");
    var textareas = document.getElementsByTagName("textarea");

    for (var i = 0; i < inputs.length; i++) {  fields.push(inputs[i]);    }
    for (var i = 0; i < textareas.length; i++) {   fields.push(textareas[i]);   }

    for (var i = 0; i < fields.length; i++) {
        var field = fields[i];
        if (typeof field.onpaste != "function" && !!field.getAttribute("onpaste")) {
            field.onpaste = eval("(function () { " + field.getAttribute("onpaste") + " })");
        }
        if (typeof field.onpaste == "function") {
            var oninput = field.oninput;
            field.oninput = function() {
                if (typeof oninput == "function") {    oninput.apply(this, arguments);     }
                if (typeof this.previousValue == "undefined") {       this.previousValue = this.value;            }
                var pasted = (Math.abs(this.previousValue.length - this.value.length) > 1 && this.value != "");
                if (pasted && !this.onpaste.apply(this, arguments)) {        this.value = this.previousValue;     }
                this.previousValue = this.value;
            };
            if (field.addEventListener) {
                field.addEventListener("input", field.oninput, false);
            } else if (field.attachEvent) {
                field.attachEvent("oninput", field.oninput);
            }
        }
	}
}

//*********** toggleDiv function show/hide children dev sections
function toggleDiv0(name,id) 
{
	if (document.getElementById || document.all || document.layers)
	{
		if (document.getElementById)
		{
			var d = document.getElementById(name+'_'+id);
			var i = document.getElementById('img_'+name+'_'+id);
			if (d.style.display == "") {
				d.style.display = "none";
				i.src = 'images/ui/plus.gif';
			} else {
				d.style.display = "";		
				i.src = 'images/ui/minus.gif';
			}
		}
	}
}
//*********** Generic toggleDiv function show/hide children dev sections
function toggleDiv(idDiv){
	var oDiv = $('#'+ idDiv);
	var oImg = $('#'+ idDiv + '_img');
	
	if (oDiv.is(':visible')) {
		oImg.attr("src", "images/ui/plus.gif"); 
	}else{
		oImg.attr("src", "images/ui/minus.gif"); 	
	} 	
	oDiv.toggle('fast'); 
}
//*********** Generic Javascript AJAX /JSON Tracer ************
function traceJS(title, info){
	var g_QS = new g_Querystring();				// Activate JS QueryString
	var	trace = g_QS.get("trace");
	if(trace=="1"){
        title = title.replace(/\&/g,' &');      //create & spacing
        info = info.replace(/\></g,'> <');        //create <XML> spacing
		$('#tracer').text("Trace: "+ title +" : "+ unescape(info)).css('background-color','yellow');	
	}
}
function traceJSON(title, info) {
    var g_QS = new g_Querystring(); 			// Activate JS QueryString
    var trace = g_QS.get("trace");
    if (trace == "1") {
        title = title.replace(/\&/g, ' &');      //create & spacing
        //info = info.replace(/\></g, '> <');        //create <XML> spacing
        //$('#tracer').text("Trace: " + title + " : " + unescape(info)).css('background-color', 'yellow');
        $('#tracer').text("Trace: " + title ).css('background-color', 'pink');
        debugger;
    }
}	
//******** Get Querystring ************** Usage: var str = g_QS.get("uiAcctFee");
//var g_QS = new g_Querystring();

//******* Global Show/Hide single ID sections (Optional: classHide - multiples classes)**********
function gShow(idName, classHide) {
    if (classHide != null) $(classHide).hide('fast');         //Hide optional items (eg, classes)
    $(idName).show('fast');
}
function gHide(idName) {
    $(idName).hide('fast');
}
//******* Refresh Parent Window (1=forceRefresh)***************Usage: $(window).unload(function() { gRefreshParent(1); });
function gRefreshParent(forceRefresh) {
    if (forceRefresh == 1)
        window.opener.location.reload();                                        //force refresh if SUBMIT        
    else
        window.opener.location.href = window.opener.location.href;            //reload asp    window.opener.location=('page.asp')
}
//***************** Drowpdown click and Go ****** usage:  $("#filter_status").change(function() { OnDropdownChangeAndGo(this); });
function OnDropdownChangeAndGo(objThis) {
    var pathname = window.location.pathname + window.location.search;
    pathname = g_GetFreshUrl(pathname, objThis.name, objThis.value);
    //alert(pathname);
    window.location = pathname;
}
//****** Refresh Page every x mil-secs ****timeperiod: 1000=1 sec, 60000=1min 600000=10 mins *******
function gRefreshPage(timeperiod){
    setTimeout("window.location.reload(true);",timeperiod);
}
//***************** Open Popup Page <a href="Javascript: openPopUpPage('video.asp?sWF=howfundworks','640','480');">
function openPopUpPage( sUrl, sW, sH ) {
    if(!sW)sW="640";
    if(!sH)sH="480";
    window.open( sUrl,'YRF', 'width='+ sW +', height='+ sH +', scrollbars=no, resizable=yes, status=no, location=no, menubar=no');
}
function gSessionTimeout() {
    //alert("You session has timeout. Please log back in again.");
    document.location.href = document.location.href;    //Geroge 7/13/11: JS Error or Timeout    
}
//************** Video Img Hove with Play button **************
function gVideoImgHover() {
    $("#imghover a").hover(
        function () { 
            /* When mouse pointer is above the link - Make the image inside link to be transparent
            $(this).find("img").animate(
            { opacity: "0.5" },
            { duration: 300 }
            );*/
            // $(this).find(".video_playbtn").show();      //Show Play button
            $(this).find(".video_playbtn").animate(
                { opacity: "1" },
                { duration: 100 }
            );
        },
        function () { 
            /* When mouse pointer move out of the link - Return image to its previous state
            $(this).find("img").animate(
            { opacity: "1" },
            { duration: 300 }
            );*/
            //$(this).find(".video_playbtn").hide();      //Hide Play button
            $(this).find(".video_playbtn").animate(
                { opacity: "0.5" },
                { duration: 100 }
            );
        }
    );        
}
//*******ccai 8/3/11: Generic Page URL Count Tracking (HTTPS)***************
function gTrackPageHTTPs() {
    $.ajax({
        type: "GET",
        url: "service.aspx?tag=urltrack",
        dataType: "html",
        cache: false,                                                               //don't cache
        data: "&sURL=" + window.location.href,                               //extraQueryString: button1 clicked    
        success: function (xml) {
            //alert("Success: URL Added:" + window.location.href);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            //alert("Failed:" + window.location.href);
        }
    });
}
//*******ccai 8/9/11: Generic Page URL Count Tracking (HTTP)***************
function gTrackPage() {
    $.ajax({
        type: "GET",
        url: "service2.aspx?tag=urltrack",
        dataType: "html",
        cache: false,                                                               //don't cache
        data: "&sURL=" + window.location.href,                               //extraQueryString: button1 clicked    
        success: function (xml) {
            //alert("Success: URL Added:" + window.location.href);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            //alert("Failed:" + window.location.href);
        }
    });
}
//***********ccai 8/3/11: Generic MISC Tracking (HTTPS)*************** gTrackMiscHTTPs("Talent Profile Button1 clicked");
function gTrackMiscHTTPs(exQS) {
    $.ajax({
        type: "GET",
        url: "service.aspx?tag=urltrack",
        dataType: "html",
        cache: false,                                                               //don't cache
        data: "&sURL=" + exQS,                                                      //extraQueryString: button1 clicked    
        success: function (xml) {
            //alert("Success: URL Added:" + window.location.href);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            //alert("Failed:" + window.location.href);
        }
    });
}
//***********ccai 8/3/11: Generic MISC Tracking (HTTP)*************** gTrackMisc("Talent Profile Button1 clicked");
function gTrackMisc(exQS) {
    $.ajax({
        type: "GET",
        url: "service2.aspx?tag=urltrack",
        dataType: "html",
        cache: false,                                                               //don't cache
        data: "&sURL=" + exQS,                                                      //extraQueryString: button1 clicked    
        success: function (xml) {
            //alert("Success: URL Added:" + window.location.href);
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            //alert("Failed:" + window.location.href);
        }
    });
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////                                                                           /////////////	
///////////////////////        YRF Website related JS                                /////////////
///////////////////////                                                                           /////////////	
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
 //******* OptionalHide LeftNav***************
 function HideNav(){
	$('#tdLeftNav').hide();
	$('#LeftNavBg').css("background-image", ""); 
 }
 

