
var BROWS_DOM = document.getElementById ? true : false;
var BROWS_IE  = document.all ? true : false;
var BROWS_NS4 = document.layers ? true : false;

function showHide_Section(elList)
{
	if(!(BROWS_DOM||BROWS_IE||BROWS_NS4)) return true;
	if(BROWS_NS4&&(toggleBy=="tag")) return true;
	for(var i=0; i<elList.length; i++)
	{
		var ElementsToToggle = [0];
		ElementsToToggle[0] = (BROWS_DOM) ? document.getElementById(elList[i]) : (BROWS_IE) ? document.all(elList[i]) : document.layers[elList[i]];
		
		for(var j=0; j<ElementsToToggle.length; j++)
		{
			var theElement = ElementsToToggle[j];
			if(!theElement) continue;
			if(BROWS_DOM||BROWS_IE)
			{
				if(theElement.style.visibility != "hidden")
				{
					theElement.style.visibility = "hidden";
					theElement.style.display = "none";
				}

				else
				{
					theElement.style.visibility = "visible";
					theElement.style.display = "inline";
				}

			}
			else
			{
				if(theElement.visibility == "hide")
				{
					theElement.visibility = "inherit";
					theElement.display = "inline";
				}
				else
				{
					theElement.visibility = "hide";
					theElement.display = "none";
				}
			}
		}
	}
	return true;
}


function autofitIframe(id){
	if (!window.opera && !document.mimeType && document.all && document.getElementById){
		parent.document.getElementById(id).style.height=this.document.body.offsetHeight+10+"px";
	}
	else if(document.getElementById) {
		parent.document.getElementById(id).style.height=this.document.body.scrollHeight+10+"px"
	}
}

function SelectChange(select) {
	if (select[select.selectedIndex].value!="-1")
	{
		location.href = select[select.selectedIndex].value;
	}
}

function breakout_of_frame()
{
  if (top.location != location) {
    top.location.href = document.location.href ;
  }
}

function isEmail(who) {
	var email=/^[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*@[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*\.([A-Za-z]){2,4}$/i;
	return(email.test(who));
}

function NewWindow(url)
{
	var m_nHeight;
	var m_nWidth;

	m_nWidth = screen.width - 200;
	m_nHeight = screen.height - 200;
	
	options = 'toolbar=yes,location=yes,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=' + m_nWidth + ',height=' + m_nHeight + '';
    window.open(url,"previewPane",options);
}

function popNewWindow(m_sName,m_sUrl,m_sHeight,m_sWidth,m_sScroll)
{
	m_sOptions = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + m_sScroll + ',resizable=no,width=' + m_sWidth + ',height=' + m_sHeight + ',copyhistory=no';
    window.open(m_sUrl,m_sName,m_sOptions);
}

function checkMailingListForm()
{
	var m_oFrmObject;
	m_oFrmObject = document.frmForm;
	
	var m_txtEmail = m_oFrmObject.elements['email'].value;
	if (!(isEmail(m_txtEmail)))
	{
		alert("Please enter a valid email address.");
		return false;
	}
	
	return true;
}


// Compare two options within a list by VALUES
function compareOptionValues(a, b) 
{ 
  // Radix 10: for numeric values
  // Radix 36: for alphanumeric values
  var sA = parseInt( a.value, 36 );  
  var sB = parseInt( b.value, 36 );  
  return sA - sB;
}



// Compare two options within a list by TEXT
function compareOptionText(a, b) 
{ 
  // Radix 10: for numeric values
  // Radix 36: for alphanumeric values
  var sA = parseInt( a.text, 36 );  
  var sB = parseInt( b.text, 36 );  
  return sA - sB;
}
// Dual list move function

function moveDualList( srcList, destList, moveAll ) 
{
  // Do nothing if nothing is selected
  if (  ( srcList.selectedIndex == -1 ) && ( moveAll == false )   )
  {
    return;
  }

  newDestList = new Array( destList.options.length );

  var len = 0;

  for( len = 0; len < destList.options.length; len++ ) 
  {
    if ( destList.options[ len ] != null )
    {
      newDestList[ len ] = new Option( destList.options[ len ].text, destList.options[ len ].value, destList.options[ len ].defaultSelected, destList.options[ len ].selected );
    }
  }

  for( var i = 0; i < srcList.options.length; i++ ) 
  { 
    if ( srcList.options[i] != null && ( srcList.options[i].selected == true || moveAll ) )
    {
	   if (srcList.options[i].value != 0)
	   {
       	// Incorporate into new list
       	newDestList[ len ] = new Option( srcList.options[i].text, srcList.options[i].value, srcList.options[i].defaultSelected, srcList.options[i].selected );
       }
	   len++;
    }
  }

  // Sort out the new destination list
  newDestList.sort( compareOptionValues );   // BY VALUES
  // Populate the destination with the items from the new array
  for ( var j = 0; j < newDestList.length; j++ ) 
  {
    if ( newDestList[ j ] != null )

    {
      destList.options[ j ] = newDestList[ j ];
    }

  }

  // Erase source list selected elements
  for( var i = srcList.options.length - 1; i >= 0; i-- ) 

  { 
    if ( srcList.options[i] != null && ( srcList.options[i].selected == true || moveAll ) )

    {
	   if (srcList.options[i].value != 0)
	   {
       srcList.options[i]       = null;
	   }
    }

  }



}




// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.

// SETUPS:
// ===============================

// Set the horizontal and vertical position for the popup

PositionX = 100;
PositionY = 100;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();		
}}
