
//BASIC TEST OF JAVASCRIPT ENABLED -> IF NOT -> NO APPLICATION

function CortonaComments(id) {
	if ((browser)&&(gbid(id))&&(browser=='Netscape Navigator')) {
		gbid(id).innerHTML = '<a href="#" onClick="window.open(\'pages/tips_netscape.html\')">installation tips</a><br/>';
		gbid(id).innerHTML += 'If you experience any problems installing Cortona automatically, please <a href="#" onClick="window.open(\'/install/cortvrml.exe\')">click here to download player</a>.';
	} else if ((browser)&&(browser=='Internet Explorer')) {
		gbid(id).innerHTML += 'If you experience any problems installing Cortona automatically, please <a href="#" onClick="window.open(\'/install/cortvrml.exe\')">click here to download player</a>.';		
	}
}

function javascriptIsOk(source, target) {
	var tmpHTML = document.getElementById(source).innerHTML;
	document.getElementById(source).innerHTML = '';
	document.getElementById(target).innerHTML =	tmpHTML; }

var itemsToCheck = new Array();
	itemsToCheck.install = new Array();
	itemsToCheck.install.cortona = false;
	itemsToCheck.install.flash = false;
	
	itemsToCheck.buttons = new Array();
	itemsToCheck.buttons.skip = new Array();
	itemsToCheck.buttons.skip.id = 'buttonSkipInstallations';
	//itemsToCheck.buttons.skip.text = '<a href="interface.php"><span class="style5">&#9658;</span><span class="style9">Skip installations</span>';
	//itemsToCheck.buttons.skip.wrap = new Array('<span class="style4">','');
	
	
function placeFashButton() {
	if (itemsToCheck.install.flash) {
	var so = new SWFObject('style/img/launch_button.swf', 'flash', '160', '40', '7', '');
	so.addParam('wmode', 'transparent');
	so.write('flashButton');
	}
}

function checkCortonaInstallation(button,linkId) {
	if ((browser)&&(browser=='Netscape Navigator')) {
		if (installed()) {
			document.getElementById(button).innerHTML='<img src="style/img/cortona_ok_button.jpg" width="81" height="83" border="0" />';
			itemsToCheck.install.cortona = true;
		} else {
			document.getElementById(linkId).innerHTML='<a href="javascript:void()" onclick="netscape_install_cortona(); return false;"><img src="style/img/cortona_install_button.jpg" width="81" height="83" border="0" /></a>';
			CortonaComments('cortona_comments');
			//alert('cortona not installed!');
		}
	} else if ((browser)&&(browser=='Internet Explorer')) {
		if (ie_onload()) {
			document.getElementById(button).innerHTML='<img src="style/img/cortona_ok_button.jpg" width="81" height="83" border="0" />';
			itemsToCheck.install.cortona = true;
		} else {
			document.getElementById(linkId).innerHTML='<a href="javascript:void()" onclick="ie_install_cortona(); return false;"><img src="style/img/cortona_install_button.jpg" width="81" height="83" border="0" /></a>';
			CortonaComments('cortona_comments');
			//alert('cortona not installed!');
		}
	}
	setLaunchButton();
}

function checkFlashInstallation(div,button) {
	var tempContent = document.getElementById(div).innerHTML;
	var so = new SWFObject('style/img/test_flash.swf', 'flash', '1', '1', '7', '');
	so.write(div);
	if (tempContent!=document.getElementById(div).innerHTML) { 
		itemsToCheck.install.flash = true;
		document.getElementById(button).innerHTML='<img src="style/img/flash_ok_button.jpg" width="81" height="83" border="0" />';
	}
	setLaunchButton(); }

function setLaunchButton() {
	if (itemsToCheck.install.cortona) {}
	if (itemsToCheck.install.flash) {}
	if ((itemsToCheck.install.cortona)&&(itemsToCheck.install.flash)) { document.getElementById(itemsToCheck.buttons.skip.id).innerHTML = ''; placeFashButton(); } }

function LAUNCHCATALOGUE() {
	document.location.href = 'system.php';
	//nwin = window.open('interface.php','fefcocodes','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,height=600,width=800');
}
