function main_frame(menu_frame) {

  if (menu_frame==null) { menu_frame="/menu/top.htm"; }
  flg=get_cookie("session");
  if (flg=="") {

    set_cookie("MAIN_FRAME",location.href);
    set_cookie("MENU_FRAME",menu_frame);
    ans = document.referrer.indexOf("64.233.179.104",0);
    if (ans == -1) { location = "/"; }
  }
}

function menu_frame(main_frame) {

  if (main_frame==null) { main_frame="/main.htm"; }
  flg=get_cookie("session");
  if (flg=="") {
    set_cookie("MAIN_FRAME",main_frame);
    set_cookie("MENU_FRAME",location.href);
    ans = document.referrer.indexOf("64.233.179.104",0);
    if (ans == -1) { location = "/"; }

  } else {

    main_url=get_cookie("MAIN_FRAME");
    ans = document.referrer.indexOf("ex",0);
    if ((ans == -1)&&(main_url=="")) { window.open(main_frame,'MAIN_FRAME'); }
    clearCookie("MAIN_FRAME");
    clearCookie("MENU_FRAME");

  }

}

function top_frame() {

  flg=get_cookie("session");
  if (flg=="") {
    set_cookie("MAIN_FRAME","/main.htm");
    set_cookie("MENU_FRAME","/menu/top.htm");
    ans = document.referrer.indexOf("64.233.179.104",0);
    if (ans == -1) { location = "/"; }

  }
}


function get_cookie(key_wrd){
    ckie_word=document.cookie+";";
    ckie_word1=ckie_word.indexOf(key_wrd, 0);
    if(ckie_word1!=-1){
        ckie_word=ckie_word.substring(ckie_word1,ckie_word.length);
        start=ckie_word.indexOf("=",0)+1;
        end=ckie_word.indexOf(";",start);
        return(unescape(ckie_word.substring(start,end)));
    }
    return("");
}
function set_cookie(key_wrd,val) {
    ckie_word=key_wrd+"="+escape(val)+";";
    ckie_word+="path=; ";
    document.cookie=ckie_word;
}
function clearCookie(key) {
    document.cookie = key + "=" + "xx; expires=Tue, 1-Jan-1980 00:00:00;";
}
