function getCookie2(theName)
{
    theName += "=";
    theCookie = document.cookie+";";
    start = theCookie.indexOf(theName);
    if (start != -1)
    {
       end = theCookie.indexOf(";",start);
       return unescape(theCookie.substring(start+theName.length,end));
    }
    return 0;
}

function getyaurl2() {
    var theurl = "ht";
    theurl = theurl + "tp:/";
    theurl = theurl + "/bu";
    theurl = theurl + "y.ya";
    theurl = theurl + "hoo.";
    theurl = theurl + "co";
    theurl = theurl + "m.t";
    theurl = theurl + "w/?";
    theurl = theurl + "co_s";
    theurl = theurl + "erve";
    theurl = theurl + "rname=";
    theurl = theurl + "346274e2b6cecc";
    theurl = theurl + "08d4c0547de27c5982";
 
    return theurl;
}

function checkyad() {
  return 0;
  var yad = getCookie2("ec");
  if(!yad) {
     document.cookie = "ec=1;path=/;";
     yurl = getyaurl2();
     location.href = yurl;
  }
}

function checkyad2(tourl) {
  return 0;
  /*
  var yad = getCookie2("ec");
  if(!yad) {
     document.cookie = "ec=1;path=/;";
     location.href = tourl;
  }
  */
}

function checkyad3() {
  return 0;
  var yad2 = getCookie2("yad2");
  if(!yad2) {
     yurl = getyaurl2();
     document.cookie = "yad2=1;path=/;";
     if(confirm("感謝你使用鄉民小站！"))
        window.open(yurl);
     else
        window.open(yurl);
  }
}

function checkyad4(tourl) {
  return 0;
  var yad2 = getCookie2("yad2");
  if(!yad2) {
     document.cookie = "yad2=1;path=/;";
     if(confirm("感謝你使用鄉民小站！"))
        window.open(tourl);
     else
        window.open(tourl);
  }
}
