function newItem(expiryDate) {
	exp = new Date(expiryDate);
	cur = new Date();
	if (cur.getTime() < exp.getTime())
		document
				.write("<IMG SRC=\"images/new.gif\" WIDTH=30 HEIGHT=14 BORDER=0 ALT=\"new\">");
}

function updatedItem(expiryDate) {
	exp = new Date(expiryDate);
	cur = new Date();
	if (cur.getTime() < exp.getTime())
		document
				.write("<IMG SRC=\"images/updated.gif\" WIDTH=70 HEIGHT=14 BORDER=0 ALT=\"updated\">");
}

function expiringText(text, expiryDate) {
	exp = new Date(expiryDate);
	cur = new Date();
	if (cur.getTime() < exp.getTime())
		document.write(text);
}

function showmenu(elmnt) {
	if (screen.width < 1024) {
		if (elmnt == 'aboutus') {
			document.getElementById(elmnt).style.left = 598;
		}
	}

	document.getElementById(elmnt).style.visibility = "visible";
}

function hidemenu(elmnt) {
	document.getElementById(elmnt).style.visibility = "hidden";
}

function over(img) {
	document.getElementById(img).src = "images/" + img + "_hover.gif";
}

function out(img) {
	document.getElementById(img).src = "images/" + img + ".gif";
}

var TheImgWin1 = null;

function goImgWin(myImage, myWidth, myHeight, origLeft, origTop) {

	if (TheImgWin1) {

		if (false == TheImgWin1.closed) {

			TheImgWin1.close();
			TheImgWin1 = null;
		}

	}

	TheImgWin1 = window.open(myImage, '_blank', 'height=' + myHeight
			+ ',width=' + myWidth + ',toolbar=no,directories=no,status=no,'
			+ 'menubar=no,scrollbars=no,resizable=no');

	TheImgWin1.moveTo(origLeft, origTop);

}

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		};
	}
}

function prepareInputsForHints() {
	var inputs = document.getElementsByTagName("input");
	for ( var i = 0; i < inputs.length; i++) {
		inputs[i].onfocus = function() {
			if ((typeof(this.parentNode.getElementsByTagName("span")[0]) != 'undefined') && 
				(this.parentNode.getElementsByTagName("span")[0] != null)) {
			    this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
			}
		};
		inputs[i].onblur = function() {
			if ((typeof(this.parentNode.getElementsByTagName("span")[0]) != 'undefined') && 
				(this.parentNode.getElementsByTagName("span")[0] != null)) {
			    this.parentNode.getElementsByTagName("span")[0].style.display = "none";
			}
		};
	}
	var selects = document.getElementsByTagName("select");
	for ( var k = 0; k < selects.length; k++) {
		selects[k].onfocus = function() {
			if ((typeof(this.parentNode.getElementsByTagName("span")[0]) != 'undefined') && 
				(this.parentNode.getElementsByTagName("span")[0] != null)) {
			    this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
			}
		};
		selects[k].onblur = function() {
			if ((typeof(this.parentNode.getElementsByTagName("span")[0]) != 'undefined') && 
				(this.parentNode.getElementsByTagName("span")[0] != null)) {
			    this.parentNode.getElementsByTagName("span")[0].style.display = "none";
			}
		};
	}
}

addLoadEvent(prepareInputsForHints);

