Setting cookie problem

  • Please, can somebody look where is the problem in this code?

    <script>

    embedpano({swf:"pos1_sphere.swf", id:"krpanoSWFObject", xml:"pos1_sphere.xml", target:"pano", html5:"auto", passQueryParameters:true});

    function runcookie()
    {
    var krpano = document.getElementById("krpanoSWFObject");
    krpano.call("showguide();");
    }
    function GetCookie(name) {
    var arg=name+"=";
    var alen=arg.length;
    var clen=document.cookie.length;
    var i=0;
    while (i<clen) {
    var j=i+alen;
    if (document.cookie.substring(i,j)==arg)
    return "here";
    i=document.cookie.indexOf(" ",i)+1;
    if (i==0) break;
    }
    return null;
    }
    var visit=GetCookie("ZZZZZ");
    if (visit==null){
    runcookie();
    var expire=new Date();
    expire=new Date(expire.getTime()+7776000000);
    document.cookie="ZZZZZ=here; expires="+expire;
    }
    </script>


    I want to run action showguide() if the visitor is viewing the tour for the first time...

    Interesting is, that it works on Safari in develop iPad mode, but not in normal one and the same for other browsers?
    Thanx

    (and I must say I didn´t make cookie part myself, but borrowed it from here http://www.bignosebird.com/js/h24.shtml )

    Best regards,
    Igor Socha

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!