
//EXAMPLE to find days between now and release date (don't forget month is zero based)
/*var d1 = new Date(2008,5,1);
var d2 = new Date();

alert(daysDiff(d1,d2));	
*/
function rkdmsEvent(movieName,eventName){
	var d = new Date();
	var t = d.getTime();
	var tracking = "<img src=\"https://www.rkdms.com/order.gif?mid="+ movieName +"&oid="+ t +"&lid=1&cid=&iid="+ eventName +"&ts=&icent=0&iqty=1&iname="+ eventName +"\" height=\"1\" width=\"1\" />";
	//document.write(tracking);	
	
	document.getElementById("bounceTracking").innerHTML = tracking;
	
	//alert(tracking);
}

function getDeeplinkHash(){
	var q = document.location.search||document.location.hash;
	if (q.length > 1) {
		var toReturn = q.substr(2);
		return toReturn
	} else {
		return ""
	}
}
var siteWidthPop = 0;
var siteHeightPop = 0;
var useScrollers = "";
var winH = 0;
var winW = 0;
var realH = 0;
var winHString = "";
var isIE = false;

function getHeight(){
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		winW = window.innerWidth;
		winH = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		isIE = true;
		winW = document.documentElement.clientWidth;
		winH = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		isIE = true;
		winW = document.body.clientWidth;
		winH = document.body.clientHeight;
	}
	
	winH = winH - 1;
	
	realH = winH;	
	
	//Set string for flash movie
	winHString = winH.toString();
	return winHString;
}

function getPopDimensions(){
	if(screen.width <= 1024){
		siteWidthPop = 1024;
	}else if (screen.width >= 1250){
		siteWidthPop = 1250;
	}else{
		siteWidthPop = screen.width;
	}
	if(screen.height <= 768){
		siteHeightPop = 768;
		useScrollers = "yes";	
	}else if (screen.height >= 850){
		siteHeightPop = 850;
		useScrollers = "no";	
	}else{
		siteHeightPop = screen.height;
		useScrollers = "yes";
	}
}

function createPops() {	
	newPopUp({
		name:"site",
		url:"site.html",
		width:siteWidthPop, height:siteHeightPop, scroll:useScrollers, resizable:"no"});
	newPopUp({
		name:"register",
		url:"pops/register/register.html",
		width:463, height:620, scroll:"no", resizable:"no"});
		
	newPopUp({
		name:"credits",
		url:"pops/credits/",
		width:1041, height:145, scroll:"no", resizable:"no"});		
}

function checkDeeplink(){
	var loc = window.location.href;
	var href_ar = loc.split("#");
	if (href_ar.length > 1) {
		if (href_ar[1] != ""){
			//alert(":::" + loc);
			launchPopUp('site','',href_ar[1]);
		}
	}
}

getPopDimensions();
createPops();