/* Window Popup Library */
function popup(mylink, windowname, width, height, params) {
	if( !window.focus )
		return false;
	
	var href = mylink;
	
	if( typeof(href) != 'string' )
		href=href.href;
	
	if( params==null )
		params = "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=1,resizable=no,directories=no,location=no";
		
	if( width==null )
		width=640;
	if( height==null )
		height=503;
		
	params += ",width=" + width + ",height=" + height;
	
	var popup = window.open(href, windowname, params);
	if( popup==null ) {
		location.href=href;
		
		return true;
	}
	
	if(popup.opener == null) { popup.opener = self; }
	
	popup.focus();
	
	return false;
}


/* Validation */

    function validCharSet(str,charset) {
      for (var i=0;i<str.length;i++)
	if (charset.indexOf(str.substr(i,1))<0)
    	  return false;
      return true;
    }

    function allDigits(str) {
      return validCharSet(str,"0123456789");
    }


/* Image Rollovers */

    function rollSetup() {
	var img, hover, norm, down
	for (var i = 0; (img = document.images[i]); i++) {
		if (img.getAttribute) {

			norm = img.getAttribute("src");
			hover = img.getAttribute("hsrc");
			down = img.getAttribute("dsrc");

			if (norm != "" && norm != null) {
				img.n = new Image();
				img.n.src = img.src;
			
				if (hover != "" && hover != null) {
					img.h = new Image();
					img.h.src = hover;
					img.onmouseover = rollSwapOn
					img.onmouseout  = rollSwapOff
				}

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

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

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

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

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

