function showCard() {
	if(!Cookie.get('showcard') && !parent.document.getElementById('templateframe')) {
		var div = document.createElement('DIV');
		div.id = 'flashcard-container';
		div.style.position = 'absolute';
		div.style.zIndex = 990;
		div.style.top = '0px';
		div.style.left = '0px';		
		document.body.appendChild(div);
		
		var cardCode = ''+
		'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+cardWidth+'" height="'+cardHeight+'">'+
	      '<param name="movie" value="'+flashCardURL+'">'+
	      '<param name="quality" value="high">'+
	      '<param name="wmode" value="transparent">'+
	      '<embed src="'+flashCardURL+'" width="'+cardWidth+'" height="'+cardHeight+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>'+
	    '</object>';
		
		var carddiv = document.getElementById('flashcard-container');		
				
		updateAfterResize();
		carddiv.innerHTML = cardCode;
		setTimeout(closeMovie, 25000);
		Cookie.set('showcard', 'yes', null, null, null, null);
		
		if(window.attachEvent) {
			window.attachEvent("onresize", updateAfterResize);			
		} else if(window.addEventListener) {
			window.addEventListener("resize", updateAfterResize, false);			
		} else {
			window["onresize"] = updateAfterResize;			
		}
	}	
}

function closeMovie() {
	var obj = document.getElementById('flashcard-container');
	obj.style.display = 'none';
}

function updateAfterResize(container) {
	var obj = document.getElementById('flashcard-container');	
	obj.style.width = cardWidth + "px";
	obj.style.height = cardHeight + "px";
	obj.style.top = (screenSize().h - cardHeight) / 2 + "px";
	obj.style.left = (screenSize().w - cardWidth) / 2 + "px";	
}



function screenSize() {
    var w, h;
    w = (window.innerWidth ? window.innerWidth : (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.offsetWidth));
    h = (window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight));
    
    return {w:w, h:h};
}

if(window.attachEvent) {
	window.attachEvent("onload", showCard);
} else if(window.addEventListener) {
	window.addEventListener("load", showCard, false);
} else {
	window["onload"] = showCard;
}