//Get cookie routine by Shelley Powers 

var showflash = true;

function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    // if cookie exists
    if (offset != -1) { 
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1) end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
//  alert("getcookie return val = "+returnvalue);
}        

function toggleflash(){
  if(showflash == 1){
    showflash = 0;
    cookietext = "showflash=0";
  }else{  
    showflash = 1;
    cookietext = "showflash=1";
  }
  document.cookie = cookietext;  
}  
  

function parsequerystring(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  } 
}


//alert(get_cookie("showflash"));
if(get_cookie("showflash")){
  showflash = get_cookie("showflash");
}else{
  showflash = 1;
}

if(parsequerystring("action") == "toggleflash"){
  toggleflash();
//  alert("toggle-ing flash");
}

//-->