function showDateSelector(dateField, minYear,maxYear, mode){
	//try to fetch the contents of the datefield
	dateParam = "&date="+ document.getElementById(dateField).value;
	dateParam+="&minYear="+minYear;
	dateParam+="&maxYear="+maxYear;
	dateParam+="&mode="+mode;
	
	retval=window.showModalDialog("../tools/selectorPopup.aspx?type=2" + dateParam, window, "unadorned:yes;dialogWidth:240px;dialogHeight:270px;resizable:no;status:no;title=no");
	if (retval!=undefined) {
		document.getElementById(dateField).value=retval[2]+'-'+retval[1];
		if (mode!=1)document.getElementById(dateField).value+='-'+retval[0]
	}
}

function selectThisDate(year, month, day, mode){
	toReturn = new Array(3);
	toReturn[0]= year;
	toReturn[1]= month;
	toReturn[2]= day;
	toReturn[3]= mode;
	top.returnValue=toReturn;
	window.close();	
}

function setColor(color, field){
	document.getElementById(field).value=color;
	javascript:__doPostBack('"+field+"','');
	
}
function showStockEnlarge(imageUrl, port){
	window.showModalDialog("StockEnlarge.aspx?imageUrl=" +imageUrl+"&port="+port, window, "unadorned:yes;dialogWidth:600px;dialogHeight:600px;resizable:yes;status:no;title=no");
}
function closeStockEnlarge(){
	window.close();	
}