var newWindow = null;
function closeWin(){
if (newWindow != null){
if(!newWindow.closed)
newWindow.close();
}
}

function popup(frm, winW, winH, offsetW, offsetH, thetitle, style){ 
closeWin();
if (style == 'pop') {
tools = "resizable,toolbar=no,location=no,scrollbars=yes,statusbar=0,menubar=no,width="+winW+",height="+winH+",left="+offsetW+",top="+offsetH; 
}
else
tools = "resizable,toolbar=no,location=no,scrollbars=yes,menubar=no,statusbar=0,width="+winW+",height="+winH+",left="+offsetW+",top="+offsetH; 

win = window.open('',thetitle,tools); 
frm.target = thetitle; 
win.focus();
} 

// global flashinstalled may be modified later by VBScript
var flashinstalled = 0;

function detectflash () {


var flashversion = 0;
MSDetect = "false";
if (navigator.plugins && navigator.plugins.length)
{
	x = navigator.plugins["Shockwave Flash"];
	if (x)
	{
		flashinstalled = 2;
		if (x.description)
		{
			y = x.description;
			flashversion = y.charAt(y.indexOf('.')-1);
		}
	}
	else
		flashinstalled = 1;
	if (navigator.plugins["Shockwave Flash 2.0"])
	{
		flashinstalled = 2;
		flashversion = 2;
	}
}
else if (navigator.mimeTypes && navigator.mimeTypes.length)
{
	x = navigator.mimeTypes['application/x-shockwave-flash'];
	if (x && x.enabledPlugin)
		flashinstalled = 2;
	else
		flashinstalled = 1;
}
else
	MSDetect = "true";
  
}


function draw_swf(file, staticfile, width, height) {



if (flashinstalled == 2 ) {


	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"  ID="script" WIDTH="'+width+'" HEIGHT="'+height+'" >');
	document.write(' <PARAM NAME=movie VALUE="'+file+'"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>'); 
	document.write(' <EMBED src="'+file+'" quality=high bgcolor=#FFFFFF swLiveConnect=FALSE WIDTH="'+width+'" HEIGHT="'+height+'" NAME="script"  TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
	document.write(' </EMBED>');
	document.write('</OBJECT>');
} else{

	document.write('<IMG SRC="'+staticfile+'" WIDTH="'+width+'" HEIGHT="'+height+'" BORDER=0 >');
}

}

function mapToggle () {

if (document.newmap.enlarge != null) {
 
  if (document.newmap.enlarge.value == '0') {
   document.newmap.enlarge.value = 'Y';
  }
  else {
  	document.newmap.enlarge.value = '0';
  }  
}
else {
  document.newmap.enlarge.value = '0';
}
  
document.newmap.submit();
return true;

}
function maskToggle () {

if (document.newmap.landmask != null) {
 
  if (document.newmap.landmask.value == '0') {
   document.newmap.landmask.value = '1';
  }
  else {
  	document.newmap.landmask.value = '0';
  }  
}
else {
  document.newmap.landmask.value = '1';
}
  
document.newmap.submit();
return true;

}



/* MouseOver Button Wizard by Mike Cullen
EMAIL ME AT mcullen1@hotmail.com or visit http://www.mobw.net */
var browser     = '';
var version     = '';
var entrance    = '';
var cond        = '';
// BROWSER
if (browser == ''){
if (navigator.appName.indexOf('Microsoft') != -1)
browser = 'IE'
else if (navigator.appName.indexOf('Netscape') != -1)
browser = 'Netscape'
else browser = 'NN';
}
// VERSION?
if (version == ''){
version= navigator.appVersion;
paren = version.indexOf('(');
whole_version = navigator.appVersion.substring(0,paren-1);
version         = parseInt(whole_version);
}
// BROWSER & VERSION
if (browser == 'IE' && version >= 4) entrance = 'yes';
if (browser == 'IE' && version < 4) entrance = 'no';
if (browser == 'Netscape' && version >= 2.02) entrance = 'yes';
if (browser == 'Netscape' && version < 2.02) entrance = 'no';

if (entrance=='yes'){
littleeartha = new Image;littleeartha.src="http://www.obis.org.au/admin/csquares/worldicon.gif";
littleearthb = new Image;littleearthb.src="http://www.obis.org.au/admin/csquares/worldicon_over.gif";

csqa = new Image; csqa.src="http://www.obis.org.au/admin/csquares/csq_map_base_01.jpg";
csqb = new Image;csqb.src="http://www.obis.org.au/admin/csquares/csq_map_over_01.jpg";
csq02a = new Image;csq02a.src="http://www.obis.org.au/admin/csquares/csq_map_base_02.jpg";
csq02b = new Image;csq02b.src="http://www.obis.org.au/admin/csquares/csq_map_over_02.jpg";
csq03a = new Image;csq03a.src="http://www.obis.org.au/admin/csquares/csq_map_base_03.jpg";
csq03b = new Image;csq03b.src="http://www.obis.org.au/admin/csquares/csq_map_over_03.jpg";
csq04a = new Image;csq04a.src="http://www.obis.org.au/admin/csquares/csq_map_base_04.jpg";
csq04b = new Image;csq04b.src="http://www.obis.org.au/admin/csquares/csq_map_over_04.jpg";
csq06a = new Image;csq06a.src="http://www.obis.org.au/admin/csquares/csq_map_base_06.jpg";
csq06b = new Image;csq06b.src="http://www.obis.org.au/admin/csquares/csq_map_over_06.jpg";
csq07a = new Image;csq07a.src="http://www.obis.org.au/admin/csquares/csq_map_base_07.jpg";
csq07b = new Image;csq07b.src="http://www.obis.org.au/admin/csquares/csq_map_over_07.jpg";
csq08a = new Image;csq08a.src="http://www.obis.org.au/admin/csquares/csq_map_base_08.jpg";
csq08b = new Image;csq08b.src="http://www.obis.org.au/admin/csquares/csq_map_over_08.jpg";
csq09a = new Image;csq09a.src="http://www.obis.org.au/admin/csquares/csq_map_base_09.jpg";
csq09b = new Image;csq09b.src="http://www.obis.org.au/admin/csquares/csq_map_over_09.jpg";
}

function lighten(imgName) {
if (entrance == 'yes'){
imgOn = eval(imgName + 'b.src');
document[imgName].src = imgOn;
}
}
function darken(imgName) {
if (entrance == 'yes'){
imgOff = eval(imgName + 'a.src');
document[imgName].src = imgOff;
}


}



