﻿//判断页面来源，设置cookie
function Gyhcs()
{
    var refurl = document.referrer + GetRequest();

    if(refurl.indexOf("google")>0 || refurl.indexOf("yahoo")>0 || refurl.indexOf("bing")>0)
    {

         
         if(refurl.indexOf("q=")>0)
         {
            var arr = refurl.split("q=");
            if(arr.length > 1)
            {
	           var result = arr[1];
	           
	           var arrr=arr[1].split("&");
	           
	           if(arrr.length > 1)
	           {
                  if(arrr[0].indexOf("ignah")<0)
                  {
                    setCookie("Coupon","SIXTH",7*24);
                  }    
                  else
                  {
                    setCookie("Coupon","WELCOME",7*24);
                  }       
	           }
	           
	               
            }
         }
         else
         {
             setCookie("Coupon","WELCOME",7*24);
         }
    }
    if(refurl.indexOf("riftgamestore")>0 || refurl.indexOf("riftcash")>0 || refurl.indexOf("sellriftgold")>0)
    {
	    setCookie("Coupon","WELCOME",7*24);
    }
}

//




////获得COOKIE
//function getCookie(cookiename)
//{
//    var result = '';
//    var mycookie = document.cookie;
//    var start2 = mycookie.indexOf(cookiename + "=");
//    if(start2>-1)
//    {
//        start=mycookie.indexOf("=",start2)+1;
//        var end = mycookie.indexOf(";",start);
//        
//        if (end == -1)
//        {
//            end = mycookie.length;
//        }
//        
//        result = unescape(mycookie.substring(start,end));
//        
//    }
//    return result;
//}

////设置COOKIE
//function setCookie(cookiename, cookievalue, hours)
//{
//    var date=new Date();
//    date.setTime(date.getTime() + Number(hours)*3600*1000);
//    temp = escape(cookievalue);
//    document.cookie = cookiename + "=" + temp  +"; path=/;expires = " + date.toGMTString();
//    //var o = 0;
//}


function setcoupontb()
{
    if(getCookie("Coupon")!="")
    {
        $('coupontb').value=getCookie("Coupon");
	//newcheckcouponp();
    }
    else
    {
        $('coupontb').value="";
    }
}


function wowhotshow() {
    var hoturl=window.location.href;
    if (hoturl.indexOf("mounthot") > 0)
    {
        GetAllShopInfoByIdCount(82);
        ShowOrHieed(82, '1_', 1, 'Miscellaneous');
        className_lx(1, '1|10');
    }


}

