function getCookie(name) 
{
        var label = name + "="
        var labelLen = label.length
        var cLen = document.cookie.length
        var mycookie = document.cookie
        var i = 0
        while (i < cLen) {
                var j = i + labelLen
                if (mycookie.substring(i,j) == label) {
                        var cEnd = mycookie.indexOf(";",j)
                        if (cEnd ==     -1) {
                                cEnd = mycookie.length
                        }
                        return unescape(mycookie.substring(j,cEnd))
                }
                i++
        }
        return null;
}

function setCookie(szName, szValue, szExpires, szPath, szDomain, bSecure)
{
        var szCookieText =         escape(szName) + '=' + escape(szValue);
        szCookieText +=            (szExpires ? '; EXPIRES=' + szExpires.toGMTString() : '');
        szCookieText +=            (szPath ? '; PATH=' + szPath : '');
        szCookieText +=            (szDomain ? '; DOMAIN=' + szDomain : '');
        szCookieText +=            (bSecure ? '; SECURE' : '');

        document.cookie = szCookieText;
}
function Rollover(theImage, theSrc)
{
        var objStr,obj;

        if(document.images)
        {
                if (typeof(theImage) == 'string')
                {
                        objStr = 'document.' + theImage;
                        obj = eval(objStr);
                        obj.src = theSrc;
                }
                else if ((typeof(theImage) == 'object') && theImage && theImage.src)
                {
                        theImage.src = theSrc;
                }
        }
}
function QLChanged(e)
{
        if (e.value!="")
                location.href="http://www.weonlydo.com/" + e.value;
        else
                location.href="http://www.weonlydo.com";
}
function CheckUpdates()
{
        location.href = "index.asp?lastvisit=" + lastvisitcook;
}
var refer_cook = getCookie('refer');
var location_cook = getCookie('location');
var time_exp = new Date();     //set new date object
time_exp.setTime(time_exp.getTime() + (1000 * 60 * 60 * 24 * 30));     //set it 30 days ahead
if (refer_cook == null || refer_cook == "")
{
	setCookie('refer', document.referrer, time_exp);
	setCookie('location', location.href, time_exp);
}

