function getXMLFromString(responseText){
	return  Try.these(
				function() { return new DOMParser().parseFromString(responseText, 'text/xml'); },
				function() { var xmldom = new ActiveXObject('Microsoft.XMLDOM'); xmldom.loadXML(responseText); return xmldom;}
				)
}
function getNodeValue(XML, node){
	var elements=XML.getElementsByTagName(node);
	if(elements[0]){
		if(elements[0].firstChild){
			return elements[0].firstChild.nodeValue;
		}
	}
	return "";
}
function popupNews(id){
	window.open("/news_print.php?id="+id,'displayWindow','width=600, height=400, scrollbar=1, scrollbars=1, resizable=1');	
}
function popupItem(id, picNum, ext){
	window.open("/popup_pic.php?pic=images/items_"+picNum+"/original/"+id+"."+ext,'displayWindow','width=600, height=400, scrollbar=1, scrollbars=1, resizable=1');	
}
function popupApro(id, ext){
	window.open("/popup_pic.php?pic=images/apro/original/"+id+"."+ext,'displayWindow','width=600, height=400, scrollbar=1, scrollbars=1, resizable=1');	
}
function popupLiveItem(auction, num){
	window.open("/popup_pic.php?pic=images/live_images/original/"+auction+"/"+num+".jpg",'displayWindow','width=600, height=400, scrollbar=1, scrollbars=1, resizable=1');	
}
function popupLiveSubPic(auction, num){
	window.open("/popup_pic.php?pic=images/live_images/original/"+auction+"/"+num,'displayWindow','width=600, height=400, scrollbar=1, scrollbars=1, resizable=1');	
}
function resize_window(){
	var pic=document.getElementsByTagName("img")[0];
	window.resizeTo(pic.width<1000?pic.width+30:1024, pic.height<700?pic.height+80:768)
}
var myGlobalHandlers = {
		onCreate: function(){
			$("load_progress").style.display="block";
		},

		onComplete: function() {
			if(Ajax.activeRequestCount == 0){
				$("load_progress").style.display="none"
			}
		}
	};

	Ajax.Responders.register(myGlobalHandlers);
	
function showMenu(id){
	for(i=1;i<5;i++){
		if(i==id){
//			document.getElementById("menu_"+i).className="head_menu_active";	
			document.getElementById("sub_menu_"+i).style.visibility="visible";	
		}
		else{
//			document.getElementById("menu_"+i).className="head_menu_inactive";
			document.getElementById("sub_menu_"+i).style.visibility="hidden";
		}
	}
}

function incFontSize(){
	size=parseInt($('news_text').style.fontSize);
	if(size<17){
		size+=2;
	}
	else{
		size=17;
	}
	$('news_text').style.fontSize=size+"px";
	$('news_text').style.lineHeight=size+5+"px";
	
}

function decFontSize(){
	size=parseInt($('news_text').style.fontSize);
	if(size>13){
		size-=2;
	}
	else{
		size=13;
	}
	$('news_text').style.fontSize=size+"px";
	$('news_text').style.lineHeight=size+5+"px";
	
}