function response_query(code_no,print_code,year,month,mode,no) {
	var req;
	var mode=mode;
	var no=no;
	var query_code=code_no;
	req = newXMLHttpRequest(); //request 객체 생성 
	req.onreadystatechange = function () { 
    // only if req shows "loaded" 
		if (req.readyState == 4) { 
			// only if "OK" 
			if (req.status == 200) { 
				document.getElementById(print_code).innerHTML = req.responseText;
				Element.hide('ajaxBox');// 다 처리한후.. 박스를 숨김..
				try{
					if (document.getElementById("total_price").innerHTML)
						var ele_total_price = true;
				} catch(e) {
						var ele_total_price = false;
				}
				if (ele_total_price == true) {
					var room_price = document.getElementById('room_price').value *1;
//					alert (room_price);
					var option_price = document.getElementById('option_price').value *1;
					var breakfast_price = document.getElementById('breakfast_price').value *1;
					var total_price = room_price+option_price+breakfast_price;
					var format_total_price = number_format(total_price);
					try{
						if (document.getElementById('h_temp_yn').value == "1") {
							document.getElementById("order_btn").src = "img/btn_new.gif";
							document.getElementById("total_price").innerHTML = "－円";
						}
						if (document.getElementById('h_temp_yn').value == "0") {
							document.getElementById("order_btn").src = "img/btn_order.gif";
							document.getElementById("total_price").innerHTML = "－円";
						}							
						if (document.getElementById('h_open_price_yn').value == "N") {
							document.getElementById("order_btn").src = "img/btn_new.gif";
							document.getElementById("total_price").innerHTML = "－円";
						} 
					} catch(e) {
							document.getElementById("total_price").innerHTML = format_total_price+"円";
					}
				}
			} else { 
				alert("There was a problem retrieving the XML data:\n" + 
					req.statusText); 
			} 
		} 
	} 
	showAjaxBox();//로딩 박스 보인후에...
	try{
		if (document.getElementById('h_id').value)
			var h_id = document.frmSearch2.h_id.value;
	} catch(e) {
			var h_id = "";
	}
	try{
		if (document.getElementById('start_date').value)
			var start_date = document.frmSearch2.start_date.value;
	} catch(e) {
			var start_date = "";
	}

	try{
		if (document.getElementById('end_date').value)
			var end_date = document.frmSearch2.end_date.value;
	} catch(e) {
			var end_date = "";
	}

	try{
		if (document.getElementById('day').value)
			var day = document.frmSearch2.day.value;
	} catch(e) {
			var day = "";
	}
	
	try{
		if (document.getElementById('room_type').value)
			var room_type = document.frmSearch2.room_type.value;
	} catch(e) {
			var room_type = "";
	}

	try{
		if (document.getElementById('room_count').value)
			var room_count = document.frmSearch2.room_count.value;
	} catch(e) {
			var room_count = "";
	}

	try{
		if (document.getElementById('h_add_adult_count').value)
			var h_add_adult_count = document.frmSearch2.h_add_adult_count.value;
	} catch(e) {
			var h_add_adult_count = "";
	}

	try{
		if (document.getElementById('h_add_child_count').value)
			var h_add_child_count = document.frmSearch2.h_add_child_count.value;
	} catch(e) {
			var h_add_child_count = "";
	}

	try{
		if (document.getElementById('h_add_bedclothes_count').value)
			var h_add_bedclothes_count = document.frmSearch2.h_add_bedclothes_count.value;
	} catch(e) {
			var h_add_bedclothes_count = "";
	}

	try{
		if (document.getElementById('h_option1_count').value)
			var h_option1_count = document.frmSearch2.h_option1_count.value;
	} catch(e) {
			var h_option1_count = "";
	}

	try{
		if (document.getElementById('h_option2_count').value)
			var h_option2_count = document.frmSearch2.h_option2_count.value;
	} catch(e) {
			var h_option2_count = "";
	}

	try{
		if (document.getElementById('h_breakfast1_count').value)
			var h_breakfast1_count = document.frmSearch2.h_breakfast1_count.value;
	} catch(e) {
			var h_breakfast1_count = "";
	}

	try{
		if (document.getElementById('h_breakfast2_count').value)
			var h_breakfast2_count = document.frmSearch2.h_breakfast2_count.value;
	} catch(e) {
			var h_breakfast2_count = "";
	}

	cur_date = new Date();
	if (year == null)	{
		var year =  cur_date.getFullYear();
	}

	if (month == null)	{
		var month =  cur_date.getMonth()+1;
	}
	
	var url = location.href.split("?");
	if (url[0].substr(0,23)=="http://hotel.konest.com") {
		query_file="hotel_query.html?code="+query_code;
	} else {
		query_file="../hotel/hotel_query.html?code="+query_code;
	}

	req.open("POST", query_file, true); 
	req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");//요청헤더의 정의 
	req.send("h_id="+h_id+"&start_date="+start_date+"&end_date="+end_date+"&day="+day+"&room_type="+room_type+"&room_count="+room_count+"&h_add_adult_count="+h_add_adult_count+"&h_add_child_count="+h_add_child_count+"&h_add_bedclothes_count="+h_add_bedclothes_count+"&h_option1_count="+h_option1_count+"&h_option2_count="+h_option2_count+"&h_breakfast1_count="+h_breakfast1_count+"&h_breakfast2_count="+h_breakfast2_count+"&year="+year+"&month="+month+"&mode="+mode+"&no="+no);
} 
//request객체생성 함수 
function newXMLHttpRequest() { 
  var xmlreq = false; 

  if (window.XMLHttpRequest) { //파이어폭스나 맥의 사파리의 경우처리 
    // Create XMLHttpRequest object in non-Microsoft browsers 
    xmlreq = new XMLHttpRequest(); 
  } else if (window.ActiveXObject) { //IE계열의 브라우져의 경우 
    // Create XMLHttpRequest via MS ActiveX 
    try { 
      // Try to create XMLHttpRequest in later versions 
      // of Internet Explorer 
      xmlreq = new ActiveXObject("Msxml2.XMLHTTP"); 
    } catch (e1) { 
      // Failed to create required ActiveXObject 
      try { 
        // Try version supported by older versions 
        // of Internet Explorer 
        xmlreq = new ActiveXObject("Microsoft.XMLHTTP"); 
      } catch (e2) { 
        // Unable to create an XMLHttpRequest with ActiveX 
      } 
    } 
  } 
  return xmlreq; 
} 

function notice_pop(url,width,height) {
	window.open(url,"yoyaku_notice","width="+width+",height="+height+",top=200,left=500,scrollbars=auto" );
}

function number_format(num) {
	var num_str = num.toString();
	var result = ''
	for(var i=0; i<num_str.length; i++) {
		var tmp = num_str.length-(i+1)
		if(i%3==0 && i!=0) result = ',' + result
		result = num_str.charAt(tmp) + result
	}
	return result
}

function showAjaxBox(ment){
   
//항상 화면 중앙에 나타나도록...
   var yp=document.body.scrollTop;
   var xp=document.body.scrollLeft;
   var ws=document.body.clientWidth;
   var hs=document.body.clientHeight;
   var ajaxBox=$('ajaxBox');


	ajaxBox.style.top=yp+eval(hs)/2-30;
	ajaxBox.style.left=xp+eval(ws)/2-100;

   Element.show(ajaxBox);    
}


function mouseover(data) {
	var obj = document.getElementsByName(data);
	var cnt = obj.length;
	for (i=0;i<cnt;i++) {
		obj[i].style.background="#a7bafd";
	}
}

function mouseout(data) {
	var obj = document.getElementsByName(data);
	var cnt = obj.length;
	for (i=0;i<cnt;i++) {
		var j=i%2;
		if (j==0) {
			obj[i].style.background="#ffffff";
		} else {
			obj[i].style.background="#f1f1f1";
		}
	}
}

function change(add) {
	sel=document.frmSearch2.town;


	for (i=sel.length-1; i>=0; i--){
		sel.options[i] = null
	}

	for (i=0; i < cnt[add].length;i++){ 
		sel.options[i] = new Option(cnt[add][i], town[add][i]);
	} 
}
function check_data() {
	var city_num = document.frmSearch2.town.selectedIndex;
//	alert(town[document.frmSearch2.city.selectedIndex][city_num-1]);
//	return false;
}

function check_data_form() {
	var frm=document.frmSearch2;
	if (document.frmSearch2.elements["option[]"][0].value=="") {
		document.frmSearch2.elements["option[]"][0].value = "";
		document.frmSearch2.elements["option[]"][1].value = "";
		document.frmSearch2.elements["option[]"][2].value = "";
		document.frmSearch2.elements["option[]"][3].value = "";
	} else {
		document.frmSearch2.elements["option[]"][0].value = urlencode(document.frmSearch2.elements["option[]"][0].value);
		document.frmSearch2.elements["option[]"][1].value = urlencode(document.frmSearch2.elements["option[]"][1].value);
		document.frmSearch2.elements["option[]"][2].value = urlencode(document.frmSearch2.elements["option[]"][2].value);
		document.frmSearch2.elements["option[]"][3].value = urlencode(document.frmSearch2.elements["option[]"][3].value);
	}
	var city_num = document.frmSearch2.town.selectedIndex;
//	alert(town[document.frmSearch2.city.selectedIndex][city_num-1]);
//	return false;
}


function day_selected() {
	start_date = document.frmSearch2.start_date.value;
	add_days = Number(document.frmSearch2.day.value);
    var ymd = start_date.split("-"); 
    var new_date = new Date(ymd[0],ymd[1]-1,Number(ymd[2])+add_days); 
	var loopY = new_date.getFullYear(); 
	var loopM = new_date.getMonth()+1;
	if (loopM<10) {
		loopM = "0"+loopM;
	}
	var loopD = new_date.getDate(); 
	if (loopD<10) {
		loopD = "0"+loopD;
	}

	document.frmSearch2.end_date.value=loopY+"-"+loopM+"-"+loopD;

}

function price_check() {
	var min_no = document.frmSearch2.price_min.selectedIndex;
	var max_no = document.frmSearch2.price_max.selectedIndex;
	var min_price = document.frmSearch2.price_min.options[document.frmSearch2.price_min.selectedIndex].value;
	var max_price = document.frmSearch2.price_max.options[document.frmSearch2.price_max.selectedIndex].value;
	if (min_price != "") min_price = 1*document.frmSearch2.price_min.options[document.frmSearch2.price_min.selectedIndex].value;
	if (max_price != "") max_price = 1*document.frmSearch2.price_max.options[document.frmSearch2.price_max.selectedIndex].value;

	if (max_price<=min_price) {
		if (min_no ==8 && min_price == max_price) {
			min_no = min_no-1;
			max_no = min_no;
			alert("異なる価格を設定してください。");
			document.frmSearch2.price_min.options[min_no].selected=true;
			document.frmSearch2.price_max.options[max_no].selected=true;
		} else if (max_price !="" && min_price >= max_price ) {
			alert("最低価格より高い価格を選択してください。");
			min_no = max_no;
			document.frmSearch2.price_min.options[min_no].selected=true;
//			document.frmSearch2.price_max.options[max_no].selected=true;
		}
	}
}

function menu_click(data,flag) {
	for (i=1;i<6;i++) {
		var img = eval("document.pr"+i);
		if (data == i) {
			img.src = "img/best_menu0"+i+".gif";
		} else {
			img.src = "img/best_menu0"+i+"r.gif";
		}
	}
	document.frmRecomm.src_no.value = data;
	recomm_hotel.location.href="inc/index_recomm.inc?h_flag="+flag;
}

function menu_unclick(data,flag) {
		var img = eval("document.pr"+data);
		img.src = "img/best_menu0"+data+"r.gif";
//	document.frmRecomm.src_no.value = data;
//	recomm_hotel.location.href="inc/index_recomm.inc?h_flag="+flag;
}

function mouse_over(no,name) {
	var img = eval("document."+name);
	img.src = "img/best_menu0"+no+".gif";
}
function mouse_out(no,name) {
	var img = eval("document."+name);
	data = document.frmRecomm.src_no.value;
	if (data==no) {
		img.src = "img/best_menu0"+no+".gif";
	} else {
		img.src = "img/best_menu0"+no+"r.gif";
	}
}

function currPage() {
	var text = "";
	if (line>=limit_line)  { 
		line=limit_line;
		var text ="<table width=\"140\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" id='test'><tr><td  height=\50\" align=\"center\" valign=\"middle\" class=\"hotel_font2\">"+MSG_NODATA+"</td></tr></table>";
	}
	for (i=1;i<=line;i++) {
		var text = text+eval("text"+i);
	}
	document.getElementById("curr").innerHTML=text;
	document.getElementById("pre").innerHTML='<a href="javascript:goPre('+(0)+')"><img src=\"img/bookmark_btn_up.gif\" width=\"150\" height=\"14\" border=0></a>';
	document.getElementById("next").innerHTML='<a href="javascript:goNext('+(line+1)+')"><img src=\"img/bookmark_btn_down.gif\" width=\"150\" height=\"18\" border=0></a>';
}

function goPre(start) {
	if (start == 0) {
		alert(MSG_START);
	} else {
		var text = "";
		for (i=start;i<=start+line-1;i++) {
			var text = text+eval("text"+i);
		}
			document.getElementById("curr").innerHTML=text;
			document.getElementById("pre").innerHTML='<a href="javascript:goPre('+(start-1)+')"><img src=\"img/bookmark_btn_up.gif\" width=\"150\" height=\"14\" border=0></a>';
			document.getElementById("next").innerHTML='<a href="javascript:goNext('+(start+line)+')"><img src=\"img/bookmark_btn_down.gif\" width=\"150\" height=\"18\" border=0></a>';
	}
}

function goNext(start) {
	if (limit_line < start) {
		alert(MSG_END);
	} else {
		var text = "";
		for (i=start-line+1;i<=start;i++) {
			var text = text+eval("text"+i);
		}
			document.getElementById("curr").innerHTML=text;
			document.getElementById("pre").innerHTML='<a href="javascript:goPre('+(start-line)+')"><img src=\"img/bookmark_btn_up.gif\" width=\"150\" height=\"14\" border=0></a>';
			document.getElementById("next").innerHTML='<a href="javascript:goNext('+(start+1)+')"><img src=\"img/bookmark_btn_down.gif\" width=\"150\" height=\"18\" border=0></a>';
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function hotel_calendar_popup(frm_name,field_name) {
	var url = "hotel_calendar_popup.html";
	window.open(url+"?frm_name="+frm_name+"&field_name="+field_name,"hotel_calendar","width=311,height=400,top=200,left=350,scrollbars=yes" );
}

function hotel_calendar_popup2(frm_name,field_name) {
	var url = "hotel_calendar_popup_dev.html";
	window.open(url+"?frm_name="+frm_name+"&field_name="+field_name,"hotel_calendar","width=311,height=400,top=200,left=350,scrollbars=yes" );
}

function hotel_price_popup(frm_name,h_id) {
	var url = "hotel_price_pop.html";
	window.open(url+"?frm_name="+frm_name+"&h_id="+h_id,"hotel_calendar","width=630,height=700,top=100,left=200,scrollbars=yes" );
}

function hotel_price_confirm(h_id,start_date,room_no,msg) {
	var msg = msg;
	if (msg == "1") {
		var k= '直前のご予約になりますので、請求メール到着後、ただちにお振込みをお願いいたします。\n\n入金確認できない場合はキャンセルとなりますのでご注意ください。';
		if (confirm(k)) {
			var url = "hotel_yoyaku.html?h_id="+h_id+"&start_date="+start_date+"&room_type="+room_no;
			opener.document.location.href=url;
			self.close();		
		}
	} else if (msg == "2") {
		var k= '直前のご予約になりますので、ご注意ください。\n\n申し込み後、予約センターからのメールを必ずご確認ください。';
		if (confirm(k)) {
			var url = "hotel_yoyaku.html?h_id="+h_id+"&start_date="+start_date+"&room_type="+room_no;
			opener.document.location.href=url;
			self.close();		
		}
	} else {
		var url = "hotel_yoyaku.html?h_id="+h_id+"&start_date="+start_date+"&room_type="+room_no;
		opener.document.location.href=url;
		self.close();	
	}
}

function hotel_price_confirm2(h_id,start_date,room_no,msg) {
	var msg = msg;
	if (msg == "1") {
		var k= '直前のご予約になりますので、請求メール到着後、ただちにお振込みをお願いいたします。\n\n入金確認できない場合はキャンセルとなりますのでご注意ください。';
		if (confirm(k)) {
			var url = "hotel_yoyaku.html?h_id="+h_id+"&start_date="+start_date+"&room_type="+room_no;
			document.location.href=url;			
		}
	} else if (msg == "2") {
		var k= '直前のご予約になりますので、ご注意ください。\n\n申し込み後、予約センターからのメールを必ずご確認ください。';
		if (confirm(k)) {
			var url = "hotel_yoyaku.html?h_id="+h_id+"&start_date="+start_date+"&room_type="+room_no;
			document.location.href=url;			
		}
	} else {
		var url = "hotel_yoyaku.html?h_id="+h_id+"&start_date="+start_date+"&room_type="+room_no;
		document.location.href=url;		
	}
}

function showflash(ls_Path, ll_Width, ll_Height)
{
	
	document.write ("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='" + ll_Width + "' height='" + ll_Height + "' VIEWASTEXT>");
	document.write ("<param name=movie value='" + ls_Path + "'>");
	document.write ("<param name=quality value=high>");
	document.write ("<param name='wmode' value='transparent'>");
	document.write ("<embed wmode='transparent' src='" + ls_Path + "' quality=high pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + ll_Width + "' height='" + ll_Height + "'></embed> ");
	document.write ("</object>");
}

function comment_pop(recommend_page) {
	window.open('../data/mail_to_friend_form.html?recommend_page='+recommend_page,'','scrollbars=auto,width=394,height=646');
}	

function comment_pop_utf(recommend_page) {
	window.open('http://www.konest.com/data/mail_to_friend_form2.html?recommend_page='+recommend_page,'','scrollbars=auto,width=394,height=646');
}	

function article_pop(f, g) {
	var v = './articlephoto_view.html?article_id='+f+'&dataStart='+g;

	window.open(v, 'articlephoto','toolbar=no,menubar=no,scrollbars=no,width=562,height=654,top=100,left=100');
}

function article_pop(f, g) {
	var v = './articlephoto_view.html?article_id='+f+'&dataStart='+g;

	window.open(v, 'articlephoto','toolbar=no,menubar=no,scrollbars=no,width=562,height=654');
}

function article_walkerhill_couponpop(f, g) {
	var v = '/data/pop_walkerhill_dutyfree.html';

	window.open(v, 'articlephoto','toolbar=no,menubar=no,scrollbars=yes,width=401,height=200');
}

function article_lotte_couponpop(f, g) {
	var v = '/data/pop_lotte_dutyfree.html';

	window.open(v, 'articlephoto','toolbar=no,menubar=no,scrollbars=no,width=401,height=250');
}

function article_lotte_couponpop2(f, g) {
	var v = '/data/pop_lotte_dutyfree2.html';

	window.open(v, 'articlephoto','toolbar=no,menubar=no,scrollbars=no,width=401,height=200');
}

function article_lotteworld_couponpop(f, g) {
	var v = '/data/pop_lotteworld_dutyfree.html';

	window.open(v, 'articlephoto','toolbar=no,menubar=no,scrollbars=no,width=401,height=250');
}

function article_donghwa_couponpop(f, g) {
	var v = '/data/pop_donghwa_dutyfree.html';

	window.open(v, 'articlephoto','toolbar=no,menubar=no,scrollbars=yes,width=401,height=280');
}

function article_coex_couponpop(f, g) {
	var v = '/data/pop_coex_dutyfree.html';

	window.open(v, 'articlephoto','toolbar=no,menubar=no,scrollbars=yes,width=401,height=280');
}

function nowseoul_pop(f) {
	var v = '/data/nowseoul_view.html?pg_id='+f;
	window.open(v, 'nowseoul','toolbar=no,menubar=no,scrollbars=no,width=700,height=566');
}

function photogallery_pop(f) {
	var v = '../data/konest_photo_gallery_top.html?pg_id='+f;
	window.open(v, 'konestphotogallery','toolbar=no,menubar=no,scrollbars=no,width=657,height=680');
}

var initBody 
function beforePrint() { 
	initBody = document.body.innerHTML; document.body.innerHTML = idkonest.innerHTML + idPrint.innerHTML; 
} 
function afterPrint() { 
	document.body.innerHTML = initBody; 
} 
function printArticle() { 
	window.print();
}
 window.onbeforeprint = beforePrint;
 window.onafterprint = afterPrint;

function list_sort(data) {
	if (data=="sort_price") {
		if (document.frmSearch2.sort_price.value==1) {
			document.frmSearch2.sort_price.value="";
		} else {
			document.frmSearch2.sort_price.value=1;
		}
		document.frmSearch2.sort_grade.value="";
		document.frmSearch2.sort_area.value="";
		document.frmSearch2.sort_akasata.value="";
	} else if (data=="sort_grade") {
		document.frmSearch2.sort_price.value="";
		if (document.frmSearch2.sort_grade.value==1) {
			document.frmSearch2.sort_grade.value="";
		} else {
			document.frmSearch2.sort_grade.value=1;
		}
		document.frmSearch2.sort_area.value="";
		document.frmSearch2.sort_akasata.value="";
	} else if (data=="sort_area") {
		document.frmSearch2.sort_price.value="";
		document.frmSearch2.sort_grade.value="";
		if (document.frmSearch2.sort_area.value==1) {
			document.frmSearch2.sort_area.value="";
		} else {
			document.frmSearch2.sort_area.value=1;
		}
		document.frmSearch2.sort_akasata.value="";
	} else if (data=="sort_akasata") {
		document.frmSearch2.sort_price.value="";
		document.frmSearch2.sort_grade.value="";
		document.frmSearch2.sort_area.value="";
		if (document.frmSearch2.sort_akasata.value==1) {
			document.frmSearch2.sort_akasata.value="";
		} else {
			document.frmSearch2.sort_akasata.value=1;
		}
	} 
	document.frmSearch2.submit();
}

function menu_checked(data) {
	document.frmInputSearch.esthe_group_code[data].checked=true;
}

function getnames(fieldname,no) {
	field = fieldname+"_code["+no+"]";

	data = eval("document.frmInputSearch."+field);
	data.checked=true;
}

function frm_subway_check() {
	if (	document.frmSubway.start_sub.value == document.frmSubway.end_sub.value) {
		alert("出発地と目的地が同じです。他の地域を選んで下さい");
		document.frmSubway.end_sub.focus();
		return false;
	}
}

function frm_subway_check2() {
	if (	document.frmSubway2.start_sub.value == document.frmSubway2.end_sub.value) {
		alert("出発地と目的地が同じです。他の地域を選んで下さい");
		document.frmSubway2.end_sub.focus();
		return false;
	}
}

function frm_search_check() {
	if (document.frmSearchLeft.area_code.value == "") {
		alert("エリアを入力してください");
		document.frmSearchLeft.area_code.focus();
		return false;
	}
}

function frmYoyakuSubmit() {
//	var reject_result = document.frmSearch2.h_reject_yn.value;
	var reject_result = document.getElementById('h_reject_yn').value;

	if (reject_result == 1) 	{
		alert("予約不可の日程を含むため、受付できません。");
		return false;
	}
}

function areaphotogallery_pop(f,desc) {
	var v = './areaphoto_list.html?pg_id='+f+'&pgi_season='+desc;
	
	window.open(v,'areaphoto','toolbar=no,menubar=no,scrollbars=no,width=642,height=652');
}

function sell_yen_calc() {
	document.frmRateCalcuSell.change_won_money.value = Math.round((document.frmRateCalcuSell.yen_money.value*document.frmRateCalcuSell.sell_yen.value/100),2);
	return false;
}

function buy_yen_calc() {
	document.frmRateCalcuBuy.change_yen_money.value = Math.round((document.frmRateCalcuBuy.won_money.value/document.frmRateCalcuBuy.buy_yen.value*100),2);
	return false;
}


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;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
