ns4 = (document.layers)? true:false
dom = (document.all)? true:false
ie5=navigator.userAgent.indexOf('MSIE 5')>0?true:false;

var collection="";
var styleObj="";
if (dom) {
	collection="all.";
	styleObj=".style";
	}

//**********image swapping**********


// Image swapping
function on(name){
if (document.images) {
obj=eval(document.images[name]);
switcher=eval(name+"_on");
obj.src=switcher.src;
}
}

function off(name){
if (document.images) {
obj=eval(document.images[name]);
switcher=eval(name+"_off");
obj.src=switcher.src;
}
}

//**********makes drop-down anchors work**********
function doSel(obj)
{
   for (i = 1; i < obj.length; i++)
      if (obj[i].selected == true)
        eval(obj[i].value);
}

//**********page height**********
function adjustLayout()
{
  // Get natural heights
  var cHeight = xHeight("container");  
  var lHeight = xHeight("sidebar");
  var rHeight = xHeight("main");
  var zHeight = xHeight("right2");
  //var tHeight = 200 + "px";
  
  // Find the maximum height
  var maxHeight =
    Math.max(cHeight, lHeight, rHeight, zHeight);

  //var maxHeight = maxHeight + tHeight;
  
  // Assign maximum height to all columns
  xHeight("container", maxHeight);  
  xHeight("sidebar", maxHeight);
  xHeight("main", maxHeight);
  xHeight("right2", maxHeight); 

  // Show the footer
  xShow("footer");
}

window.onload = function()
{
  xAddEventListener(window, "resize",
    adjustLayout, false);
  adjustLayout();
}
//**********page height**********

//**********popup window size and conditions**********


	// Everything uses this baby
function getObject(obj) {
	var theObj;
	if (typeof obj=="string") {
		theObj= eval("document." + collection + obj + styleObj);
	}
	else {
		theObj=obj;
	}
	return theObj;
}

function show(obj) {
	var theObj=getObject(obj);
	theObj.visibility='visible';
}
	
function hide(obj) {
	var theObj=getObject(obj);
	theObj.visibility='hidden';
}

function moveTo(obj,xL,yL) {
        obj.left = xL;
        obj.top = yL;
}


function popup(path,winName){
	//Ignore winName
	popDialog=window.open(path,'winName',"width=550,height=375,scrollbars=auto,resizable=no,menubar=no,top=10,left=20,marginwidth=0,marginheight=0");
	setTimeout("popDialog.focus()",200);
}

function popup2(path,winName){
	//Ignore winName
	popDialog2=window.open(path,'winName2',"width=550,height=425,scrollbars=auto,resizable=no,menubar=no,top=10,left=10");
	setTimeout("popDialog2.focus()",200);
}

function popup3(path,winName){
	//Ignore winName
	popDialog3=window.open(path,'winName3',"width=400,height=340,scrollbars=yes,resizable=no,menubar=no,top=10,left=30");
	setTimeout("popDialog3.focus()",200);
}

function popup4(path,winName){
	//Ignore winName
	popDialog3=window.open(path,'winName3',"width=550,height=525,scrollbars=auto,resizable=no,menubar=no,top=10,left=30");
	setTimeout("popDialog3.focus()",200);
}

function popup_link(path,winName){
	//Ignore winName
	popDialog4=window.open(path,'winName4',"width=800,height=400,scrollbars=yes,resizable=yes,menubar=yes,top=10,left=30,toolbar=yes,location=yes");
	setTimeout("popDialog4.focus()",200);
}

function med_popup(path,winName){
	//Ignore winName
	popDialog3=window.open(path,'winName',"width=540,height=550,scrollbars=yes,resizable=yes,menubar=no,top=10,left=30");
	setTimeout("popDialog3.focus()",200);
}

function player(path,winName){
	//Ignore winName
	popDialog3=window.open(path,'winName',"width=240,height=560,scrollbars=yes,resizable=yes,menubar=no,top=10,left=30");
	setTimeout("popDialog3.focus()",200);
}

function medlarge_popup(path,winName){
	//Ignore winName
	popDialog3=window.open(path,'winName3',"width=560,height=350,scrollbars=auto,resizable=no,menubar=no,top=10,left=30");
	setTimeout("popDialog3.focus()",200);
}

function small_popup(path,winName){
	//Ignore winName
	popDialog3=window.open(path,'winName',"width=550,height=225,scrollbars=auto,resizable=no,menubar=no,top=10,left=30");
	setTimeout("popDialog3.focus()",200);
}

function large_popup(path,winName){
	//Ignore winName
	popDialog3=window.open(path,'winName3',"width=550,height=550,scrollbars=auto,resizable=no,menubar=no,top=10,left=30");
	setTimeout("popDialog3.focus()",200);
}
 
function map_popup(path,winName){
	//Ignore winName
	popDialog3=window.open(path,'winName3',"width=500,height=350,scrollbars=auto,resizable=no,menubar=no,top=10,left=30");
	setTimeout("popDialog3.focus()",200);
}
 
function xsmall_popup(path,winName){
	//Ignore winName
	popDialog3=window.open(path,'winName',"width=250,height=220,scrollbars=no,resizable=no,menubar=no,top=10,left=30");
	setTimeout("popDialog3.focus()",200);
}

function largescroll_popup(path,winName){
	//Ignore winName
	popDialog3=window.open(path,'winName3',"width=540,height=550,scrollbars=yes,resizable=no,menubar=no,top=10,left=30");
	setTimeout("popDialog3.focus()",200);
}

function largescroll_popup2(path,winName){
	//Ignore winName
	popDialog3=window.open(path,'winName3',"width=650,height=500,scrollbars=yes,resizable=no,menubar=no,top=10,left=30");
	setTimeout("popDialog3.focus()",200);
}


function writeTextInput(){
 var size;
 navigator.appName=="Netscape"?size=10:size=20;
 document.write('<input type="text" size="'+size+'">');
}
 
function writeTextInput1(){
 var size;
 navigator.appName=="Netscape"?size=14:size=14;
 document.write('<table border="0" cellpadding="0" cellspacing="0" width="115"><tr><td><form method="get" action="http://search.atomz.com/search/"><input type="hidden" name="sp_a" value="sp1003bc69"><input size="'+size+'" name="sp-q"></td></tr><tr><td valign="top" align="right"><input type="image" value="submit" img src="http://www.greentortoise.com/images/b_go_r.gif" width="49" height="26" alt="Submit query" border="0" align="right"></td></tr></table><input type="hidden" name="sp_p" value="all"><input type="hidden" name="sp_f" value="ISO-8859-1"></form>');
} 
   
         
function writeTextarea(){
 var size;
 navigator.appName=="Netscape"?cols=25:cols=35;
 navigator.appName=="Netscape"?rows=5:rows=5;
 document.write('<textarea rows="'+rows+'" cols="'+cols+'" wrap="virtual"></textarea>');
}


// ***** SELECT JUMP ***** 
function doSel(obj)
{
   for (i = 1; i < obj.length; i++)
      if (obj[i].selected == true)
        eval(obj[i].value);
}

