﻿// JScript File

function c4load(url) {
	if(url.substring(0,11) == 'javascript:')
	    eval(unescape(url.substring(11)));
	else if (url == 'http://')
	    return;
	else if (url != '')
	    document.location.href = url;
}

function popup(url, width, height, scrollbars, extras) {
	if(extras!=null)
		extras = ',' + extras;
	else
		extras = ',' + 'locationbar=0,menubar=0,statusbar=0,toolbar=0,status=0,location=0,resizable=no';
	newwin = window.open(url, '','width=' + width +',height=' + height + ', scrollbars=' + scrollbars + extras);
	newwin.focus();
}


function createFlash(flashPath, width, height) {
    document.write('<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="'+ width +'" height="'+ height +'" id="case_smooth" align="middle">' +
	'<param name="allowScriptAccess" value="sameDomain" />' +
	'<param name="movie" value="'+ flashPath +'" />' +
	'<param name="quality" value="best" />' +
	'<param name="bgcolor" value="#ffffff" />' +
	'<embed src="'+ flashPath +'" quality="best" bgcolor="#ffffff" width="'+ width +'" height="'+ height +'" name="case_smooth" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
	'</object>\n');
}

function c4SubmitOnEnter(btn)
{
    // process only the Enter key
    if (event.keyCode == 13)
    {
        // cancel the default submit
        event.returnValue=false;
        event.cancel = true;
        if(btn != null) {
			// submit the form by programmatically clicking the specified button
			btn.click();
        }
        else {
			//submit the form without button click
			document.forms[0].submit();
        }
    }
}


function switchElement(id1, id2) {
	document.getElementById(id1).style.display="none";
	document.getElementById(id2).style.display="block";
}


function initialize() {
	if(document.getElementById("map")) {
		loadMap();
	}
}

function unload() {
	if(document.getElementById("map"))
		GUnload();
}