/*	
	================
	theWorkshop 2003
	================
*/
var GENLIB_revision = 1
/*
- created 8/8/2003 17:10:12 ME
*/

function Highlighter() {
	this.ignoreObjectName = null;
	this.lowlightClass = ''
	this.highlightClass = ''
	this.mouseOver = Highlighter_mouseOver
	this.mouseOut = Highlighter_mouseOut
	this.highlight = Highlighter_highlight
	this.lowlight = Highlighter_lowlight
}

function Highlighter_mouseOver(obj) {

	if (obj.name != this.ignoreObjectName) this.highlight(obj)
}

function Highlighter_mouseOut(obj) {

	if (obj.name != this.ignoreObjectName) this.lowlight(obj)
}

function Highlighter_highlight(obj) {

	if (obj.src) {
		insertImagePostFix(obj, "_over")
	} else {
		obj.className = this.highlightClass
	}
}

function Highlighter_lowlight(obj) {

	if (obj.src) {
		removeImagePostFix(obj, "_over")
	} else {
		obj.className = this.lowlightClass
	}
}

function insertImagePostFix(obj, postFix) {
	
	var tmp_src = obj.src
	if (tmp_src.indexOf(postFix) > 1) return
	var dotPos = tmp_src.lastIndexOf('.')

	tmp_src = tmp_src.substring(0, dotPos)+ postFix + tmp_src.substring(dotPos);
	obj.src = tmp_src
}

function removeImagePostFix(obj, postFix) {

	var tmp_src = obj.src
	if (tmp_src.indexOf(postFix) == -1) return
	var dotPos = tmp_src.lastIndexOf('.')

	tmp_src = tmp_src.substring(0, dotPos - postFix.length) + tmp_src.substring(dotPos);
	obj.src = tmp_src
}

function getObjRef(nme) {

	if (document.getElementById) {
		return document.getElementById(nme)
	} else {
		return document.all(nme)
	}
}

function swapImg(obj, src){

	if (typeof(obj) != "object") obj = getObjRef(obj)
	obj.src = src;
}


function openScrapBook(href){
	winWidth = screen.availWidth;
	winHeight = screen.availHeight;	
	var ratio = 0.43636;
	width = Math.round(winWidth - 50);
	height = Math.round(width * ratio);
	if (width > 1100){
		width = 1100
	}
	if (height > 480){
		height = 480
	}
	var top = (winHeight - height)/2;
	var left = (winWidth - width)/2;
	newWin = window.open(href,"scrapBook","directories=no,fullscreen=no,height="+height+",left="+left+",top="+top+",menubar=no,resizable=no,scrolling=no,status=no,titlebar=no,toolbar=no,width="+width+"");
	newWin.focus();
}

function openElScrapBook(href,width,height){
	if(width == ""){
		width = 635;
	}
	if(height == ""){
		height = 500;	
	}
	winWidth = screen.availWidth;
	if(width > winWidth) width = winWidth;
	newWin = window.open(href,"elScrapBook","directories=no,fullscreen=no,height="+height+",menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no,width="+width+"");
	newWin.location = href;
	newWin.resizeTo(width,height);
	newWin.focus();	
}

function preloadImage(imgSrc) {
	window.status = "Preloading image "+ imgSrc
	this.preloadedImages[imgSrc] = new Image()
	this.preloadedImages[imgSrc].src = imgSrc
	window.status = ""
}