//------------------------------------------------
function GetCookie(MyVar){
  VarList = document.cookie.split(";");
  Found=false;
  MyValue=null;
  i=0;
  while ((i <VarList.length) && (!Found)) {
    LineLength = VarList[i].length;
    Space= (i==0)? 1 : 2 ;
    if (VarList[i].indexOf(MyVar + "=") >= 0)  { 
      Found= true;
      MyValue= VarList[i].substring(MyVar.length + Space , LineLength)
    }
    i = i + 1;
  }
  //alert(document.cookie);	
  return MyValue;
}

//------------------------------------------------
function SetCookie(MyVar, NewValue){
  document.cookie = MyVar + "=" + NewValue + ";path=/;";
  //alert(document.cookie);
}

