function createIntroPopup(swfPath, width, height) {
	var introContainer = document.createElement('div');
	introContainer.id = 'introMovieContainer';
	introContainer.style.display = 'none';
	introContainer.style.position = 'absolute';
	introContainer.style.left = '0px';
	introContainer.style.top = '0px';
	introContainer.style.width = '100%';
	introContainer.style.height = '1024px';
	introContainer.style.backgroundColor = 'black';
	introContainer.style.opacity = 0.9;
	introContainer.style.MozOpacity = 0.9;
	introContainer.style.KhtmlOpacity = 0.9; 
	introContainer.style.filter = 'alpha(opacity=90)';
	introContainer.style.textAlign = 'center';
	
	var style = 'width: '+width+'; height: '+height+'; display: block; margin-top: 20px; margin-left: auto; margin-right: auto;';
	introContainer.innerHTML = '<object width="'+width+'" height="'+height+'" style="'+style+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" data="'+swfPath+'" ><param name="movie" value="'+swfPath+'" /><embed type="application/x-shockwave-flash" src="'+swfPath+'" width="'+width+'" height="'+height+'"></embed></object>';

	document.body.appendChild(introContainer);
	
	return introContainer;
}

function showIntroPopup(swfPath, width, height, ignoreCookie) {
	if (ignoreCookie != true) {
		var dscIntroViewed = false;
		var nameEQ = 'dsc_intro_viewed=';
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') {
				c = c.substring(1,c.length);
			}
			if (c.indexOf(nameEQ) == 0) {
				dscIntroViewed = c.substring(nameEQ.length,c.length);
				break;
			}
		}
	}
	if (ignoreCookie == true || dscIntroViewed != 'true') {
		var introContainer = document.getElementById('introMovieContainer');
		
		if (!introContainer) introContainer = createIntroPopup(swfPath, width, height);

		introContainer.style.display = 'block';
	
		var date = new Date();
		date.setTime(date.getTime()+(24*60*60*1000));
		document.cookie = 'dsc_intro_viewed=true; expires='+date.toGMTString()+'; path=/';
	}
}

function initIntro() {
	setTimeout("showIntroPopup('/flash/home.swf', 730, 547);",10);
}

function clearIntroCookie() {
	document.cookie = 'dsc_intro_viewed=false; expires=-1; path=/';
}

function hideIntroPopup() {
	var introContainer = document.getElementById('introMovieContainer');
	if (introContainer) introContainer.style.display = 'none';
}