// JavaScript Document
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function mouseOver(id){ 
  document.getElementById(id).className="languageListTableDivRollOver";
}

function mouseOut(id){ 
  document.getElementById(id).className="languageListTableDiv";
}

function loadXMLDoc(dname)   //cross-browser function to load an XML document, "dname"
{
   try //Internet Explorer
   {
       xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	  
   }
   catch(e)
   {
      try //Firefox, Mozilla, Opera, etc.
      {
         xmlDoc=document.implementation.createDocument("","",null);
		
      }
      catch(e) {alert(e.message)}
   }

   try
   {

       var ua = navigator.userAgent.toLowerCase();
       if (ua.indexOf('safari/') != -1){ //user is reporting as Safari, use XMLHttpRequest instead.
          XmlHTTP = new XMLHttpRequest();
          XmlHTTP.open("get", dname, false);
          XmlHTTP.send("");
          var xDoc = XmlHTTP.responseXML;
          return xDoc;
       }else{

         xmlDoc.async=false;
         xmlDoc.load(dname);
         return(xmlDoc); 

      }

   }
   catch(e) {alert(e.message)}
   return(null);
} 

function getDate()
{
	var now = new Date();
   
    var months = new Array(
      'January','February','March','April','May',
      'June','July','August','September','October',
      'November','December');
    var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
    function fourdigits(number)	{
      return (number < 1000) ? number + 1900 : number;}
    today =       months[now.getMonth()] + " " +
       date + ", " +
       (fourdigits(now.getYear()));

	 document.getElementById('monthDate').innerHTML = today;
}

function calcHeight(id)
{
//find the height of the internal page
var the_height=
document.getElementById(id).contentWindow.
document.body.scrollHeight;

the_height = the_height + 30;
//change the height of the iframe
document.getElementById(id).height=
the_height;
}

function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 

function blendimage(divid, imageid, imagefile, millisec) { 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 
     
    //set the current image as background 
    document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")"; 
     
    //make image transparent 
    changeOpac(0, imageid); 
     
    //make new image 
    document.getElementById(imageid).src = imagefile; 

    //fade in image 
    for(i = 0; i <= 100; i++) { 
        setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed)); 
        timer++; 
    } 
} 



function get_random(maxNum)
{
  if (Math.random && Math.round)
  {
    var ranNum= Math.round(Math.random()*(maxNum-1));
    ranNum+=1;
    return ranNum;
  }
  else
  {
  today= new Date();
  hours= today.getHours();
  mins=   today.getMinutes();
  secn=  today.getSeconds();
  if (hours==19)
   hours=18;
  var ranNum= (((hours+1)*(mins+1)*secn)%maxNum)+1;
  return ranNum;
  }
}
