document.domain = "hyundaicard.com";



$(document).ready(function(){

	$(".uds").mouseover(function(){

		$(this).addClass('udsOver')

	});

	$(".selItemsArea input:radio").css({position:"absolute",left:"-9999px"});

	$(".selItemsArea").hide();

	$(".selItemsArea label").hover(

		function(){$(this).addClass('hoverClass')},

		function(){$(this).removeClass('hoverClass')}

	);

	$(".selArea").mousedown(function(){

		$(".uds").removeClass('udsOver');

		var selTarget = this;

		var selTargetText = $(selTarget.firstChild);		

		var selTargetVal = $(selTarget.lastChild);		

		var selTargetWidth = this.offsetWidth;

		selTarget = (selTarget.nextSibling.nodeType == 3) ? selTarget.nextSibling : selTarget;

		$(selTarget.nextSibling).css({width:selTargetWidth+"px"}).slideToggle(200);

		$(selTarget.nextSibling).mousedown(function(event){

			var selText = event.target.firstChild.nodeValue;

			var chkVal = event.target.previousSibling.value;

			var st = this.nextSibling;

			st = (st.nodeType == 3) ? st.nextSibling : st;

			$(selTargetText).val(selText);			

			$(this.nextSibling).val(chkVal);

			$(".uds").removeClass('udsOver');

		});

	});

	$(document).mousedown(function(){

		$(".selItemsArea").hide();

	});

});





function slide(elementID,final_y,interval) {

  if (!document.getElementById) return false;

  if (!document.getElementById(elementID)) return false;

  var elem = document.getElementById(elementID);  

  if (elem.movement) {clearTimeout(elem.movement);}   

  var ypos = parseInt(getStyle(elem,"marginTop"));  

  if (ypos < final_y) {

    var dist = Math.ceil((final_y - ypos)/5);

    ypos = ypos + dist;

  }

  if (ypos > final_y) {

    var dist = Math.ceil((ypos - final_y)/5);

    ypos = ypos - dist;

  }

  if(ypos == final_y){return true;}  

  elem.style.marginTop = ypos + "px";

  var repeat = "slide('"+elementID+"',"+final_y+","+interval+")";

  elem.movement = setTimeout(repeat,interval);

}



function toggleGNB(){

	var toggleCategory = document.getElementById("toggleCategory");	

	var headArea = document.getElementById("headArea");

	var gnb = document.getElementById("gnb");

	if(getStyle(headArea,"marginTop") == "-715px")	slide("headArea",0,0);	// ÀüÃ¼¸Þ´º º¸±â H ¼öÁ¤½Ã

	else slide("headArea",-716,0); // ÀüÃ¼¸Þ´º º¸±â H ¼öÁ¤½Ã

	//toggleCategory.onclick = function(){		

	//	if(getStyle(headArea,"marginTop") == "-385px")	slide("headArea",0,0);	

	//	else slide("headArea",-386,0);

	//}

	

	//gnb.onmouseout = function(){

	//	if(getStyle(headArea,"marginTop") == "-1px") slide('headArea',-384,0);

	//}

}



function toggle(targetId){

	var toggleTarget = document.getElementById(targetId)		

	toggleTarget.style.display=(getStyle(toggleTarget,'display')=='none') ? 'block':'none';	

}



function sview(a,targetId){

	var toggleTarget = document.getElementById(targetId)		

	toggleTarget.style.display=(getStyle(toggleTarget,'display')=='none') ? 'block':'none';

	a.src = (a.src.indexOf("_on.gif") > -1) ? 

	a.src.replace(/_on.gif/,'.gif') : a.src = a.src.replace(/.gif/,'_on.gif');



	

}



function slideCartIn(){toggle("cartInfo");	slide("cartInfo",0,0);}

function slideCartOut(){slide("cartInfo",-179,0);}



function getStyle(el, style) {

	var value = el.style[style];

	if(!value)	{

		if(document.defaultView && document.defaultView.getComputedStyle) {

			var css = document.defaultView.getComputedStyle(el, null);

			value = css ? css[style] : null;

		} 

		else if (el.currentStyle) value = el.currentStyle[style];

	}

	return value == 'auto' ? null : value;

}



function setPng24(obj) {

    obj.width=obj.height=1;

    obj.className=obj.className.replace(/\bpng\b/i,'');

    obj.style.filter =

    "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src+"',sizingMethod='image');"

    obj.src=''; 

    return '';

}



var Radio = function(name)

{

	this.img_on = "/NexSoil_KOR/images/radio_on.gif";

	this.img_off = "/NexSoil_KOR/images/radio_off.gif";

	this.radio = {};

	this.checked_id = "";

	var self=this;



	var ra = null,img=null;

	var cid = "";

	for(var i=0; i<document.getElementsByName(name).length; i++)

	{

		ra = document.getElementsByName(name)[i];

		cid =ra.id;

		img=ra.parentNode.insertBefore(document.createElement('img'), ra);



		img.src = this.img_off;

		if(ra.checked)

		{

			img.src = this.img_on;

			this.checked_id = cid;

		}

		

		img.cid = cid;

		img.onclick = function() {

			self.select(this.cid);

			if(self.radio[this.cid].ra.onclick) self.radio[this.cid].ra.onclick();

		};

		ra.style.display="none";

		this.radio[cid] = {ra:ra, img:img};

	}

};

Radio.prototype={

	select : function(cid) {

		this.radio[cid].img.src = this.img_on;

		this.radio[cid].ra.checked=true;

		if(this.checked_id && this.checked_id!=cid) this.radio[this.checked_id].img.src = this.img_off;

		this.checked_id=cid;

	},

	showValue : function() {

		return this.radio[this.checked_id].ra.value;

	}

};



function rndReset(){		

	var rndDivs = document.getElementsByTagName("div");	

	for( i = 0 , j = rndDivs.length ; i < j ; i++){	

		if(rndDivs[i].className.indexOf("rndType") > -1){

			if(rndDivs[i].offsetHeight % 2 > 0 && rndDivs[i].currentStyle && navigator.userAgent.toLowerCase().indexOf("msie 6")!=-1){

				var rndBottoms = rndDivs[i].getElementsByTagName("span");

				for(t = 0 ; t < rndBottoms.length ; t++ ){

					if(rndBottoms[t].className == "rnd bl" || rndBottoms[t].className == "rnd br"){					

						rndBottoms[t].style.bottom = parseInt(rndBottoms[t].currentStyle.getAttribute('bottom'))-1+"px";

					}				

				}

			}

			if(rndDivs[i].offsetWidth % 2 > 0 && rndDivs[i].currentStyle && navigator.userAgent.toLowerCase().indexOf("msie 6")!=-1){

				var rndRights = rndDivs[i].getElementsByTagName("span");

				for(j = 0 ; j < rndRights.length ; j++ ){

					if(rndRights[j].className == "rnd tr" || rndRights[j].className == "rnd br"){

						rndRights[j].style.right = parseInt(rndRights[j].currentStyle.getAttribute('right'))-1+"px";

					}				

				}

			}

		}

	}	

}



window.onload=function(){	

	rndReset();

}



var Rolling=function(cid,count,interval,n) {

	this.cid = cid;

	this.count = count;	

	this.n = (n)?n:"1";

	this.onchange = null;



	for(var k=1; k<=this.count; k++) document.getElementById(this.cid+"_"+k).style.display="none";

	document.getElementById(this.cid+"_"+this.n).style.display="block";



	this.div = document.getElementById(this.cid);//ÀüÃ¼div

	this.div.onmouseover=function(){this.isover=true; }

	this.div.onmouseout=function() {this.isover=false;}

	this.btn_next = document.getElementById("btn_"+this.cid+"_next");

	this.btn_prev = document.getElementById("btn_"+this.cid+"_prev");



	var self=this;

	if(this.btn_next) this.btn_next.onclick=function(){self.next() }

	if(this.btn_prev) this.btn_prev.onclick=function(){self.prev() }

	if(interval>0) setInterval(function(){self.play()}, interval);

}

Rolling.prototype = {

	play : function() {

		if(this.div.isover) return;

		this.next();

	},

	change :function(){

		if(this.onchange) this.onchange();

	},

	prev :function(){

		document.getElementById(this.cid+"_"+this.n).style.display="none";

		this.n=(this.n==1)?this.count:--this.n;

		document.getElementById(this.cid+"_"+this.n).style.display="block";

		this.change();

	},

	next :function(){

		document.getElementById(this.cid+"_"+this.n).style.display="none";

		this.n=(this.n==this.count)? 1:++this.n;

		document.getElementById(this.cid+"_"+this.n).style.display="block";

		this.change();

	},

	random : function() {

		var rn=Math.round((this.count-1)*Math.random());

		for(var i=0;i<rn;i++) this.next();

	}

};

//¼¿·ºÆ®¹Ú½º ¸ðµ¨

function month_open(){

var target = document.getElementById('monthCont')		

	target.style.display = 'block';	

}

function monthClose(){

	var target = document.getElementById('monthCont')		

	target.style.display = 'none';	

}

//ÄÁÅÙÃ÷ ÀÚµ¿¸®»çÀÌÁî

function iframeResize(iframe_id) {

 var h = (self.innerHeight) ? document.documentElement.offsetHeight : document.body.scrollHeight;

 try{parent.document.getElementById(iframe_id).style.height = h+"px";

 }catch(e){}

}



// Tab Content

function initTabMenu(tabContainerID) {

	var tabContainer = document.getElementById(tabContainerID);

	var tabAnchor = tabContainer.getElementsByTagName("a");

	var i = 0;



	for(i=0; i<tabAnchor.length; i++) {

		if (tabAnchor.item(i).className == "tab")

			thismenu = tabAnchor.item(i);

		else

			continue;



		thismenu.container = tabContainer;

		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);

		thismenu.targetEl.style.display = "none";

		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);

		thismenu.onclick = function tabMenuClick() {

			currentmenu = this.container.current;

			if (currentmenu == this)

				return false;



			if (currentmenu) {

				currentmenu.targetEl.style.display = "none";

				if (currentmenu.imgEl) {

					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");

				} else {

					currentmenu.className = currentmenu.className.replace(" on", "");

				}

			}

			this.targetEl.style.display = "";

			if (this.imgEl) {

				this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");

			} else {

				this.className += " on";

			}

			this.container.current = this;



			return false;

		};



		if (!thismenu.container.first)

			thismenu.container.first = thismenu;

	}

	if (tabContainer.first)

		tabContainer.first.onclick();

}



// »ç¿ëÀÚ ÁöÁ¤¿¡ µû¸¥ Tabmenu 111115 Ãß°¡ 
function initTabMenu01(tabContainerID, m) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {

		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;


		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);//serviceT Á¦¾î
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);

		thismenu.onclick = function tabMenuClick() {
			thismenu.targetEl.style.display = "none";
			thismenu.imgEl.src = thismenu.imgEl.src.replace("_on.gif", ".gif");

			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");
				} else {
					currentmenu.className = currentmenu.className.replace(" on", "");
				}
			}
			this.targetEl.style.display = "";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");

			} else {
				this.className += " on";
			}
			this.container.current = this;

			return false;
		};


		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}

		if (tabContainer.first)
			thismenu = tabAnchor.item(m-1);
			thismenu.imgEl = tabContainer.getElementsByTagName("img").item(m-1);
			thismenu.targetEl.style.display = "block";
			thismenu.imgEl.src = thismenu.imgEl.src.replace(".gif", "_on.gif");

}


Object.extend=function(a, b){
  for (var property in b) a[property] = b[property];
  return a;
}

function indexTab(cid,count,options){ 
//alert(cid);
 this.options={
  snum:1,     //½ÃÀÛ¹øÈ£
  event_type:'click', //mouseover,click
  tabMenu_type:'img',  //img,css
  class_over:'on',  //over ½Ã css
  onChange:null   //º¯°æµÉ¶§ ÀÌº¥Æ®
 }
 Object.extend(this.options, options);
 this.cid=cid;
 this.count=count;
 var menu;
 for(var i=1; i<=count; i++)
 {
  menu=document.getElementById("tabMenu_"+cid+"_"+i);
  menu.n=i;
  menu.css=menu.className;
  var self=this;
  menu['on'+this.options.event_type]=function(){ setTab(this.n) }
 } 
	setTab(this.options.snum);
}

function setTab(n){
  this.n=n;
  var type=this.options.tabMenu_type;
  for(var k=1; k<=this.count; k++)
  {
   document.getElementById("cont_"+this.cid+"_"+k).style.display="none";
   if(type=='img') document.getElementById("tabMenu_"+this.cid+"_"+k).src=document.getElementById("tabMenu_"+this.cid+"_"+k).src.replace("_on.gif",".gif");
   else document.getElementById("tabMenu_"+this.cid+"_"+k).className=document.getElementById("tabMenu_"+this.cid+"_"+k).css;
   
  }
  document.getElementById("cont_"+this.cid+"_"+n).style.display="block";
  if(type=='img') document.getElementById("tabMenu_"+this.cid+"_"+n).src=document.getElementById("tabMenu_"+this.cid+"_"+n).src.replace(".gif","_on.gif");
  else document.getElementById("tabMenu_"+this.cid+"_"+n).className= document.getElementById("tabMenu_"+this.cid+"_"+n).css +' '+this.options.class_over;
  if(this.options.onChange) this.options.onChange.call(this);
 
}



// Message Window

function openMessageWindow(href) {

	var windowEl = document.createElement("iframe");

	windowEl.src = href;

	windowEl.frameBorder = 0;

	windowEl.scrolling = "no";

	windowEl.allowTransparency = "true";

	windowEl.style.zIndex = 1001;

	windowEl.style.position = 'absolute';

	document.getElementsByTagName("body").item(0).appendChild(windowEl);

	document.getElementsByTagName("body").item(0).popup = windowEl;

	var selects = document.getElementsByTagName("select");

	for (i = 0; i < selects.length; i++) {

		selects.item(i).hided = true;

		selects.item(i).style.visibility = "hidden";

	}



	var mask = document.createElement("div");

	mask.onclick = closeMessageWindow;

	mask.style.width = document.documentElement.clientWidth + "px";

	mask.style.height = document.documentElement.scrollHeight + "px";

	mask.style.position = 'absolute';

	mask.style.top = "0";

	mask.style.left = "0";

	mask.style.zIndex = 1000;

	mask.style.backgroundColor = "#FFF";

	mask.style.opacity = "0";

	mask.style.filter = "alpha(opacity = 0)";

	document.getElementsByTagName("body").item(0).appendChild(mask);

	windowEl.mask = mask;

}



function closeMessageWindow() {

	var windowEl = parent.document.getElementsByTagName("body").item(0).popup;

	if (!windowEl)

		return false;



	var selects = parent.document.getElementsByTagName("select");

	for (i = 0; i < selects.length; i++) {

		if (selects.item(i).hided == true) {

			selects.item(i).style.visibility = "visible";

		}

	}



	windowEl.style.display = "none";

	windowEl.mask.parentNode.removeChild(windowEl.mask);

	windowEl.mask = null;

	

	//return true;

}

function positionMessageWindow() {

	if (!parent.document.getElementsByTagName("body").item(0).popup)

		return;



	var windowEl = parent.document.getElementsByTagName("body").item(0).popup;

	windowEl.style.height = "auto";

	windowEl.style.width = "auto";

	var windowElHeight = document.documentElement.scrollHeight;

	var windowElWidth = document.documentElement.scrollWidth;

	windowEl.style.height = windowElHeight + 5 + "px";

	windowEl.style.width = windowElWidth + "px";

	windowEl.style.top = parent.document.documentElement.scrollTop + (parent.document.documentElement.clientHeight - windowElHeight) / 2 + "px";

	windowEl.style.left = (parent.document.documentElement.clientWidth - windowElWidth) / 2 + "px";

}

// Message Popup Layer

function openMessagePopup(elId) {

	var windowEl = document.getElementById(elId.split("#")[1]);

	if (!windowEl)

		return true;



	windowEl.style.display = 'block';

	windowEl.style.zIndex = 1001;

	windowEl.style.position = 'absolute';

	windowEl.style.top = document.documentElement.scrollTop + (document.documentElement.clientHeight - windowEl.offsetHeight) / 2 + "px";

	windowEl.style.left = (document.documentElement.clientWidth - windowEl.offsetWidth) / 2 + "px";



	var selects = document.getElementsByTagName("select");

	for (i = 0; i < selects.length; i++) {

		selects.item(i).hided = true;

		selects.item(i).style.visibility = "hidden";

	}



	var mask = document.createElement("div");

	mask.onclick = function () {

		closeMessagePopup(elId);

	}

	mask.style.width = document.documentElement.clientWidth + "px";

	mask.style.height = document.documentElement.scrollHeight + "px";

	mask.style.position = 'absolute';

	mask.style.top = "0";

	mask.style.left = "0";

	mask.style.zIndex = 1000;

	mask.style.backgroundColor = "#FFF";

	mask.style.opacity = "0";

	mask.style.filter = "alpha(opacity = 0)";

	document.getElementsByTagName("body").item(0).appendChild(mask);

	windowEl.mask = mask;

}

function closeMessagePopup(elId) {

	var windowEl = document.getElementById(elId.split("#")[1]);

	if (!windowEl)

		return true;



	var selects = parent.document.getElementsByTagName("select");

	for (i = 0; i < selects.length; i++) {

		if (selects.item(i).hided == true) {

			selects.item(i).style.visibility = "visible";

		}

	}



	windowEl.style.display = "none";

	windowEl.mask.parentNode.removeChild(windowEl.mask);

	windowEl.mask = null;

}



/* Slide Content */

function initSlideContent(container, content, items, prevbtn, nextbtn) {

	var container = container;

	container.content = content;

	container.prevbtn = prevbtn;

	container.nextbtn = nextbtn;

	container.isImageButton = false;

	

	container.x = 0;

	container.content.x = 0;

	if(items == null || items.length < 1) return false;

	container.content.style.width = items.item(0).offsetWidth * items.length + "px";



	container.slide = window.setInterval(

		function () {

			if (Math.abs(content.x - container.x) > 1) {

				container.content.x += (container.x - container.content.x) * .5;

				container.content.style.left = container.content.x + "px";

			} else {

				container.content.x = container.x;

				container.content.style.left = container.content.x + "px";

				//window.clearInterval(container.slide);

			}

		}

	, 80);

	container.prevbtn.onclick = function () {

		if (container.x + container.offsetWidth > 0) {

			return false;

		}

		container.x += container.offsetWidth;

		setButton();

		return false;

	}

	container.nextbtn.onclick = function () {

		if (container.x - container.offsetWidth <= container.content.offsetWidth * -1) {

			return false;

		}

		container.x -= container.offsetWidth;

		setButton();

		return false;

	}

	function setButton() {

		var previmage = container.prevbtn.getElementsByTagName("img").item(0);

		var nextimage = container.nextbtn.getElementsByTagName("img").item(0);



		//if (container.x + container.offsetWidth > 0) {

			//previmage.src = previmage.src.replace(".gif", "_off.gif")

		//} else {

			//previmage.src = previmage.src.replace("_off.gif", ".gif")

		//}

		//if (container.x - container.offsetWidth <= container.content.offsetWidth * -1) {

			//nextimage.src = nextimage.src.replace(".gif", "_off.gif")

		//} else {

			//nextimage.src = nextimage.src.replace("_off.gif", ".gif")

		//}

	}

	setButton();

}



/* definition list toggle */

function initToggle(tabContainer) {

	triggers = tabContainer.getElementsByTagName("a");



	for(i = 0; i < triggers.length; i++) {

		if (triggers.item(i).href.split("#")[1])

			triggers.item(i).targetEl = document.getElementById(triggers.item(i).href.split("#")[1]);



		if (!triggers.item(i).targetEl)

			continue;



		triggers.item(i).targetEl.style.display = "none";

		triggers.item(i).onclick = function () {

			if (tabContainer.current == this) {

				this.targetEl.style.display = "none";

				tabContainer.current = null;

			} else {

				if (tabContainer.current) {

					tabContainer.current.targetEl.style.display = "none";

				}

				this.targetEl.style.display = "block";

				tabContainer.current = this;

			}

			return false;

		}

	}

}



/* payment-tab */

function payTabMenu(tabContainerID) {

	var tabContainer = document.getElementById(tabContainerID);

	var tabAnchor = tabContainer.getElementsByTagName("a");

	var i = 0;



	for(i=0; i<tabAnchor.length; i++) {

		if (tabAnchor.item(i).className == "tab")

			thismenu = tabAnchor.item(i);

		else

			continue;



		thismenu.container = tabContainer;

		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);

		thismenu.targetEl.style.display = "none";

		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);

		thismenu.onclick = function tabMenuClick() {

			currentmenu = this.container.current;

			if (currentmenu == this)

				return false;



			if (currentmenu) {

				currentmenu.targetEl.style.display = "none";

				if (currentmenu.imgEl) {

					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");

				} else {

					currentmenu.className = currentmenu.className.replace(" on", "");

				}

			}

			this.targetEl.style.display = "";

			if (this.imgEl) {

				this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");

			} else {

				this.className += " on";

			}

			this.container.current = this;



			return false;

		};



		//if (!thismenu.container.first)

			//thismenu.container.first = thismenu;

	}

	if (tabContainer.first)

		tabContainer.first.onclick();

}



/* cinema-goldclass */

function showGold(tabContainerID) {

	var tabContainer = document.getElementById(tabContainerID);

	var tabAnchor = tabContainer.getElementsByTagName("a");

	var i = 0;



	for(i=0; i<tabAnchor.length; i++) {

		if (tabAnchor.item(i).className == "tab")

			thismenu = tabAnchor.item(i);

		else

			continue;



		thismenu.container = tabContainer;

		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);

		thismenu.targetEl.style.display = "none";

		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);

		thismenu.onclick = function tabMenuClick() {

			currentmenu = this.container.current;

			if (currentmenu == this)

				return false;



			if (currentmenu) {

				currentmenu.targetEl.style.display = "none";

				if (currentmenu.imgEl) {

					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");

				} else {

					currentmenu.className = currentmenu.className.replace(" on", "");

				}

			}

			this.targetEl.style.display = "";

			if (this.imgEl) {

				this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");

			} else {

				this.className += " on";

			}

			this.container.current = this;



			return false;

		};



		if (!thismenu.container.first)

			thismenu.container.first = thismenu;

	}

	if (tabContainer.first)

		tabContainer.first.onclick();

}



function initView(tabContainerID) {

	var tabContainer = document.getElementById(tabContainerID);

	var tabAnchor = tabContainer.getElementsByTagName("a");

	var i = 0;



	for(i=0; i<tabAnchor.length; i++) {

		if (tabAnchor.item(i).className == "tab")

			thismenu = tabAnchor.item(i);

		else

			continue;



		thismenu.container = tabContainer;

		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);

		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);

		thismenu.onclick = function tabMenuClick() {

			currentmenu = this.container.current;

			if (currentmenu == this)

				return false;



			if (currentmenu) {

			}

			this.targetEl.style.display = "";

			this.container.current = this;



		};



		if (!thismenu.container.first)

			thismenu.container.first = thismenu;

	}

	if (tabContainer.first)

		tabContainer.first.onclick();

}



// °¶·¯¸® 

function simpleGallery(wrapClass,borderID) {

	wrapperSet = '.' + wrapClass + ' ul li:has(a)';

	wrapperSetFirst = wrapperSet + ':first-child';

	$(wrapperSetFirst).addClass('on');

	borderset = '#' + borderID;

	$(borderset).css('display','block');

	$(wrapperSet).mouseover(function(){

		$(wrapperSet).removeClass('on');

		$(this).addClass('on');

		$(borderset).appendTo(this);

		var getlink = this.getElementsByTagName("a")[0];

		var gethref = $(getlink).attr('href');

		var getimg = this.getElementsByTagName("img")[0];

		getsrc = (getimg.src.indexOf(".gif") > -1) ? 

		getimg.src.replace(/.gif/,'.jpg') : getimg.src;

		getsrc = (getsrc.indexOf("thumb") > -1) ? 

		getsrc.replace(/thumb/,'photo') : getsrc;

		getsrc = (getsrc.indexOf("pt") > -1) ? 

		getsrc.replace(/pt/,'photo') : getsrc;

		$(gethref).attr('src',getsrc);

	});

};







function overBorder(wrapClass,borderID) {

 wrapperSet = '.' + wrapClass + ' ul li a';

 wrapperSetFirst = wrapperSet + ':first-child';

 borderset = '#' + borderID;

 $(borderset).css('display','block');

 $(wrapperSet).mouseover(function(){

  $(borderset).appendTo(this);

  var gethref = $(this).attr('href');

  $(borderset).mousedown(function(){

  location.href = gethref;

 });

 });

 

};



function rolloverList(spaceHeight,wrapClass,borderID){

	wrapperSet = '.' + wrapClass + ' ul li a';

	wrapperSetFirst = wrapperSet + ':first-child';

	borderset = '#' + borderID;

	$(borderset).css('display','block');

	$(wrapperSet).mouseover(function(){

		$(borderset).appendTo(this);

	});

	$(wrapperSet).mousedown(function(){

		getsrc = this.firstChild.src;

		$("#viewContent").attr('src',getsrc);

		return false;

	});

	var listWrap = document.getElementById("listR");

	var prev = document.getElementById("ppp");

	var next = document.getElementById("nnn");

	var ul = listWrap.getElementsByTagName("ul")[0];

	var thumbLists = listWrap.getElementsByTagName("a");

	var unit1 = listWrap.getElementsByTagName("img")[0].offsetHeight+spaceHeight;

	var allLen = (unit1)*listWrap.getElementsByTagName("li").length;

	var lot = allLen / (unit1*5);

	var remainder = allLen % (unit1*5);

	var index = 1;

	

	prev.onclick = function(){	

		

		if(index == 1) {

			alert("Ã³À½ÀÔ´Ï´Ù!");

		} else {

			var currentCoo = getStyle(ul,"top");

			ul.style.top = parseInt(currentCoo) + (unit1*5) + "px";

			index--;

		}	

		return false;

	}

	

	next.onclick = function(){	

		if(index == lot && remainder == 0){

			alert("¸¶Áö¸·ÀÔ´Ï´Ù!");

		} else if(index == (parseInt(lot+1))){

			alert("¸¶Áö¸·ÀÔ´Ï´Ù!");

		} else {

			var currentCoo = getStyle(ul,"top");

			ul.style.top = parseInt(currentCoo) - (unit1*5) + "px";

			index++;

		}	

		return false;

	}

	

	function getStyle(element, style){

		if(element.currentStyle) return element.currentStyle.getAttribute(style); // IE

		else{

			var css = document.defaultView.getComputedStyle(element, null);

			return css.getPropertyValue(style);

		}

	}

}

function rolloverList2(spaceWidth,wrapClass,borderID){

	wrapperSet = '.' + wrapClass + ' ul li a';

	wrapperSetFirst = wrapperSet + ':first-child';

	borderset = '#' + borderID;

	$(borderset).css('display','block');

	$(wrapperSet).mouseover(function(){

		$(wrapperSet).removeClass('on');

	   	$(this).addClass('on');

   		$(borderset).appendTo(this);

	});

	$(wrapperSet).mousedown(function(){

		getsrc = this.firstChild.src;

		$("#viewContent").attr('src',getsrc);

		return false;

	});

	var listWrap = document.getElementById("listR");

	var prev = document.getElementById("ppp");

	var next = document.getElementById("nnn");

	var ul = listWrap.getElementsByTagName("ul")[0];

	var thumbLists = listWrap.getElementsByTagName("a");

	var unit1 = listWrap.getElementsByTagName("img")[0].offsetWidth+spaceWidth;

	var allLen = (unit1)*listWrap.getElementsByTagName("li").length;

	var lot = allLen / (unit1*4);

	var remainder = allLen % (unit1*4);

	var index = 1;

	

	prev.onclick = function(){	

		

		if(index == 1) {

			//alert("Ã³À½ÀÔ´Ï´Ù!");

		} else {

			var currentCoo = getStyle(ul,"left");

			ul.style.left = parseInt(currentCoo) + (unit1*4) + "px";

			index--;

		}	

		return false;

	}

	

	next.onclick = function(){	

		if(index == lot && remainder == 0){

			ul.style.left = 0 + "px";

			index =1;

			//alert("¸¶Áö¸·ÀÔ´Ï´Ù!");

		} else if(index == (parseInt(lot+1))){

			ul.style.left = 0 + "px";

			index =1;

			//alert("¸¶Áö¸·ÀÔ´Ï´Ù!");

		} else {

			var currentCoo = getStyle(ul,"left");

			ul.style.left = parseInt(currentCoo) - (unit1*4) + "px";

			index++;

		}	

		return false;

	}

	

	function getStyle(element, style){

		if(element.currentStyle) return element.currentStyle.getAttribute(style); // IE

		else{

			var css = document.defaultView.getComputedStyle(element, null);

			return css.getPropertyValue(style);

		}

	}

}

function rolloverList3(wrapClass,borderID){

	

	wrapperSet = '.' + wrapClass + ' ul li a';

	wrapperSetFirst = wrapperSet + ':first-child';

	borderset = '#' + borderID;

	$(borderset).css('display','block');

	$(wrapperSet).mouseover(function(){

		$(wrapperSet).removeClass('on');

		$(this).addClass('on');

		$(borderset).appendTo(this);

	});

	$(wrapperSet).mousedown(function(){

		classCheck = $(this).hasClass("test");

		if (classCheck) { 

			var popLink = $(this).attr('href');

 			window.open(popLink,'','width=370,height=430,top=300,left=500,status=yes')

		}

		else{

			getsrc = this.firstChild.src;

			$("#viewContent").attr('src',getsrc);

			return false;

		}});

}





//ÇÃ·¡½Ã

function flashWrite(url,w,h,vars,bg,win){

	

	var id=url.split("/")[url.split("/").length-1].split(".")[0]; //id´Â ÆÄÀÏ¸íÀ¸·Î ¼³Á¤

	if(vars==null) vars='';

	if(bg==null) bg='#FFFFFF';

	if(win==null) win='transparent';



	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ

	var flashStr= "	<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'";

		flashStr+="		codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0'";

		flashStr+="		width='"+w+"'";

		flashStr+="		height='"+h+"'";

		flashStr+="		id='"+id+"'";

		flashStr+="		align='middle'>";



		flashStr+="		<param name='allowScriptAccess' value='always' />";

		flashStr+="		<param name='movie' value='"+url+"' />";

		flashStr+="		<param name='FlashVars' value='"+vars+"' />";

		flashStr+="		<param name='wmode' value='"+win+"' />";

		flashStr+="		<param name='menu' value='false' />";

		flashStr+="		<param name='quality' value='high' />";

		flashStr+="		<param name='bgcolor' value='"+bg+"' />";

	

		flashStr+="		<embed src='"+url+"'";

		flashStr+="		       flashVars='"+vars+"'";

		flashStr+="		       wmode='"+win+"'";

		flashStr+="		       menu='false'";

		flashStr+="		       quality='high'";

		flashStr+="		       bgcolor='"+bg+"'";

		flashStr+="		       width='"+w+"'";

		flashStr+="		       height='"+h+"'";

		flashStr+="		       name='"+id+"'";

		flashStr+="		       align='middle'";

		flashStr+="		       allowScriptAccess='always'";

		flashStr+="		       type='application/x-shockwave-flash'";

		flashStr+="		       pluginspage='http://www.macromedia.com/go/getflashplayer' />";

		flashStr+=" </object>";



	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â

	document.write(flashStr);

}

function flashWriteID(url,id,w,h,vars,bg,win){

	

	if(vars==null) vars='';

	if(bg==null) bg='#FFFFFF';

	if(win==null) win='transparent';



	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ

	var flashStr= "	<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'";

		flashStr+="		codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0'";

		flashStr+="		width='"+w+"'";

		flashStr+="		height='"+h+"'";

		flashStr+="		id='"+id+"'";

		flashStr+="		align='middle'>";



		flashStr+="		<param name='allowScriptAccess' value='always' />";

		flashStr+="		<param name='movie' value='"+url+"' />";

		flashStr+="		<param name='FlashVars' value='"+vars+"' />";

		flashStr+="		<param name='wmode' value='"+win+"' />";

		flashStr+="		<param name='menu' value='false' />";

		flashStr+="		<param name='quality' value='high' />";

		flashStr+="		<param name='bgcolor' value='"+bg+"' />";

	

		flashStr+="		<embed src='"+url+"'";

		flashStr+="		       flashVars='"+vars+"'";

		flashStr+="		       wmode='"+win+"'";

		flashStr+="		       menu='false'";

		flashStr+="		       quality='high'";

		flashStr+="		       bgcolor='"+bg+"'";

		flashStr+="		       width='"+w+"'";

		flashStr+="		       height='"+h+"'";

		flashStr+="		       name='"+id+"'";

		flashStr+="		       align='middle'";

		flashStr+="		       allowScriptAccess='always'";

		flashStr+="		       type='application/x-shockwave-flash'";

		flashStr+="		       pluginspage='http://www.macromedia.com/go/getflashplayer' />";

		flashStr+=" </object>";



	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â

	document.write(flashStr);

}

function flashSize(w,h){

	document.bannerFla.width = w + "px";

	document.bannerFla.height = h + "px";

}

function toploginResize(h){

	if (h == "225")  // MouseOver½Ã Flash¿¡¼­ toploginResize("225"); È£Ãâ
	{
		document.toplogin.height = 244  + "px";
	}else
	{
		document.toplogin.height = h  + "px"; // MouseOut ½Ã Flash¿¡¼­ toploginResize("55"); È£Ãâ
	}
}


function callExternalInterface(flashname,xmlPath,imgnumber,TotalBox){

	 //getMovieName(flashname).callFlash(xmlPath);
	 document.getElementById(flashname).callFlash(xmlPath); //120213 ¼öÁ¤
	 cultureImgBox(imgnumber,TotalBox);

}

function getMovieName(movieName) {

	if (navigator.appName.indexOf("Microsoft") != -1) {

		return window[movieName]

	}

	else {

		return document[movieName]



	}

}

function cultureImgBox(imgN,TB){

	ul = document.getElementById(TB);

	TabList = ul.getElementsByTagName("img");

	for (i=0;i < TabList.length ; i++){

		TabList[i].src = TabList[i].src.replace("_on.gif",".gif");

	}

	TabImg = document.getElementById('mainT'+imgN);

	TabImg.src = TabImg.src.replace(".gif","_on.gif");

}

function seatInfo_on(){

	contant1 = document.getElementById('seatInfoView');

	contant2 = document.getElementById('seatInfoAction');

	contant1.style.display = "none";

	contant2.style.display = "block";

}

function seatInfo_off(){

	contant1 = document.getElementById('seatInfoView');

	contant2 = document.getElementById('seatInfoAction');

	contant1.style.display = "block";

	contant2.style.display = "none";

}

function pop_esay(){

	window.open('/popup/easyCounsel.jsp','notice1','width=630,height=590,top=0,left=0,status=yes'); 

}

function pop_ARS(){

	window.open('/popup/popup_ARS.jsp','ARS','width=800,height=600,top=0,left=0,status=no'); 

}

function pop_rent(){

	window.open('/leisure/campingcar/program/pop_rent.jsp','notice1','width=710,height=810,top=0,left=0,status=yes'); 

}

function popclose(){

	window.close();

}

function pop_useRule(){

	window.open('/privia/useRule/useRule.jsp','notice1','width=442,height=476,top=0,left=0,status=yes'); 

}

function resize(num){

	window.resizeTo(645,num);

}

function gotoPage(page,target){

	//alert(page);



	if (eval(page) == ""){

		alert("ÁØºñÁßÀÔ´Ï´Ù!");



	}else if(page == "fristsite"){ // »õÃ¢ ¶ç¿ì±â

		open(eval(page), '_blank');

	

	}else if(page == "111" ){ // ºÎ¸ðÃ¢¿¡¼­ ÀÌµ¿

		on_chk=window.opener.location=eval(page); 



	}else if(page == "111"){ //ÆË¾÷

		on_chk=window.open(eval(page),'step1','width=550,height=650,top=0,left=0,scrollbars=no,resizable=no,status=no');

		on_chk.focus();

	

	}else{

		if (eval(page) == "/"){

			parent.location.href = eval(page);

		}else{

			location.href = eval(page);

		}

	}

}

function serviceTrick_on(link,num){

	var id = document.getElementById('serviceTrickList');

	var a  = id.getElementsByTagName("li");

	for(i=1;i<=a.length;i++){

		document.getElementById('serviceTrickimg'+i).src = document.getElementById('serviceTrickimg'+i).src.replace("_on.gif", ".gif");

	}

	for(i=1; i<=a.length; i++) {

		if(num == i){

			link.src = link.src.replace(".gif", "_on.gif");

		}

	}

}
