/*

0. utils and vars
1. loginCRM(lg,pw)
  1a. loginAction(lg,pswd)
  1c. loginAction2()
  1b. loginCRM2()
  1d. loginAction3()
  1e. loginActionLo(lg,pswd)
  1f. loginCRMLo()
  1g. loginAction3Lo()
2. onLogOutClick()
  2a. onExitClick()
  2b. onExitClickLo()
  2c. onLogOutClickLo()
3. onlinkClickContent()
  3a. onlinkClickContentLo()
4. content4()
5. getCheckStatus()
  5a. getCheckStatusParent()
6. getSubmitRequest()
7. getAskQuestion()
8. requestSubmit_Complete()
9. setKeyUpLogin()
  9a. setKeyUpLogin2()
  9b. setKeyUpLoginLo()
  9c. setKeyUpLoginRe()
10. getAccountCreate();
  10a. getAccountCreateLo()
11. resetMyNotCheckbox(int)
12. deleteFavWPLink(int)
13. getFavWPsList()
  13a. getOuterList1()
  13b. getOuterList2()
  13c. getFavServiceSetUp()
  13d. getContent3Subs()
14. subsList()

15. getUpdateAccount()
16. getUnsub()
17. getContactAdmin()

18. addRemoveLists(int)
19. addAllLists(int)
20. removeAllLists(int)

21. setDNM(int)
22. sendCAEmail()
23. getForgotPassword()
  23a. getForgotPasswordLo()
24. accountSetupAction()
  24a. accountSetupAction2();
  24b. accountSetupActionLo();
25. Validate_Email_Address(str)
26. Validate_String(str,str)
27. resendConfirmationEmail(int)
28. getNewPassword()
29. getNewPassAction()

30. checkEmailAddress();
  30a. checkEmailAddressLo();
31. getEditAccount(int)
32. getPasswordEdit(int)
33. getEmailFormatEdit(int)

34. getHomeTab()
35. getHomeTabEdit()
36. saveEmailFormat(int)
37. saveEditPassword()
38. accountEditAction()
39. getSubsLogin()
40. accountSignup()

41. addAllFavServ()
42. removeAllFavServ()
43. addRemoveFavServ()

44. getPageList()
--45. getServiceGroup()
46. customizeNews()
47. getCustomNews()

48. addRemoveFavNewsCategory()
49. addAllNewsCats()
50. removeAllNewsCats()

51. getMyEvents()
52. editMyEvents()
53. addRemoveFavEventSubCategory()
54. addAllEventSubCats()
55. removeAllEventSubCats()

56. eventSetPages(int)
  56a. webPagesSetPages(int)
  56b. servicesSetPages(int)
  
57. getReLogin()
58. resetPageNotice(int,int)

59. setUpdateReminder()
60. setAutoLoginExpiration()

*/


/* ==================================
0. utils and vars
================================== */

var myVar;
var log;
var pass;
var var1;
var subject;
var body;
var tabID;

var eValue;
var value1;
var value2;
var value3;
var valid;
var fname;
var lname;
var pageID;
var tCount;
var loggedIn;
var scID;
var grpxValue;
var onOff
var stCheckResult;

var dupCheckResult = 0;

if (document.images)
   {
      image_off= new Image(950,52);
      image_off.src="/custom/extranet/images/loginbkg_off.png";  

      image2= new Image(950,52);
      image2.src="/custom/extranet/images/loginBkg_over.png";

      image2o2= new Image(950,52);
      image2o2.src="/custom/extranet/images/loginBkg_over2.png";
      
      image_Blank= new Image(950,52);
      image_Blank.src="/custom/extranet/images/loginBkg_blank.png";  

      image_Blank_off= new Image(950,52);
      image_Blank_off.src="/custom/extranet/images/loginbkg_off_blank.png";

      image_on= new Image(950,45);
      image_on.src="/custom/extranet/images/loginBkg_on.png";
      
      image_onHP= new Image(950,45);
      image_onHP.src="/custom/extranet/images/loginBkg_onHP.png";  

      image_over_lC2= new Image(950,52);
      image_over_lC2.src="/custom/extranet/images/loginBkg_over_lC2.png";

      image_over_Lc= new Image(950,52);
      image_over_Lc.src="/custom/extranet/images/loginBkg_over_Lc.png";

      imageC1 = new Image(129,30);
      imageC1.src="/custom/extranet/images/extTab_01_off.png";  
      imageC2 = new Image(116,30);
      imageC2.src="/custom/extranet/images/extTab_02_off.png";  
      imageC3 = new Image(130,30);
      imageC3.src="/custom/extranet/images/extTab_03_off.png";  
      imageC4 = new Image(174,30);
      imageC4.src="/custom/extranet/images/extTab_04_off.png";  
      imageC5 = new Image(146,30);
      imageC5.src="/custom/extranet/images/extTab_05_off.png";  

      imageC1o = new Image(129,30);
      imageC1o.src="/custom/extranet/images/extTab_01_over.png";  
      imageC2o = new Image(116,30);
      imageC2o.src="/custom/extranet/images/extTab_02_over.png";  
      imageC3o = new Image(130,30);
      imageC3o.src="/custom/extranet/images/extTab_03_over.png";  
      imageC4o = new Image(174,30);
      imageC4o.src="/custom/extranet/images/extTab_04_over.png";  
      imageC5o = new Image(146,30);
      imageC5o.src="/custom/extranet/images/extTab_05_over.png";  
      
      imageC1on = new Image(129,30);
      imageC1on.src="/custom/extranet/images/extTab_01_on.png";  
      imageC2on = new Image(116,30);
      imageC2on.src="/custom/extranet/images/extTab_02_on.png";  
      imageC3on = new Image(130,30);
      imageC3on.src="/custom/extranet/images/extTab_03_on.png";  
      imageC4on = new Image(174,30);
      imageC4on.src="/custom/extranet/images/extTab_04_on.png";  
      imageC5on = new Image(146,30);
      imageC5on.src="/custom/extranet/images/extTab_05_on.png"; 
      
      bkg01 = new Image(950,290);
      bkg01.src="/custom/extranet/images/extBkg_01a.png";
      bkg02 = new Image(950,290);
      bkg02.src="/custom/extranet/images/extBkg_02a.png";
      bkg03 = new Image(950,290);
      bkg03.src="/custom/extranet/images/extBkg_03a.png";
      bkg04 = new Image(950,290);
      bkg04.src="/custom/extranet/images/extBkg_04a.png";
      bkg05 = new Image(950,290);
      bkg05.src="/custom/extranet/images/extBkg_05a.png";
      bkg00 = new Image(950,290);
      bkg00.src="/custom/extranet/images/extBkg_00a.png";
      
      bkg06 = new Image(950,290);
      bkg06.src="/custom/extranet/images/extBkg_06a.png";
      
      bkg07 = new Image(703,359);
      bkg07.src="/custom/hpPortal/images/tabbed_body_01.png";
      bkg08 = new Image(703,359);
      bkg08.src="/custom/hpPortal/images/tabbed_body_02.png";
      bkg09 = new Image(703,359);
      bkg09.src="/custom/hpPortal/images/tabbed_body_03.png";
      bkg10 = new Image(703,359);
      bkg10.src="/custom/hpPortal/images/tabbed_body_04.png";
      
      imageB_AccAdd = new Image(108,34);
      imageB_AccAdd.src="/custom/extranet/images/save_off.png";  
      imageB_AccAdd_cancel = new Image(108,34);
      imageB_AccAdd_cancel.src="/custom/extranet/images/cancel_off.png";
      imageB_AccAdd_send = new Image(108,34);
      imageB_AccAdd_send.src="/custom/extranet/images/send_off.png";
      
      imageB_AccAddo = new Image(108,34);
      imageB_AccAddo.src="/custom/extranet/images/save_on.png";  
      imageB_AccAdd_cancelo = new Image(108,34);
      imageB_AccAdd_cancelo.src="/custom/extranet/images/cancel_on.png";
      imageB_AccAdd_sendo = new Image(108,34);
      imageB_AccAdd_sendo.src="/custom/extranet/images/send_on.png";
      
      
      imageCalIcon = new Image(37,37);
      imageCalIcon.src="/custom/extranet/images/calbkg.png";
      
      imageMN1 = new Image(171,36);
      imageMN1.src="/custom/extranet/images/myNot_selAll_off.png";  
      imageMN2 = new Image(171,36);
      imageMN2.src="/custom/extranet/images/myNot_selNone_off.png";  
      imageMN3 = new Image(171,36);
      imageMN3.src="/custom/extranet/images/myNot_UnSub_off.png";  
      imageMN4 = new Image(171,36);
      imageMN4.src="/custom/extranet/images/myNot_emailFormat_off.png";  
      imageMN5 = new Image(171,36);
      imageMN5.src="/custom/extranet/images/myNot_contactAdmin_off.png";  
      imageMN6 = new Image(171,36);
      imageMN6.src="/custom/extranet/images/myNot_VN_off.png";  
      
      imageMN1o = new Image(171,36);
      imageMN1o.src="/custom/extranet/images/myNot_selAll_on.png";  
      imageMN2o = new Image(171,36);
      imageMN2o.src="/custom/extranet/images/myNot_selNone_on.png";  
      imageMN3o = new Image(171,36);
      imageMN3o.src="/custom/extranet/images/myNot_UnSub_on.png";  
      imageMN4o = new Image(171,36);
      imageMN4o.src="/custom/extranet/images/myNot_emailFormat_on.png";  
      imageMN5o = new Image(171,36);
      imageMN5o.src="/custom/extranet/images/myNot_contactAdmin_on.png";  
      imageMN6o = new Image(171,36);
      imageMN6o.src="/custom/extranet/images/myNot_VN_on.png";
      
      imageSV1 = new Image(171,36);
      imageSV1.src="/custom/extranet/images/mySrv_Req_off.png";  
      imageSV2 = new Image(171,36);
      imageSV2.src="/custom/extranet/images/mySrv_FAQ_off.png";  
      imageSV3 = new Image(171,36);
      imageSV3.src="/custom/extranet/images/mySrv_UG_off.png";  
      imageSV4 = new Image(171,36);
      imageSV4.src="/custom/extranet/images/mySrv_CA_off.png";  
      
      imageSV1o = new Image(171,36);
      imageSV1o.src="/custom/extranet/images/mySrv_Req_on.png";  
      imageSV2o = new Image(171,36);
      imageSV2o.src="/custom/extranet/images/mySrv_FAQ_on.png";  
      imageSV3o = new Image(171,36);
      imageSV3o.src="/custom/extranet/images/mySrv_UG_on.png";  
      imageSV4o = new Image(171,36);
      imageSV4o.src="/custom/extranet/images/mySrv_CA_on.png"; 
      
      imageFV1 = new Image(171,36);
      imageFV1.src="/custom/extranet/images/myFav_selSrv_off.png";  
      imageFV2 = new Image(171,36);
      imageFV2.src="/custom/extranet/images/myFav_selAll_off.png";  
      imageFV3 = new Image(171,36);
      imageFV3.src="/custom/extranet/images/myFav_selNone_off.png";  
      imageFV4 = new Image(171,36);
      imageFV4.src="/custom/extranet/images/myFav_Rtn_off.png";
      /*imageFV5 = new Image(171,36);
      imageFV5.src="/custom/extranet/images/myFav_more_off.png"; */
      imageFV6 = new Image(171,36);
      imageFV6.src="/custom/extranet/images/myFav_AllServ_off.png"; 
      
      imageFV1o = new Image(171,36);
      imageFV1o.src="/custom/extranet/images/myFav_selSrv_on.png";  
      imageFV1op = new Image(171,36);
      imageFV1op.src="/custom/extranet/images/myFav_selSrv_on.png";  
      imageFV2o = new Image(171,36);
      imageFV2o.src="/custom/extranet/images/myFav_selAll_on.png";  
      imageFV3o = new Image(171,36);
      imageFV3o.src="/custom/extranet/images/myFav_selNone_on.png";  
      imageFV4o = new Image(171,36);
      imageFV4o.src="/custom/extranet/images/myFav_Rtn_on.png";
      /*imageFV5o = new Image(171,36);
      imageFV5o.src="/custom/extranet/images/myFav_more_on.png"; */
      imageFV6o = new Image(171,36);
      imageFV6o.src="/custom/extranet/images/myFav_AllServ_on.png"; 

      imageEV1 = new Image(171,36);
      imageEV1.src="/custom/extranet/images/myEV_edit_off.png";  
      imageEV2 = new Image(171,36);
      imageEV2.src="/custom/extranet/images/myEV_viewCal_off.png";  
      imageEV3 = new Image(171,36);
      imageEV3.src="/custom/extranet/images/myEV_Back_off.png";  
      
      imageEV1o = new Image(171,36);
      imageEV1o.src="/custom/extranet/images/myEV_edit_on.png";  
      imageEV2o = new Image(171,36);
      imageEV2o.src="/custom/extranet/images/myEV_viewCal_on.png";  
      imageEV3o = new Image(171,36);
      imageEV3o.src="/custom/extranet/images/myEV_Back_on.png";  
      
      imageNW1 = new Image(171,36);
      imageNW1.src="/custom/extranet/images/myNW_cust_off.png";  
      imageNW2 = new Image(171,36);
      imageNW2.src="/custom/extranet/images/myNW_All_off.png";  
      imageNW3 = new Image(171,36);
      imageNW3.src="/custom/extranet/images/myNW_Back_off.png";  
      
      imageNW1o = new Image(171,36);
      imageNW1o.src="/custom/extranet/images/myNW_cust_on.png";  
      imageNW2o = new Image(171,36);
      imageNW2o.src="/custom/extranet/images/myNW_All_on.png";  
      imageNW3o = new Image(171,36);
      imageNW3o.src="/custom/extranet/images/myNW_Back_on.png"; 
      
      image001 = new Image(230,118);
      image001.src="/custom/extranet/images/update_01.png";  
      image002 = new Image(230,118);
      image002.src="/custom/extranet/images/change_01.png";  
      image003 = new Image(230,118);
      image003.src="/custom/extranet/images/contact_01.png";  
      
      image001o = new Image(230,118);
      image001o.src="/custom/extranet/images/update_02.png";  
      image002o = new Image(230,118);
      image002o.src="/custom/extranet/images/change_02.png";  
      image003o = new Image(230,118);
      image003o.src="/custom/extranet/images/contact_02.png"; 
      
      imageFav1 = new Image(77,16);
      imageFav1.src="/custom/extranet/images/favorited.png";  
      imageFav2 = new Image(95,16);
      imageFav2.src="/custom/extranet/images/addToFavs01.png";  
      imageFav2o = new Image(95,16);
      imageFav2o.src="/custom/extranet/images/addToFavs02.png"; 
      
      helpb = new Image(171,36);
      helpb.src="/custom/extranet/images/help_off.png"; 
      helpbo = new Image(171,36);
      helpbo.src="/custom/extranet/images/help_on.png"; 
	 }

function onLogInClick(){

  var coordArray = findPos(document.getElementById("content"));
  var intX = coordArray[0];

    var currX = tempX - intX;
    if (currX >= 830){
      onLogInCreateAccClick();
    }else{
      document.getElementById('loginRow').style.display='none';
      document.getElementById('loginRowFields').style.display='';
      //document.getElementById('loginName').value='';
      document.getElementById('loginPswd').value='';
      document.getElementById('loginFieldsTable').style.display='';
      document.getElementById('loginValidation').style.display='none';
      var mytext = document.getElementById("loginName"); 
      mytext.focus();
    }
  }

 

  function onLogInClickHTTPS() {

    var coordArray = findPos(document.getElementById("content"));
    var intX = coordArray[0];

    var currX = tempX - intX;

    if (currX >= 830) {
      setSecurePopup(2)
    } else {
      setSecurePopup(1)
    }
  }

function onLogInCreateAccClick(){
  document.getElementById('loginRow').style.display='none';
  document.getElementById('loginValidation').style.display='none';
  document.getElementById('logcontents').style.display='';
  getAccountCreate();
}

function onLogInCreateAccClickHTTPS() {
  //document.getElementById('loginRow').style.display = 'none';
  //document.getElementById('loginValidation').style.display = 'none';
  //document.getElementById('logcontents').style.display = '';
  //getAccountCreate();
  alert(' create Account popup Here!')
}

function onLogRowClick(){

   document.getElementById('loginFieldsTable').style.display='none';
   document.getElementById('loginResponse').style.display='';
   var lg=document.getElementById("loginName").value;
   var pw=document.getElementById("loginPswd").value;
   if (lg==''||pw==''){
     loginValidation();
   } else {
     loginAction(lg,pw);

   }
}

function onLogInClickLo(){

   var lg=document.getElementById("loginName").value;
   var pw=document.getElementById("loginPswd").value;
   if (lg==''||pw==''){
     loginValidationLo();
   } else {
     loginActionLo(lg,pw);
   }
}

function onLoLoginFocus(){
  document.getElementById('loginValidation').style.display='none';
  document.getElementById("loginFailed").style.display='none';
}

function onLogRowClickCancel(){
  document.getElementById('loginRow').style.display='';
  document.getElementById('logcontents').style.display='none';
  document.getElementById('loginRowFields').style.display='none';
  //document.getElementById('linkSec').style.display='none';
}
function loadMyRancho(){
  document.getElementById('loginRow').style.display='none';
  document.getElementById('logcontents').style.display='';
  document.getElementById('loginRowFields').style.display='none';
  document.getElementById('loginResponse').style.display='none';
}

function loginValidation(){
  document.getElementById('loginValidation').style.display='';
  document.getElementById('loginResponse').style.display='none';
  setTimeout('onLogInClick();',1000);
}
function loginValidationLo(){
  document.getElementById('loginValidation').style.display='';
  
  //document.getElementById('loginResponse').style.display='none';
  //setTimeout('onLogInClick();',1000);
}

var processing1 = '<table cellpassing="0" cellspaging="0" border="0" width="70"><tr><td><img src="/custom/hpPortal/images/loader_p2.gif"  width="24" /></td><td><div class="processingText">LOADING!</div></td></tr></table>';
var processingExt = "<table cellpadding='0' cellspacing='0' border='0' align='center' width='500'><tr><td align='center' style='height:200px;'><span class='loadingText'>Loading <img src='/custom/extranet/images/loader_p6.gif' /></span></td></tr></table>";
var processing2 = '<span class="processing2">Processing...</span>';

var loading2 = '<table cellpadding="0" cellspacing="0" border="0" style="position:relative;top:0;left:0;">';
      loading2 = loading2 + '<tr><td colspan="4"></td></tr><tr><td width="10"></td><td class="text11red" align="right">';
      loading2 = loading2 + 'Loading&nbsp;&nbsp;';
      loading2 = loading2 + '</td><td>';
      loading2 = loading2 + '<img src="/custom/extranet/images/loader_p1.gif" />';
      loading2 = loading2 + '</td><td></td></tr></table>';
      
var loading3 = '<table cellpadding="0" cellspacing="0" border="0" align="center" >';
      loading3 = loading3 + '<tr><td></td></tr><tr><td align="center" style="vertical-align:center;color:#ffffff;font-size:11px;">';
      loading3 = loading3 + 'Loading...';
      loading3 = loading3 + '</td></tr><tr><td height="5"></td></tr><tr><td align="center">';
      loading3 = loading3 + '<img src="/custom/extranet/images/loader_p6.gif" width="100"/>';
      loading3 = loading3 + '</td></tr></table>';

var updating1 = '<table cellpadding="0" cellspacing="0" border="0" style="position:relative;top:0;left:0;">';
      updating1 = updating1 + '<tr><td colspan="4"></td></tr><tr><td width="10"></td><td class="text11red" align="right">';
      updating1 = updating1 + 'Updating&nbsp;&nbsp;';
      updating1 = updating1 + '</td><td>';
      updating1 = updating1 + '<img src="/custom/extranet/images/loader_p4.gif" width="25"/>';
      updating1 = updating1 + '</td><td></td></tr></table>';
      
var IE = document.all?true:false;
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;
var tempX = 0;
var tempY = 0;
function getMouseXY(e) {
if (IE) { // grab the x-y pos.s if browser is IE
try
  {
  tempX = event.clientX + document.body.scrollLeft;
  tempY = event.clientY + document.body.scrollTop;
  }
catch(err)
  {
  //Handle errors here
  }

}
else {  // grab the x-y pos.s if browser is NS
tempX = e.pageX;
tempY = e.pageY;
}  
if (tempX < 0){tempX = 0;}
if (tempY < 0){tempY = 0;} 

//document.Show.MouseX.value = tempX;
//document.Show.MouseY.value = tempY;

return true;
}
function findPos(obj) {
	var curleft = curtop = 0;
  if (obj.offsetParent) {
    do {
			    curleft += obj.offsetLeft;
			    curtop += obj.offsetTop;

    } while (obj = obj.offsetParent);
  }
return [curleft,curtop];
}

function change2(picName,imgName)
 {
var coordArray = findPos(document.getElementById("content"));
var intX = coordArray[0];

    var currX = tempX - intX;
    if (currX >= 830){
      imgName = 'image2o2';
    }
   if (document.images)
    {
      imgOn=eval(imgName + ".src");
      document[picName].src= imgOn;
    }
 }
 
 function changeLoginBkg(){
 
    var coordArray = findPos(document.getElementById("content"));
    var intX = coordArray[0];
    
    var currX = tempX - intX;
    if (currX >= 850){
        document.getElementById("loginBgkDiv").style.background='url(/custom/extranet/images/loginBkg_over_lC2.png)';
    }else{
        document.getElementById("loginBgkDiv").style.background='url(/custom/extranet/images/loginBkg_over_Lc.png)';
    }
 }
 
function submitCancelLogin(){
var coordArray = findPos(document.getElementById("content"));
    var intX = coordArray[0];
    
    var currX = tempX - intX;
    if (currX >= 850){
      onLogRowClickCancel();
    }else if(currX >= 750 && currX < 850){
      onLogRowClick();
    }
}

function cursorChange(int1,int2){
  var oo = int1;
  if(oo==1){
    document.body.style.cursor='pointer';
    document.getElementById("row"+int2).style.background='url(/custom/extranet/images/calbkg2.png)';
  }else{
    document.body.style.cursor='default';
    document.getElementById("row"+int2).style.background='url(/custom/extranet/images/calbkg.png)';
  } 
}

function cursorChangeLo(int1){
  var oo = int1;
  if(oo==1){
    document.body.style.cursor='pointer';
  }else{
    document.body.style.cursor='default';
  } 
}
function getEventLink(int){
 alert('getEvent '+int)
}
function getServLink(int){
 alert('getService '+int)
}

function buttonOver(int){
  /*filter:alpha(opacity=50);
  opacity: 0.5;*/
  document.getElementById("button"+int).style.filter='alpha(opacity=50)';
  document.getElementById("button"+int).style.opacity='0.5';
  document.getElementById("button"+int).style.zoom='1';
}

function buttonOut(int){
  document.getElementById("button"+int).style.filter='';
  document.getElementById("button"+int).style.opacity='1';
}

function buttonDown(int){
  document.getElementById("button"+int).style.filter='alpha(opacity=20)';
  document.getElementById("button"+int).style.opacity='0.2';
}
function buttonUp(int){
  document.getElementById("button"+int).style.filter='alpha(opacity=50)';
  document.getElementById("button"+int).style.opacity='0.5';
}

function clearDiv(divID){
  document.getElementById(divID).innerHTML='';
}

function openChild(file, window2, width, height) {

  var leftPos = 100//(screen.width / 2) - (width/2)
  var topPos = 100//(screen.height / 2) - (height/2)
  if(screen){
    leftPos = (screen.width / 2) - (width/2)
    topPos = (screen.height / 2) - (height/2)
  }

  childWindow = open(file, window2, 'scrollbars=yes,resizable=yes,width=' + width + ',height=' + height + ', screenX=' + leftPos + ', screenY=' + topPos + ', left='+ leftPos +', top='+ topPos +'');
  window2.focus;
  if (childWindow.opener == null) childWindow.opener = self;
}

function openChildHTTPS(file, window2, width, height) {
  

  var leftPos = 100//(screen.width / 2) - (width/2)
  var topPos = 100//(screen.height / 2) - (height/2)
  if (screen) {
    leftPos = (screen.width / 2) - (width / 2)
    topPos = (screen.height / 2) - (height / 2)
  }

  childWindow = open(file, window2, 'scrollbars=yes,resizable=yes,width=' + width + ',height=' + height + ', screenX=' + leftPos + ', screenY=' + topPos + ', left=' + leftPos + ', top=' + topPos + '');
  window2.focus;
  if (childWindow.opener == null) childWindow.opener = self;
}

function change1(picName, imgName) {
  if (document.images) {
    imgOn = eval(imgName + ".src");
    document[picName].src = imgOn;
  }
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

/* ==================================
1. loginCRM(lg,pswd)
================================== */

var xmlLoginCRM;

function loginCRM(lg,pswd)
{ 

xmlLoginCRM=GetXmlHttpObject();
if (xmlLoginCRM==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/extranet/loginCRM.asp";
url=url+"?sid="+Math.random();

var str='lg='+lg+'&';
str=str+'pswd='+pswd+'&';

xmlLoginCRM.onreadystatechange=stateChangedLoginCRM;
xmlLoginCRM.open("POST",url,true);
xmlLoginCRM.setRequestHeader("Content-Type", 
      "application/x-www-form-urlencoded; charset=UTF-8"); 
xmlLoginCRM.send(str);
}

function stateChangedLoginCRM() 
{ 
  if (xmlLoginCRM.readyState==4)
  { 
    //setTimeout('resetPage();',1000);
  }
}

/* ==================================
1a. loginAction(lg,pswd)
================================== */
var xmlLoginAction;

function loginAction()
{ 

//log=lg
  //pass=pswd
  log = document.getElementById("loginName2").value;
  pass = document.getElementById("loginPswd2").value;

xmlLoginAction=GetXmlHttpObject();
if (xmlLoginAction==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/extranet/loginAction.asp";
url=url+"?sid="+Math.random();

var str='lg='+log+'&';
str = str + 'pswd=' + pass + '&';

///alert(str)

xmlLoginAction.onreadystatechange=stateChangedLoginAction;
xmlLoginAction.open("POST",url,true);
xmlLoginAction.setRequestHeader("Content-Type", 
      "application/x-www-form-urlencoded; charset=UTF-8"); 
xmlLoginAction.send(str);
}

function stateChangedLoginAction() 
{ 
  if (xmlLoginAction.readyState==4) {

    //alert(xmlLoginAction.responseText)
    //document.getElementById("processingDiv").innerHTML=xmlLoginAction.responseText;
    var logActionVar = xmlLoginAction.responseText
    var logActionSplit = logActionVar.split('!::!')
    var logAction = logActionSplit[0]  //parseInt(xmlLoginAction.responseText);
    isCRMSection = logActionSplit[1]
    //document.getElementById("myRanchoContent2").innerHTML = '';
    //alert(xmlLoginAction.responseText)
    //alert(isCRMSection)

    //redirect var
    // 0 homepage
    // 1 crm  /crm/default.asp
    // 2 faqs  /crm/ReqFaq/faq.asp
    // 3 submit /crm/Request/newrequest.asp
    // 4 track  /crm/Request/checkStatus.asp

    if (logAction>=1){
      //loginCRM(log,pass);
      //document.getElementById("myRanchoLginHidden").value='yes';
      if (logAction >= 2 ) {
        //setTimeout('getEditAccount(-1);', 2000);
        if (isCRMSection == 0) {
          window.opener.location.href = 'http://www.cityofrc.us';
        } else if (isCRMSection == 1) {
          window.opener.location.href = 'http://www.cityofrc.us/crm/default.asp';
        } else if (isCRMSection == 2) {
          window.opener.location.href = 'http://www.cityofrc.us/crm/ReqFaq/faq.asp';
        } else if (isCRMSection == 3) {
          window.opener.location.href = 'http://www.cityofrc.us/crm/Request/newrequest.asp';
        } else if (isCRMSection == 4) {
          window.opener.location.href = 'http://www.cityofrc.us/crm/Request/checkStatus.asp';
        } else {
          window.opener.location.href = 'http://www.cityofrc.us';
        }
        self.close();
      } else {
        //window.opener.document.location = '/';
        //opener.document.location = '/';
        if (isCRMSection == 0) {
          window.opener.location.href = 'http://www.cityofrc.us';
        } else if (isCRMSection == 1) {
          window.opener.location.href = 'http://www.cityofrc.us/crm/default.asp';
        } else if (isCRMSection == 2) {
          window.opener.location.href = 'http://www.cityofrc.us/crm/ReqFaq/faq.asp';
        } else if (isCRMSection == 3) {
          window.opener.location.href = 'http://www.cityofrc.us/crm/Request/newrequest.asp';
        } else if (isCRMSection == 4) {
          window.opener.location.href = 'http://www.cityofrc.us/crm/Request/checkStatus.asp';
        } else {
          window.opener.location.href = 'http://www.cityofrc.us';
        }
        //opener.location.href = '/';
        //opener.location.href = 'http://rc-2011.civicasoft.com';
        //opener.location.reload();
        //window.open("http://rc-2011.civicasoft.com", "", "fullscreen=yes,scrollbars=auto")
        //readSecurePopupWindowStatus()
        self.close();
      }
    } else {
      //document.getElementById("loginResponse").style.display='none';
      //document.getElementById("loginFailed").style.display='';
      //setTimeout('resetLogin();',1000);
      document.getElementById("loginMessage").innerHTML = '<span style="color:#cc0000;font-weight:bold;">Username and/or password is incorrect. Please try again!</span>';
      setTimeout('document.getElementById("loginMessage").innerHTML = ""',2000);
    }
  }
}

function checkClosed() {
//alert('cc')
  if (new_win.closed) {
    alert('Window was closed');
  } else {
    window.setTimeout(checkClosed, 1000);
  }
}





function resetLogin(){
  document.getElementById("loginResponse").style.display='none';
  document.getElementById("loginFailed").style.display='none';
  onLogInClick();
}

function resetPage(){
  
  document.getElementById('logcontents').style.display='';
  document.getElementById("myRanchoContent").innerHTML=xmlLoginCRM.responseText;
  document.getElementById('loginRow').style.display='none';
  document.getElementById('loginRowFields').style.display='none';
  document.getElementById("loginResponse").style.display='none';
  checkStatus();
  //onlinkClickContent(1)
}


/* ==================================
1aa. checkStatus()
================================== */
var xmlCheckStatus;

function checkStatus()
{ 

xmlCheckStatus=GetXmlHttpObject();
if (xmlCheckStatus==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/extranet/checkStatus.asp";
url=url+"?sid="+Math.random();

var str='';

xmlCheckStatus.onreadystatechange=stateChangedCheckStatus;
xmlCheckStatus.open("POST",url,true);
xmlCheckStatus.setRequestHeader("Content-Type", 
      "application/x-www-form-urlencoded; charset=UTF-8"); 
xmlCheckStatus.send(str);
}

function stateChangedCheckStatus() 
{ 
  if (xmlCheckStatus.readyState==4)
  { 
    stCheckResults = parseInt(xmlCheckStatus.responseText);
    
    if (stCheckResults==9){
      onlinkClickContent(0)
    } else {
      onlinkClickContent(1)
    }
  }
}

/* ==================================
1c. loginAction2()
================================== */
var xmlLoginAction2;

function loginAction2()
{ 

log=document.getElementById("loginName2").value
pass=document.getElementById("loginPswd2").value

xmlLoginAction2=GetXmlHttpObject();
if (xmlLoginAction2==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/extranet/loginAction.asp";
url=url+"?sid="+Math.random();

var str='lg='+log+'&';
str=str+'pswd='+pass+'&';

xmlLoginAction2.onreadystatechange=stateChangedLoginAction2;
xmlLoginAction2.open("POST",url,true);
xmlLoginAction2.setRequestHeader("Content-Type", 
      "application/x-www-form-urlencoded; charset=UTF-8"); 
xmlLoginAction2.send(str);
}

function stateChangedLoginAction2() 
{ 
  if (xmlLoginAction2.readyState==4)
  { 
  //document.getElementById("processingDiv").innerHTML=xmlLoginAction.responseText;
  var logAction = parseInt(xmlLoginAction2.responseText);
    if (logAction>=1){
      loginCRM2(5);
    } else {
      //document.getElementById("loginResponse").style.display='none';
     document.getElementById("loginMessage").innerHTML='<span style="font-weight:bold;color:#cc0000;">Login Failed. Check Username and Password and try again.</a>';
      setTimeout('clearLoginFields();',3000);
    }
  }
}

function clearLoginFields(){
  document.getElementById("loginMessage").innerHTML='';
  document.getElementById("loginName2").value='';
  document.getElementById("loginPswd2").value='';
}


/* ==================================
1d. loginAction3()
================================== */
var xmlLoginAction3;

function loginAction3()
{ 

log=document.getElementById("loginName2").value
pass=document.getElementById("loginPswd2").value

xmlLoginAction3=GetXmlHttpObject();
if (xmlLoginAction3==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/extranet/loginAction.asp";
url=url+"?sid="+Math.random();

var str='lg='+log+'&';
str=str+'pswd='+pass+'&';

xmlLoginAction3.onreadystatechange=stateChangedLoginAction3;
xmlLoginAction3.open("POST",url,true);
xmlLoginAction3.setRequestHeader("Content-Type", 
      "application/x-www-form-urlencoded; charset=UTF-8"); 
xmlLoginAction3.send(str);
}

function stateChangedLoginAction3() 
{ 
  if (xmlLoginAction3.readyState==4)
  { 
  var logAction = parseInt(xmlLoginAction3.responseText);
    if (logAction>=1){
      loginCRM2(1);
    } else {
      document.getElementById("loginMessage").innerHTML='<span style="font-weight:bold;color:#cc0000;">Login Failed. Check Username and Password and try again.</a>';
      setTimeout('clearLoginFields();',3000);
    }
  }
}


/* ==================================
1g. loginAction3Lo()
================================== */
var xmlLoginAction3Lo;

function loginAction3Lo()
{ 

log=document.getElementById("loginName2").value
pass=document.getElementById("loginPswd2").value

xmlLoginAction3Lo=GetXmlHttpObject();
if (xmlLoginAction3Lo==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/extranet/loginAction.asp";
url=url+"?sid="+Math.random();

var str='lg='+log+'&';
str=str+'pswd='+pass+'&';

xmlLoginAction3Lo.onreadystatechange=stateChangedLoginAction3Lo;
xmlLoginAction3Lo.open("POST",url,true);
xmlLoginAction3Lo.setRequestHeader("Content-Type", 
      "application/x-www-form-urlencoded; charset=UTF-8"); 
xmlLoginAction3Lo.send(str);
}

function stateChangedLoginAction3Lo() 
{ 
  if (xmlLoginAction3Lo.readyState==4)
  { 
  var logAction = parseInt(xmlLoginAction3Lo.responseText);
    if (logAction>=1){
      loginCRMLo(1);
    } else {
      document.getElementById("loginMessage").innerHTML='<span style="font-weight:bold;color:#cc0000;">Login Failed. Check Username and Password and try again.</a>';
      setTimeout('clearLoginFields();',3000);
    }
  }
}



/* ==================================
1b. loginCRM2()
================================== */

var xmlLoginCRM2;

function loginCRM2(int)
{ 

myVar=int;

xmlLoginCRM2=GetXmlHttpObject();
if (xmlLoginCRM2==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/extranet/loginCRM.asp";
url=url+"?sid="+Math.random();

xmlLoginCRM2.onreadystatechange=stateChangedLoginCRM2;
xmlLoginCRM2.open("GET",url,true);
xmlLoginCRM2.send(null);
}

function stateChangedLoginCRM2() 
{ 
  if (xmlLoginCRM2.readyState==4)
  { 
  document.getElementById('logcontents').style.display='';
  document.getElementById("myRanchoContent").innerHTML=xmlLoginCRM2.responseText;
  document.getElementById('loginRow').style.display='none';
  document.getElementById('loginRowFields').style.display='none';
  document.getElementById('loginResponse').style.display='none';
  document.getElementById("myRanchoLginHidden").value='yes';
  onlinkClickContent(myVar);
    getInitialContent();
    //alert('here');
  }
}

/* ==================================
1f. loginCRMLo()
================================== */

var xmlLoginCRMLo;

function loginCRMLo(int)
{ 

value1=int;

xmlLoginCRMLo=GetXmlHttpObject();
if(xmlLoginCRMLo==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/extranet/loginCRMLo.asp";
url=url+"?sid="+Math.random();

xmlLoginCRMLo.onreadystatechange=stateChangedLoginCRMLo;
xmlLoginCRMLo.open("GET",url,true);
xmlLoginCRMLo.send(null);
}

function stateChangedLoginCRMLo() 
{ 
  if (xmlLoginCRMLo.readyState==4)
  { 
    document.getElementById("loginTableLo").style.display='none';
    document.getElementById("myRanchoContentLo").innerHTML=xmlLoginCRMLo.responseText;
    setTimeout('contentExt('+ value1 +');',500);
  }
}

/* ==================================
1e. loginActionLo(lg,pswd)
================================== */
var xmlLoginActionLo;

function loginActionLo(lg,pswd)
{ 

log=lg
pass=pswd

xmlLoginActionLo=GetXmlHttpObject();
if (xmlLoginActionLo==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/extranet/loginAction.asp";
url=url+"?sid="+Math.random();

var str='lg='+lg+'&';
str=str+'pswd='+pswd+'&';

xmlLoginActionLo.onreadystatechange=stateChangedLoginActionLo;
xmlLoginActionLo.open("POST",url,true);
xmlLoginActionLo.setRequestHeader("Content-Type", 
      "application/x-www-form-urlencoded; charset=UTF-8"); 
xmlLoginActionLo.send(str);
}

function stateChangedLoginActionLo() 
{ 
  if (xmlLoginActionLo.readyState==4)
  { 
  //document.getElementById("processingDiv").innerHTML=xmlLoginAction.responseText;
  var logAction = parseInt(xmlLoginActionLo.responseText);
    if (logAction>=1){
      loginCRMLo(0);
      document.getElementById("loginName").value='';
      document.getElementById("loginPswd").value='';
    } else {
      document.getElementById("loginFailed").style.display='';
      
    }
  }
}

/* ==================================
2. onLogOutClick()
================================== */

var xmlOnLogOutClick;

function onLogOutClick()
{ 

xmlOnLogOutClick=GetXmlHttpObject();
if (xmlOnLogOutClick==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var msg = 'Are you sure?';
 if(confirm(msg)){
    var url="/custom/extranet/onLogOutClick.asp";
    url=url+"?sid="+Math.random();

    xmlOnLogOutClick.onreadystatechange=stateChangedOnLogOutClick;
    xmlOnLogOutClick.open("GET",url,true);
    xmlOnLogOutClick.send(null);
  }
}

function stateChangedOnLogOutClick() 
{ 
  if (xmlOnLogOutClick.readyState==4)
  { 
  document.getElementById('loginRow').style.display='';
  document.getElementById('logcontents').style.display='none';
  document.getElementById("myRanchoLginHidden").value='no';
  //window.location.reload();
  }
}


/* ==================================
2c. onLogOutClickLo()
================================== */

var xmlOnLogOutClickLo;

function onLogOutClickLo()
{ 

xmlOnLogOutClickLo=GetXmlHttpObject();
if (xmlOnLogOutClickLo==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var msg = 'Are you sure?';
 if(confirm(msg)){
    var url="/custom/extranet/onLogOutClick.asp";
    url=url+"?sid="+Math.random();

    xmlOnLogOutClickLo.onreadystatechange=stateChangedOnLogOutClickLo;
    xmlOnLogOutClickLo.open("GET",url,true);
    xmlOnLogOutClickLo.send(null);
  }
}

function stateChangedOnLogOutClickLo() 
{ 
  if (xmlOnLogOutClickLo.readyState==4)
  { 
    document.getElementById('loginTableLo').style.display='';
    document.getElementById("myRanchoContentLo").innerHTML='';
  }
}

/* ==================================
2a. onExitClick()
================================== */

var xmlOnExitClick;

function onExitClick(strng)
{ 

value1 = strng;

xmlOnExitClick=GetXmlHttpObject();
if (xmlOnExitClick==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
    var url="/custom/extranet/onLogOutClick.asp";
    url=url+"?sid="+Math.random();

    xmlOnExitClick.onreadystatechange=stateChangedOnExitClick;
    xmlOnExitClick.open("GET",url,true);
    xmlOnExitClick.send(null);
}

function stateChangedOnExitClick() 
{ 
  if (xmlOnExitClick.readyState==4)
  { 

    if(value1=='lo'){
      document.getElementById('myRanchoContentLo').innerHTML='';
    }else{
      //document.getElementById('loginRow').style.display='';
      //document.getElementById('logcontents').style.display='none';
    }
  }
}

/* ==================================
2b. onExitClickLo()
================================== */

var xmlOnExitClickLo;

function onExitClickLo()
{ 

xmlOnExitClickLo=GetXmlHttpObject();
if (xmlOnExitClickLo==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

    var url="/custom/extranet/onLogOutClick.asp";
    url=url+"?sid="+Math.random();

    xmlOnExitClickLo.onreadystatechange=stateChangedOnExitClickLo;
    xmlOnExitClickLo.open("GET",url,true);
    xmlOnExitClickLo.send(null);
}

function stateChangedOnExitClickLo() 
{ 
  if (xmlOnExitClickLo.readyState==4)
  { 
    document.getElementById('myRanchoContentLo').innerHTML='';
  }
}

/* ==================================
3. onlinkClickContent()
================================== */

function onlinkClickContent(int) {

var selc=int;
  if(selc==1){
    contentBkg(1);
    document.getElementById('topRowBkg').style.background = 'url(/custom/extranet/images/loginBkg_on.png)';
    document.getElementById('link0c').className = 'myRanchoText';
    document.getElementById('link1c').innerHTML='<img name="pic1c" src="/custom/extranet/images/extTab_01_on.png" width="112" height="30" />';
    document.getElementById('link2c').innerHTML='<A HREF="javascript:onlinkClickContent(2);" onMouseover="change1(\'pic2c\',\'imageC2o\')" onMouseout="change1(\'pic2c\',\'imageC2\')"><img name="pic2c" src="/custom/extranet/images/extTab_02_off.png" width="100" height="30" border="0" /></a>';
    document.getElementById('link3c').innerHTML='<A HREF="javascript:onlinkClickContent(3);" onMouseover="change1(\'pic3c\',\'imageC3o\')" onMouseout="change1(\'pic3c\',\'imageC3\')"><img name="pic3c" src="/custom/extranet/images/extTab_03_off.png" width="114" height="30" border="0" /></a>';
    document.getElementById('link4c').innerHTML='<A HREF="javascript:onlinkClickContent(4);" onMouseover="change1(\'pic4c\',\'imageC4o\')" onMouseout="change1(\'pic4c\',\'imageC4\')"><img name="pic4c" src="/custom/extranet/images/extTab_04_off.png" width="161" height="30" border="0" /></a>';
    document.getElementById('link5c').innerHTML='<A HREF="javascript:onlinkClickContent(5);" onMouseover="change1(\'pic5c\',\'imageC5o\')" onMouseout="change1(\'pic5c\',\'imageC5\')"><img name="pic5c" src="/custom/extranet/images/extTab_05_off.png" width="154" height="30" border="0" /></a>';
    contentExt(1);
  }else if (selc==2){
    contentBkg(2);
    document.getElementById('topRowBkg').style.background = 'url(/custom/extranet/images/loginBkg_on.png)';
    document.getElementById('link0c').className = 'myRanchoText';
    document.getElementById('link2c').innerHTML='<img name="pic2c" src="/custom/extranet/images/extTab_02_on.png" width="100" height="30" />';
    document.getElementById('link1c').innerHTML='<A HREF="javascript:onlinkClickContent(1);" onMouseover="change1(\'pic1c\',\'imageC1o\')" onMouseout="change1(\'pic1c\',\'imageC1\')"><img name="pic1c" src="/custom/extranet/images/extTab_01_off.png" width="112" height="30" border="0" /></a>';
    document.getElementById('link3c').innerHTML='<A HREF="javascript:onlinkClickContent(3);" onMouseover="change1(\'pic3c\',\'imageC3o\')" onMouseout="change1(\'pic3c\',\'imageC3\')"><img name="pic3c" src="/custom/extranet/images/extTab_03_off.png" width="114" height="30" border="0" /></a>';
    document.getElementById('link4c').innerHTML='<A HREF="javascript:onlinkClickContent(4);" onMouseover="change1(\'pic4c\',\'imageC4o\')" onMouseout="change1(\'pic4c\',\'imageC4\')"><img name="pic4c" src="/custom/extranet/images/extTab_04_off.png" width="161" height="30" border="0" /></a>';
    document.getElementById('link5c').innerHTML='<A HREF="javascript:onlinkClickContent(5);" onMouseover="change1(\'pic5c\',\'imageC5o\')" onMouseout="change1(\'pic5c\',\'imageC5\')"><img name="pic5c" src="/custom/extranet/images/extTab_05_off.png" width="154" height="30" border="0" /></a>';
    contentExt(2);
  }else if (selc==3){
    contentBkg(3);
    document.getElementById('topRowBkg').style.background = 'url(/custom/extranet/images/loginBkg_on.png)';
    document.getElementById('link0c').className = 'myRanchoText';
    document.getElementById('link3c').innerHTML='<img name="pic3c" src="/custom/extranet/images/extTab_03_on.png" width="114" height="30" />';
    document.getElementById('link1c').innerHTML='<A HREF="javascript:onlinkClickContent(1);" onMouseover="change1(\'pic1c\',\'imageC1o\')" onMouseout="change1(\'pic1c\',\'imageC1\')"><img name="pic1c" src="/custom/extranet/images/extTab_01_off.png" width="112" height="30" border="0" /></a>';
    document.getElementById('link2c').innerHTML='<A HREF="javascript:onlinkClickContent(2);" onMouseover="change1(\'pic2c\',\'imageC2o\')" onMouseout="change1(\'pic2c\',\'imageC2\')"><img name="pic2c" src="/custom/extranet/images/extTab_02_off.png" width="100" height="30" border="0" /></a>';
    document.getElementById('link4c').innerHTML='<A HREF="javascript:onlinkClickContent(4);" onMouseover="change1(\'pic4c\',\'imageC4o\')" onMouseout="change1(\'pic4c\',\'imageC4\')"><img name="pic4c" src="/custom/extranet/images/extTab_04_off.png" width="161" height="30" border="0" /></a>';
    document.getElementById('link5c').innerHTML='<A HREF="javascript:onlinkClickContent(5);" onMouseover="change1(\'pic5c\',\'imageC5o\')" onMouseout="change1(\'pic5c\',\'imageC5\')"><img name="pic5c" src="/custom/extranet/images/extTab_05_off.png" width="154" height="30" border="0" /></a>';
    contentExt(3);
  }else if (selc==4){
    contentBkg(4);
    document.getElementById('topRowBkg').style.background = 'url(/custom/extranet/images/loginBkg_on.png)';
    document.getElementById('link0c').className = 'myRanchoText';
    document.getElementById('link4c').innerHTML='<img name="pic4c" src="/custom/extranet/images/extTab_04_on.png" width="161" height="30" />';
    document.getElementById('link1c').innerHTML='<A HREF="javascript:onlinkClickContent(1);" onMouseover="change1(\'pic1c\',\'imageC1o\')" onMouseout="change1(\'pic1c\',\'imageC1\')"><img name="pic1c" src="/custom/extranet/images/extTab_01_off.png" width="112" height="30" border="0" /></a>';
    document.getElementById('link2c').innerHTML='<A HREF="javascript:onlinkClickContent(2);" onMouseover="change1(\'pic2c\',\'imageC2o\')" onMouseout="change1(\'pic2c\',\'imageC2\')"><img name="pic2c" src="/custom/extranet/images/extTab_02_off.png" width="100" height="30" border="0" /></a>';
    document.getElementById('link3c').innerHTML='<A HREF="javascript:onlinkClickContent(3);" onMouseover="change1(\'pic3c\',\'imageC3o\')" onMouseout="change1(\'pic3c\',\'imageC3\')"><img name="pic3c" src="/custom/extranet/images/extTab_03_off.png" width="114" height="30" border="0" /></a>';
    document.getElementById('link5c').innerHTML='<A HREF="javascript:onlinkClickContent(5);" onMouseover="change1(\'pic5c\',\'imageC5o\')" onMouseout="change1(\'pic5c\',\'imageC5\')"><img name="pic5c" src="/custom/extranet/images/extTab_05_off.png" width="154" height="30" border="0" /></a>';
    contentExt(4);
  }else if (selc==5){
    contentBkg(5);
    document.getElementById('topRowBkg').style.background = 'url(/custom/extranet/images/loginBkg_on.png)';
    document.getElementById('link0c').className = 'myRanchoText';
    document.getElementById('link5c').innerHTML='<img name="pic5c" src="/custom/extranet/images/extTab_05_on.png" width="155" height="30" />';
	  document.getElementById('link1c').innerHTML='<A HREF="javascript:onlinkClickContent(1);" onMouseover="change1(\'pic1c\',\'imageC1o\')" onMouseout="change1(\'pic1c\',\'imageC1\')"><img name="pic1c" src="/custom/extranet/images/extTab_01_off.png" width="112" height="30" border="0" /></a>';
	  document.getElementById('link2c').innerHTML='<A HREF="javascript:onlinkClickContent(2);" onMouseover="change1(\'pic2c\',\'imageC2o\')" onMouseout="change1(\'pic2c\',\'imageC2\')"><img name="pic2c" src="/custom/extranet/images/extTab_02_off.png" width="100" height="30" border="0" /></a>';
	  document.getElementById('link3c').innerHTML='<A HREF="javascript:onlinkClickContent(3);" onMouseover="change1(\'pic3c\',\'imageC3o\')" onMouseout="change1(\'pic3c\',\'imageC3\')"><img name="pic3c" src="/custom/extranet/images/extTab_03_off.png" width="114" height="30" border="0" /></a>';
	  document.getElementById('link4c').innerHTML='<A HREF="javascript:onlinkClickContent(4);" onMouseover="change1(\'pic4c\',\'imageC4o\')" onMouseout="change1(\'pic4c\',\'imageC4\')"><img name="pic4c" src="/custom/extranet/images/extTab_04_off.png" width="161" height="30" border="0" /></a>';
    contentExt(5);
  }else if (selc==0){
    contentBkg(0);
    document.getElementById('topRowBkg').style.background = 'url(/custom/extranet/images/loginBkg_onHP.png)';
    document.getElementById('link0c').className = 'myRanchoText2';
    document.getElementById('link1c').innerHTML='<A HREF="javascript:onlinkClickContent(1);" onMouseover="change1(\'pic1c\',\'imageC1o\')" onMouseout="change1(\'pic1c\',\'imageC1\')"><img name="pic1c" src="/custom/extranet/images/extTab_01_off.png" width="112" height="30" border="0" /></a>';
    document.getElementById('link2c').innerHTML='<A HREF="javascript:onlinkClickContent(2);" onMouseover="change1(\'pic2c\',\'imageC2o\')" onMouseout="change1(\'pic2c\',\'imageC2\')"><img name="pic2c" src="/custom/extranet/images/extTab_02_off.png" width="100" height="30" border="0" /></a>';
    document.getElementById('link3c').innerHTML='<A HREF="javascript:onlinkClickContent(3);" onMouseover="change1(\'pic3c\',\'imageC3o\')" onMouseout="change1(\'pic3c\',\'imageC3\')"><img name="pic3c" src="/custom/extranet/images/extTab_03_off.png" width="114" height="30" border="0" /></a>';
    document.getElementById('link4c').innerHTML='<A HREF="javascript:onlinkClickContent(4);" onMouseover="change1(\'pic4c\',\'imageC4o\')" onMouseout="change1(\'pic4c\',\'imageC4\')"><img name="pic4c" src="/custom/extranet/images/extTab_04_off.png" width="161" height="30" border="0" /></a>';
    document.getElementById('link5c').innerHTML='<A HREF="javascript:onlinkClickContent(5);" onMouseover="change1(\'pic5c\',\'imageC5o\')" onMouseout="change1(\'pic5c\',\'imageC5\')"><img name="pic5c" src="/custom/extranet/images/extTab_05_off.png" width="154" height="30" border="0" /></a>';
    contentExt(0);
  }

}
//function content5(){
//document.getElementById('contentSelect').innerHTML='<img src="/custom/extranet/images/extBkg_05.png" width="950" height="245" />';
//}

function contentBkg(int){
  document.getElementById('contentSelect').innerHTML='';
  if(int<=9){
    document.getElementById('contentSelect').style.background='url(/custom/extranet/images/extBkg_0'+int+'a.png)';
  }else{
    document.getElementById('contentSelect').style.background='url(/custom/extranet/images/extBkg_'+int+'a.png)';
  }
  document.getElementById('contentSelect').style.width='950';
  if(int>0){
    if(int==17){
      document.getElementById('contentSelect').style.height='350';
    }else{
      document.getElementById('contentSelect').style.height='290';
    }
  }else if(int<=0){
    document.getElementById('contentSelect').style.height='350';
  }
  document.getElementById('contentSelect').style.backgroundRepeat ='no-repeat';
}


/* ==================================
3a. onlinkClickContentLo()
================================== */

function onlinkClickContentLo(int){
var selc=int;
  if(selc==1){
    document.getElementById('link0c').className = 'myRanchoText';
    contentExt(1);
  }else if (selc==2){
    document.getElementById('link0c').className = 'myRanchoText';
    contentExt(2);
  }else if (selc==3){
    document.getElementById('link0c').className = 'myRanchoText';
    contentExt(3);
  }else if (selc==4){
    document.getElementById('link0c').className = 'myRanchoText';
    contentExt(4);
  }else if (selc==5){
    document.getElementById('link0c').className = 'myRanchoText';
    contentExt(5);
  }else if (selc==0){
    document.getElementById('link0c').className = 'myRanchoText2';
    contentExt(0);
  }

}


/* ==================================
4. contentExt(int)
================================== */

var xmlContentExt

function contentExt(int)
{ 

myVar=int;

  xmlContentExt=GetXmlHttpObject();
  if (xmlContentExt==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/content"+ int +".asp";
  url=url+"?sid="+Math.random();
  
  xmlContentExt.onreadystatechange=stateChangedContentExt;
  xmlContentExt.open("GET",url,true);
  xmlContentExt.send(null);
 
}

function stateChangedContentExt() 
{
  if (xmlContentExt.readyState<4){
    document.getElementById("contentSelect").innerHTML=processingExt;
  }else if (xmlContentExt.readyState==4){
    document.getElementById("contentSelect").innerHTML=xmlContentExt.responseText;
    scID = document.getElementById("sessionContactID").value;
    
    if(scID=="0"||scID==""){
      if(myVar>=6){
      }else{
        getReLogin();
      }
    }else{
      
      if(myVar==4){
        getCheckStatus();
      }else if(myVar==5){
        subsList(0);
      }else if(myVar==0){
        //getHomeTab();
      }else if(myVar==3){
        //getContent3Subs();
        getOuterList2(1);
        getOuterList1(1);
      }else if(myVar==1){
        getCustomNews();
      }else if(myVar==2){
        getMyEvents(1);
      }
    }
  }
}

/* ==================================
5. getCheckStatus()
================================== */

var xmlGetCheckStatus;

function getCheckStatus()
{ 

  xmlGetCheckStatus=GetXmlHttpObject();
  if (xmlGetCheckStatus==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/getCheckStatus.asp";
  url=url+"?sid="+Math.random();
  
  xmlGetCheckStatus.onreadystatechange=stateChangedGetCheckStatus;
  xmlGetCheckStatus.open("GET",url,true);
  xmlGetCheckStatus.send(null);
 
}

function stateChangedGetCheckStatus() 
{ 
  if (xmlGetCheckStatus.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlGetCheckStatus.readyState==4){
    document.getElementById("loadingDiv").innerHTML='';
    document.getElementById("subsListDiv").innerHTML=xmlGetCheckStatus.responseText;
    grpxValue=document.getElementById("grpxver").value;
    if(grpxValue!='lo'){
      onTabClick(1);
    }else{
      getTabbedContents(1);
    }
  }
}


/* ==================================
5a. getCheckStatusParent()
================================== */

var xmlGetCheckStatusParent;

function getCheckStatusParent()
{ 

  xmlGetCheckStatusParent=GetXmlHttpObject();
  if (xmlGetCheckStatusParent==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/getCheckStatus.asp";
  url=url+"?sid="+Math.random();
  
  xmlGetCheckStatusParent.onreadystatechange=stateChangedGetCheckStatusParent;
  xmlGetCheckStatusParent.open("GET",url,true);
  xmlGetCheckStatusParent.send(null);
 
}

function stateChangedGetCheckStatusParent() 
{ 
  if (xmlGetCheckStatusParent.readyState==4)
  {
document.getElementById("subsListDiv").innerHTML=xmlGetCheckStatusParent.responseText;
  }
}

/* ==================================
6. getSubmitRequest()
================================== */

var xmlGetSubmitRequest;

function getSubmitRequest()
{ 

  xmlGetSubmitRequest=GetXmlHttpObject();
  if (xmlGetSubmitRequest==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/getSubmitRequest.asp";
  url=url+"?sid="+Math.random();
  
  xmlGetSubmitRequest.onreadystatechange=stateChangedGetSubmitRequest;
  xmlGetSubmitRequest.open("GET",url,true);
  xmlGetSubmitRequest.send(null);
 
}

function stateChangedGetSubmitRequest() 
{ 
  if (xmlGetSubmitRequest.readyState==4)
  {
    document.getElementById("subsListDiv").innerHTML=xmlGetSubmitRequest.responseText;
  }
}

/* ==================================
7. getAskQuestion()
================================== */

var xmlGetAskQuestion;

function getAskQuestion()
{ 

  xmlGetAskQuestion=GetXmlHttpObject();
  if (xmlGetAskQuestion==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/getAskQuestion.asp";
  url=url+"?sid="+Math.random();
  
  xmlGetAskQuestion.onreadystatechange=stateChangedGetAskQuestion;
  xmlGetAskQuestion.open("GET",url,true);
  xmlGetAskQuestion.send(null);
 
}

function stateChangedGetAskQuestion() 
{ 
  if (xmlGetAskQuestion.readyState==4)
  {
    document.getElementById("qcontents").innerHTML=xmlGetAskQuestion.responseText;
  }
}

/* ==================================
8. requestSubmit_Complete()
================================== */
var xmlRequestSubmit_Complete;

function requestSubmit_Complete()
{ 

xmlRequestSubmit_Complete=GetXmlHttpObject();
if (xmlRequestSubmit_Complete==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/extranet/RequestSubmit_Complete.asp";
url=url+"?sid="+Math.random();

var str='lg=1&';
str=str+'pswd=1&';

xmlRequestSubmit_Complete.onreadystatechange=stateChangedRequestSubmit_Complete;
xmlRequestSubmit_Complete.open("POST",url,true);
xmlRequestSubmit_Complete.setRequestHeader("Content-Type", 
      "application/x-www-form-urlencoded; charset=UTF-8"); 
xmlRequestSubmit_Complete.send(str);
}

function stateChangedRequestSubmit_Complete() 
{ 
  if (xmlRequestSubmit_Complete.readyState==4)
  { 
    document.getElementById("qcontents").innerHTML=xmlRequestSubmit_Complete.responseText;
    document.getElementById("requestText").innerHTML='Your Request has been received.';
    setTimeout('getAskQuestion();',2000);
    setTimeout('getQTitle();',2000);
  }
}

function getQTitle(){
 document.getElementById("requestText").innerHTML='Please Send us Your Request';
}

/* ==================================
9. setKeyUpLogin()
================================== */


function setKeyUpLogin(e)
{ 
var characterCode 
//var unicode=e.charCode? e.charCode : e.keyCode
//alert(unicode)

  if(e && e.which){ //if which property of event object is supported (NN4)
    //alert("nn="+e.which)
    e = e
    characterCode = e.which //character code is contained in NN4's which property
  }
  else{
    e = event
    characterCode = e.keyCode //character code is contained in IE's keyCode property
    //alert("ie="+characterCode)
  }

  if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
    onLogRowClick();
  }
}      

/* ==================================
9a. setKeyUpLogin2()
================================== */


function setKeyUpLogin2(e)
{ 
var characterCode 
//var unicode=e.charCode? e.charCode : e.keyCode
//alert(unicode)

  if(e && e.which){ //if which property of event object is supported (NN4)
    //alert("nn="+e.which)
    e = e
    characterCode = e.which //character code is contained in NN4's which property
  }
  else{
    e = event
    characterCode = e.keyCode //character code is contained in IE's keyCode property
    //alert("ie="+characterCode)
  }

  if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
    //onLogRowClick();
    //loginAction2();
    loginAction();
  }
}

/* ==================================
9b. setKeyUpLoginLo()
================================== */


function setKeyUpLoginLo(e)
{ 
var characterCode 
//var unicode=e.charCode? e.charCode : e.keyCode
//alert(unicode)

  if(e && e.which){ //if which property of event object is supported (NN4)
    //alert("nn="+e.which)
    e = e
    characterCode = e.which //character code is contained in NN4's which property
  }
  else{
    e = event
    characterCode = e.keyCode //character code is contained in IE's keyCode property
    //alert("ie="+characterCode)
  }

  if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
    onLogInClickLo();
  }
}      


/* ==================================
9c. setKeyUpLoginRe()
================================== */


function setKeyUpLoginRe(e)
{ 
var characterCode 
//var unicode=e.charCode? e.charCode : e.keyCode
//alert(unicode)

  if(e && e.which){ //if which property of event object is supported (NN4)
    //alert("nn="+e.which)
    e = e
    characterCode = e.which //character code is contained in NN4's which property
  }
  else{
    e = event
    characterCode = e.keyCode //character code is contained in IE's keyCode property
    //alert("ie="+characterCode)
  }

  if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
    loginAction3();
  }
} 

/* ==================================
10. getAccountCreate()
================================== */
var xmlGetAccountCreate;

function getAccountCreate()
{ 

xmlGetAccountCreate=GetXmlHttpObject();
if (xmlGetAccountCreate==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/extranet/getAccountCreate.asp";
url=url+"?sid="+Math.random();

xmlGetAccountCreate.onreadystatechange=stateChangedGetAccountCreate;
xmlGetAccountCreate.open("GET",url,true);
xmlGetAccountCreate.send(null);
}

function stateChangedGetAccountCreate() 
{ 
  if (xmlGetAccountCreate.readyState<4){
    document.getElementById('myRanchoContent').innerHTML=processingExt;
  }else if (xmlGetAccountCreate.readyState==4){ 
    document.getElementById('myRanchoContent').innerHTML=xmlGetAccountCreate.responseText;
    contentBkg(6);
    contentExt(6);
  }
}


/* ==================================
10a. getAccountCreateLo()
================================== */
var xmlGetAccountCreateLo;

function getAccountCreateLo()
{ 

xmlGetAccountCreateLo=GetXmlHttpObject();
if (xmlGetAccountCreateLo==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/extranet/getAccountCreate.asp";
url=url+"?sid="+Math.random();

xmlGetAccountCreateLo.onreadystatechange=stateChangedGetAccountCreateLo;
xmlGetAccountCreateLo.open("GET",url,true);
xmlGetAccountCreateLo.send(null);
}

function stateChangedGetAccountCreateLo() 
{ 
  if (xmlGetAccountCreateLo.readyState<4){
    document.getElementById('myRanchoContentLo').innerHTML=processingExt;
  }else if (xmlGetAccountCreateLo.readyState==4){ 
    document.getElementById('myRanchoContentLo').innerHTML=xmlGetAccountCreateLo.responseText;
    contentExt(6);
  }
}




/* ==================================
11. resetMyNotCheckbox(int)
================================== */
var xmlResetMyNotCheckbox;

function resetMyNotCheckbox(int)
{ 

xmlResetMyNotCheckbox=GetXmlHttpObject();
if (xmlResetMyNotCheckbox==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/extranet/resetMyNotCheckbox.asp";
url=url+"?sid="+Math.random();

var str='ID='+int;

xmlResetMyNotCheckbox.onreadystatechange=stateChangedResetMyNotCheckbox;
xmlResetMyNotCheckbox.open("POST",url,true);
xmlResetMyNotCheckbox.setRequestHeader("Content-Type", 
      "application/x-www-form-urlencoded; charset=UTF-8"); 
xmlResetMyNotCheckbox.send(str);
}

function stateChangedResetMyNotCheckbox() 
{ 
  if (xmlResetMyNotCheckbox.readyState<4){
    //document.getElementById('myRanchoContent').innerHTML=processingExt;
  }else if (xmlResetMyNotCheckbox.readyState==4){ 
    //document.getElementById('myRanchoContent').innerHTML=xmlResetMyNotCheckbox.responseText;
  }
}


/* ==================================
12. deleteFavWPLink(int)
================================== */
var xmlDeleteFavWPLink;

function deleteFavWPLink(int)
{ 

xmlDeleteFavWPLink=GetXmlHttpObject();
if (xmlDeleteFavWPLink==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/extranet/deleteFavWPLink.asp";
url=url+"?sid="+Math.random();

var str='ID='+int;
var msg = "Remove as a favorite? \nAre you sure?";
  if(confirm(msg)){
    xmlDeleteFavWPLink.onreadystatechange=stateChangedDeleteFavWPLink;
    xmlDeleteFavWPLink.open("POST",url,true);
    xmlDeleteFavWPLink.setRequestHeader("Content-Type", 
          "application/x-www-form-urlencoded; charset=UTF-8"); 
    xmlDeleteFavWPLink.send(str);
  }
}

function stateChangedDeleteFavWPLink() 
{ 
  if (xmlDeleteFavWPLink.readyState<4){
    document.getElementById('loadingDiv').innerHTML=loading3;
  }else if (xmlDeleteFavWPLink.readyState==4){ 
    document.getElementById('loadingDiv').innerHTML='';
    //getFavWPsList();
    getOuterList2(1);
  }
}


/* ==================================
13. getFavWPsList()
================================== */
var xmlGetFavWPsList;

function getFavWPsList()
{ 

xmlGetFavWPsList=GetXmlHttpObject();
if (xmlGetFavWPsList==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/extranet/favWPsList.asp";
url=url+"?sid="+Math.random();

xmlGetFavWPsList.onreadystatechange=stateChangedGetFavWPsList;
xmlGetFavWPsList.open("GET",url,true);
xmlGetFavWPsList.send(null);
}

function stateChangedGetFavWPsList() 
{ 
  if (xmlGetFavWPsList.readyState<4){
    document.getElementById('loadingDiv').innerHTML=loading3;
  }else if (xmlGetFavWPsList.readyState==4){ 
    document.getElementById('loadingDiv').innerHTML='';
    document.getElementById('outerList2').innerHTML=xmlGetFavWPsList.responseText;
  }
}


/* ==================================
13a. getOuterList1()
================================== */
var xmlGetOuterList1;

function getOuterList1(int){ 

pageID = int;

xmlGetOuterList1=GetXmlHttpObject();
if (xmlGetOuterList1==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/extranet/getOuterList1.asp";
url=url+"?sid="+Math.random();

var str = 'PageID='+pageID;

xmlGetOuterList1.onreadystatechange=stateChangedGetOuterList1;
xmlGetOuterList1.open("POST",url,true);
xmlGetOuterList1.setRequestHeader("Content-Type", 
          "application/x-www-form-urlencoded; charset=UTF-8"); 
xmlGetOuterList1.send(str);
}

function stateChangedGetOuterList1() 
{ 
  if (xmlGetOuterList1.readyState<4){
    document.getElementById('loadingDiv').innerHTML=loading3;
  }else if (xmlGetOuterList1.readyState==4){ 
    document.getElementById('loadingDiv').innerHTML='';
    document.getElementById('outerList1').innerHTML=xmlGetOuterList1.responseText;
    document.getElementById("favCount0").innerHTML=document.getElementById("sCount").value;
    document.getElementById("favCount1").innerHTML=document.getElementById("eCount").value;
    document.getElementById("favCount2").innerHTML=document.getElementById("tCount").value;
    servicesSetPages(pageID);
    document.getElementById('myFavTitleTable2').style.display='';
    document.getElementById('myFavTitleTable2a').style.display='none';
  }
}

/* ==================================
13b. getOuterList2()
================================== */
var xmlGetOuterList2;

function getOuterList2(int)
{ 

pageID = int;

xmlGetOuterList2=GetXmlHttpObject();
if (xmlGetOuterList2==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/extranet/getOuterList2.asp";
url=url+"?sid="+Math.random();

var str = 'PageID='+pageID;

xmlGetOuterList2.onreadystatechange=stateChangedGetOuterList2;
xmlGetOuterList2.open("POST",url,true);
xmlGetOuterList2.setRequestHeader("Content-Type", 
          "application/x-www-form-urlencoded; charset=UTF-8"); 
xmlGetOuterList2.send(str);
}

function stateChangedGetOuterList2() 
{ 
  if (xmlGetOuterList2.readyState<4){
    document.getElementById('loadingDiv').innerHTML=loading3;
  }else if (xmlGetOuterList2.readyState==4){ 
    document.getElementById('loadingDiv').innerHTML='';
    document.getElementById('con3Outer').style.display='none';
    document.getElementById('outerList2').innerHTML=xmlGetOuterList2.responseText;
    document.getElementById("favCount0a").innerHTML=document.getElementById("sCounta").value;
    document.getElementById("favCount1a").innerHTML=document.getElementById("eCounta").value;
    document.getElementById("favCount2a").innerHTML=document.getElementById("tCounta").value;
    webPagesSetPages(pageID);
    document.getElementById('myFavTitleTable1').style.display='';
    document.getElementById('moreButtonRow').style.display='';
   
  }
}

/* ==================================
13c. getFavServiceSetUp()
================================== */
var xmlGetFavServiceSetUp;

function getFavServiceSetUp()
{ 

xmlGetFavServiceSetUp=GetXmlHttpObject();
if (xmlGetFavServiceSetUp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/extranet/getFavServiceSetUp.asp";
url=url+"?sid="+Math.random();

xmlGetFavServiceSetUp.onreadystatechange=stateChangedGetFavServiceSetUp;
xmlGetFavServiceSetUp.open("GET",url,true);
xmlGetFavServiceSetUp.send(null);
}

function stateChangedGetFavServiceSetUp() 
{ 
  if (xmlGetFavServiceSetUp.readyState<4){
    document.getElementById('loadingDiv').innerHTML=loading3;
  }else if (xmlGetFavServiceSetUp.readyState==4){
  
    document.getElementById('con3Outer').style.display='';
    document.getElementById('loadingDiv').innerHTML='';
    document.getElementById('favButton').style.display='none';
    document.getElementById('favButton2').style.display='';
    document.getElementById('webFavsTitle').style.display='none';
    
    document.getElementById('subsListDiv').innerHTML=xmlGetFavServiceSetUp.responseText;
    document.getElementById('favCount1b').innerHTML=document.getElementById('currentSCount').value;
    document.getElementById('favCount2b').innerHTML=document.getElementById('totalSCount').value;
    document.getElementById('myFavTitleTable1').style.display='none';
    document.getElementById('myFavTitleTable2').style.display='none';
    document.getElementById('myFavTitleTable2a').style.display='';
    document.getElementById('myFavTitleTable2b').style.display='none';
    document.getElementById('moreButtonRow').style.display='none';
  }
}


/* ==================================
13d. getContent3Subs()
================================== */
var xmlGetContent3Subs;

function getContent3Subs()
{ 

//xmlGetContent3Subs=GetXmlHttpObject();
//if (xmlGetContent3Subs==null)
  //{
  //alert ("Your browser does not support AJAX!");
  //return;
  //} 

//var url="/custom/extranet/getContent3Subs.asp";
//url=url+"?sid="+Math.random();

//xmlGetContent3Subs.onreadystatechange=stateChangedGetContent3Subs;
//xmlGetContent3Subs.open("GET",url,true);
//xmlGetContent3Subs.send(null);
//}

//function stateChangedGetContent3Subs() 
//{ 
  //if (xmlGetContent3Subs.readyState<4){
    //document.getElementById('loadingDiv').innerHTML=loading3;
 // }else if (xmlGetContent3Subs.readyState==4){ 
    document.getElementById('myFavTitleTable1').style.display='';
    document.getElementById('myFavTitleTable2').style.display='';
    document.getElementById('myFavTitleTable2a').style.display='none';
    document.getElementById('myFavTitleTable2b').style.display='';
    document.getElementById('favButton').style.display='';
    document.getElementById('favButton2').style.display='none';   
    document.getElementById('webFavsTitle').style.display='';
     
    document.getElementById('subsListDiv').innerHTML='';//xmlGetContent3Subs.responseText;
    //document.getElementById('loadingDiv').innerHTML='';
    getOuterList1(1);
    getOuterList2(1);
    
 // }
}


/* ==================================
14. subsList()
================================== */

var xmlSubsList;

function subsList(int)
{

value1=int;

  xmlSubsList=GetXmlHttpObject();
  if (xmlSubsList==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
    
  var url="/custom/extranet/subsList.asp";
  url=url+"?sid="+Math.random();
  
  var str='bookmark='+value1;

  xmlSubsList.onreadystatechange=stateChangedSubsList;
  xmlSubsList.open("Post",url,true);
  xmlSubsList.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlSubsList.send(str);
  
}

function stateChangedSubsList() 
{ 
  if (xmlSubsList.readyState < 4){
      document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlSubsList.readyState==4){ 
  
      document.getElementById("subsListDiv").innerHTML=xmlSubsList.responseText; 
      document.getElementById("loadingDiv").innerHTML='';
      document.getElementById("notCount1").innerHTML=document.getElementById("numchecked").value;
      document.getElementById("viewNotButton").style.display='none';
      var1 = document.getElementById("dnm").value;
      if(var1==2){
        document.getElementById("notButtons1").style.display='none';
      }else{
        document.getElementById("notButtons1").style.display='';
      }
  }
}


/* ==================================
14. subsList()
================================== */

var xmlHelpList;

function helpList()
{

  xmlHelpList=GetXmlHttpObject();
  if (xmlHelpList==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
    
  var url="/custom/extranet/helpList.asp";
  url=url+"?sid="+Math.random();
  
  var str='bookmark='+value1;

  xmlHelpList.onreadystatechange=stateChangedSHelpList;
  xmlHelpList.open("Post",url,true);
  xmlHelpList.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlHelpList.send(str);
  
}

function stateChangedSHelpList() 
{ 
  if (xmlHelpList.readyState < 4){
      document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlHelpList.readyState==4){ 
      document.getElementById("loadingDiv").innerHTML='';
      //open hsslide with help
  }
}


/* ==================================
15. getUpdateAccount()
================================== */

var xmlGetUpdateAccount;

function getUpdateAccount(int)
{

value1=int;

  xmlGetUpdateAccount=GetXmlHttpObject();
  if (xmlGetUpdateAccount==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
    
  var url="/custom/extranet/getUpdateAccount.asp";
  url=url+"?sid="+Math.random();
  
  var str='bookmark='+value1;

  xmlGetUpdateAccount.onreadystatechange=stateChangedGetUpdateAccount;
  xmlGetUpdateAccount.open("Post",url,true);
  xmlGetUpdateAccount.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlGetUpdateAccount.send(str);
  
}

function stateChangedGetUpdateAccount() 
{ 
  if (xmlGetUpdateAccount.readyState < 4){
      document.getElementById("loadingDiv").innerHTML=loading2;  
  }else if (xmlGetUpdateAccount.readyState==4){ 
      document.getElementById("subsListDiv").innerHTML=xmlGetUpdateAccount.responseText; 
      document.getElementById("loadingDiv").innerHTML='';
  }
}


/* ==================================
16. getUnsub()
================================== */

var xmlGetUnsub;

function getUnsub(int)
{

value1=int;

  xmlGetUnsub=GetXmlHttpObject();
  if (xmlGetUnsub==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
    
  var url="/custom/extranet/getUnsub.asp";
  url=url+"?sid="+Math.random();
  
  var str='choice='+value1;

  xmlGetUnsub.onreadystatechange=stateChangedGetUnsub;
  xmlGetUnsub.open("Post",url,true);
  xmlGetUnsub.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlGetUnsub.send(str);
  
}

function stateChangedGetUnsub() 
{ 
  if (xmlGetUnsub.readyState < 4){
      document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlGetUnsub.readyState==4){ 
      document.getElementById("subsListDiv").innerHTML=xmlGetUnsub.responseText; 
      document.getElementById("loadingDiv").innerHTML='';
  }
}


/* ==================================
17. getContactAdmin()
================================== */

var xmlGetContactAdmin;

function getContactAdmin(int)
{

  tabID = int;

  xmlGetContactAdmin=GetXmlHttpObject();
  if (xmlGetContactAdmin==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
    
  var url="/custom/extranet/getContactAdmin.asp";
  url=url+"?sid="+Math.random();
  
  var str='tabID='+int;

  xmlGetContactAdmin.onreadystatechange=stateChangedGetContactAdmin;
  xmlGetContactAdmin.open("POST",url,true);
  xmlGetContactAdmin.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlGetContactAdmin.send(str);
  
}

function stateChangedGetContactAdmin() 
{ 
  if (xmlGetContactAdmin.readyState < 4){
      document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlGetContactAdmin.readyState==4){ 
      document.getElementById("subsListDiv").innerHTML=xmlGetContactAdmin.responseText; 
      document.getElementById("loadingDiv").innerHTML='';
      if(tabID==0){
        document.getElementById("buttonRow00").style.display='none';
        document.getElementById("buttonRow01").style.display='none';
      }
  }
}

/* ==================================
18. addRemoveLists(int)
================================== */

var xmlAddRemoveLists;

function addRemoveLists(ID1,ID2,ID3)
{

  xmlAddRemoveLists=GetXmlHttpObject();
  if (xmlAddRemoveLists==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/addRemoveLists.asp";
  url=url+"?sid="+Math.random();
  
  var str='contactID='+ID2+'&';
  str=str+'listID='+ID1+'&';
  str=str+'checked='+ID3;

  xmlAddRemoveLists.onreadystatechange=stateChangedAddRemoveLists;
  xmlAddRemoveLists.open("POST",url,true);
  xmlAddRemoveLists.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlAddRemoveLists.send(str);
}

function stateChangedAddRemoveLists() 
{ 
  if (xmlAddRemoveLists.readyState==4)
  { 
  //document.getElementById("loadingDiv").innerHTML=xmlAddRemoveLists.responseText;  
   //content5();
   //checkedList();
   //chosenSubs();
   document.getElementById("updateNotice1").style.display='';
   setTimeout('document.getElementById("updateNotice1").style.display="none";',3000);
   subsList(0);
  }
}


/* ==================================
19. addAllLists(int)
================================== */

var xmlAddAllLists;

function addAllLists()
{

  xmlAddAllLists=GetXmlHttpObject();
  if (xmlAddAllLists==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/addAllLists.asp";
  url=url+"?sid="+Math.random();

  xmlAddAllLists.onreadystatechange=stateChangedAddAllLists;
  xmlAddAllLists.open("GET",url,true);
  xmlAddAllLists.send(null);
}

function stateChangedAddAllLists() 
{ 
  if (xmlAddAllLists.readyState==4)
  { 
    //document.getElementById("errorDiv").innerHTML=xmlAddAllLists.responseText;  
    //content5();
   //checkedList();
   //chosenSubs();
   document.getElementById("updateNotice1").style.display='';
   setTimeout('document.getElementById("updateNotice1").style.display="none";',3000);
   subsList(0)
  }
}

/* ==================================
20. removeAllLists(int)
================================== */

var xmlRemoveAllLists;

function removeAllLists()
{

  xmlRemoveAllLists=GetXmlHttpObject();
  if (xmlRemoveAllLists==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/removeAllLists.asp";
  url=url+"?sid="+Math.random();

  xmlRemoveAllLists.onreadystatechange=stateChangedRemoveAllLists;
  xmlRemoveAllLists.open("GET",url,true);
  xmlRemoveAllLists.send(null);
}

function stateChangedRemoveAllLists() 
{ 
  if (xmlRemoveAllLists.readyState==4)
  { 
  //document.getElementById("errorDiv").innerHTML=xmlRemoveAllLists.responseText;  
   //content5();
   //checkedList();
   //chosenSubs();
   document.getElementById("updateNotice1").style.display='';
   setTimeout('document.getElementById("updateNotice1").style.display="none";',3000);
   subsList(0)
  }
}


/* ==================================
21. setDNM(int)
================================== */

var xmlSetDNM;

function setDNM(int1,int2)
{

  myVar = int1

  xmlSetDNM=GetXmlHttpObject();
  if (xmlSetDNM==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/setDNM.asp";
  url=url+"?sid="+Math.random();
  
  var str='choice='+int1;
  
  var msg = 'Are you sure?';
  
  if(confirm(msg)){
    if(int1!=int2){
    xmlSetDNM.onreadystatechange=stateChangedSetDNM;
    xmlSetDNM.open("POST",url,true);
    xmlSetDNM.setRequestHeader("Content-Type", 
          "application/x-www-form-urlencoded; charset=UTF-8"); 
    xmlSetDNM.send(str);
    }
  }else{
    getUnsub(int1);
  }
}

function stateChangedSetDNM() 
{ 
  if (xmlSetDNM.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlSetDNM.readyState==4){ 
    document.getElementById("loadingDiv").innerHTML=''; 
    if(myVar==1){
      document.getElementById("notButtons1").style.display='none';
      document.getElementById("notCount1").innerHTML=0;
      document.getElementById("dnm").value=2; 
    }else{
      document.getElementById("viewNotButton").style.display='';
      document.getElementById("dnm").value=0;
    }
    document.getElementById("subsListDiv").innerHTML=xmlSetDNM.responseText; 
  }
}


/* ==================================
22. sendCAEmail()
================================== */

var xmlSendCAEmail;

function sendCAEmail(int,int2)
{

var1=int;
tabID=int2;

  subject = document.getElementById("subj1").value;
  body = document.getElementById("cont1").value;

body = body.replace(/[\n]/g, '<br>');

  xmlSendCAEmail=GetXmlHttpObject();
  if (xmlSendCAEmail==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/sendCAEmail.asp";
  url=url+"?sid="+Math.random();
  
  var str='subj='+escape(subject)+'&';
  str=str+'body='+escape(body);
  //alert(str)
  if (subject == '' || body==''){
     if (subject == ''){
        document.getElementById("subj_error").innerHTML='<span style="color:#cc0000;font-weight:bold;">Subject is required!</span><style>.inputFontSubj{border-color:red;border-width:1px;}</style>';
     }
      if (body==''){
        document.getElementById("body_error").innerHTML='<span style="color:#cc0000;font-weight:bold;">Body is required!</span><style>.inputFontBody{border-color:red;border-width:1px;}</style>';
     }
 }else{
 
    document.getElementById("subj_error").innerHTML='';
    document.getElementById("body_error").innerHTML='';

  
    var msg = 'Are you sure?';
    
    if(confirm(msg)){
      xmlSendCAEmail.onreadystatechange=stateChangedSendCAEmail;
      xmlSendCAEmail.open("POST",url,true);
      xmlSendCAEmail.setRequestHeader("Content-Type", 
            "application/x-www-form-urlencoded; charset=UTF-8"); 
      xmlSendCAEmail.send(str);
    }
  }
}

function stateChangedSendCAEmail() 
{ 
  if (xmlSendCAEmail.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlSendCAEmail.readyState==4){ 
    document.getElementById("loadingDiv").innerHTML=''; 
    document.getElementById("subsListDiv").innerHTML=xmlSendCAEmail.responseText; 
    if(tabID==5){
      setTimeout('subsList(var1);',5000);
    }else if(tabID==0){
      setTimeout('getHomeTab();',5000);
    }
  }
}



/* ==================================
23. getForgotPassword()
================================== */
var xmlGetForgotPassword;

function getForgotPassword()
{ 

  document.getElementById('loginRowFields').style.display='none';
  document.getElementById('loginValidation').style.display='none';
  document.getElementById('logcontents').style.display='';

xmlGetForgotPassword=GetXmlHttpObject();
if (xmlGetForgotPassword==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/extranet/getForgotPassword.asp";
url=url+"?sid="+Math.random();

xmlGetForgotPassword.onreadystatechange=stateChangedGetForgotPassword;
xmlGetForgotPassword.open("GET",url,true);
xmlGetForgotPassword.send(null);
}

function stateChangedGetForgotPassword() 
{ 
  if (xmlGetForgotPassword.readyState<4){
    document.getElementById('myRanchoContent').innerHTML=processingExt;
  }else if (xmlGetForgotPassword.readyState==4){ 
    document.getElementById('myRanchoContent').innerHTML=xmlGetForgotPassword.responseText;
    contentBkg(0);
    contentExt(7);
  }
}

/* ==================================
23a. getForgotPasswordHTTPS()
================================== */
var xmlGetForgotPassword;

function getForgotPasswordHTPS() {

  //document.getElementById('loginRowFields').style.display = 'none';
  //document.getElementById('loginValidation').style.display = 'none';
  //document.getElementById('logcontents').style.display = '';

  xmlGetForgotPassword = GetXmlHttpObject();
  if (xmlGetForgotPassword == null) {
    alert("Your browser does not support AJAX!");
    return;
  }

  var url = "/custom/extranet/getForgotPassword.asp";
  url = url + "?sid=" + Math.random();

  xmlGetForgotPassword.onreadystatechange = stateChangedGetForgotPassword;
  xmlGetForgotPassword.open("GET", url, true);
  xmlGetForgotPassword.send(null);
}

function stateChangedGetForgotPassword() {
  if (xmlGetForgotPassword.readyState < 4) {
    //document.getElementById('myRanchoContent').innerHTML = processingExt;
  } else if (xmlGetForgotPassword.readyState == 4) {
    //document.getElementById('myRanchoContent').innerHTML = xmlGetForgotPassword.responseText;
    contentBkg(0);
    contentExt(7);
  }
}

/* ==================================
23a. getForgotPasswordLo()
================================== */
var xmlGetForgotPasswordLo;

function getForgotPasswordLo()
{ 

xmlGetForgotPasswordLo=GetXmlHttpObject();
if (xmlGetForgotPasswordLo==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/extranet/getForgotPassword.asp";
url=url+"?sid="+Math.random();

xmlGetForgotPasswordLo.onreadystatechange=stateChangedGetForgotPasswordLo;
xmlGetForgotPasswordLo.open("GET",url,true);
xmlGetForgotPasswordLo.send(null);
}

function stateChangedGetForgotPasswordLo() 
{ 
  if (xmlGetForgotPasswordLo.readyState<4){
    document.getElementById('myRanchoContentLo').innerHTML=processingExt;
  }else if (xmlGetForgotPasswordLo.readyState==4){ 
    document.getElementById('myRanchoContentLo').innerHTML=xmlGetForgotPasswordLo.responseText;
    contentExt(7);
  }
}

/* ==================================
24. accountSetupAction();
================================== */

var xmlAccountSetupAction;

function accountSetupAction()
{ 

eValue=document.getElementById("emailAddress").value;
value1=document.getElementById("pswd1").value;
value2=document.getElementById("pswd2").value;
value3=value1.length;
valid = Validate_Email_Address(eValue);
fname=document.getElementById("firstName").value;
lname=document.getElementById("lastName").value;

if (value1==''||value2==''||value1!= value2||value3<6||valid != true||eValue==''||fname==''||lname==''){
  if (value1==''){
    document.getElementById("passError1").innerHTML='Required!<style>.inputFontPass1{border-color:red;border-width:1px;}</style>';
  }else if (value1!= value2){
    document.getElementById("passError1").innerHTML='Passwords don\'t match!<style>.inputFontPass1{border-color:red;border-width:1px;};.inputFontPass2{border-color:red;border-width:1px;}</style>';
  }else if (value3<6){
    document.getElementById("passError1").innerHTML='Password needs to be <br />at least 6 characters!<style>.inputFontPass1{border-color:red;border-width:1px;};.inputFontPass2{border-color:red;border-width:1px;}</style>';
  }
  if (value2==''){
    document.getElementById("passError2").innerHTML='Required!<style>.inputFontPass2{border-color:red;border-width:1px;}</style>';
  }

  if (valid != true){
    document.getElementById("email_error").innerHTML='Invalid Email Address!<style>.inputFontEmail{border-color:red;border-width:1px;}</style>';
 }
 if (eValue==''){
    document.getElementById("email_error").innerHTML='Required!<style>.inputFontEmail{border-color:red;border-width:1px;}</style>';
 }
 if (fname==''){
    document.getElementById("fname_error").innerHTML='Required!<style>.inputFontName1{border-color:red;border-width:1px;}</style>';
 }
 if (lname==''){
    document.getElementById("lname_error").innerHTML='Required!<style>.inputFontName2{border-color:red;border-width:1px;}</style>';
 }
}else{

  //alert('dcr='+dupCheckResult);
  
  if(dupCheckResult==0){
     alert('Please double check you information!');
  }else if(dupCheckResult==1){
  
    xmlAccountSetupAction=GetXmlHttpObject();
    if (xmlAccountSetupAction==null)
      {
      alert ("Your browser does not support AJAX!");
      return;
      } 
    var url="/custom/extranet/accountSetupAction.asp";
    url=url+"?sid="+Math.random();
    
     var str='emailAddress='+escape(document.getElementById("emailAddress").value)+'&';
      str=str+'pswd1='+escape(document.getElementById("pswd1").value)+'&';
      str=str+'firstName='+escape(document.getElementById("firstName").value)+'&';
      str=str+'lastName='+escape(document.getElementById("lastName").value)+'&';  
    
    xmlAccountSetupAction.onreadystatechange=stateChangedAccountSetupAction;
    xmlAccountSetupAction.open("POST",url,true);
    xmlAccountSetupAction.setRequestHeader("Content-Type", 
          "application/x-www-form-urlencoded; charset=UTF-8"); 
    xmlAccountSetupAction.send(str);
  
  }else {
    alert('Email address is already in the database. \nPlease go to the password reset menu if you no longer have the password. \n(See error above Email Address entry)');
  }
    
 }
}

function stateChangedAccountSetupAction() 
{  
  if (xmlAccountSetupAction.readyState<4){
    //document.getElementById("loadingDiv").innerHTML=loading3;
  }else if (xmlAccountSetupAction.readyState==4){
    //document.getElementById("loadingDiv").innerHTML='';
    //alert(xmlAccountSetupAction.responseText)
    window.opener.location.href = 'http://www.cityofrc.us';
    self.close();
   //loginCRM2(0)
    //onlinkClickContent(0)
    //mainSection();
    //document.getElementById("contentSelect").innerHTML=xmlAccountSetupAction.responseText;  
  }
}


/* ==================================
24a. accountSetupAction2();
================================== */

var xmlAccountSetupAction2;

function accountSetupAction2()
{ 

eValue=document.getElementById("emailAddress").value;
value1=document.getElementById("pswd1").value;
value2=document.getElementById("pswd2").value;
value3=value1.length;
valid = Validate_Email_Address(eValue);
fname=document.getElementById("firstName").value;
lname=document.getElementById("lastName").value;

if (value1==''||value2==''||value1!= value2||value3<6||valid != true||eValue==''||fname==''||lname==''){
  if (value1==''){
    document.getElementById("passError1").innerHTML='Required!<style>.inputFontPass1{border-color:red;border-width:1px;}</style>';
  }else if (value1!= value2){
    document.getElementById("passError1").innerHTML='Passwords don\'t match!<style>.inputFontPass1{border-color:red;border-width:1px;};.inputFontPass2{border-color:red;border-width:1px;}</style>';
  }else if (value3<6){
    document.getElementById("passError1").innerHTML='Password needs to be <br />at least 6 characters!<style>.inputFontPass1{border-color:red;border-width:1px;};.inputFontPass2{border-color:red;border-width:1px;}</style>';
  }
  if (value2==''){
    document.getElementById("passError2").innerHTML='Required!<style>.inputFontPass2{border-color:red;border-width:1px;}</style>';
  }

  if (valid != true){
    document.getElementById("email_error").innerHTML='Invalid Email Address!<style>.inputFontEmail{border-color:red;border-width:1px;}</style>';
 }
 if (eValue==''){
    document.getElementById("email_error").innerHTML='Required!<style>.inputFontEmail{border-color:red;border-width:1px;}</style>';
 }
 if (fname==''){
    document.getElementById("fname_error").innerHTML='Required!<style>.inputFontName1{border-color:red;border-width:1px;}</style>';
 }
 if (lname==''){
    document.getElementById("lname_error").innerHTML='Required!<style>.inputFontName2{border-color:red;border-width:1px;}</style>';
 }
}else{
/*
  xmlAccountSetupAction2=GetXmlHttpObject();
  if (xmlAccountSetupAction2==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/accountSetupAction.asp";
  url=url+"?sid="+Math.random();
  
   var str='emailAddress='+escape(document.getElementById("emailAddress").value)+'&';
    str=str+'pswd1='+escape(document.getElementById("pswd1").value)+'&';
    str=str+'firstName='+escape(document.getElementById("firstName").value)+'&';
    str=str+'lastName='+escape(document.getElementById("lastName").value)+'&';  
  
  xmlAccountSetupAction2.onreadystatechange=stateChangedAccountSetupAction2;
  xmlAccountSetupAction2.open("POST",url,true);
  xmlAccountSetupAction2.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlAccountSetupAction2.send(str);
*/  
  if(dupCheckResult==0){
     alert('Please double check you information!');
  }else if(dupCheckResult==1){
  
    xmlAccountSetupAction2=GetXmlHttpObject();
    if (xmlAccountSetupAction2==null)
      {
      alert ("Your browser does not support AJAX!");
      return;
      } 
    var url="/custom/extranet/accountSetupAction.asp";
    url=url+"?sid="+Math.random();
    
     var str='emailAddress='+escape(document.getElementById("emailAddress").value)+'&';
      str=str+'pswd1='+escape(document.getElementById("pswd1").value)+'&';
      str=str+'firstName='+escape(document.getElementById("firstName").value)+'&';
      str=str+'lastName='+escape(document.getElementById("lastName").value)+'&';  
    
    xmlAccountSetupAction2.onreadystatechange=stateChangedAccountSetupAction2;
    xmlAccountSetupAction2.open("POST",url,true);
    xmlAccountSetupAction2.setRequestHeader("Content-Type", 
          "application/x-www-form-urlencoded; charset=UTF-8"); 
    xmlAccountSetupAction2.send(str);
  
  }else {
    alert('Email address is already in the database. \nPlease go to the password reset menu if you no longer have the password. \n(See error above Email Address entry)');
  }
  
 }
}

function stateChangedAccountSetupAction2() 
{  
  if (xmlAccountSetupAction2.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;
  }else if (xmlAccountSetupAction2.readyState==4){ 
    document.getElementById("loadingDiv").innerHTML='';
   setTimeout('loginCRM2(5);',1000);
    //onlinkClickContent(0)
    //mainSection();
    //document.getElementById("contentSelect").innerHTML=xmlAccountSetupAction.responseText;  
  }
}


/* ==================================
24b. accountSetupActionLo();
================================== */

var xmlAccountSetupActionLo;

function accountSetupActionLo()
{ 

eValue=document.getElementById("emailAddress").value;
value1=document.getElementById("pswd1").value;
value2=document.getElementById("pswd2").value;
value3=value1.length;
valid = Validate_Email_Address(eValue);
fname=document.getElementById("firstName").value;
lname=document.getElementById("lastName").value;

if (value1==''||value2==''||value1!= value2||value3<6||valid != true||eValue==''||fname==''||lname==''){
  if (value1==''){
    document.getElementById("passError1").innerHTML='Required!<style>.inputFontPass1{border-color:red;border-width:1px;}</style>';
  }else if (value1!= value2){
    document.getElementById("passError1").innerHTML='Passwords don\'t match!<style>.inputFontPass1{border-color:red;border-width:1px;};.inputFontPass2{border-color:red;border-width:1px;}</style>';
  }else if (value3<6){
    document.getElementById("passError1").innerHTML='Password needs to be <br />at least 6 characters!<style>.inputFontPass1{border-color:red;border-width:1px;};.inputFontPass2{border-color:red;border-width:1px;}</style>';
  }
  if (value2==''){
    document.getElementById("passError2").innerHTML='Required!<style>.inputFontPass2{border-color:red;border-width:1px;}</style>';
  }

  if (valid != true){
    document.getElementById("email_error").innerHTML='Invalid Email Address!<style>.inputFontEmail{border-color:red;border-width:1px;}</style>';
 }
 if (eValue==''){
    document.getElementById("email_error").innerHTML='Required!<style>.inputFontEmail{border-color:red;border-width:1px;}</style>';
 }
 if (fname==''){
    document.getElementById("fname_error").innerHTML='Required!<style>.inputFontName1{border-color:red;border-width:1px;}</style>';
 }
 if (lname==''){
    document.getElementById("lname_error").innerHTML='Required!<style>.inputFontName2{border-color:red;border-width:1px;}</style>';
 }
}else{
/*
  xmlAccountSetupActionLo=GetXmlHttpObject();
  if (xmlAccountSetupActionLo==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/accountSetupAction.asp";
  url=url+"?sid="+Math.random();
  
   var str='emailAddress='+escape(document.getElementById("emailAddress").value)+'&';
    str=str+'pswd1='+escape(document.getElementById("pswd1").value)+'&';
    str=str+'firstName='+escape(document.getElementById("firstName").value)+'&';
    str=str+'lastName='+escape(document.getElementById("lastName").value)+'&';  
  
  xmlAccountSetupActionLo.onreadystatechange=stateChangedAccountSetupActionLo;
  xmlAccountSetupActionLo.open("POST",url,true);
  xmlAccountSetupActionLo.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlAccountSetupActionLo.send(str);
 */ 
  if(dupCheckResult==0){
     alert('Please double check you information!');
  }else if(dupCheckResult==1){
  
    xmlAccountSetupActionLo=GetXmlHttpObject();
    if (xmlAccountSetupActionLo==null)
      {
      alert ("Your browser does not support AJAX!");
      return;
      } 
    var url="/custom/extranet/accountSetupAction.asp";
    url=url+"?sid="+Math.random();
    
     var str='emailAddress='+escape(document.getElementById("emailAddress").value)+'&';
      str=str+'pswd1='+escape(document.getElementById("pswd1").value)+'&';
      str=str+'firstName='+escape(document.getElementById("firstName").value)+'&';
      str=str+'lastName='+escape(document.getElementById("lastName").value)+'&';  
    
    xmlAccountSetupActionLo.onreadystatechange=stateChangedAccountSetupActionLo;
    xmlAccountSetupActionLo.open("POST",url,true);
    xmlAccountSetupActionLo.setRequestHeader("Content-Type", 
          "application/x-www-form-urlencoded; charset=UTF-8"); 
    xmlAccountSetupActionLo.send(str);
  
  }else {
    alert('Email address is already in the database. \nPlease go to the password reset menu if you no longer have the password. \n(See error above Email Address entry)');
  }
  
 }
}

function stateChangedAccountSetupActionLo() 
{  
  if (xmlAccountSetupActionLo.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;
  }else if (xmlAccountSetupActionLo.readyState==4){ 
    document.getElementById("loadingDiv").innerHTML='';
    setTimeout('loginCRMLo(0);',1000);
    //document.getElementById("contentSelect").innerHTML=xmlAccountSetupActionLo.responseText;  
  }
}

/* ==================================
25. Validate_Email_Address(str)
================================== */

function Validate_Email_Address(email_address)
         {
         //Assumes that valid email addresses consist of user_name@domain.tld
         at = email_address.indexOf('@');
         dot = email_address.indexOf('.');
         
         if(at == -1 || 
            dot == -1 || 
            //dot <= at + 1 ||
            dot == 0 || 
            dot == email_address.length - 1)
            return(false);
            
         user_name = email_address.substr(0, at);
         domain_name = email_address.substr(at + 1, email_address.length);                  
         
         if(Validate_String(user_name) === false || 
            Validate_String(domain_name) === false)
            return(false);                     
        
         return(true);
         }

/* ==================================
26. Validate_String(str,str)
================================== */

function Validate_String(string, return_invalid_chars)
         { 
         valid_chars = '1234567890-_.^~abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
         invalid_chars = '';
         
         if(string == null || string == '')
            return(true);
         
         //For every character on the string.   
         for(index = 0; index < string.length; index++)
            {
            char = string.substr(index, 1);                        
            
            //Is it a valid character?
            if(valid_chars.indexOf(char) == -1)
              {
              //If not, is it already on the list of invalid characters?
              if(invalid_chars.indexOf(char) == -1)
                {
                //If it's not, add it.
                if(invalid_chars == '')
                   invalid_chars += char;
                else
                   invalid_chars += ', ' + char;
                }
              }
            }                     
            
         //If the string does not contain invalid characters, the function will return true.
         //If it does, it will either return false or a list of the invalid characters used
         //in the string, depending on the value of the second parameter.
         if(return_invalid_chars == true && invalid_chars != '')
           {
           last_comma = invalid_chars.lastIndexOf(',');
           
           if(last_comma != -1)
              invalid_chars = invalid_chars.substr(0, $last_comma) + 
              ' and ' + invalid_chars.substr(last_comma + 1, invalid_chars.length);
                      
           return(invalid_chars);
           }
         else
           return(invalid_chars == ''); 
         }



/* ==================================
27. resendConfirmationEmail(int)
================================== */

var xmlResendConfirmationEmail;

function resendConfirmationEmail(int)
{

  xmlResendConfirmationEmail=GetXmlHttpObject();
  if (xmlResendConfirmationEmail==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/resendConfirmationEmail.asp";
  url=url+"?sid="+Math.random();
  
  var str='ID='+int;

  xmlResendConfirmationEmail.onreadystatechange=stateChangedResendConfirmationEmail;
  xmlResendConfirmationEmail.open("POST",url,true);
  xmlResendConfirmationEmail.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlResendConfirmationEmail.send(str);
}

function stateChangedResendConfirmationEmail() 
{ 
  if (xmlResendConfirmationEmail.readyState==4)
  {
  
  //document.getElementById("errorDiv").innerHTML=xmlResendConfirmationEmail.responseText;
  document.getElementById("emailsentmsg").innerHTML=xmlResendConfirmationEmail.responseText; 
  setTimeout('msgOff();',2000);
   //content5();
   //checkedList();
   //chosenSubs();
   //subsList(0)
  }
}

function msgOff(){
  document.getElementById("emailsentmsg").innerHTML='';
}


/* ==================================
28. getNewPassword();
================================== */

var xmlGetNewPassword;

function getNewPassword(int)
{ 
value1=document.getElementById("email1").value;
value2=int
 if (value1==''){
    document.getElementById("passEmpty").innerHTML='&nbsp;Required!<style>.inputFontPass1{border-color:red;border-width:1px;}</style>';
 }else{ 
  xmlGetNewPassword=GetXmlHttpObject();
  if (xmlGetNewPassword==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/getNewPassword.asp";
  url=url+"?sid="+Math.random();

  var str='eID='+int+'&';
  str=str+'email='+escape(document.getElementById("email1").value);
  
  xmlGetNewPassword.onreadystatechange=stateChangedGetNewPassword;
  xmlGetNewPassword.open("POST",url,true);
  xmlGetNewPassword.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlGetNewPassword.send(str);
 }
}

function stateChangedGetNewPassword() 
{ 
  if (xmlGetNewPassword.readyState==4)
  { 
    var eMessage = xmlGetNewPassword.responseText
    var inString = eMessage.indexOf('This email');
    //alert(inString)
    document.getElementById("emailMessageDiv").innerHTML=eMessage;
    if (inString=='-1'){
      //setTimeout('onExitClick();',3000);  
    }
    getNewPassAction(value1);
  }
}


/* ==================================
29. getNewPassAction();
================================== */

var xmlGetNewPassAction;

function getNewPassAction(int)
{ 
contactID = int;

  xmlGetNewPassAction=GetXmlHttpObject();
  if (xmlGetNewPassAction==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/getNewPassAction.asp";
  url=url+"?sid="+Math.random();

  var str = 'ID='+contactID;

  xmlGetNewPassAction.onreadystatechange=stateChangedGetNewPassAction;
  xmlGetNewPassAction.open("POST",url,true);
  xmlGetNewPassAction.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlGetNewPassAction.send(str);

}

function stateChangedGetNewPassAction() 
{ 
  if (xmlGetNewPassAction.readyState==4)
  { 
     ////loginForm();
     //document.getElementById("portalHome").innerHTML=xmlGetNewPassAction.responseText;
    setTimeout('setSecurePopup(1);',3000);
  }
}

/* ==================================
30. checkEmailAddress();
================================== */

var xmlCheckEmailAddress;

function checkEmailAddress()
{ 
value1 = document.getElementById("emailAddress").value;

  xmlCheckEmailAddress=GetXmlHttpObject();
  if (xmlCheckEmailAddress==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/checkEmailAddress.asp";
  url=url+"?sid="+Math.random();

  var str = 'em='+value1;

  xmlCheckEmailAddress.onreadystatechange=stateChangedCheckEmailAddress;
  xmlCheckEmailAddress.open("POST",url,true);
  xmlCheckEmailAddress.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlCheckEmailAddress.send(str);

}

function stateChangedCheckEmailAddress() 
{ 
  if (xmlCheckEmailAddress.readyState==4)
  { 
     var dupCheck = xmlCheckEmailAddress.responseText;
     
     document.getElementById("email_error").innerHTML=xmlCheckEmailAddress.responseText; 
     //alert('dcl='+dupCheck.length)
     if (dupCheck.length > 0){
       dupCheckResult=2;
     }else {
       dupCheckResult=1;
     }
     
  }
}

/* ==================================
30a. checkEmailAddressLo(); 
================================== */

var xmlCheckEmailAddressLo;

function checkEmailAddressLo()
{ 
value1 = document.getElementById("emailAddress").value;

  xmlCheckEmailAddressLo=GetXmlHttpObject();
  if (xmlCheckEmailAddressLo==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/checkEmailAddressLo.asp";
  url=url+"?sid="+Math.random();

  var str = 'em='+value1;

  xmlCheckEmailAddressLo.onreadystatechange=stateChangedCheckEmailAddressLo;
  xmlCheckEmailAddressLo.open("POST",url,true);
  xmlCheckEmailAddressLo.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlCheckEmailAddressLo.send(str);

}

function stateChangedCheckEmailAddressLo() 
{ 
  if (xmlCheckEmailAddressLo.readyState<4){
  
  }else if (xmlCheckEmailAddressLo.readyState==4)
  { 
     var dupCheck = xmlCheckEmailAddressLo.responseText;
     
     document.getElementById("email_error").innerHTML=xmlCheckEmailAddressLo.responseText; 
     //alert('dcl='+dupCheck.length)
     if (dupCheck.length > 0){
       dupCheckResult=2;
     }else {
       dupCheckResult=1;
     }
  }
}


/* ==================================
31. getEditAccount(int)
================================== */

var xmlGetEditAccount;

function getEditAccount(int) {

 value1 = int;
 
  xmlGetEditAccount=GetXmlHttpObject();
  if (xmlGetEditAccount==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/getAccountEdit_HTTPS.asp";
  url=url+"?sid="+Math.random();
  
  var str='ID='+int;
  
  xmlGetEditAccount.onreadystatechange=stateChangedGetEditAccount;
  xmlGetEditAccount.open("POST",url,true);
  xmlGetEditAccount.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlGetEditAccount.send(str);

}

function stateChangedGetEditAccount() 
{ 
  if (xmlGetEditAccount.readyState==4) {

    setSecurePopup(6)


   /* if (value1==-1){
    
      onlinkClickContent(0)
      setTimeout('document.getElementById("subsListDiv").innerHTML=xmlGetEditAccount.responseText;',1000);
      setTimeout('document.getElementById("buttonRow00").style.display="none";',500);
      setTimeout('document.getElementById("buttonRow01").style.display="none";',500);
      setTimeout('document.getElementById("messageDiv").innerHTML = document.getElementById("updateMessage").value;',2000);
    }else{
      document.getElementById("subsListDiv").innerHTML=xmlGetEditAccount.responseText;
      document.getElementById("buttonRow00").style.display='none';
      document.getElementById("buttonRow01").style.display='none';
    }
    */
  }
}


/* ==================================
32. getPasswordEdit(int)
================================== */

var xmlGetPasswordEdit;

function getPasswordEdit(int) {

  xmlGetPasswordEdit=GetXmlHttpObject();
  if (xmlGetPasswordEdit==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/getEditPassword_HTTPS.asp";
  url=url+"?sid="+Math.random();
  
  var str='ID='+int;
  
  xmlGetPasswordEdit.onreadystatechange=stateChangedGetPasswordEdit;
  xmlGetPasswordEdit.open("POST",url,true);
  xmlGetPasswordEdit.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlGetPasswordEdit.send(str);

}

function stateChangedGetPasswordEdit() 
{ 
  if (xmlGetPasswordEdit.readyState==4) {
    setSecurePopup(5)
   
  //document.getElementById("subsListDiv").innerHTML=xmlGetPasswordEdit.responseText;
  //document.getElementById("buttonRow00").style.display='none';
  //document.getElementById("buttonRow01").style.display='none';
  }
}


/* ==================================
33. getEmailFormatEdit(int)
================================== */

var xmlGetEmailFormatEdit;

function getEmailFormatEdit(int)
{
 
  xmlGetEmailFormatEdit=GetXmlHttpObject();
  if (xmlGetEmailFormatEdit==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/getEmailFormatEdit.asp";
  url=url+"?sid="+Math.random();
  
  var str='ID='+int;
  
  xmlGetEmailFormatEdit.onreadystatechange=stateChangedGetEmailFormatEdit;
  xmlGetEmailFormatEdit.open("POST",url,true);
  xmlGetEmailFormatEdit.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlGetEmailFormatEdit.send(str);
}

function stateChangedGetEmailFormatEdit() 
{ 
  if (xmlGetEmailFormatEdit.readyState==4)
  { 
  document.getElementById("subsListDiv").innerHTML=xmlGetEmailFormatEdit.responseText;
  }
}


/* ==================================
34. getHomeTab()
================================== */

var xmlGetHomeTab;

function getHomeTab()
{
 /*
  xmlGetHomeTab=GetXmlHttpObject();
  if (xmlGetHomeTab==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/getHomeTab.asp";
  url=url+"?sid="+Math.random();
  
  var str='ID=';

  xmlGetHomeTab.onreadystatechange=stateChangedGetHomeTab;
  xmlGetHomeTab.open("POST",url,true);
  xmlGetHomeTab.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlGetHomeTab.send(str);
}

function stateChangedGetHomeTab() 
{ 
  if (xmlGetHomeTab.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlGetHomeTab.readyState==4){
    document.getElementById("subsListDiv").innerHTML=xmlGetHomeTab.responseText; 
    document.getElementById("loadingDiv").innerHTML='';  
  }
  */
  document.getElementById("buttonRow00").style.display='';
  document.getElementById("buttonRow01").style.display='';
  document.getElementById("subsListDiv").innerHTML='';
}


/* ==================================
35. getHomeTabEdit()
================================== */

var xmlGetHomeTabEdit;

function getHomeTabEdit()
{
 
  xmlGetHomeTabEdit=GetXmlHttpObject();
  if (xmlGetHomeTabEdit==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/getHomeTabEdit.asp";
  url=url+"?sid="+Math.random();
  
  var str='ID=';
  
  xmlGetHomeTabEdit.onreadystatechange=stateChangedGetHomeTabEdit;
  xmlGetHomeTabEdit.open("POST",url,true);
  xmlGetHomeTabEdit.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlGetHomeTabEdit.send(str);
}

function stateChangedGetHomeTabEdit() 
{ 
  if (xmlGetHomeTabEdit.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlGetHomeTabEdit.readyState==4){
    document.getElementById("subsListDiv").innerHTML=xmlGetHomeTabEdit.responseText; 
    document.getElementById("loadingDiv").innerHTML='';  
  }
}


/* ==================================
36. saveEmailFormat(int)
================================== */

var xmlSaveEmailFormat;

function saveEmailFormat(int)
{
contactID=int
  var results1;
  var results2;
  var results;
  results1=document.getElementById("fmtChk1").checked ? "true" : "false";
  results2=document.getElementById("fmtChk2").checked ? "true" : "false";
  if (results1=='true'){
    results='html';
  }else if (results2=='true'){
    results='text';
  }

  xmlSaveEmailFormat=GetXmlHttpObject();
  if (xmlSaveEmailFormat==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/saveEmailFormat.asp";
  url=url+"?sid="+Math.random();
  
  var str='ID='+int+'&';
  str=str+'eFormat='+results;
  
  xmlSaveEmailFormat.onreadystatechange=stateChangedSaveEmailFormat;
  xmlSaveEmailFormat.open("POST",url,true);
  xmlSaveEmailFormat.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlSaveEmailFormat.send(str);
}

function stateChangedSaveEmailFormat() 
{ 
  if (xmlSaveEmailFormat.readyState==4)
  { 
   //getEditAccount(contactID);
  document.getElementById("statusEF").innerHTML=xmlSaveEmailFormat.responseText;
  setTimeout('document.getElementById("statusEF").innerHTML="";',3000);
  }
}



/* ==================================
37. saveEditPassword();
================================== */

var xmlSaveEditPassword;

function saveEditPassword(int)
{ 
contactID=int
value1=document.getElementById("pswd1").value;
value2=document.getElementById("pswd2").value;
value3=value1.length;


if (value1==''||value2==''||value1!= value2||value3<6){
  if (value1==''){
    document.getElementById("passError1").innerHTML='Required!<style>.inputFontPass1{border-color:red;border-width:1px;}</style>';
  }else if (value1!= value2){
    document.getElementById("passError1").innerHTML='Passwords don\'t match!<style>.inputFontPass1{border-color:red;border-width:1px;};.inputFontPass2{border-color:red;border-width:1px;}</style>';
  }else if (value3<6){
    document.getElementById("passError1").innerHTML='Password needs to be <br />at least 6 characters!<style>.inputFontPass1{border-color:red;border-width:1px;};.inputFontPass2{border-color:red;border-width:1px;}</style>';
  }
  if (value2==''){
    document.getElementById("passError2").innerHTML='Required!<style>.inputFontPass2{border-color:red;border-width:1px;}</style>';
  }

}else{

  xmlSaveEditPassword=GetXmlHttpObject();
  if (xmlSaveEditPassword==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
    var url="/custom/extranet/saveEditPassword.asp";
    url=url+"?sid="+Math.random();
    
    var str='ID='+int+'&';
    str=str+'pswd1='+escape(value1)+'&';
  
    var msg = 'Are you sure?';
    if(confirm(msg)){
      xmlSaveEditPassword.onreadystatechange=stateChangedSaveEditPassword;
      xmlSaveEditPassword.open("POST",url,true);
      xmlSaveEditPassword.setRequestHeader("Content-Type", 
            "application/x-www-form-urlencoded; charset=UTF-8"); 
      xmlSaveEditPassword.send(str);
    }
  }
}

function stateChangedSaveEditPassword() 
{ 
  if (xmlSaveEditPassword.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlSaveEditPassword.readyState==4){
    document.getElementById("passMessage").innerHTML=xmlSaveEditPassword.responseText;  
    document.getElementById("loadingDiv").innerHTML='';  
    setTimeout('getHomeTab();',3000);  
  }
}


/* ==================================
37a. saveEditPassword_HTTPS();
================================== */

var xmlSaveEditPassword;

function saveEditPassword_HTTPS(int) {
  contactID = int
  value1 = document.getElementById("pswd1").value;
  value2 = document.getElementById("pswd2").value;
  value3 = value1.length;


  if (value1 == '' || value2 == '' || value1 != value2 || value3 < 6) {
    if (value1 == '') {
      document.getElementById("passError1").innerHTML = 'Required!<style>.inputFontPass1{border-color:red;border-width:1px;}</style>';
    } else if (value1 != value2) {
      document.getElementById("passError1").innerHTML = 'Passwords don\'t match!<style>.inputFontPass1{border-color:red;border-width:1px;};.inputFontPass2{border-color:red;border-width:1px;}</style>';
    } else if (value3 < 6) {
      document.getElementById("passError1").innerHTML = 'Password needs to be <br />at least 6 characters!<style>.inputFontPass1{border-color:red;border-width:1px;};.inputFontPass2{border-color:red;border-width:1px;}</style>';
    }
    if (value2 == '') {
      document.getElementById("passError2").innerHTML = 'Required!<style>.inputFontPass2{border-color:red;border-width:1px;}</style>';
    }

  } else {

    xmlSaveEditPassword = GetXmlHttpObject();
    if (xmlSaveEditPassword == null) {
      alert("Your browser does not support AJAX!");
      return;
    }
    var url = "/custom/extranet/saveEditPassword_HTTPS.asp";
    url = url + "?sid=" + Math.random();

    var str = 'ID=' + int + '&';
    str = str + 'pswd1=' + escape(value1) + '&';

    var msg = 'Are you sure?';
    if (confirm(msg)) {
      xmlSaveEditPassword.onreadystatechange = stateChangedSaveEditPassword_HTTPS;
      xmlSaveEditPassword.open("POST", url, true);
      xmlSaveEditPassword.setRequestHeader("Content-Type",
            "application/x-www-form-urlencoded; charset=UTF-8");
      xmlSaveEditPassword.send(str);
    }
  }
}

function stateChangedSaveEditPassword_HTTPS() {
  if (xmlSaveEditPassword.readyState < 4) {
    //document.getElementById("loadingDiv").innerHTML = loading3;
  } else if (xmlSaveEditPassword.readyState == 4) {
    document.getElementById("passMessage").innerHTML = xmlSaveEditPassword.responseText;
   // document.getElementById("loadingDiv").innerHTML = '';
    setTimeout('self.close();', 3000);
  }
}



/* ==================================
38. accountEditAction();
================================== */

var xmlAccountEditAction;

function accountEditAction_HTTPS(int)
{ 
 
eValue=document.getElementById("emailAddress").value;
valid = Validate_Email_Address(eValue);
fname=document.getElementById("firstName").value;
lname=document.getElementById("lastName").value;

if (valid != true||eValue==''||fname==''||lname==''){
 
 if (valid != true){
    document.getElementById("email_error").innerHTML='Invalid Email Address!<style>.inputFontEmail{border-color:red;border-width:1px;}</style>';
 }
 if (eValue==''){
    document.getElementById("email_error").innerHTML='Required!<style>.inputFontEmail{border-color:red;border-width:1px;}</style>';
 }
 if (fname==''){
    document.getElementById("fname_error").innerHTML='Required!<style>.inputFontName1{border-color:red;border-width:1px;}</style>';
 }
 if (lname==''){
    document.getElementById("lname_error").innerHTML='Required!<style>.inputFontName2{border-color:red;border-width:1px;}</style>';
 }
}else{
 var msg='Are you sure?\n(If you changed your email address (username),\n  be sure to take note of it.\n  Otherwise, you won\'t be able to log-in.)';
 //var msg='Are you sure?';

  
  xmlAccountEditAction=GetXmlHttpObject();
  if (xmlAccountEditAction==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/accountEditAction_HTTPS.asp";
  url=url+"?sid="+Math.random();
  
  if(confirm(msg)){
  
  var str='emailAddress='+escape(document.getElementById("emailAddress").value)+'&';
  str=str+'firstName='+escape(document.getElementById("firstName").value)+'&';
  str=str+'middleName='+escape(document.getElementById("middleName").value)+'&';
  str=str+'lastName='+escape(document.getElementById("lastName").value)+'&';
  str=str+'cellPhone='+escape(document.getElementById("cellPhone").value)+'&';
  str=str+'otherPhone='+escape(document.getElementById("otherPhone").value)+'&';
  str=str+'address1='+escape(document.getElementById("address1").value)+'&';
  str=str+'address2='+escape(document.getElementById("address2").value)+'&';
  //str=str+'address3='+escape(document.getElementById("address3").value)+'&';
  str=str+'city='+escape(document.getElementById("city").value)+'&';
  str=str+'state='+escape(document.getElementById("state").value)+'&';
  str=str+'zip='+escape(document.getElementById("zip").value)+'&';
  str=str+'subzip='+escape(document.getElementById("subzip").value)+'&';
  str=str+'country='+escape(document.getElementById("country").value)+'&';
  str=str+'keepLoggedIn='+(document.getElementById("keepLogin").checked ? "true" : "false")+'&';
  str=str+'ID='+int;

    xmlAccountEditAction.onreadystatechange=stateChangedAccountEditAction;
    xmlAccountEditAction.open("POST",url,true);
    xmlAccountEditAction.setRequestHeader("Content-Type", 
          "application/x-www-form-urlencoded; charset=UTF-8"); 
    xmlAccountEditAction.send(str);
   }
 }
}

function stateChangedAccountEditAction() 
{
  if (xmlAccountEditAction.readyState<4){
    //document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlAccountEditAction.readyState==4){ 
    //document.getElementById("loadingDiv").innerHTML='';  
    document.getElementById("statusMessage").innerHTML=xmlAccountEditAction.responseText;
    setTimeout('document.getElementById("statusMessage").innerHTML="";', 1500);
    setTimeout('self.close();', 1500);
    //setTimeout('getHomeTab();',1500);
    //setTimeout('document.getElementById("buttonRow00").style.display="";',2000);
    //setTimeout('document.getElementById("buttonRow01").style.display="";',2000);
  }
}

/* ==================================
39. getSubsLogin()
================================== */
var xmlGetSubsLogin;

function getSubsLogin()
{ 
  
loggedIn = document.getElementById("myRanchoLginHidden").value;

xmlGetSubsLogin=GetXmlHttpObject();
if (xmlGetSubsLogin==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/extranet/getSubsLogin.asp";
url=url+"?sid="+Math.random();

xmlGetSubsLogin.onreadystatechange=stateChangedGetSubsLogin;
xmlGetSubsLogin.open("GET",url,true);
xmlGetSubsLogin.send(null);
}

function stateChangedGetSubsLogin() 
{ 
  if (xmlGetSubsLogin.readyState<4){
    document.getElementById('myRanchoContent').innerHTML=processingExt;
  }else if (xmlGetSubsLogin.readyState==4){
    if(loggedIn=='yes'){
      loginCRM2(5);
    }else{
      document.getElementById('loginRow').style.display='none';
      document.getElementById('loginValidation').style.display='none';
      document.getElementById('logcontents').style.display='';
      document.getElementById('loginRowFields').style.display='none'; 
      document.getElementById('myRanchoContent').innerHTML=xmlGetSubsLogin.responseText;
      contentBkg(17);
      contentExt(8);
      getInitialContent();
    }
  }
}

/* ==================================
40. accountSignup()
================================== */
var xmlAccountSignup;

function accountSignup()
{ 
  document.getElementById('loginRow').style.display='none';
  document.getElementById('loginValidation').style.display='none';
  document.getElementById('logcontents').style.display='';
  
xmlAccountSignup=GetXmlHttpObject();
if (xmlAccountSignup==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/extranet/accountSignup.asp";
url=url+"?sid="+Math.random();

xmlAccountSignup.onreadystatechange=stateChangedAccountSignup;
xmlAccountSignup.open("GET",url,true);
xmlAccountSignup.send(null);
}

function stateChangedAccountSignup() 
{ 
  if (xmlAccountSignup.readyState<4){
    document.getElementById('myRanchoContent').innerHTML=processingExt;
  }else if (xmlAccountSignup.readyState==4){ 
    document.getElementById('myRanchoContent').innerHTML=xmlAccountSignup.responseText;
    contentBkg(6);
    contentExt(9);
  }
}

/* ==================================
41. addAllFavServ()
================================== */

var xmlAddAllFavServ;

function addAllFavServ()
{

  xmlAddAllFavServ=GetXmlHttpObject();
  if (xmlAddAllFavServ==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/addAllFavServ.asp";
  url=url+"?sid="+Math.random();

  xmlAddAllFavServ.onreadystatechange=stateChangedAddAllFavServ;
  xmlAddAllFavServ.open("GET",url,true);
  xmlAddAllFavServ.send(null);
}

function stateChangedAddAllFavServ() 
{ 
  if (xmlAddAllFavServ.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlAddAllFavServ.readyState==4){ 
    document.getElementById("loadingDiv").innerHTML=''; 
    //document.getElementById('subsListDiv').innerHTML=xmlAddAllFavServ.responseText;
    getFavServiceSetUp();
  }
}

/* ==================================
42. removeAllFavServ()
================================== */

var xmlRemoveAllFavServ;

function removeAllFavServ()
{

  xmlRemoveAllFavServ=GetXmlHttpObject();
  if (xmlRemoveAllFavServ==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/removeAllFavServ.asp";
  url=url+"?sid="+Math.random();

  xmlRemoveAllFavServ.onreadystatechange=stateChangedRemoveAllFavServ;
  xmlRemoveAllFavServ.open("GET",url,true);
  xmlRemoveAllFavServ.send(null);
}

function stateChangedRemoveAllFavServ() 
{ 
  if (xmlRemoveAllFavServ.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlRemoveAllFavServ.readyState==4){ 
    document.getElementById("loadingDiv").innerHTML=''; 
    getFavServiceSetUp();
  }
}


/* ==================================
43. addRemoveFavServ()
================================== */

var xmlAddRemoveFavServ;

function addRemoveFavServ(ID1,ID2)
{

  xmlAddRemoveFavServ=GetXmlHttpObject();
  if (xmlAddRemoveFavServ==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    }
  var url="/custom/extranet/addRemoveFavServ.asp";
  url=url+"?sid="+Math.random();
  
  var str='contactID='+ID2+'&';
  str=str+'servID='+ID1;

  xmlAddRemoveFavServ.onreadystatechange=stateChangedAddRemoveFavServ;
  xmlAddRemoveFavServ.open("POST",url,true);
  xmlAddRemoveFavServ.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlAddRemoveFavServ.send(str);
}

function stateChangedAddRemoveFavServ() 
{ 
  if (xmlAddRemoveFavServ.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlAddRemoveFavServ.readyState==4){ 
    document.getElementById("loadingDiv").innerHTML=''; 
    getFavServiceSetUp();
    //var total = parseFloat(document.getElementById('currentSCount').value) + 1
    //document.getElementById('favCount1').innerHTML=total;
    //document.getElementById('favCount2').innerHTML=document.getElementById('totalSCount').value;
  }
}

/* ==================================
44. getPageList()
================================== */

var xmlGetPageList;

function getPageList(ID1,int2,int3)
{
  value1=ID1;
  value2=int2;
  value3=int3;
  
  xmlGetPageList=GetXmlHttpObject();
  if (xmlGetPageList==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    }
  var url="/custom/extranet/getPageList.asp";
  url=url+"?sid="+Math.random();
  
  var str='servID='+value1;

  xmlGetPageList.onreadystatechange=stateChangedGetPageList;
  xmlGetPageList.open("POST",url,true);
  xmlGetPageList.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlGetPageList.send(str);
}

function stateChangedGetPageList() 
{ 
  if (xmlGetPageList.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlGetPageList.readyState==4){ 
    document.getElementById("loadingDiv").innerHTML=''; 

    if(value2==0){
      document.getElementById("ocButton"+value1).innerHTML='<img src="/custom/extranet/images/folderMinus.png" onclick="getPageList('+ value1 +',1,'+value3+');" /> (CLOSE LIST)';
      document.getElementById('pageListDiv'+value1).innerHTML=xmlGetPageList.responseText;
    }else{
      document.getElementById("ocButton"+value1).innerHTML='<img src="/custom/extranet/images/folderPlus.png" onclick="getPageList('+ value1 +',0,'+value3+');" /> (OPEN LIST of '+value3+')';
      document.getElementById('pageListDiv'+value1).innerHTML='';
    }
  }
}

/* ==================================
45. getServiceGroup()
================================== */

var xmlGetServiceGroup;

function getServiceGroup(ID1)
{
  value1=ID1;
  
  xmlGetServiceGroup=GetXmlHttpObject();
  if (xmlGetServiceGroup==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    }
  var url="/custom/extranet/getServiceGroup.asp";
  url=url+"?sid="+Math.random();
  
  var str='servID='+value1;

  xmlGetServiceGroup.onreadystatechange=stateChangedGetServiceGroup;
  xmlGetServiceGroup.open("POST",url,true);
  xmlGetServiceGroup.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlGetServiceGroup.send(str);
}

function stateChangedGetServiceGroup() 
{ 
  if (xmlGetServiceGroup.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlGetServiceGroup.readyState==4){ 
    document.getElementById("loadingDiv").innerHTML=''; 
    document.getElementById('outerList1').innerHTML=xmlGetServiceGroup.responseText;
  }
}


/* ==================================
46. customizeNews()
================================== */

var xmlCustomizeNews;

function customizeNews()
{

  xmlCustomizeNews=GetXmlHttpObject();
  if (xmlCustomizeNews==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/customizeNews.asp";
  url=url+"?sid="+Math.random();

  xmlCustomizeNews.onreadystatechange=stateChangedCustomizeNews;
  xmlCustomizeNews.open("GET",url,true);
  xmlCustomizeNews.send(null);
}

function stateChangedCustomizeNews() 
{ 
  if (xmlCustomizeNews.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlCustomizeNews.readyState==4){ 
    document.getElementById("loadingDiv").innerHTML=''; 
    document.getElementById('subsListDiv').innerHTML=xmlCustomizeNews.responseText;
    document.getElementById("row1").style.display='';
    document.getElementById("row2").style.display='';
    document.getElementById("row3").style.display='';
    document.getElementById("row4").style.display='';
    document.getElementById("row5").style.display='';
    document.getElementById("row6").style.display='';
    document.getElementById("row7").style.display='none';
    document.getElementById("row8").style.display='none';
    document.getElementById("viewAllNewsRow").style.display='none';
  }
}


/* ==================================
47. getCustomNews()
================================== */

var xmlGetCustomNews;

function getCustomNews()
{

  xmlGetCustomNews=GetXmlHttpObject();
  if (xmlGetCustomNews==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/getCustomNews.asp";
  url=url+"?sid="+Math.random();

  xmlGetCustomNews.onreadystatechange=stateChangedGetCustomNews;
  xmlGetCustomNews.open("GET",url,true);
  xmlGetCustomNews.send(null);
}

function stateChangedGetCustomNews() 
{ 
  if (xmlGetCustomNews.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlGetCustomNews.readyState==4){ 
    document.getElementById("loadingDiv").innerHTML=''; 
    document.getElementById('subsListDiv').innerHTML=xmlGetCustomNews.responseText;
    document.getElementById("row1").style.display='none';
    document.getElementById("row2").style.display='none';
    document.getElementById("row3").style.display='none';
    document.getElementById("row4").style.display='none';
    document.getElementById("row5").style.display='none';
    document.getElementById("row6").style.display='none';
    document.getElementById("row7").style.display='';
    document.getElementById("row8").style.display='';
    document.getElementById("viewAllNewsRow").style.display='';
  }
}

/* ==================================
48. addRemoveFavNewsCategory()
================================== */

var xmlAddRemoveFavNewsCategory;

function addRemoveFavNewsCategory(int1,int2)
{
  value1=int1;
  value2=int2;
  
  xmlAddRemoveFavNewsCategory=GetXmlHttpObject();
  if (xmlAddRemoveFavNewsCategory==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    }
  var url="/custom/extranet/addRemoveFavNewsCategory.asp";
  url=url+"?sid="+Math.random();
  
  var str='catID='+value1+'&';
  str=str+'checked='+value2;

  xmlAddRemoveFavNewsCategory.onreadystatechange=stateChangedAddRemoveFavNewsCategory;
  xmlAddRemoveFavNewsCategory.open("POST",url,true);
  xmlAddRemoveFavNewsCategory.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlAddRemoveFavNewsCategory.send(str);
}

function stateChangedAddRemoveFavNewsCategory() 
{ 
  if (xmlAddRemoveFavNewsCategory.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlAddRemoveFavNewsCategory.readyState==4){ 
    document.getElementById("loadingDiv").innerHTML=''; 
    //document.getElementById('subsListDiv').innerHTML=xmlAddRemoveFavNewsCategory.responseText;
    customizeNews();
  }
}

/* ==================================
49. addAllNewsCats()
================================== */

var xmlAddAllNewsCats;

function addAllNewsCats()
{

  xmlAddAllNewsCats=GetXmlHttpObject();
  if (xmlAddAllNewsCats==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/addAllNewsCats.asp";
  url=url+"?sid="+Math.random();

  xmlAddAllNewsCats.onreadystatechange=stateChangedAddAllNewsCats;
  xmlAddAllNewsCats.open("GET",url,true);
  xmlAddAllNewsCats.send(null);
}

function stateChangedAddAllNewsCats() 
{ 
  if (xmlAddAllNewsCats.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlAddAllNewsCats.readyState==4){ 
    document.getElementById("loadingDiv").innerHTML=''; 
    //document.getElementById('subsListDiv').innerHTML=xmlAddAllNewsCats.responseText;
    customizeNews();
  }
}

/* ==================================
50. removeAllNewsCats()
================================== */

var xmlRemoveAllNewsCats;

function removeAllNewsCats()
{

  xmlRemoveAllNewsCats=GetXmlHttpObject();
  if (xmlRemoveAllNewsCats==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/removeAllNewsCats.asp";
  url=url+"?sid="+Math.random();

  xmlRemoveAllNewsCats.onreadystatechange=stateChangedRemoveAllNewsCats;
  xmlRemoveAllNewsCats.open("GET",url,true);
  xmlRemoveAllNewsCats.send(null);
}

function stateChangedRemoveAllNewsCats() 
{ 
  if (xmlRemoveAllNewsCats.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlRemoveAllNewsCats.readyState==4){ 
    document.getElementById("loadingDiv").innerHTML=''; 
    customizeNews();
  }
}


/* ==================================
51. getMyEvents()
================================== */

var xmlGetMyEvents;

function getMyEvents(int)
{
  pageID=int;

  xmlGetMyEvents=GetXmlHttpObject();
  if (xmlGetMyEvents==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/getMyEvents.asp";
  url=url+"?sid="+Math.random();

  var str='pageID='+pageID;

  xmlGetMyEvents.onreadystatechange=stateChangedGetMyEvents;
  xmlGetMyEvents.open("POST",url,true);
  xmlGetMyEvents.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8");
  xmlGetMyEvents.send(str); 
}

function stateChangedGetMyEvents() 
{ 
  if (xmlGetMyEvents.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlGetMyEvents.readyState==4){
  document.getElementById('subsListDiv').innerHTML=xmlGetMyEvents.responseText; 
    document.getElementById("row1").style.display='';
    document.getElementById("row2").style.display='';
    document.getElementById("row3").style.display='';
    document.getElementById("row4").style.display='';
    document.getElementById("row5").style.display='none';
    document.getElementById("row6").style.display='none';
    document.getElementById("row7").style.display='none';
    document.getElementById("row8").style.display='none';
    document.getElementById("row9").style.display='none';
    document.getElementById("row10").style.display='none';
    document.getElementById("titleRow").style.display='none';
    
    document.getElementById("favCount0").innerHTML=document.getElementById("sCount").value;
    document.getElementById("favCount1").innerHTML=document.getElementById("eCount").value;
    document.getElementById("totalCount1").innerHTML=document.getElementById("tCount").value;
    eventSetPages(pageID);
    document.getElementById("loadingDiv").innerHTML='';
    document.getElementById('eventsCountSpan').style.display='';
  }
}


/* ==================================
52. editMyEvents()
================================== */

var xmlEditMyEvents;

function editMyEvents()
{

  xmlEditMyEvents=GetXmlHttpObject();
  if (xmlEditMyEvents==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/editMyEvents.asp";
  url=url+"?sid="+Math.random();

  xmlEditMyEvents.onreadystatechange=stateChangedEditMyEvents;
  xmlEditMyEvents.open("GET",url,true);
  xmlEditMyEvents.send(null);
}

function stateChangedEditMyEvents() 
{ 
  if (xmlEditMyEvents.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlEditMyEvents.readyState==4){ 
    document.getElementById("row1").style.display='none';
    document.getElementById("row2").style.display='none';
    document.getElementById("row3").style.display='none';
    document.getElementById("row4").style.display='none';
    document.getElementById("row5").style.display='';
    document.getElementById("row6").style.display='';
    document.getElementById("row7").style.display='';
    document.getElementById("row8").style.display='';
    document.getElementById("row9").style.display='';
    document.getElementById("row10").style.display='';
    document.getElementById('subsListDiv').innerHTML=xmlEditMyEvents.responseText;
    document.getElementById("loadingDiv").innerHTML=''; 
    
    document.getElementById("titleRow").style.display='';
    
    document.getElementById('favEventSubCount').innerHTML=document.getElementById('selected').value;
    document.getElementById('favEventSubTotal').innerHTML=document.getElementById('count').value;
    document.getElementById('eventSetPages').innerHTML='';
    document.getElementById('eventsCountSpan').style.display='none';
  }
}


/* ==================================
53. addRemoveFavEventSubCategory()
================================== */

var xmlAddRemoveFavEventSubCategory;

function addRemoveFavEventSubCategory(int1,int2)
{
  value1=int1;
  value2=int2;
  
  xmlAddRemoveFavEventSubCategory=GetXmlHttpObject();
  if (xmlAddRemoveFavEventSubCategory==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    }
  var url="/custom/extranet/addRemoveFavEventSubCategory.asp";
  url=url+"?sid="+Math.random();
  
  var str='catID='+value1+'&';
  str=str+'checked='+value2;

  xmlAddRemoveFavEventSubCategory.onreadystatechange=stateChangedAddRemoveFavEventSubCategory;
  xmlAddRemoveFavEventSubCategory.open("POST",url,true);
  xmlAddRemoveFavEventSubCategory.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlAddRemoveFavEventSubCategory.send(str);
}

function stateChangedAddRemoveFavEventSubCategory() 
{ 
  if (xmlAddRemoveFavEventSubCategory.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlAddRemoveFavEventSubCategory.readyState==4){ 
    document.getElementById("loadingDiv").innerHTML=''; 
    //document.getElementById('subsListDiv').innerHTML=xmlAddRemoveFavEventSubCategory.responseText;
    editMyEvents();
  }
}

/* ==================================
54. addAllEventSubCats()
================================== */

var xmlAddAllEventSubCats;

function addAllEventSubCats()
{

  xmlAddAllEventSubCats=GetXmlHttpObject();
  if (xmlAddAllEventSubCats==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/addAllEventSubCats.asp";
  url=url+"?sid="+Math.random();

  xmlAddAllEventSubCats.onreadystatechange=stateChangedAddAllEventSubCats;
  xmlAddAllEventSubCats.open("GET",url,true);
  xmlAddAllEventSubCats.send(null);
}

function stateChangedAddAllEventSubCats() 
{ 
  if (xmlAddAllEventSubCats.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlAddAllEventSubCats.readyState==4){ 
    document.getElementById("loadingDiv").innerHTML=''; 
    //document.getElementById('subsListDiv').innerHTML=xmlAddAllEventSubCats.responseText;
    editMyEvents();
  }
}

/* ==================================
55. removeAllEventSubCats()
================================== */

var xmlRemoveAllEventSubCats;

function removeAllEventSubCats()
{

  xmlRemoveAllEventSubCats=GetXmlHttpObject();
  if (xmlRemoveAllEventSubCats==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    } 
  var url="/custom/extranet/removeAllEventSubCats.asp";
  url=url+"?sid="+Math.random();

  xmlRemoveAllEventSubCats.onreadystatechange=stateChangedRemoveAllEventSubCats;
  xmlRemoveAllEventSubCats.open("GET",url,true);
  xmlRemoveAllEventSubCats.send(null);
}

function stateChangedRemoveAllEventSubCats() 
{ 
  if (xmlRemoveAllEventSubCats.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlRemoveAllEventSubCats.readyState==4){ 
    document.getElementById("loadingDiv").innerHTML=''; 
    editMyEvents();
  }
}


/* ==================================
56. eventSetPages(int)
================================== */

var xmlEventSetPages;

function eventSetPages(int)
{
  pageID = int;
  tCount = document.getElementById("tCount").value;
  
  xmlEventSetPages=GetXmlHttpObject();
  if (xmlEventSetPages==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    }
  var url="/custom/extranet/eventSetPages.asp";
  url=url+"?sid="+Math.random();
  
  var str='pageID='+pageID+'&';
  str=str+'tCount='+tCount;

  xmlEventSetPages.onreadystatechange=stateChangedEventSetPages;
  xmlEventSetPages.open("POST",url,true);
  xmlEventSetPages.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlEventSetPages.send(str);
}

function stateChangedEventSetPages() 
{ 
  if (xmlEventSetPages.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlEventSetPages.readyState==4){ 
    document.getElementById("loadingDiv").innerHTML=''; 
    document.getElementById('eventSetPages').innerHTML=xmlEventSetPages.responseText;
  }
}


/* ==================================
56a. webPagesSetPages(int)
================================== */

var xmlWebPagesSetPages;

function webPagesSetPages(int)
{
  pageID = int;
  tCount = document.getElementById("tCounta").value;
  
  xmlWebPagesSetPages=GetXmlHttpObject();
  if (xmlWebPagesSetPages==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    }
  var url="/custom/extranet/webPagesSetPages.asp";
  url=url+"?sid="+Math.random();
  
  var str='pageID='+pageID+'&';
  str=str+'tCount='+tCount;

  xmlWebPagesSetPages.onreadystatechange=stateChangedWebPagesSetPages;
  xmlWebPagesSetPages.open("POST",url,true);
  xmlWebPagesSetPages.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlWebPagesSetPages.send(str);
}

function stateChangedWebPagesSetPages() 
{ 
  if (xmlWebPagesSetPages.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlWebPagesSetPages.readyState==4){ 
    document.getElementById("loadingDiv").innerHTML=''; 
    document.getElementById('webPagesSetPages').innerHTML=xmlWebPagesSetPages.responseText;
  }
}

/* ==================================
56b. servicesSetPages(int)
================================== */

var xmlServicesSetPages;

function servicesSetPages(int)
{
  pageID = int;
  tCount = document.getElementById("tCount").value;
  
  xmlServicesSetPages=GetXmlHttpObject();
  if (xmlServicesSetPages==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    }
  var url="/custom/extranet/servicesSetPages.asp";
  url=url+"?sid="+Math.random();
  
  var str='pageID='+pageID+'&';
  str=str+'tCount='+tCount;

  xmlServicesSetPages.onreadystatechange=stateChangedServicesSetPages;
  xmlServicesSetPages.open("POST",url,true);
  xmlServicesSetPages.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlServicesSetPages.send(str);
}

function stateChangedServicesSetPages() 
{ 
  if (xmlServicesSetPages.readyState<4){
    document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlServicesSetPages.readyState==4){ 
    document.getElementById("loadingDiv").innerHTML=''; 
    document.getElementById('servicesSetPages').innerHTML=xmlServicesSetPages.responseText;
  }
}


/* ==================================
57. getReLogin()
================================== */

var xmlGetReLogin;

function getReLogin()
{
  
  xmlGetReLogin=GetXmlHttpObject();
  if (xmlGetReLogin==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    }
  var url="/custom/extranet/reLogin.asp";
  url=url+"?sid="+Math.random();

  xmlGetReLogin.onreadystatechange=stateChangedGetReLogin;
  xmlGetReLogin.open("GET",url,true);
  xmlGetReLogin.send(null);
}

function stateChangedGetReLogin() 
{ 
  if (xmlGetReLogin.readyState<4){
    //document.getElementById("loadingDiv").innerHTML=loading3;  
  }else if (xmlGetReLogin.readyState==4){ 
    //document.getElementById("loadingDiv").innerHTML=''; 
    document.getElementById('contentSelect').innerHTML=xmlGetReLogin.responseText;
  }
}


function checkQFormValidation( pForm )
{
 alert(pForm)
	var msg = '';
	msg = 'Are you sure?';

	if( confirm( msg ) )
	{
		pForm.action = '/crm/include/page_gen_question_complete_subsite.asp';
		pForm.submit();
	}
}	

function submitCRMQuestion(){

  //alert('here')
}


/* ==================================
58. resetPageNotice(int,int)
================================== */

var xmlResetPageNotice;

function resetPageNotice(int1,int2)
{
  favID = int1;
  onOff = int2;
  
  xmlResetPageNotice=GetXmlHttpObject();
  if (xmlResetPageNotice==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    }
  var url="/custom/extranet/resetPageNotice.asp";
  url=url+"?sid="+Math.random();
  
  var str='favID='+favID+'&';
  str=str+'onOff='+onOff;

  xmlResetPageNotice.onreadystatechange=stateChangedResetPageNotice;
  xmlResetPageNotice.open("POST",url,true);
  xmlResetPageNotice.setRequestHeader("Content-Type", 
        "application/x-www-form-urlencoded; charset=UTF-8"); 
  xmlResetPageNotice.send(str);
}

function stateChangedResetPageNotice() 
{ 
  if (xmlResetPageNotice.readyState<4){
    document.getElementById("updatingDiv").innerHTML=updating1;  
  }else if (xmlResetPageNotice.readyState==4){ 
    document.getElementById("updatingDiv").innerHTML=''; 
    window.opener.document.getElementById('noticeImageReplace'+favID).innerHTML=xmlResetPageNotice.responseText;
  }
}

  
/* ==================================
59. setUpdateReminder()
================================== */

var xmlSetUpdateReminder;

function setUpdateReminder()
{

var1=document.getElementById("updateReminder").value;

xmlSetUpdateReminder=GetXmlHttpObject();
if (xmlSetUpdateReminder==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }

    var url="/civica/portal/admin/setUpdateReminder.asp";
    url=url+"?sid="+Math.random();

    var str='var1='+var1+'&';
    
    xmlSetUpdateReminder.onreadystatechange=stateChangedSetUpdateReminder;
    xmlSetUpdateReminder.open("POST",url,true);
    xmlSetUpdateReminder.setRequestHeader("Content-Type", 
      "application/x-www-form-urlencoded; charset=UTF-8");
    xmlSetUpdateReminder.send(str);

}

function stateChangedSetUpdateReminder() 
{ 
   if (xmlSetUpdateReminder.readyState<4){
     document.getElementById("reminderSpan").innerHTML=processing2;
   }else if (xmlSetUpdateReminder.readyState==4){
     document.getElementById("reminderSpan").innerHTML=xmlSetUpdateReminder.responseText;
   }
}

    
/* ==================================
60. setAutoLoginExpiration()
================================== */

var xmlSetAutoLoginExpiration;

function setAutoLoginExpiration()
{

var1=document.getElementById("autoLoginExpiration").value;

xmlSetAutoLoginExpiration=GetXmlHttpObject();
if (xmlSetAutoLoginExpiration==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }

    var url="/civica/portal/admin/setAutoLoginExpiration.asp";
    url=url+"?sid="+Math.random();

    var str='var1='+var1+'&';
    
    xmlSetAutoLoginExpiration.onreadystatechange=stateChangedSetAutoLoginExpiration;
    xmlSetAutoLoginExpiration.open("POST",url,true);
    xmlSetAutoLoginExpiration.setRequestHeader("Content-Type", 
      "application/x-www-form-urlencoded; charset=UTF-8");
    xmlSetAutoLoginExpiration.send(str);

}

function stateChangedSetAutoLoginExpiration() 
{ 
   if (xmlSetAutoLoginExpiration.readyState<4){
     document.getElementById("expSpan").innerHTML=processing2;
   }else if (xmlSetAutoLoginExpiration.readyState==4){
     document.getElementById("expSpan").innerHTML=xmlSetAutoLoginExpiration.responseText;
   }
 }


 /* ==================================
 61. setSecurePopup(int)
 ================================== */

 var xmlSetSecurePopup;
 var var1c;

 var isCRMSection;

 function setSecurePopup(int) {

   var1c = int;

   xmlSetSecurePopup = GetXmlHttpObject();
   if (xmlSetSecurePopup == null) {
     alert("Your browser does not support AJAX!");
     return;
   }

   var url = "/custom/extranet/setSecurePopup.asp";
   url = url + "?sid=" + Math.random();

   var str = 'var1=' + var1c + '&';

   xmlSetSecurePopup.onreadystatechange = stateChangedSetSecurePopup;
   xmlSetSecurePopup.open("POST", url, true);
   xmlSetSecurePopup.setRequestHeader("Content-Type",
      "application/x-www-form-urlencoded; charset=UTF-8");
   xmlSetSecurePopup.send(str);

 }

 function stateChangedSetSecurePopup() {
 //alert(var1c)
   if (xmlSetSecurePopup.readyState < 4) {
     //document.getElementById("expSpan").innerHTML = processing2;
   } else if (xmlSetSecurePopup.readyState == 4) {
     //document.getElementById("myRanchoContent2").innerHTML = xmlSetSecurePopup.responseText;
     //alert(xmlSetSecurePopup.responseText)
   if (var1c <= 10) {
     isCRMSection = 0;
   } else {
     isCRMSection = 1;
   }
     setSecurePopupWindowStatus(var1c)
     //openChildHTTPS('https://rc-2011.civicasoft.com/custom/extranet/securePopup.asp?rnd='+Math.random(), 'loginWin', 990, 430);
   }
 }


 /* ==================================
 61a. setSecurePopupCRM(int)
 ================================== */

 var xmlSetSecurePopupCRM;
 var var1c;

 function setSecurePopupCRM(int) {

   var1c = int;

   xmlSetSecurePopupCRM = GetXmlHttpObject();
   if (xmlSetSecurePopupCRM == null) {
     alert("Your browser does not support AJAX!");
     return;
   }

   var url = "/custom/extranet/setSecurePopup.asp";
   url = url + "?sid=" + Math.random();

   var str = 'var1=' + var1c + '&';

   xmlSetSecurePopupCRM.onreadystatechange = stateChangedSetSecurePopupCRM;
   xmlSetSecurePopupCRM.open("POST", url, true);
   xmlSetSecurePopupCRM.setRequestHeader("Content-Type",
      "application/x-www-form-urlencoded; charset=UTF-8");
   xmlSetSecurePopupCRM.send(str);

 }

 function stateChangedSetSecurePopupCRM() {
   //alert(var1c)
   if (xmlSetSecurePopupCRM.readyState < 4) {
     //document.getElementById("expSpan").innerHTML = processing2;
   } else if (xmlSetSecurePopup.readyState == 4) {
     setSecurePopupWindowStatus(var1c)
   }
 }


 /* ==================================
 62. setSecurePopupWindowStatus()
 ================================== */

 var xmlSetSecurePopupWindowStatus;

 function setSecurePopupWindowStatus(int) {

   xmlSetSecurePopupWindowStatus = GetXmlHttpObject();
   if (xmlSetSecurePopupWindowStatus == null) {
     alert("Your browser does not support AJAX!");
     return;
   }

   var url = "/custom/extranet/setSecurePopupWindowStatus.asp";
   url = url + "?sid=" + Math.random();

   var str = 'var1='+ int;

   xmlSetSecurePopupWindowStatus.onreadystatechange = stateChangedSetSecurePopupWindowStatus;
   xmlSetSecurePopupWindowStatus.open("POST", url, true);
   xmlSetSecurePopupWindowStatus.setRequestHeader("Content-Type",
      "application/x-www-form-urlencoded; charset=UTF-8");
   xmlSetSecurePopupWindowStatus.send(str);

 }

 function stateChangedSetSecurePopupWindowStatus() {
   if (xmlSetSecurePopupWindowStatus.readyState < 4) {

   } else if (xmlSetSecurePopupWindowStatus.readyState == 4) {
     //document.getElementById("myRanchoContent2").innerHTML = xmlSetSecurePopupWindowStatus.responseText;
     //alert(xmlSetSecurePopupWindowStatus.responseText;
     openChildHTTPS('https://www.cityofrc.us/custom/extranet/securePopup.asp?rnd=' + Math.random(), 'loginWin', 990, 430);
     reviewSecurePopupStatus();
     
   }
 }



 /* ==================================
 63. readSecurePopupWindowStatus()
 ================================== */

 var xmlReadSecurePopupWindowStatus;
 var secureWindowStatus = 0;

 function readSecurePopupWindowStatus() {

   xmlReadSecurePopupWindowStatus = GetXmlHttpObject();
   if (xmlReadSecurePopupWindowStatus == null) {
     alert("Your browser does not support AJAX!");
     return;
   }

   var url = "/custom/extranet/readSecurePopupWindowStatus.asp";
   url = url + "?sid=" + Math.random();

   var str = 'var1=';

   xmlReadSecurePopupWindowStatus.onreadystatechange = stateChangedReadSecurePopupWindowStatus;
   xmlReadSecurePopupWindowStatus.open("POST", url, true);
   xmlReadSecurePopupWindowStatus.setRequestHeader("Content-Type",
      "application/x-www-form-urlencoded; charset=UTF-8");
   xmlReadSecurePopupWindowStatus.send(str);

 }

 function stateChangedReadSecurePopupWindowStatus(){ 
   if (xmlReadSecurePopupWindowStatus.readyState < 4) {

   } else if (xmlReadSecurePopupWindowStatus.readyState == 4) {
     //document.getElementById("myRanchoContent2").innerHTML = xmlReadSecurePopupWindowStatus.responseText;
     //alert('wss=' + xmlReadSecurePopupWindowStatus.responseText);
     secureWindowStatus = parseInt(xmlReadSecurePopupWindowStatus.responseText);
     //alert('wss=' + secureWindowStatus);
     //if (secureWindowStatus == 99) {
       //window.location.href = 'http://www.google.com';
       //window.close();
     //}
   }
 }


 function reviewSecurePopupStatus() {
   readSecurePopupWindowStatus()
 //alert('ws=' + secureWindowStatus)
   if (secureWindowStatus == 99) {
  //alert(secureWindowStatus)
     //window.location.href = 'http://www.google.com';
     //window.close();
     window.open('', '_self', '');
     window.close();
   }
   setTimeout('reviewSecurePopupStatus()', 2000);
 }


 function getLoginStatusGoToSubs() {

   readLoginStatus();
   //openChild('https://rc-2011.civicasoft.com/custom/extranet/popupLogin.asp?windowID=4', 'loginWin', 990, 430);
   // if logged in then
   // go to home page redirect and tabselect = 5

   //if not logged in then 
   //popup to login and redirect to homepage tabselect 5
 }

 /* ==================================
 64. readLoginStatus()
 ================================== */

 var xmlReadLoginStatus;
 var loginStatus1;
 function readLoginStatus() {

   xmlReadLoginStatus = GetXmlHttpObject();
   if (xmlReadLoginStatus == null) {
     alert("Your browser does not support AJAX!");
     return;
   }

   var url = "/custom/extranet/readLoginStatus.asp";
   url = url + "?sid=" + Math.random();

   var str = 'var1=';

   xmlReadLoginStatus.onreadystatechange = stateChangedReadLoginStatus;
   xmlReadLoginStatus.open("POST", url, true);
   xmlReadLoginStatus.setRequestHeader("Content-Type",
      "application/x-www-form-urlencoded; charset=UTF-8");
   xmlReadLoginStatus.send(str);

 }

 function stateChangedReadLoginStatus() {
   if (xmlReadLoginStatus.readyState < 4) {

   } else if (xmlReadLoginStatus.readyState == 4) {

     loginStatus1 = parseInt(xmlReadLoginStatus.responseText);

     if (loginStatus1 >= 1) {
       //alert('logged in')
       // window.location.href = '/default.asp'
       resetTabSelect(5);
     } else {
       //openChild('https://rc-2011.civicasoft.com/custom/extranet/popupLogin.asp?windowID=4', 'loginWin', 990, 430);
       setSecurePopup(4)
     }

   }
 }


