// JavaScript Document

function openWin(src,width,height,left,top,scroll) {
	if (left==null || left=="") left=(screen.width-width) / 2;
	if (top==null || top=="") top=(screen.height-height) / 2;
	if (scroll=="") scroll="auto";
	var win = window.open(src,"", "toolbar=no,scrollbars="+scroll+",location=no,status=no,width="+width+",height="+height+",left=" + left + ", top=" + top + ",resizable=no");
	win.focus();
}

function hideIntro() {
	document.getElementById("intro").style.visibility="hidden";
}

function showSql() {
	document.getElementById("sql").style.display="block";
	document.getElementById("hideSql").style.display="block";
	document.getElementById("showSql").style.display="none";
}

function hideSql() {
	document.getElementById("sql").style.display="none";
	document.getElementById("hideSql").style.display="none";
	document.getElementById("showSql").style.display="block";
}

function detail(ref) {
	ref.style.cursor="hand";
	ref.style.background="#a6a6a6";
	for (i=0;i<ref.childNodes.length;i++) {
		ref.childNodes[i].style.color="white";
	}
}

function undetail(ref) {
	ref.style.cursor="normal";
	ref.style.background="#9CD9F7";
	for (i=0;i<ref.childNodes.length;i++) {
		ref.childNodes[i].style.color="#0656A7";
	}
}

function detailWin(iddp) {
	var win = window.open('detail.php?iddp='+iddp+'','','scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no');
	win.focus();
}

function loginGuest() {
	if (document.forms[0].user.value!="guest") {
		document.forms[0].user.value="guest";
		//document.forms[0].user.disabled="true";
		document.forms[0].user.style.color="#aca899";
	} else document.forms[0].user.value="";
}

function markChange(ref) {
	var changed = document.forms[0].changed.value;
	if (changed!="") changed = changed + "," +ref.name;
	else changed = ref.name;
	document.forms[0].changed.value = changed;
}
