
<!--
//=====================================================================
//Common Javascript functions
//=====================================================================

//Convert a value - strip commas from a string so arithmetic can be performed
function cVal(val) {
  var sTmp = "" ;
  
  if (val > ""){
   sTmp = val.replace(/,/g,"") ;
  } 
  
  // If alpha return 0
  lNum = "N";
  for (i = 0; i < sTmp.length; i++) {
   if (sTmp.substr(i,1).search(/[0123456789]/) >= 0){
    lNum = "Y";
   } 
  }
  if (lNum == "Y") { 
   return sTmp * 1 ;
  }
  else {
   return 0;
  } 
}


function PrintScreen(){
 window.print()
} 



//=====================================================================
// Cookie Functions
//=====================================================================

//milliseconds * seconds * minutes * hours * days * year
//always set to 1-year in the future for now 
// expiry value was originally set to = 31536000000
//expiry = 0 clears cookies whn browser is closed
//delete a cookie by sending '' as the cookieValue
//function WriteCookie (cookieName, cookieValue, expiry) 

function WriteCookie (cookieName, cookieValue) {
  var expDate = new Date();
  var expiry
  expiry = 0;
  if(expiry)
  {
  expDate.setTime (expDate.getTime() + expiry);
      document.cookie = cookieName + "=" + escape (cookieValue) + "; expires=" + expDate.toGMTString();
      }
      else
      {
          document.cookie = cookieName + "=" + escape (cookieValue);
  	}
}

function ReadCookie (CookieName) {
  var CookieString = document.cookie;
  var CookieSet = CookieString.split (';');
  var SetSize = CookieSet.length;
  var CookiePieces
  var ReturnValue = "";
  var x = 0;

  for (x = 0; ((x < SetSize) && (ReturnValue == "")); x++) {

    CookiePieces = CookieSet[x].split ('=');

    if (CookiePieces[0].substring (0,1) == ' ') {
      CookiePieces[0] = unescape(CookiePieces[0].substring (1, CookiePieces[0].length));
    }

    if (CookiePieces[0] == CookieName) {
      ReturnValue = unescape(CookiePieces[1]);
    }

  }

  return unescape(ReturnValue);
}

function GetCookie (name){
 var arg = name + "=";
 var alen = arg.length;
 var allcookies = this.document.cookie
 
 var clen = document.cookie.length;
 var i = 0;
 while (i < clen){
      var j = i + alen;
      if (document.cookie.substring(i, j) == arg)
         return getCookieVal (j);
      i = document.cookie.indexOf(" ", i) + 1;
      if (i == 0) 
         break; 
      }
   return null;
   }

function SetCookie (name, value) 
   {
   var argv = SetCookie.arguments;
   var argc = SetCookie.arguments.length;
   var expires = (2 < argc) ? argv[2] : null;
   var path = (3 < argc) ? argv[3] : null;
   var domain = (4 < argc) ? argv[4] : null;
   var secure = (5 < argc) ? argv[5] : false;
   document.cookie = name + "=" + escape (value) +
     ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
     ((path == null) ? "" : ("; path=" + path)) +
     ((domain == null) ? "" : ("; domain=" + domain)) +
	((secure == true) ? "; secure" : "");
   }
//=====================================================================
// End Cookie Functions
//=====================================================================

//-->

//=====================================================================
// Text Bump Functions
//=====================================================================
function jump0(){
if (ns6&&!ns6switch){
jump.innerHTML=message
return
}
if(message.length > 6){
for(i=0; i != message.length;i++){
txt=txt+"<span style='position:relative;' id='n"+i+"'>"+message.charAt(i)+"</span>"};
jump.innerHTML=txt;
txt="";
jump1a()
}
else{
alert("Your message is to short")
}
}

function jump1a(){
nfinal=(document.getElementById)? document.getElementById("n0") : document.all.n0
nfinal.style.left=-num2;
if(num2 != 9){
num2=num2+3;
setTimeout("jump1a()",50)
}
else{
jump1b()
}
}

function jump1b(){
nfinal.style.left=-num2;
if(num2 != 0){num2=num2-3;
setTimeout("jump1b()",50)
}
else{
jump2()
}
}

function jump2(){
txt="";
for(i=0;i != message.length;i++){
if(i+num > -1 && i+num < 7){
txt=txt+"<span style='position:relative;top:"+mes[i+num]+"'>"+message.charAt(i)+"</span>"
}
else{txt=txt+"<span>"+message.charAt(i)+"</span>"}
}
jump.innerHTML=txt;
txt="";
if(num != (-message.length)){
num--;
setTimeout("jump2()",50)}
else{num=0;
setTimeout("jump0()",50)}}

//-->

