

// POPUP WINDOWS
function closeWindow() {
	if (typeof(popupWin) != "undefined" && !popupWin.closed){
		popupWin.close();
	}
}

function showWindow (url, name, w, h, scroll, resize) {
	var winX = 0;
	var winY = 0;
	var popupWin;
	if (parseInt(navigator.appVersion)>=4) {
		winX = (screen.availWidth - w)*0.5;
		winY = (screen.availHeight - h)*0.5;
	}
	closeWindow();
	if(name=="demoWin") {
		this.close();
	}
	popupWin = window.open(url, name, 'width=' + w + ',height=' + h + ',left=' + winX + ',top=' + winY + ',scrollbars=' + scroll + ',resizable=' + resize);
	popupWin.focus();
}

function isEmpty(varStr){
	var whitespace = " \t\n\r\f\v\b";
	for (var i = 0; i < varStr.length; i++){   
		var c = "" + varStr.charAt(i);
		if (whitespace.indexOf(c) == -1) 
    	return false;
	}
	return true;
}

function showSWMovie(){
	// make sure it's IE and not Opera
	if (IEShockwave && !NNShockwave) {
		document.write('<object class="noprint" classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000"');
		document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"');
		document.write('id="Eye_Random_01" width="200" height="120">');
		document.write('<param name="src" value="movingeye.dcr" />');
		document.write('<param name="swStretchStyle" value="fill" />');
		document.write('<param name="swRemote" value="swSaveEnabled=');
		document.write('"true" swVolume="true" swRestart="true" ');
		document.write('swPausePlay="true" swFastForward="true" swContextMenu="true" />');
		document.write('<param name="bgColor" value="#ffffff" />');
		document.write('</object>');
		document.write('<img class="noscreen" src="images/eye_bg.gif" width="272" height="118" align="right" border="0" alt="" />');
	} else if (NNShockwave) {
		document.write('<embed class="noprint" src="movingeye.dcr"');
		document.write(' bgColor=#ffffff  width=200 height=118 swStretchStyle=fill ');
		document.write('swRemote="');
		document.write("swSaveEnabled='true' swVolume='true' swRestart='true' swPausePlay='true' swFastForward='true' swContextMenu='true' ");
		document.write('"');
		document.write(' type="application/x-director" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveDirector">');
		document.write('</embed>');
		document.write('<img class="noscreen" src="images/eye_bg.gif" width="272" height="118" align="right" border="0" alt="" />');
	} else if (!IEShockwave && !NNShockwave){
		document.write('<img src="images/spacer.gif" width="1" height="1" border="0" alt="" />');
	}
}

function showSWButton(){
	if (!IEShockwave && !NNShockwave) {
		document.write('</td>');
		document.write('</tr>');
		document.write('<tr>');
		document.write('<td class="sidenav"><a class="shockwave" href="getshockwave.html">');
		document.write('get shockwave player</a>');
	}
}

//	TO RESIZE THE CURRENT WINDOW
function resizeWindow(w,h) {
	if(document.layers) {
		window.innerWidth=w;
		window.innerHeight=h;
	}
	else {
		window.resizeTo(w,h);
	}
}


// TESTING FOR NETSCAPE
var NS4 = false;
if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
	NS4 = true;
}

//	NETSCAPE 4 NOTICE
function showNS4Notice() {
	if (NS4) {
		document.write('<table width="551" align="center" class="warning" bgcolor="#ffffff" border="1" cellpadding="5" cellspacing="0">');
		document.write('<tr>');
		document.write('<td>');
		document.write('<p><strong>Limitations of Netscape 4</strong><br />');
		document.write('If you see this message, it indicates that you are using Netscape 4 as your browser. ');
		document.write('Please note that while this browser will display the main content of the 2Cin3D site ');
		document.write('adequately, some of the presentation effects and formatting will be lost. ');
		document.write('Also, due to a "bug" in Netscape 4, pages containing dynamically created text ');
		document.write('cannot be printed. Thus <strong>you will probably not be able to print pages from this site</strong>.');
		document.write('</p></td>');
		document.write('</tr>');
		document.write('</table>');
	}
}