﻿var ybJS={

    fullImageSrc:function(){ 
        var images = document.getElementsByTagName("img");    
        for(var i=0 ;i<images.length;i++)
        {
            if(images[i].alt!="")
            {              
                if(images[i].alt.indexOf("http://")>-1)
                {
                    images[i].src=unescape(images[i].alt);
                }
            }
            else
            {
              images[i].src="/PriceTop/CSS/images/exclamation.gif";
            }
            
            var img=images[i]; 
            img.onerror=function() 
            { 
                 this.src="/PriceTop/CSS/images/question.gif";
            } 
      
        }
       }
       ,
       
       CookieCommon:function(){ 
            function SetCookie(name,value,expires,path,domain,secure)
            {
                var expDays = expires*24*60*60*1000;
                var expDate = new Date();
                expDate.setTime(expDate.getTime()+expDays);
                var expString = ((expires==null) ? "" : (";expires="+expDate.toGMTString()))
                var pathString = ((path==null) ? "" : (";path="+path))
                var domainString = ((domain==null) ? "" : (";domain="+domain))
                var secureString = ((secure==true) ? ";secure" : "" )
                document.cookie = name + "=" + escape(value) + expString + pathString + domainString + secureString;
            } 

             
            function GetCookie(name)
            {
                var result = null;
                var myCookie = document.cookie + ";";
                var searchName = name + "=";
                var startOfCookie = myCookie.indexOf(searchName);
                var endOfCookie;
                if (startOfCookie != -1)
                {
                    startOfCookie += searchName.length;
                    endOfCookie = myCookie.indexOf(";",startOfCookie);
                    result = unescape(myCookie.substring(startOfCookie, endOfCookie));
                }
               return result;
            } 

             
            function ClearCookie(name)
            {
                var ThreeDays=3*24*60*60*1000;
                var expDate = new Date();
                expDate.setTime(expDate.getTime()-ThreeDays);
                document.cookie=name+"=;expires="+expDate.toGMTString();
            }

       }

}