var WIDGET_WIDTH = "298";
var WIDGET_HEIGHT = "475";

var BOOKMARK_WIDTH = "660";
var BOOKMARK_HEIGHT = "790";

var JOKER_WIDTH = "710";
var JOKER_HEIGHT = "500";

var SQUIRREL_WIDTH = "1024";
var SQUIRREL_HEIGHT = "768";

var FRIEND_WIDTH = "580";
var FRIEND_HEIGHT = "600";

/*

Implementation:

callPopUp('widget');
callPopUp('bookmark');
callPopUp('jokerCard');
callPopUp('squirrels');

*/

function callPopUp(type){
	var windowLocation;
	var windowHeight;
	var windowWidth;
	switch(type){
		case "widget":
			windowLocation = "http://solutions.vzwshop.com/nokia/assets/widget/index.html";
			windowHeight = WIDGET_HEIGHT;
			windowWidth = WIDGET_WIDTH;
		break;
		case "bookmark":
			windowLocation = "http://www.addthis.com/bookmark.php?pub=addthis&url=http://solutions.vzwshop.com/nokia&title=The Dark Knight";
			windowHeight = BOOKMARK_HEIGHT;
			windowWidth = BOOKMARK_WIDTH;
		break;
		case "jokerCard":
			windowLocation = "http://thejokersbagofcash.young-america.com/";
			windowHeight = JOKER_HEIGHT;
			windowWidth = JOKER_WIDTH;
		break;
		case "winners":
			return;
			windowLocation = "http://solutions.vzwshop.com/nokia";
			windowHeight = JOKER_HEIGHT;
			windowWidth = JOKER_WIDTH;
		break;
		case "friend":
			windowLocation = "https://email.vzwshop.com/servlet/website/ResponseForm?OSPETB_9_TZ_IHmtHg_.4007.40";
			windowHeight = FRIEND_HEIGHT;
			windowWidth = FRIEND_WIDTH;
		break;
		case "squirrels":
			windowLocation = "http://happytreefriends.atomfilms.com/";
			windowHeight = SQUIRREL_HEIGHT;
			windowWidth = SQUIRREL_WIDTH;
		break;
	}
	window.open(windowLocation, "BatWindow", "width="+windowWidth+",height="+windowHeight);
}

function detectWindowSize(){
	var windowWidth = 0;
	var windowHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		windowWidth = window.innerWidth;
		windowHeight = window.innerHeight;
	}else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		windowWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	}else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}
	return windowHeight;
}