function hover(who, baseClass, what) {
	var current;
	
	eval('current = who.className.match(/(Sel)?'+baseClass+'(Hover)?/);');
	current = current[0];
	
	if(what && current && current.search(/Hover$/) == -1) {
		eval('who.className = who.className.replace(/'+current+'/, "'+current+'Hover");');
	} else if(!what && current && current.search(/Hover$/) != -1) {
		eval('who.className = who.className.replace(/'+current+'/, "'+current.replace(/Hover$/, '')+'");');
	}
}

function select(who, baseClass, what) {
	var current;
	
	eval('current = who.className.match(/(Sel)?'+baseClass+'(Hover)?/);');
	current = current[0];
	
	if(what && current && current.search(/^Sel/) == -1) {
		eval('who.className = who.className.replace(/'+current+'/, "Sel'+current+'");');
	} else if(!what && current && current.search(/^Sel/) != -1) {
		eval('who.className = who.className.replace(/'+current+'/, "'+current.replace(/^Sel/, '')+'");');
	}
}

function parseStr(str) {
	var first = str.split('&');
	var data = new Array();
	
	for(var i = 0; i < first.length; i++) {
		var last = first[i].split('=');
		
		data[last[0]] = last[1];
	}
	
	return data;
}

function outputPNG(imgSource, hoverSource, width, height, title) {	
	var isIE = (navigator.appName == "Microsoft Internet Explorer" && navigator.userAgent.indexOf('Opera') == -1);
	if(isIE) {
		// filter for MSIE 6.x and 5.5
		var ie6xFilter = /^.*MSIE [6]\.[0-9].*$/;
		var ie55Filter = /^.*MSIE [5].*$/;
		if (ie6xFilter.test(navigator.userAgent) || ie55Filter.test(navigator.userAgent)) {
			if (hoverSource) {
				document.write('<img src="images/pixel.gif" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='+imgSource+');" onmouseover="this.filters(0).src=\''+hoverSource+'\';" onmouseout="this.filters(0).src=\''+imgSource+'\';" width="'+width+'" height="'+height+'" alt="'+title+'" title="'+title+'">');
			}
			else {
				document.write('<img src="images/pixel.gif" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='+imgSource+');" width="'+width+'" height="'+height+'" alt="'+title+'" title="'+title+'">');
			}
		}
		else {
			if (hoverSource) {
				document.write('<img src="'+imgSource+'" onmouseover="this.src=\''+hoverSource+'\';" onmouseout="this.src=\''+imgSource+'\';" width="'+width+'" height="'+height+'" alt="'+title+'" title="'+title+'">');	 
			}
			else {
				document.write('<img src="'+imgSource+'" width="'+width+'" height="'+height+'" alt="'+title+'" title="'+title+'">');	 
			}
		}
	}
	else {
		if (hoverSource) {
			document.write('<img src="'+imgSource+'" onmouseover="this.src=\''+hoverSource+'\';" onmouseout="this.src=\''+imgSource+'\';" width="'+width+'" height="'+height+'" alt="'+title+'" title="'+title+'">');	 
		}
		else {
			document.write('<img src="'+imgSource+'" width="'+width+'" height="'+height+'" alt="'+title+'" title="'+title+'">');	 
		}
	}
}

function checkJS(what, where) {
	var needLoad;
	eval('needLoad = !document.'+what+';');
	if(needLoad)
		evalJSFrom(where);
}

function evalJSFrom(url) {
	var data = getPageDataDirect(url);
	
	if(data != null)
		eval(data);
}

function preload(imagePathArray) {
	var imageArray = new Array();
	for (var i = 0; i < imagePathArray.length; i++) {
		var nextImage = new Image();
		nextImage.src = imagePathArray[i];
		imageArray.push(nextImage);
	}
	return imageArray;
}
