var browserVersion;	
	
function browserDetect(path){
	var pathToCSS;

	if (path != '') {
		pathToCSS = path;
	} else {
		pathToCSS = './';
	}
	

	if (document.getElementById && document.all ) { 			
	// Browser is version IE 5.0 +
		browserVersion = "ie5plus";
	}
	else if(!document.all && document.getElementById){
		// Browser is version Netscape 6.0 +
	}
	else if (document.all) { 
		// Older Browser Redirect - triggered by any IE version that itsn't IE 5+
		browserVersion = "notSupported";
	}
	else if (document.layers) {
		// Older Browser Redirect - triggered by any Netscape version that itsn't Netscape 6+
		browserVersion = "notSupported";
		location = "download.html";;
	}
}


function openwindow(){
	var contestPopup_CookieName = "atriascontestpopup";
	if (navigator.cookieEnabled) {
		if (getCookie(contestPopup_CookieName).length > 0) return;
		setCookie(contestPopup_CookieName, "true")
	}
	window.open('atriascontest.html','','status=no,resizable=yes,scrollbars=no,location=no,toolbar=no,left=150,top=50,width=400,height=325');
}



//
// This function sets a document cookie.
//
function setCookie( sName, sValue, expDate )
{
    if ( sName.length < 1 )
        return;

    if ( sValue.length > 0)
    {
        var newCookie = sName + "=" + sValue + "; ";
        if ((expDate != null) && expDate.toGMTString) {
            newCookie = "expires=" + expDate.toGMTString();
        }
        document.cookie = newCookie;
    }
    else
    {
        //  this will cause the named cookie to be deleted.
        document.cookie = sName + "=";
    }
}

function deleteCookie( sName )
{
    document.cookie = sName + "=";
}

//
//  This function will fetch a named cookie
//
function getCookie( sName )
{
    var sValue = "";
    var index = 0;

    //  The "cookie" property on the document is actually a
    //  single string of the form "name=value; name2=value2; ..."
    //  As a result we must search through the cookie string
    //  to find the name=value pair that we are looking for.
    //
    if( document.cookie )
        index = document.cookie.indexOf( sName + "=" );
    else
        index = -1;

    if ( index < 0 )
    {
        sValue = "";
    }
    else
    {
        var countbegin = (document.cookie.indexOf( "=", index ) + 1);
        if ( 0 < countbegin )
        {
            var countend = document.cookie.indexOf( ";", countbegin );
            if ( countend < 0 )
                countend = document.cookie.length;
            sValue = document.cookie.substring( countbegin, countend );
        }
        else
        {
            sValue = "";
        }
    }
    return sValue;
}


