function sfHover() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

function openGallery(URL)
{
	window.open(URL,null,"status=no ,toolbar=no,menubar= no,location=no,width=825,height=500,resizable=no,scrollbars=no,left=0,top=0");
}

function openScreenshot(screenshot)	// variables include screenshot file name
{
	var x=window.open('', '','width=800,height=600,resizable=yes,scrollbars=yes,left=0,top=0');
	x.document.write('<html><body><img src="graphics/' + screenshot + '" /></body></html>');
	x.focus();
}

function openFlash(segment)
{
	flashwindow=window.open("flash/" + segment,"mywindow","location=0,status=0,scrollbars=0,width=750,height=550,resizable=0");
}

function insertFlash(flash,w,h)
{

document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+flash+"' align='middle'>");
document.write("<param name='allowScriptAccess' value='sameDomain' />");
document.write("<param name='wmode' value='transparent' />");
document.write("<param name='movie' value='flash/"+flash+".swf' /><param name='quality' value='high' /><param name='scale' value='exactfit' /><param name='bgcolor' value='#ffffff' /><embed src='flash/"+flash+".swf' quality='high' scale='exactfit' bgcolor='#ffffff' width='"+w+"' height='"+h+"' name='"+flash+"' align='middle' allowScriptAccess='sameDomain' wmode='transparent' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
document.write("</object>");

}



    	function CreateClientCookie(name, value, days)
    	{
    		if (days)
    		{
    			var date = new Date();
    			date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
    			var expires = "; expires=" + date.toGMTString();
    		}
    		else var expires = "";
    		document.cookie = name + "=" + escape(value) + expires + "; path=/";
    	}

    	function ReadClientCookie(name)
    	{
    		var nameEQ = name + "=";
    		var ca = document.cookie.split(';');
    		for (var i = 0; i < ca.length; i++)
    		{
    			var c = ca[i];
    			while (c.charAt(0) == ' ') c = c.substring(1, c.length);
    			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
    		}
    		return null;
    	}
    	function eraseCookie(name) {
    		CreateClientCookie(name, "", -1);
    	}

    	function areCookiesEnabled() {
    		var r = false;
    		CreateClientCookie("testing", "Hello", 1);
    		if (ReadClientCookie("testing") != null) {
    			r = true;
    			eraseCookie("testing");
    		}
    		return r;
    	}

function setCookie(c_name,value,exdays)
 {
 
 return CreateClientCookie(c_name,value,exdays);
 
 var exdate=new Date();
 exdate.setDate(exdate.getDate() + exdays);
 var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
 document.cookie=c_name + "=" + c_value;
}

var visitorCheckError = 0;

function visitorCheck()
{
if (typeof document.referrer != "undefined" && document.referrer != null)
 {
    if (document.referrer.toString().toLowerCase() != document.location.href.toString().toLowerCase())
    {
        try { CreateClientCookie("c_Last_Url",document.referrer,1); } catch(e) { }
    } 
 }
    var relativeDomain = "trackersuite.net";
    var strReferrer = "";
    var refDomain = "";
    try
    {
        relativeDomain = relativeDomain.toLowerCase();
        strReferrer = document.referrer.toLowerCase();
        refDomain = strReferrer.replace("http://", "").replace("https://", "");
        if (refDomain.indexOf("www.") == 0)
        {
            refDomain = refDomain.replace("www.","");
        }
        if (refDomain.substring(0,relativeDomain.length) == relativeDomain)
        {
            return;
        }       
    }
    catch(e)
    {
        visitorCheckError++;
        if (visitorCheckError < 10)
        {
            setTimeout(visitorCheck,1000);
        }
        else
        {
            visitorCheckError = 0;
        }
        return;
    }
    if (strReferrer == "")
    {
        visitorCheckError++;
        if (visitorCheckError < 10)
        {
            setTimeout(visitorCheck,1000);
        }
        else
        {
            visitorCheckError = 0;
            try { setCookie("c_Entry_Url","Referrer was empty",1); } catch(e) { }
        }       
    }
    else
    {
        try { setCookie("c_Entry_Url",strReferrer,1); } catch(e) { }
        
    }
}

visitorCheck(); 
