var NONE  = 0x0000;
var TITLE = 0x0001;
var mb;
var undefined;
var lastImageUrl;
// **********
// ** returns the id of the event object
function getEventId(e) {
	e = (e) ? e : ((event) ? event : null);
return(((e.target) ? e.target : ((e.srcElement) ? e.srcElement : null)).id);
}
// *****
function getEventName(e) {
	e = (e) ? e : ((event) ? event : null);
return(((e.target) ? e.target : ((e.srcElement) ? e.srcElement : null)).name);
}
// *****
function getObj(obj, id) {
return(obj.getElementById(id));
}
// *****
function getVal(obj, id) {
return(obj.getElementById(id).value);
}
// *****
function setVal(obj, id, val) {
	obj.getElementById(id).value = val;
return(0);
}
// *****
function getAttr(obj, id, attr) {
return(getObj(obj, id).getAttribute(attr));
}
// *****
function setStyle(obj, id, attr, val) {
	getObj(obj, id).style.setAttribute(attr, val);
return(0);
}
// *****
function hideObj(obj, id) {
	getObj(obj, id).style.display = "none";
return(0);
}
// *****
function showObj(obj, id) {
	getObj(obj, id).style.display = "block";
return(0);
}
// *****
function QueryCB(sKey) {
return(QueryStr(sKey, window.clipboardData.getData("Text")));
}
// *****
function QueryURL(sKey) {
return(QueryStr(sKey, document.location));
}
// *****
function QueryStr(sKey, str) {
	var p1, p2, k = new String(sKey), s = new String(str);;
	k = k.toUpperCase();
	s = s.toUpperCase();
	p1 = s.indexOf(k) + k.length + 1;
	p2 = s.indexOf("&", p1);
	if (p2 == -1)
		p2 = s.length;
return(s.substring(p1, p2));
}
// *****
function IsDebug() {
	var ret = false;
	if (QueryURL("DEBUG") == "Y")
		ret = true;
return(ret);
}
// *****
function EventId(e) {
	if (IsNS4() == true) return(e.target.name);
	if (IsNS() == true)	return(e.currentTarget.name);
return(document.activeElement.name);
}
// *********
function OpenErrBox(h, w, msg) {
	var l, s = new String(msg);

    l = ((screen.width / 2) - (300 / 2)) - 12;
	t = (screen.availHeight / 2) - (100 / 2) - 100;
	if (IsIE() == true)
		mb = window.open("", "MsgBox", "left="+l+",top="+t+",dependent=yes,scrollbars=no,menubar=no,height="+h+",innerHeight=700,width="+w+",innerWidth="+w);
	  else
		mb = window.open("", "MsgBox", "screenX="+l+",screenY="+t+",dependent=yes,scrollbars=yes,menubar=no,height="+h+",width="+w);
return(mb);
}
// **********
function wmb(str) {
	mb.document.write(str);
return(0);
}
// **********
function wr(str) {
	document.write(str);
return(0);
}
// **********
function wrt(str) {
	document.write(str& "<br>")
return(0);
}
// **********
function GetListVal(lst) {
return(lst.options[lst.selectedIndex].value);
}
// **********
function GetListText(lst) {
return(lst.options[lst.selectedIndex].text);
}
// **********
function SetListIndex(lst, str) {
	var i;

	if (lst.name == "selRank")
		flag = true;

	for (i = 0; i < lst.length; ++i) {
		if (lst.options(i).value == str) {
			lst.selectedIndex = i;
			break;
		}
	}
return(lst.selectedIndex);
}
// ******************
function openPictureViewer(url){
	var win, windowSpecs;

	windowSpecs = 'titlebar=no, location=no,toolbar=no,status=no,menubar=no,scrollbars=no,width=500,height=450,resizable=yes,top=50,left=50';
//alert("I'm using the openPictureViewer in incCommon");
	win = window.open(url, 'ImageWindow', windowSpecs);
	win.focus();
}
// **********************
function openPictureEvent(e){
	var win, windowSpecs, url, name;

	name = getEventName(e);
	if (name == "../_pages/Pop_upPriceTable.asp" ){
		windowSpecs = 'titlebar=no, location=no,toolbar=false,status=no,menubar=no,scrollbars=no,width=250,height=300,resizable=no,top=50,left=50';
		url = name;
	} else {
		url = "../_images/" + name;
		windowSpecs = 'titlebar=no, location=no,toolbar=false,status=no,menubar=no,scrollbars=no,width=500,height=450,resizable=yes,top=50,left=50';
	}
//	alert(url);
	win = window.open(url, 'ImageWindow', windowSpecs);
	win.focus();
}
// ******************
function showPicture(evt){
	var url, name;
//xlert('inside showPicture incCommon.js with '+evt);

	name = getEventName(evt);
	url = "../_images/" + name;

//	lastImageUrl = document.getElementById("feature").src;
	if (name.slice(3,7) == "Wide"){
		document.getElementById("feature").height = 250;
		document.getElementById("feature").width = 325;
	}else{
		document.getElementById("feature").height = 370;
		document.getElementById("feature").width = 325;
	}
	document.getElementById("feature").src = url;
//	img name='feature' src='../_images/" & image & "' width='" & width & "' height='" & height &
}
// ******************
function showWidePicture(evt){
	var url, name;

	name = getEventName(evt);
	url = "../_images/" + name;

	if (name.slice(3,6) == "Nar"){
		document.getElementById("feature").height = 409;
		document.getElementById("feature").width = 326;
	}else{
		document.getElementById("feature").height = 409;
		document.getElementById("feature").width = 545;
	}

	document.getElementById("feature").src = url;
}
// ***************
function returnPicture(){
	var url, name;
	//xlert("picture url to be shown is : "+lastImageUrl);

	document.getElementById("feature").src = lastImageUrl;
		document.getElementById("feature").height = 370;
		document.getElementById("feature").width = 325;
}
// ***************
function returnWidePicture(){
	var url, name;
//	alert("picture url to be shown is : "+lastImageUrl);

	document.getElementById("feature").src = lastImageUrl;
		document.getElementById("feature").width = 545;
		document.getElementById("feature").height = 409;
}
// **********
function Page_OnLoad(){
	lastImageUrl = document.getElementById("feature").src;
}
// **************