// -------------------------------------------
// GENERAL JAVASCRIPT FUNCTIONS
// Robert Reinhard (Bukwild.com)
// 1.1.1 - 10/24/06
// -------------------------------------------

//open a centered popup
function popup(url,width,height,title,scrollbar,resizable,center) {
	
	//set defaults
	if (width == null) width = 600;
	if (height == null) height = 450;
	if (title == null) title = 'auto_popup';
	if (scrollbar == null) scrollbar = false;
	if (resizable == null) resizable = false;
	if (center == null) center = true;

	//set props
	scrollbar = scrollbar == true ? 'yes' : 'no';
	resizable = resizable == true ? 'yes' : 'no';
	winProperties = 'height='+height+',width='+width+',toolbar=no,location=no,scrollbars='+scrollbar+',titlebar=no,menubar=no,resizable='+resizable+',status=no';
	
	//open and move
	win = window.open(url,title, winProperties);
	if (!win) alert('Please disable your popup blocker to use this site.');
	else if (center) {
		if (self.screen) {
			sw = self.screen.width;
			sh = self.screen.height;
		} else return;
		win.moveTo((sw-width)/2,(sh-height)/2);
	}
	
}


//get element ref
function getElement(name){
	var dom = document.getElementById;
	var iex = document.all;
	var ns4 = document.layers;
	var el = dom ? document.getElementById(name) : iex ? document.all[name] : ns4 ? eval(nest+"document."+name) : false;
	el.css = ns4 ? el : el.style;
	return el;
}

//swap the visiiblity of an element
var old_swap_vis_id = null;
function swapVis(id) {
	var el = getElement(id);
	if (old_swap_vis_id) old_swap_vis_id.css.display="none";
	el.css.display="";
	old_swap_vis_id = el;
}

//get browser size
function getWindowSize() {
	if (parseInt(navigator.appVersion)>3) {
		if (navigator.appName=="Netscape") {
			winW = window.innerWidth;
			winH = window.innerHeight;
		}
		if (navigator.appName.indexOf("Microsoft")!=-1) {
			winW = document.body.offsetWidth;
			winH = document.body.offsetHeight;
		}
	}
	return new Array(winW,winH);
}


// ¸Þ´ºÀÌµ¿
function go_submenu(n) {
  if(n == '1') location.href = '/index.asp';
  else if(n == '2') location.href = '/info/basic_200912.asp';
  else if(n == '2-1') location.href = '/info/basic_200912.asp';
  else if(n == '2-2') location.href = '/info/itinerary/index.asp';
  else if(n == '2-3') location.href = '/info/FAQ/index.asp';
  else if(n == '2-4') location.href = '/info/map.asp';
  else if(n == '2-5') location.href = '/info/drive/index.asp';
  else if(n == '3') location.href = '/region/index.asp';
  else if(n == '3-1') location.href = '/region/cc/index.asp';
  else if(n == '3-2') location.href = '/region/cv/index.asp';
  else if(n == '3-3') location.href = '/region/deserts/index.asp';
  else if(n == '3-4') location.href = '/region/gc/index.asp';
  else if(n == '3-5') location.href = '/region/hs/index.asp';
  else if(n == '3-6') location.href = '/region/ie/index.asp';
  else if(n == '3-7') location.href = '/region/la/index.asp';
  else if(n == '3-8') location.href = '/region/nc/index.asp';
  else if(n == '3-9') location.href = '/region/oc/index.asp';
  else if(n == '3-10') location.href = '/region/sd/index.asp';
  else if(n == '3-11') location.href = '/region/sfba/index.asp';
  else if(n == '3-12') location.href = '/region/sc/index.asp';
  else if(n == '4') location.href = '/theme/';
  else if(n == '4-1') location.href = '/theme/foodwine/index.asp';
  else if(n == '4-2') location.href = '/theme/heal/index.asp';
  else if(n == '4-3') location.href = '/theme/themepark/index.asp';
  else if(n == '4-4') location.href = '/theme/shop/index.asp';
  else if(n == '4-5') location.href = '/theme/park/index.asp';
  else if(n == '4-6') location.href = '/theme/entertainment/index.asp';
  else if(n == '4-7') location.href = '/theme/sports/index.asp';
  else if(n == '4-8') location.href = '/theme/artculture/index.asp';
  else if(n == '4-9') location.href = '/theme/drive/index.asp';
  else if(n == '4-10') location.href = '/theme/luxury/index.asp';
  else if(n == '5') location.href = '/media/index_200912.asp';
}

function print_this() {
  window.print();
}

function setPng24(obj) {
    obj.width=obj.height=1;
    obj.className=obj.className.replace(/\bpng24\b/i,'');
    obj.style.filter =
    "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
    obj.src=''; 
    return '';
}