var curr_prow = 1;
var curr_pcol = 1;
function unhighlight(prow,pcol){
	var obj = MM_findObj('id_'+prow+'_'+pcol);
	obj.style.backgroundColor = '#000000';
}
function highlight(prow,pcol,first){
	if(!first) {
		unhighlight(curr_prow,curr_pcol);
	}
	curr_prow = prow;
	curr_pcol = pcol;
	var obj = MM_findObj('id_'+prow+'_'+pcol);
	obj.style.backgroundColor = '#ffffff';
}
function getMleft(){
	var mleft = 0;
	if (parseInt(navigator.appVersion)>3) {
		mleft = (screen.width - 640) / 2;
	}
	return mleft;
}
function imageWin(url,name,width,height) {
	var features = "channelmode=no, directories=no, fullscreen=no, location=no, menubar=no, resizable=yes, scrollbars=no, status=no, titlebar=no, toolbar=no, width=" + width + ", height=" + height + ", top=10, left=" + getMleft();
	var replace = false;
	var ew = window.open(url, name, features, replace);
	ew.focus();
}
function mt(part1, part2, subj) {
	var emailer = "mail" + "to:" + escape(part1) + "@" + escape(part2) + "?subject=" + escape(subj);
	window.location.href = emailer;
}
function fortuneWin(url,name,width,height) {
	var features = "channelmode=no, directories=no, fullscreen=no, location=no, menubar=no, resizable=yes, scrollbars=no, status=no, titlebar=no, toolbar=no, width=" + width + ", height=" + height + ", top=10, left=" + getMleft();
	var replace = false;
	var ew = window.open(url, name, features, replace);
	ew.focus();
}
function MM_findObj(n, d) { //v4.01
	var p,i,x;
	if(!d){
		d = document;
	}
	if((p = n.indexOf("?"))>0 && parent.frames.length) {
		d = parent.frames[n.substring(p+1)].document;
		n = n.substring(0,p);
	}
	if(!(x = d[n]) && d.all) {
		x = d.all[n];
	}
	for (i=0; !x && i<d.forms.length; i++) {
		x = d.forms[i][n];
	}
	for(i=0;!x && d.layers && i<d.layers.length; i++) {
		x = MM_findObj(n,d.layers[i].document);
	}
	if(!x && d.getElementById) {
		x = d.getElementById(n);
	}
	return x;
}