var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

function getBrowserInfo() {
	if (checkIt('konqueror')) {
		browser = "Konqueror";
		OS = "Linux";
	}
	else if (checkIt('safari')) browser 	= "Safari"
	else if (checkIt('omniweb')) browser 	= "OmniWeb"
	else if (checkIt('opera')) browser 		= "Opera"
	else if (checkIt('webtv')) browser 		= "WebTV";
	else if (checkIt('icab')) browser 		= "iCab"
	else if (checkIt('msie')) browser 		= "Internet Explorer"
	else if (!checkIt('compatible')) {
		browser = "Netscape Navigator"
		version = detect.charAt(8);
	}
	else browser = "An unknown browser";

	if (!version) version = detect.charAt(place + thestring.length);

	if (!OS) {
		if (checkIt('linux')) OS 		= "Linux";
		else if (checkIt('x11')) OS 	= "Unix";
		else if (checkIt('mac')) OS 	= "Mac"
		else if (checkIt('win')) OS 	= "Windows"
		else OS 								= "an unknown operating system";
	}
}

function checkIt(string) {
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}

function showIntro()
{
	getBrowserInfo();
	prepareIE('100%','hidden');
	addMarkup();
	window.scrollTo(0, 0);
	info_inner = '<div align="right" style="background-image:url(images/line_video.gif);"><a href="javascript:;" onClick="deactivate()"><img src="images/b_close.gif" border="0"></a></div>'
			   + '<iframe width="500" height="279" frameborder="0" marginheight="0" marginwidth="0" src="video.html" scrolling="no" name="movie"></iframe>';

	document.getElementById('video').innerHTML = info_inner;
}

function addMarkup() {
	bod 				= document.getElementsByTagName('body')[0];
	overlay 			= document.createElement('div');
	overlay.id			= 'dvOverlay';
	lb					= document.createElement('div');
	lb.id				= 'video';
	bod.appendChild(overlay);
	bod.appendChild(lb);
}

function prepareIE(height,overflow){
	if(browser == "Internet Explorer")
	{
		bod = document.getElementsByTagName('body')[0];
		bod.style.height = height;
		bod.style.overflow = overflow;
  
		htm = document.getElementsByTagName('html')[0];
		htm.style.height = height;
		htm.style.overflow = overflow; 
	} else {
		bod = document.getElementsByTagName('body')[0];
		bod.style.overflow = overflow;
	}
}

function deactivate()
{
	movie.location.href='bla.html';
	bod.removeChild(overlay);
	bod.removeChild(lb);
	if (browser == "Internet Explorer"){
		prepareIE("auto", "auto");
	} else {
	bod = document.getElementsByTagName('body')[0];
	bod.style.overflow = "auto";
	}
}

