/*

0. utils
1. getTabbedContents(int)
2. getNewsSetup()
3. saveNewsSetup()
4. getVideo()
4a. getVideoV()
5. submitCalendar_tabbed()

6. getLinks(int)
7. loadVidFirst()

*/

/* ==================================
0. vars and utils
================================== */

var myVar;
var log;
var pass;
var calDate;
var tabID;
var prevChoice;
var grVersion;
var linkID;
var vidID;

var month=new Array(12);
for (i = 0; i < month.length; ++ i){
  month [i] = new Array(2);
}

month[0][0]="January";
month[0][1]="31";
month[1][0]="February";
month[1][1]="28";
month[2][0]="March";
month[2][1]="31";
month[3][0]="April";
month[3][1]="30";
month[4][0]="May";
month[4][1]="31";
month[5][0]="June";
month[5][1]="30";
month[6][0]="July";
month[6][1]="31";
month[7][0]="August";
month[7][1]="31";
month[8][0]="September";
month[8][1]="30";
month[9][0]="October";
month[9][1]="31";
month[10][0]="November";
month[10][1]="30";
month[11][0]="December";
month[11][1]="31";

var myDayNames = new Array(
'Sunday',
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday'
);

var processing2a = '<table cellpassing="0" cellspaging="0" border="0" width="70"><tr><td width="20" height="20" style="width:20px;height:20px;"><!--img src="/custom/hpPortal/images/loaderLo.gif" /--></td><td><div class="processingTextLo">LOADING!</div></td></tr></table>';

if (document.images)
  { 
    imageT1 = new Image(139,31);
    imageT1.src="/img/00/layout/tabbed_01_off.png";

    imageT2= new Image(155,31);
    imageT2.src="/img/00/layout/tabbed_02_off.png";

    imageT3= new Image(95,31);
    imageT3.src="/img/00/layout/tabbed_03_off.png";

    imageT4= new Image(174,31);
    imageT4.src="/img/00/layout/tabbed_04_off.png";

    imageT1o= new Image(139,31);
    imageT1o.src="/img/00/layout/tabbed_01_over.png";

    imageT2o= new Image(155,31);
    imageT2o.src="/img/00/layout/tabbed_02_over.png";

    imageT3o= new Image(95,31);
    imageT3o.src="/img/00/layout/tabbed_03_over.png";

    imageT4o= new Image(174,31);
    imageT4o.src="/img/00/layout/tabbed_04_over.png";     
     
    imageTabbed_01_on = new Image(139,31);
    imageTabbed_01_on.src="/img/00/layout/tabbed_01_on.png";
    
    imageTabbed_02_on = new Image(155,31);
    imageTabbed_02_on.src="/img/00/layout/tabbed_02_on.png";
    
    imageTabbed_03_on = new Image(95,31);
    imageTabbed_03_on.src="/img/00/layout/tabbed_03_on.png";
    
    imageTabbed_04_on = new Image(174,31);
    imageTabbed_04_on.src="/img/00/layout/tabbed_04_on.png";

    imageTabbed_end = new Image(70,31);
    imageTabbed_end.src="/img/00/layout/tabbed_end.png";  
    
    image_load_bkg = new Image(950,345);
    image_load_bkg.src="/custom/extranet/images/waitimage.png"; 
    
    imageJB1off = new Image(150,20);
    imageJB1off.src="/custom/hpPortal/images/jumpButton1.png";  
    
    imageJB1over = new Image(150,20);
    imageJB1over.src="/custom/hpPortal/images/jumpButton2.png"; 
    
    imageCalShell1 = new Image(310,235);
    imageCalShell1.src="/custom/hpPortal/images/calShell1.jpg"; 

  }

function change1(picName,imgName)
 {
   if (document.images)
    {
      imgOn=eval(imgName + ".src");
      document[picName].src= imgOn;
    }
 }
 
 function rowOver(int){
   document.getElementById("row"+int).style.background='url(/custom/hpPortal/images/vidListBkg.png) no-repeat';
   document.body.style.cursor='pointer';
 }
 
 function rowOut(int){
   document.getElementById("row"+int).style.background='';
   document.body.style.cursor='default';
 }
 
 function rowOverE(int){
   document.body.style.cursor='pointer';
 }
 
 function rowOutE(int){
   document.body.style.cursor='default';
 }
 
 function getVideo2(int){
   alert('Video '+int)
 }
  function getEvent(int){
   alert('Event '+int)
 }

function onTabClick(int){
  var sel=int;
  if(sel==1){
    if(document.getElementById('playerHolder')){
      document.getElementById('playerHolder').innerHTML='';
    }
    document.getElementById('tabbedContentDiv').style.background='url(/custom/hpPortal/images/tabbed_body_01.png)';
    document.getElementById('tabbedContentDiv').style.backgroundRepeat='no-repeat';
    document.getElementById('tabbedLink01').innerHTML='<img name="pic1T" src="/img/00/layout/tabbed_01_on.png" width="139" height="31" border="0" />';
    document.getElementById('tabbedLink02').innerHTML='<A HREF="javascript:onTabClick(2);" onMouseover="change1(\'pic2T\',\'imageT2o\')" onMouseout="change1(\'pic2T\',\'imageT2\')"><img name="pic2T" src="/img/00/layout/tabbed_02_off.png" width="155" height="31" border="0" /></a>';
    document.getElementById('tabbedLink03').innerHTML='<A HREF="javascript:onTabClick(3);" onMouseover="change1(\'pic3T\',\'imageT3o\')" onMouseout="change1(\'pic3T\',\'imageT3\')"><img name="pic3T" src="/img/00/layout/tabbed_03_off.png" width="95" height="31" border="0" /></a>';
    document.getElementById('tabbedLink04').innerHTML='<A HREF="javascript:onTabClick(4);" onMouseover="change1(\'pic4T\',\'imageT4o\')" onMouseout="change1(\'pic4T\',\'imageT4\')"><img name="pic4T" src="/img/00/layout/tabbed_04_off.png" width="174" height="31" border="0" /></a>';
    getTabbedContents(1);
   }else if (sel==2){
    if(document.getElementById('playerHolder')){
      document.getElementById('playerHolder').innerHTML='';
    }
    document.getElementById('tabbedContentDiv').style.background='url(/custom/hpPortal/images/tabbed_body_02.png)';
    document.getElementById('tabbedContentDiv').style.backgroundRepeat='no-repeat';
    document.getElementById('tabbedLink02').innerHTML='<img name="pic2T" src="/img/00/layout/tabbed_02_on.png" width="155" height="31" border="0" />';
    document.getElementById('tabbedLink01').innerHTML='<A HREF="javascript:onTabClick(1);" onMouseover="change1(\'pic1T\',\'imageT1o\')" onMouseout="change1(\'pic1T\',\'imageT1\')"><img name="pic1T" src="/img/00/layout/tabbed_01_off.png" width="139" height="31" border="0" /></a>';
    document.getElementById('tabbedLink03').innerHTML='<A HREF="javascript:onTabClick(3);" onMouseover="change1(\'pic3T\',\'imageT3o\')" onMouseout="change1(\'pic3T\',\'imageT3\')"><img name="pic3T" src="/img/00/layout/tabbed_03_off.png" width="95" height="31" border="0" /></a>';
    document.getElementById('tabbedLink04').innerHTML='<A HREF="javascript:onTabClick(4);" onMouseover="change1(\'pic4T\',\'imageT4o\')" onMouseout="change1(\'pic4T\',\'imageT4\')"><img name="pic4T" src="/img/00/layout/tabbed_04_off.png" width="174" height="31" border="0" /></a>';
    getTabbedContents(2);
  }else if (sel==3){
    document.getElementById('tabbedContentDiv').style.background='url(/custom/hpPortal/images/tabbed_body_03.png)';
    document.getElementById('tabbedContentDiv').style.backgroundRepeat='no-repeat';
    document.getElementById('tabbedLink03').innerHTML='<img name="pic3T" src="/img/00/layout/tabbed_03_on.png" width="95" height="31" border="0" />';
    document.getElementById('tabbedLink01').innerHTML='<A HREF="javascript:onTabClick(1);" onMouseover="change1(\'pic1T\',\'imageT1o\')" onMouseout="change1(\'pic1T\',\'imageT1\')"><img name="pic1T" src="/img/00/layout/tabbed_01_off.png" width="139" height="31" border="0" /></a>';
    document.getElementById('tabbedLink02').innerHTML='<A HREF="javascript:onTabClick(2);" onMouseover="change1(\'pic2T\',\'imageT2o\')" onMouseout="change1(\'pic2T\',\'imageT2\')"><img name="pic2T" src="/img/00/layout/tabbed_02_off.png" width="155" height="31" border="0" /></a>';
    document.getElementById('tabbedLink04').innerHTML='<A HREF="javascript:onTabClick(4);" onMouseover="change1(\'pic4T\',\'imageT4o\')" onMouseout="change1(\'pic4T\',\'imageT4\')"><img name="pic4T" src="/img/00/layout/tabbed_04_off.png" width="174" height="31" border="0" /></a>';
    getTabbedContents(3);
  }else if (sel==4){
    if(document.getElementById('playerHolder')){
      document.getElementById('playerHolder').innerHTML='';
    }
    document.getElementById('tabbedContentDiv').style.background='url(/custom/hpPortal/images/tabbed_body_04.png)';
    document.getElementById('tabbedContentDiv').style.backgroundRepeat='no-repeat';
    document.getElementById('tabbedLink04').innerHTML='<img name="pic4T" src="/img/00/layout/tabbed_04_on.png" width="174" height="31" border="0" />';
    document.getElementById('tabbedLink01').innerHTML='<A HREF="javascript:onTabClick(1);" onMouseover="change1(\'pic1T\',\'imageT1o\')" onMouseout="change1(\'pic1T\',\'imageT1\')"><img name="pic1T" src="/img/00/layout/tabbed_01_off.png" width="139" height="31" border="0" /></a>';
    document.getElementById('tabbedLink02').innerHTML='<A HREF="javascript:onTabClick(2);" onMouseover="change1(\'pic2T\',\'imageT2o\')" onMouseout="change1(\'pic2T\',\'imageT2\')"><img name="pic2T" src="/img/00/layout/tabbed_02_off.png" width="155" height="31" border="0" /></a>';
    document.getElementById('tabbedLink03').innerHTML='<A HREF="javascript:onTabClick(3);" onMouseover="change1(\'pic3T\',\'imageT3o\')" onMouseout="change1(\'pic3T\',\'imageT3\')"><img name="pic3T" src="/img/00/layout/tabbed_03_off.png" width="95" height="31" border="0" /></a>';
    getTabbedContents(4);
  }
}

function getInitialContent(){
  //document.getElementById("processingDiv").innerHTML=processing1;
  onTabClick(1);
}

if(typeof jQuery != 'undefined') {
	
		function loadCal( date )
		{
		  var now = new Date();
		  var today = (now.getMonth()+1)+'/'+now.getDate()+'/'+now.getFullYear();
		  //alert("date="+date+" sys="+today)
		  if(date==today){
		     document.getElementById("jumpButton").style.display='none';
		  }else{
		     setTimeout('document.getElementById("jumpButton").style.display="";',2000);
		  }
		  
			jQuery('#calwrap').load('/custom/hpPortal/tabbed_cal.asp?smalldate=' + date , function(){
			  submitCalendar_tabbed(date,0);
			});	
			
			
		}
	}
	
function loadVid(ID){

//document.getElementById("flashContent").style.display = '';

		var flashvars = {};
		flashvars.allowfullscreen = true;
		flashvars.allowscriptaccess = "always";
		flashvars.bgcolor = '#000000';
		flashvars.clip_id=ID;
		flashvars.server='vimeo.com';
		flashvars.show_title=0;
		flashvars.show_byline=0;
		flashvars.show_portrait=0;
		flashvars.color='#00ADEF';
		flashvars.fullscreen=1;
		flashvars.autoplay=1;
		flashvars.loop=0;
		flashvars.quality = "high";
		flashvars.wmode = "opaque";
		var params = {};			
		params.allowfullscreen = true;
		params.allowscriptaccess = "always";
		params.bgcolor = '#000000';
		params.clip_id=ID;
		params.server='vimeo.com';
		params.show_title=0;
		params.show_byline=0;
		params.show_portrait=0;
		params.color='#00ADEF';
		params.fullscreen=1;
		params.autoplay=1;
		params.loop=0;
		params.quality = "high";
		params.wmode = "opaque";
		
		swfobject.embedSWF("http://vimeo.com/moogaloop.swf", "flashContent", "420", "322", "9.0.124", false, flashvars, params);
		
}

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. getTabbedContents(int)
================================== */

var xmlGetTabbedContents;

function getTabbedContents(int)
{ 

tabID = int;

xmlGetTabbedContents=GetXmlHttpObject();
if (xmlGetTabbedContents==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/hpPortal/getTabbedContent"+int+".asp";
url=url+"?sid="+Math.random();

var str='choice='+int;

xmlGetTabbedContents.onreadystatechange=stateChangedGetTabbedContents;
xmlGetTabbedContents.open("POST",url,true);
xmlGetTabbedContents.setRequestHeader("Content-Type", 
      "application/x-www-form-urlencoded; charset=UTF-8"); 
xmlGetTabbedContents.send(str);
}

function stateChangedGetTabbedContents() 
{ 

  if (xmlGetTabbedContents.readyState<4){
    document.getElementById("processingDiv").innerHTML=processing2a;
  }else if (xmlGetTabbedContents.readyState==4){ 
    document.getElementById("processingDiv").innerHTML='';
    document.getElementById("tabbedContentDiv").innerHTML=xmlGetTabbedContents.responseText;
    
    var date1 = new Date();
    var today = ((date1.getMonth()+1)+'/'+date1.getDate()+'/'+date1.getFullYear());
    
    if(tabID==2){
      submitCalendar_tabbed(today,0);
    }else if(tabID==3){
      loadVidFirst();
    }
  }
}


/* ==================================
2. getNewsSetup()
================================== */

var xmlGetNewsSetup;

function getNewsSetup()
{ 

xmlGetNewsSetup=GetXmlHttpObject();
if (xmlGetNewsSetup==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/hpPortal/getNewsSetup.asp";
url=url+"?sid="+Math.random();

xmlGetNewsSetup.onreadystatechange=stateChangedGetNewsSetup;
xmlGetNewsSetup.open("GET",url,true);
xmlGetNewsSetup.send(null);
}

function stateChangedGetNewsSetup() 
{ 

  if (xmlGetNewsSetup.readyState<4){
    document.getElementById("processingDiv").innerHTML=processing2a;
  }else if (xmlGetNewsSetup.readyState==4){ 
    document.getElementById("processingDiv").innerHTML='';
    document.getElementById("tabbedContentDiv").innerHTML=xmlGetNewsSetup.responseText;
  }
}


/* ==================================
3. saveNewsSetup()
================================== */

var xmlSaveNewsSetup;

function saveNewsSetup()
{ 

xmlSaveNewsSetup=GetXmlHttpObject();
if (xmlSaveNewsSetup==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/hpPortal/saveNewsSetup.asp";
url=url+"?sid="+Math.random();

xmlSaveNewsSetup.onreadystatechange=stateChangedSaveNewsSetup;
xmlSaveNewsSetup.open("GET",url,true);
xmlSaveNewsSetup.send(null);
}

function stateChangedSaveNewsSetup() 
{ 

  if (xmlSaveNewsSetup.readyState<4){
    document.getElementById("processingDiv").innerHTML=processing2a;
  }else if (xmlSaveNewsSetup.readyState==4){ 
    document.getElementById("processingDiv").innerHTML='';
    //document.getElementById("tabbedContentDiv").innerHTML=xmlSaveNewsSetup.responseText;
    getTabbedContents(1);
  }
}



/* ==================================
4. getVideo()
================================== */

var xmlGetVideo;

function getVideo(int)
{ 

xmlGetVideo=GetXmlHttpObject();
if (xmlGetVideo==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/hpPortal/getVideo.asp";
url=url+"?sid="+Math.random();

var str='vidID='+int;

xmlGetVideo.onreadystatechange=stateChangedGetVideo;
xmlGetVideo.open("POST",url,true);
xmlGetVideo.setRequestHeader("Content-Type", 
      "application/x-www-form-urlencoded; charset=UTF-8"); 
xmlGetVideo.send(str);
}

function stateChangedGetVideo() 
{ 

  if (xmlGetVideo.readyState<4){
    document.getElementById("processingDiv").innerHTML=processing2a;
  }else if (xmlGetVideo.readyState==4){ 
    document.getElementById("processingDiv").innerHTML='';
    document.getElementById("playerHolder").innerHTML=xmlGetVideo.responseText;
    //getTabbedContents(1);
  }
}


/* ==================================
4a. getVideoV()
================================== */

var xmlGetVideoV;

function getVideoV(ID)
{ 

vidID = ID;

xmlGetVideoV=GetXmlHttpObject();
if (xmlGetVideoV==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/hpPortal/getVideoV.asp";
url=url+"?sid="+Math.random();

var str='vidID='+ID;

xmlGetVideoV.onreadystatechange=stateChangedGetVideoV;
xmlGetVideoV.open("POST",url,true);
xmlGetVideoV.setRequestHeader("Content-Type", 
      "application/x-www-form-urlencoded; charset=UTF-8"); 
xmlGetVideoV.send(str);
}

function stateChangedGetVideoV() 
{ 

  if (xmlGetVideoV.readyState<4){
    document.getElementById("processingDiv").innerHTML=processing2a;
  }else if (xmlGetVideoV.readyState==4){ 
    document.getElementById("processingDiv").innerHTML='';
    document.getElementById("playerHolder").innerHTML=xmlGetVideoV.responseText;
    loadVid(vidID);
    
  }
}

/* ==================================
5. submitCalendar_tabbed()
================================== */

var xmlSubmitCalendar_tabbed;

function submitCalendar_tabbed( inDate, mode )
{ 

calDate=inDate;
grVersion = document.getElementById("grVersion").value;

var dateTest= calDate.split("/");

var dayTest0 = parseInt(month[(dateTest[0])-1][1]);
var dayTest1 = parseInt(dateTest[1]);
//alert('1='+dateTest[0]+' 2='+dateTest[1]+' 3='+dateTest[2])
//alert('dayTest0='+dayTest0+' dayTest1='+dayTest1)
if(dayTest1<=dayTest0){
   calDate = inDate;
} else {
   calDate = dateTest[0] + '/' + dayTest0 + '/' + dateTest[2]; 
}
//alert(calDate)
xmlSubmitCalendar_tabbed=GetXmlHttpObject();
if (xmlSubmitCalendar_tabbed==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/hpPortal/submitCalendar_tabbed.asp";
url=url+"?sid="+Math.random();

var str='dateID='+escape(calDate);
//alert(str)
xmlSubmitCalendar_tabbed.onreadystatechange=stateChangedSubmitCalendar_tabbed;
xmlSubmitCalendar_tabbed.open("POST",url,true);
xmlSubmitCalendar_tabbed.setRequestHeader("Content-Type", 
      "application/x-www-form-urlencoded; charset=UTF-8"); 
xmlSubmitCalendar_tabbed.send(str);
}

function stateChangedSubmitCalendar_tabbed() 
{ 

  if (xmlSubmitCalendar_tabbed.readyState<4){
    document.getElementById("processingDiv").innerHTML=processing2a;
  }else if (xmlSubmitCalendar_tabbed.readyState==4){
  
    document.getElementById("processingDiv").innerHTML='';
    //setTimeout('document.getElementById("eventListDateTitle").innerHTML="this current date";',1000);
    
    
    //alert('loading'+' caldate='+calDate)
    
    var date1 = new Date();
    var dateCompare = ((date1.getMonth()+1)+'/'+date1.getDate()+'/'+date1.getFullYear());
    var date2 = new Date(calDate);
    //alert(date2)
    var newDisplayDate = month[date2.getMonth()][0]+' '+date2.getDate()+', '+date2.getFullYear();
    var MonthP = date2.getMonth()+2;
    var MonthM = date2.getMonth();
    var yearP = date2.getFullYear();
    var yearM = date2.getFullYear();
    if (MonthP==13){
      MonthP=1;
      yearP=yearP+1
    }
    if (MonthM==0){
      MonthM=12;
      yearM=yearM-1
    }
    
    var dayOfTheWeek = myDayNames[date2.getDay()];
    var monthName = month[date2.getMonth()][0]
    var newDateTitle = dayOfTheWeek + ', ' + monthName + ' ' + date2.getDate() + ', ' + date2.getFullYear();
    
    document.getElementById("eventListDateTitle").innerHTML=newDateTitle;
    document.getElementById("eventListDiv").innerHTML=xmlSubmitCalendar_tabbed.responseText;
    
    var dayNumM;
    var dayNumP;
    var dayNum = date2.getDate();
   //alert('pc='+prevChoice+' dayNum='+dayNum)
    var dayTestTotalM = month[MonthM-1][1];
    var dayTestTotalP = month[MonthP-1][1];
    var dayTestEval = date2.getDate();

    //alert('mm='+MonthM+' mp='+MonthP+'dtEval='+dayTestEval+' dtTotalP='+dayTestTotalP+' dtTotalM='+dayTestTotalM)
    if(dayTestEval>dayTestTotalM){
      dayNumM = dayTestTotalM
    } else {
      dayNumM = dayTestEval
    }
    if(dayTestEval>dayTestTotalP){
      dayNumP = dayTestTotalP
    } else {
      dayNumP = dayTestEval
    }
    
    if(prevChoice>month[date2.getMonth()][1]){
      prevChoice=month[date2.getMonth()][1];
    }
    
    var calDateP = MonthP+'/'+dayNumP+'/'+yearP;
    var calDateM = MonthM+'/'+dayNumM+'/'+yearM;
    
    if (dateCompare!=calDate){
      document.getElementById("jumpButton").style.display='';
    }else{
      document.getElementById("jumpButton").style.display='none';
    }
    
    document.getElementById("currentDate").innerHTML=newDisplayDate;
    document.getElementById("prevLink").href='JavaScript:loadCal("'+calDateM+'");';
    document.getElementById("nextLink").href='JavaScript:loadCal("'+calDateP+'");';

    if (prevChoice>0){
      document.getElementById("Date"+prevChoice).style.backgroundColor='';
      document.getElementById("Date"+prevChoice).style.borderWidth='';
      document.getElementById("Date"+prevChoice).style.borderColor='';
      document.getElementById("Date"+prevChoice).style.borderStyle='';
      document.getElementById("Date"+dayNum).style.borderCollapse='';
    }
    
    if(grVersion!='lo'){
        
      document.getElementById("Date"+dayNum).style.backgroundColor='#a45d1d';
      document.getElementById("Date"+dayNum).style.borderWidth='1px';
      document.getElementById("Date"+dayNum).style.borderColor='#ff9900';
      document.getElementById("Date"+dayNum).style.borderStyle='solid';
      document.getElementById("Date"+dayNum).style.borderCollapse='collapse';
    
    }else{
    
      document.getElementById("Date"+dayNum).style.backgroundColor='#f99a81';
      document.getElementById("Date"+dayNum).style.borderWidth='1px';
      document.getElementById("Date"+dayNum).style.borderColor='#cc0000';
      document.getElementById("Date"+dayNum).style.borderStyle='solid';
      document.getElementById("Date"+dayNum).style.borderCollapse='collapse';
    
    }

    prevChoice = date2.getDate();
  }
}


function getLinkLists(){
  setTimeout('getLinks(6);',1000);
  setTimeout('getLinks(7);',2000);
  setTimeout('getLinks(8);',3000);
  setTimeout('getLinks(9);',4000);
}


/* ==================================
6. getLinks()
================================== */

var xmlGetLinks;

function getLinks(int)
{ 

linkID = int;

xmlGetLinks=GetXmlHttpObject();
if (xmlGetLinks==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/hpPortal/getLinks.asp";
url=url+"?sid="+Math.random();

var str = 'choice='+int

xmlGetLinks.onreadystatechange=stateChangedGetLinks;
xmlGetLinks.open("POST",url,true);
xmlGetLinks.setRequestHeader("Content-Type", 
      "application/x-www-form-urlencoded; charset=UTF-8"); 
xmlGetLinks.send(str);
}

function stateChangedGetLinks() 
{ 
  if (xmlGetLinks.readyState<4){
    document.getElementById("processingDiv2").innerHTML=processing2a;
  }else if (xmlGetLinks.readyState==4){ 
    document.getElementById("processingDiv2").innerHTML='';
    if(linkID==6){
      document.getElementById("resLinksDiv").innerHTML=xmlGetLinks.responseText;
    }else if(linkID==7){
      document.getElementById("busLinksDiv").innerHTML=xmlGetLinks.responseText;
    }else if(linkID==8){
      document.getElementById("visLinksDiv").innerHTML=xmlGetLinks.responseText;
    }else if(linkID==9){
      document.getElementById("serLinksDiv").innerHTML=xmlGetLinks.responseText;
    }
  }
}


/* ==================================
7. loadVidFirst()
================================== */

var xmlLoadVidFirst;

function loadVidFirst()
{ 

xmlLoadVidFirst=GetXmlHttpObject();
if (xmlLoadVidFirst==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 

var url="/custom/hpPortal/loadVidFirst.asp";
url=url+"?sid="+Math.random();

xmlLoadVidFirst.onreadystatechange=stateChangedLoadVidFirst;
xmlLoadVidFirst.open("GET",url,true);
xmlLoadVidFirst.send(null);
}

function stateChangedLoadVidFirst() 
{ 
  if (xmlLoadVidFirst.readyState<4){
    document.getElementById("processingDiv").innerHTML=processing2a;
  }else if (xmlLoadVidFirst.readyState==4){ 
    document.getElementById("processingDiv").innerHTML='';
    var results = xmlLoadVidFirst.responseText
    loadVid(results);
  }
}
