﻿var isFxMac = (navigator.platform.toLowerCase().indexOf('mac') != -1);
var isSafari = (navigator.userAgent && navigator.vendor && (navigator.userAgent.toLowerCase().indexOf("applewebkit") != -1 || navigator.vendor.indexOf("Apple") != -1));

/* AGE SCREEN */

function DropYoungAgeCookie() {
	var COOKIE_AGE = 20; // minutes
	document.cookie = "YoungAgeCookie=1; expires=" + (new Date((new Date()).getTime() + COOKIE_AGE * 60000)).toGMTString();
}

function CheckYoungAgeCookie() {
	var tooYoung;
	if (document.cookie.match(/YoungAgeCookie=1/i) != null) {
		tooYoung = "true";
	} else {
		tooYoung = "false";
	}
	flash = eval("window.document.objBabyRuth");
	flash.SetVariable("tooYoung",tooYoung);
}

/* IMAGE UPLOAD */

function SuperFanFileUploadPop() {
    openWindow({ url:'SuperFans/ImageUpload.aspx', top:'180px', left:'150px', relativeTo:'flashContainer'}, 'SuperFans/ImageUpload.aspx', '449px', '192px');
}

function ClosePop() { closeWindow(); }

/* DEFAULT FUNCTIONS */

var popup;
function openWindow(modalArg, url, width, height)
{
    if(isFxMac || isSafari) {
        if (popup && !popup.closed) { popup.location = url; popup.resizeTo(width,height); }
		else { popup = window.open(url, "popup", "width=" + width + ",height=" + height + ",resizable=1,menubar=0,toolbar=0,status=0,scrollbars=0"); }
    } else {
		myLightbox.startModal(modalArg);
	}
}

function closeWindow()
{
    if(isFxMac || isSafari) {
		window.close();
    } else {
		myLightbox.endModal();
	}
}

/* BAD WORD FILTER */
/* DATABASE POST */
/* SEND TO FRIEND */
