 Mx = "";
 My = "";


var toolTips=new Array(); // regular array (add an optional integer
toolTips['Email']="The email address with which you would like to receive correspondence from TSIA.";
toolTips['UserName']="Must be at least 6 characters.";
toolTips['Password']="Must be at least 6 characters and not equal to your username.";
toolTips['ConfirmPassword']="Must be equal to password.";
toolTips['Salutation']="Mr. Mrs. Ms.";      
toolTips['FirstName']="First Name";
toolTips['LastName']="Last Name";
toolTips['Title']="Your title at your present place of employment.";
toolTips['Company']="The name of your company. A list of potential matches will begin to be shown after you type the first few letters of the company name. ";
toolTips['Level']="The level of your role or responsibility within your company";
toolTips['PrimaryJobFunction']="Your primary job function within your company";

toolTips['AlternateEmail']="You have the option to enter an alternate email address to confirm employment with your company if you would prefer to use a personal email address as your primary email address for email correspondence with TSIA. After entering your alternate email address and saving your record, please click the ‘Send Verification Link’ in order to confirm ownership of your alternate email address. <BR>If your company is a corporate member or partner and you register using a recognized corporate email domain, you will receive automatic member or partner-protected website access after you have verified ownership of your email address. <BR>If you register with a personal email address or an unrecognized corporate email domain you be given community-level access to our website until your access level has been approved by TSIA Member Services.";
toolTips['OwershipVerified']="Verification of email ownership is required in order to receive full website access.  If you have not already done so, please click on the 'Send Verification Email' to complete this process.";
toolTips['RegisteredCorporateDomain']="If you register using a recognized corporate email domain (i.e. jane.smith@oracle.com or joe.blog@cisco.com) and your company is a a corporate member or partner of TSIA, you will automatically be granted full website access once you have verified ownership of your email address.<br /><br />If you register with a personal emaill address or an unrecognized corporate email domain, you will be given community-level access to our website until your employment has been verified by TSIA Member Services.";

toolTips['InterestedInMembershipOfferings']="Please select whether you are interested in our membership offerings, our sponsorship opportunities, or both.";

toolTips['FieldServices']="Please select at least one service discipline of interest.";

toolTips['ConferenceEmails']="Click here to opt out of all conference-specific emails.";

toolTips['ProgramEmails']="Click here to opt out of all program-related emails.";

toolTips['ResearchEmails']="Click here to opt out of all research-specific emails.";

toolTips['WebcastEmails']="Click here to opt out of all webcast-specific emails.";
toolTips['MembershipEmails']="Click here to opt out of all membership-related emails.";
toolTips['PartnershipEmails']="Click here to opt out of all partnership-related emails.";
toolTips['TSWMay2010Emails']="Click here to opt out of all emails specific to the Technology Services World conference in May 2010.";
toolTips['TSWMay2011Emails']="Click here to opt out of all emails specific to the Technology Services World conference in May 2011.";
toolTips['TSWOct2011Emails']="Click here to opt out of all emails specific to the Technology Services World conference in Oct 2011.";
toolTips['TSEApr2011Emails']="Click here to opt out of all emails specific to the Technology Services Europe conference in April 2011.";

toolTips['DoNotCall']="Click here to opt out of all marketing-related telephone calls.";

toolTips['GlobalEmailCommunications']="Click here to opt out of all program and marketing emails from TSIA.";

toolTips['PostalMailCommunications']="Click here to opt out of all marketing and program related postal mail from TSIA.";
toolTips['WebsiteAccess']="Depending on a Valid Email Address and Domain of that Email, access to secure areas are granted. View your Company Info tab to see what additional areas you have access to.";

/* BUYERS GUIDE TOOL TIPS */
toolTips['BGAddress']="Address that will be displayed on Buyer\'s Guide Page.";
toolTips['BGCity']="City that will be displayed on Buyer\'s Guide Page.";
toolTips['BGState']="State that will be displayed on Buyer\'s Guide Page.";
toolTips['BGZip']="Zip or Postal Code that will be displayed on Buyer\'s Guide Page.";
toolTips['BGCountry']="Country that will be displayed on Buyer\'s Guide Page.";
toolTips['BGPhone']="Phone that will be displayed on Buyer\'s Guide Page.";
toolTips['BGYear']="Year that the data being submitted pertains too.";
toolTips['BGEmployees']="Number of employees in your company.";
toolTips['BGInstallBase']="Number of Customers (please list number of customer accounts, not implementations)";
toolTips['BGReferences']="Example Customers (12 maximum - Please separate with a comma - max characters is 255)";
toolTips['BGProducts']="Products/Solutions (12 Maximum - Please enter all products separated by a comma - max characters is 255)";
toolTips['BGDeployment']="Deployments Options (Saas/cloud or OnPremise) (If both, please select both options)";
toolTips['BGLogo']="Upload your corporate logo in GIF, JPG or PNG format.  Otherwise, please email your logo to lucy.fabbri@tsia.com and type EMAIL in the logo field.";


 function SetOpacity(elem, opacityAsInt)
 {
      var opacityAsDecimal = opacityAsInt;
     
     if (opacityAsInt > 100)
         opacityAsInt = opacityAsDecimal = 100; 
     else if (opacityAsInt < 0)
         opacityAsInt = opacityAsDecimal = 0; 
     
     opacityAsDecimal /= 100;
     if (opacityAsInt < 1)
         opacityAsInt = 1; // IE7 bug, text smoothing cuts out if 0
     
     elem.style.opacity = (opacityAsDecimal);
     elem.style.filter  = "alpha(opacity=" + opacityAsInt + ")";
	 
 }
 
  var keyStr = "ABCDEFGHIJKLMNOP" +
               "QRSTUVWXYZabcdef" +
               "ghijklmnopqrstuv" +
               "wxyz0123456789+/" +
               "=";

  function encode64(input) {
     input = escape(input);
     var output = "";
     var chr1, chr2, chr3 = "";
     var enc1, enc2, enc3, enc4 = "";
     var i = 0;

     do {
        chr1 = input.charCodeAt(i++);
        chr2 = input.charCodeAt(i++);
        chr3 = input.charCodeAt(i++);

        enc1 = chr1 >> 2;
        enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
        enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
        enc4 = chr3 & 63;

        if (isNaN(chr2)) {
           enc3 = enc4 = 64;
        } else if (isNaN(chr3)) {
           enc4 = 64;
        }

        output = output +
           keyStr.charAt(enc1) +
           keyStr.charAt(enc2) +
           keyStr.charAt(enc3) +
           keyStr.charAt(enc4);
        chr1 = chr2 = chr3 = "";
        enc1 = enc2 = enc3 = enc4 = "";
     } while (i < input.length);

     return output;
  }

  function decode64(input) {
     var output = "";
     var chr1, chr2, chr3 = "";
     var enc1, enc2, enc3, enc4 = "";
     var i = 0;

     // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
     var base64test = /[^A-Za-z0-9\+\/\=]/g;
     if (base64test.exec(input)) {
        alert("There were invalid base64 characters in the input text.\n" +
              "Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\n" +
              "Expect errors in decoding.");
     }
     input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");

     do {
        enc1 = keyStr.indexOf(input.charAt(i++));
        enc2 = keyStr.indexOf(input.charAt(i++));
        enc3 = keyStr.indexOf(input.charAt(i++));
        enc4 = keyStr.indexOf(input.charAt(i++));

        chr1 = (enc1 << 2) | (enc2 >> 4);
        chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
        chr3 = ((enc3 & 3) << 6) | enc4;

        output = output + String.fromCharCode(chr1);

        if (enc3 != 64) {
           output = output + String.fromCharCode(chr2);
        }
        if (enc4 != 64) {
           output = output + String.fromCharCode(chr3);
        }

        chr1 = chr2 = chr3 = "";
        enc1 = enc2 = enc3 = enc4 = "";

     } while (i < input.length);

     return unescape(output);
  }

function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft;
    tempY = event.clientY + document.body.scrollTop;
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX;
    tempY = e.pageY;
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0;}
  if (tempY < 0){tempY = 0;}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  Mx = tempX;
  My = tempY;
  return true
}


var cleanDirty = "clean";
var currentTab = 0;

function hideModal(){
	cleanDirty = "clean";
	jQuery.modal.close();
}

function goBack(currentTab){
	
	TabbedPanels1.showPanel(Number(currentTab));
	jQuery.modal.close();
	
}

function checkDirty(cleanDirty, currentTab){
	
	if(cleanDirty == "dirty"){
		
document.getElementById("basic-modal-content").innerHTML = "<h3>TSIA Notification</h3>You have made changes to your profile and tried to navigate to another tab or page without saving your changes.  <br/><br/>Please click the \"Cancel\" button to return to the page and save your changes or click the \"OK\" button to proceed to the selected page.<br /><br /><br /><center><input type=\"button\" id=\"tabChangeOk\" name=\"tabChangeOk\" value=\"OK\" class=\"blue_btn\" onclick=\"hideModal();\">&nbsp;&nbsp;<input type=\"button\" id=\"tabChangeCancel\" name=\"tabChangeCancel\" value=\"Cancel\" class=\"blue_btn\" onclick=\"goBack(" + currentTab +");\"></center>";
  jQuery('#basic-modal-content').modal();
		
	} else {
	return true;	
	}
	
}

function makeDirty(){
	currentTab = TabbedPanels1.getCurrentTabIndex();
	cleanDirty = "dirty";
}

