// Hello! 


function NewWindow(mypage,windowName,width,height) {
	window.open(mypage,windowName,'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,width='+width+',height='+height+',resizable=0');
}

// centered window pop
// sample: <a href="newPage.html" onclick="NewWindow(this.href,'name','200','100','yes');return false">link</a>

var win = null;
function CenteredWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}


// blur links  
// call onload or for singles just use onfocus="if(this.blur)this.blur()"

function BlurLinks(){
	if(document.getElementById){
    		lnks=document.getElementsByTagName('a');
    		for(i=0;i<lnks.length;i++){
    			lnks[i].onfocus=new Function("if(this.blur)this.blur()");
    		}
	}
}

// menus

function show(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
}

// mm rollovers

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// a preloader, if needed
// preload( '01.gif', '02.gif' ); 

function preload()
{ 
  var args = preload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}

// resume database pop-up:

//Set loginWin to null
loginWin = null;
function OpenLoginWindow(pagename)
{
  //Close any open login window
  CloseLoginWindow();
  //Open a new login window
  loginWin = window.open('' + pagename,'loginWindow','toolbar=no,location=no,directories=no,scrollbars=no,resizable=no,width='+350+',height='+220);
}
function CloseLoginWindow()
{
  if(loginWin != null){
    //Close the current login window
    if(!loginWin.closed){
      loginWin.close();
    }
  }
}


//  simple rollovers

function mSetup() {
	var img, sh, sn, sd
	for (var i = 0; (img = document.images[i]); i++) {
		if (img.getAttribute) {

			sn = img.getAttribute("src");
			sh = img.getAttribute("hsrc");
			sd = img.getAttribute("dsrc");

			if (sn != "" && sn != null) {
				img.n = new Image();
				img.n.src = img.src;
			
				if (sh != "" && sh != null) {
					img.h = new Image();
					img.h.src = sh;
					img.onmouseover = mSwapOn
					img.onmouseout  = mSwapOff
				}

				if (sd != "" && sd != null) {
					img.d = new Image();
					img.d.src = sd;
					img.onmousedown = mSwapDown
				}
			}
		}
	}
}

function mSwapOn() {
	this.src = this.h.src;
}

function mSwapOff() {
	this.src  = this.n.src;
}

function mSwapDown() {
	this.src  = this.d.src;
	this.temp = typeof(document.onmouseup) != 'undefined' && typeof(document.onmouseup) != 'unknown' ? document.onmouseup : "";
	mSwapUp.img = this;
	document.onmouseup = mSwapUp;
}

function mSwapUp() {
	var ths = mSwapUp.img;
	ths.src = ths.n.src;
	if (ths.temp) document.onmouseup = ths.temp;
}

window.onload = mSetup;