function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		preloadFlag = true;
	}
}

//-----------------------------------------------------------------------------------------------------
// This is the implementation of SimpleSwap
// by Jehiah Czebotar
// Version 1.1 - June 10, 2005
//
// Include this script on your page
// then make image rollovers simple like:
// <img src="/images/ss_img.gif" oversrc="/images/ss_img_over.gif">
//
// http://jehiah.com/archive/simple-swap
// 


function SimpleSwap(el,which){
	el.src=el.getAttribute(which || "origsrc");
}

function SimpleSwapSetup(){
	var x = document.getElementsByTagName("img");
	for (var i=0;i<x.length;i++){
		var oversrc = x[i].getAttribute("oversrc");
		if (!oversrc) continue;
		// preload image
		// comment the next two lines to disable image pre-loading
		x[i].oversrc_img = new Image();
		x[i].oversrc_img.src=oversrc;
		// set event handlers
		x[i].onmouseover = new Function("SimpleSwap(this,'oversrc');");
		x[i].onmouseout = new Function("SimpleSwap(this);");
		// save original src
		x[i].setAttribute("origsrc",x[i].src);
	}
}

var PreSimpleSwapOnload =(window.onload)? window.onload : function(){};
window.onload = function(){PreSimpleSwapOnload(); SimpleSwapSetup();}
//-----------------------------------------------------------------------------------------------------\\

function showdivbyid(idshow,classgroup) 
{
	var myregexp = new RegExp(classgroup);
	var divs = document.getElementsByTagName('div');
	for(i=0;i<divs.length;i++)
	{
		if (myregexp.exec(divs[i].className)) // if the div classname matches the given class then decide whether to show or hide it
		{
			if(divs[i].id.match(idshow)) //if the div ID equals the idshowed value then show it
			{
				if (document.getElementById) // DOM3 = IE5, NS6
					divs[i].style.display="block";// show/hide
				else
					if (document.layers) // Netscape 4
						document.layers[divs[i]].display = 'block';
					else // IE 4
						document.all.divs[i].display = 'block';
			} 
			else //otherwise hide it
			{
				if (document.getElementById)
					divs[i].style.display="none";
				else
					if (document.layers) // Netscape 4
						document.divs[i].display = 'none';
					else // IE 4
						document.all.divs[i].display = 'none';
			}
		}
	}
}

//show & hide
 function showMenu( targetId ){
  if (document.getElementById){
        target = document.getElementById( targetId );
          target.style.display = "block";
     }
} 
function hideMenu( targetId ){
  if (document.getElementById){
        target = document.getElementById( targetId );
          target.style.display = "none";
     }
} 
//-----------------------------------------------------------------------------------------------------
function zPopWindow(zURL,zName,xSize,ySize,zOptLevel) {
	// a zOptLevel value of 1 yields a window with no ornamentation, bars, menus etc
	// a zOptLevel value of 2 yields the same window as 1, but with scroll bars
	// a zOptLevel value of 3 (or nothing, or anything but 1 or 2) yields a window with full menus, etc
	W = screen.width;
	H = screen.height;
	if (!xSize) { xSize = W / 1.25; }
	if (!ySize) { ySize = H / 1.25; }
	if (!zName) { zName = "NewWindow"; }
	xPos = (W - xSize) / 2;
	yPos = (H - ySize) / 2;

	if (zOptLevel == 1) {
		var zWinOpts = 'height=' + ySize + ',width=' + xSize + ',left=' + xPos + ',top=' + yPos + 'screenX=' + xPos + ',screenY=' + yPos;
	} else if  (zOptLevel == 2) {
		var zWinOpts = 'height=' + ySize + ',width=' + xSize + ',scrollbars=yes,left=' + xPos + ',top=' + yPos + 'screenX=' + xPos + ',screenY=' + yPos;
    } else {
		var zWinOpts = 'height=' + ySize + ',width=' + xSize + ',resizable=yes,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,left=' + xPos + ',top=' + yPos + 'screenX=' + xPos + ',screenY=' + yPos;
	}

	var PopWin = window.open(zURL,zName,zWinOpts);

}
//-----------------------------------------------------------------------------------------------------