var xml;
var	XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
var old_style = "menu-container-nor";

function Submit( mode ){	
	var f = document.__form;
	f["mode"].value = mode;
	f.submit();
}

function buildXmlElement( tagName, text){
////////////////////////////////////////////////////////////////////////////////////////
	var xml = '<' + tagName + '><![CDATA[' + text + ']]></' + tagName + '>'

	return xml
}
function dbSet( submitFiles, datasend ){

	document.body.style.cursor= "wait"
	var XmlData = datasend
	var url = submitFiles;
	XmlHttp.Open( "POST", url, false );
	XmlHttp.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded" );
	XmlHttp.Send( XmlData );

	if (XmlHttp.status != 200 || XmlHttp.responseXML.xml == "")	{
		if (XmlHttp.status == 404)
			message('Server not found') 
		else{
			try	{
				message(errorText.childNodes[0].rows[0].cells[1].innerText)
			}catch(e){
				try	{
					message(XmlHttp.responseXML.selectSingleNode('//errorMessage').text)
				}catch(e){
					var win = window.open("about:blank",null,'toolbars=no,height=500,width=500,resizable=yes')
					win.document.open()
					win.document.write(XmlHttp.responseText)
					win.document.close()
				}
			}
		}
		document.body.style.cursor= "default"	
		return null;
	}
	document.body.style.cursor= "default"	
	return XmlHttp.responseXML
}

function show_kem( filename ){
	window.open( filename,"KEM","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=600, height=400")
}

BrowseImage = function(v, fol){
	var w = screen.width/2,h=screen.height/2;
	var l = (screen.width-w)/2;
	var t = (screen.height-h)/2;
	var win = window.open('',v,'top='+ t +',left='+l+',width='+w+',height='+h+',status=yes,scrollbars=yes,resizable=yes,dependent=yes,alwaysRaised=yes');
	win.location.href = "/album.asp?fol="+ fol
	if(!win) alert("Unable to open window. Please configure your popup blocker to allow popups of this site.");
	else {
		win.focus();
		//win.caller = this;
	}	
}

RemoveImage = function(v){ document.all[v].value = ""; }
GetImage = function(url,fi){ document.all[fi].value = url; }

function print_page(){
	if(window.print)
		window.print();
	else
		alert("Your browser doesn't support printing. Please use File->print option.");
};

buttonOver = function(eButton)	{ old_style = eButton.className; eButton.className = "menu-container-hil"; };
buttonOut = function(eButton) { eButton.className = old_style; };
buttonDown = function(eButton) {
	if (!this._enabled||this._readonly||eButton.leaveOn) return false;
	eButton.style.backgroundColor = "#8494B5";
	eButton.style.borderColor = "darkblue darkblue darkblue darkblue";
};
buttonUp = function(eButton) {
	if (!this._enabled||this._readonly||eButton.leaveOn) return false;
	eButton.style.backgroundColor = "#B5BDD6";
	eButton.style.borderColor = "darkblue darkblue darkblue darkblue";
	eButton = null; 
};