/*/////////////////////////////////////////////////////
±âº»
/////////////////////////////////////////////////////*/
var defaultUrl="http://www.babomall.com/rd/";
var defaultUrls="https://www.babomall.com/rd/";

/*
function MM_reloadPage(init) {
	//reloads the window if Nav4 resized
	if (init==true) with (navigator) {
		if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
			document.MM_pgW=innerWidth;
			document.MM_pgH=innerHeight;
			onresize=MM_reloadPage;
		}
	}
	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
*/

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_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_openBrWindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}

//±âº» Ã¢´Ý±â
function winClose() {
	self.close();
}

//ÀÎÇ²¹Ú½º Å¬¸¯½Ã º¸´õ»öº¯°æ
function inFocus1(i,color) {
	(i).style.border='1px solid ' + color;
}
function outFocus1(i,color) {
	(i).style.border='1px solid ' + color;
}

//¸µÅ© Á¡¼±X
function autoBlur(){
  if(event.srcElement.tagName=="a" || event.srcElement.tagName=="img") 
  document.body.focus(); 
} 
document.onfocusin=autoBlur; 

//ÆË¾÷À§Ä¡ center
function pop_center() {
	var width = screen.width; 
	var height = screen.height;
	var left = width/2 - 175;
	var top = height/2 - 160
	window.moveTo(left,top); 
}

//ÆË¾÷À§Ä¡ »ç¿ëÀÚº¯°æ
function pop_center_fnc(marginW,marginH) {
	var width = screen.width; 
	var height = screen.height;
	var left = width/2 - marginW;
	var top = height/2 - marginH;
	window.moveTo(left,top); 
}

//ÆË¾÷¸®»çÀÌÁî
function pop_autoReSize(width,height)
{
	// XP¼­ºñ½ºÆÑ2 ºê¶ó¿ìÀúÀÏ °æ¿ì ³ôÀÌ°¡ ÁÙ¾îµê +20 Ã³¸®
	var g_fIsSP2 = false; 
	g_fIsSP2 = (window.navigator.userAgent.indexOf("SV1") != -1);
	if (g_fIsSP2)
	{
		// XP SP2 ºê¶ó¿ìÀúÀÓ..
		window.resizeTo(width,height+20);
	}
	else
	{
		//XP SP2 ºê¶ó¿ìÀú°¡ ¾Æ´Ô.
		window.resizeTo(width,height);
	}
}

/*/////////////////////////////////////////////////////
ÅëÇÕ°Ë»ö
/////////////////////////////////////////////////////*/
function clearFind() {
	var form = document.searchForm;
	form.findValue.value='';
	form.findValue.style.fontFamily="µ¸¿ò";
	form.findValue.style.fontSize="12px";
	form.findValue.style.color ="#000000" ;
	form.findValue.style.fontWeight ="" ;
	form.findValue.style.letterSpacing = "0" ;
}

function topSearch() {
	var form = document.searchForm;
	if (form.findValue.value=='' || form.findValue.value=='|' || form.findValue.value=='°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä') {
		alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À');
		form.findValue.focus();
		return false;
	}
	else {
		if(form.findValue.style.color=='#000000') {
			form.action =  defaultUrl+"index.html";
			form.submit();
		} else {		
			document.location.href=document.searchForm.action;
		}	
	}
}

function resultSearch() {
	var form = document.rsearchForm;
	if (form.findNow.value=='') {
		alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À');
		form.findNow.focus();
		return false;
	}
	/*
	else {
		if(form.findReCk[0].checked==true && form.findNow.value!='') { //add
			if(form.findRetryAdd.value!='')
			{
				form.findRetryAdd.value=form.findRetryAdd.value+","+form.findRetry.value;
			}
			else
			{
				form.findRetryAdd.value=form.findRetry.value;
			}	
		}
		else if(form.findReCk[1].checked==true && form.findRetry.value!='') { //sub
			//form.findRetrySub.value=form.findRetrySub.value+","+form.findRetry.value;

			if(form.findRetrySub.value!='')
			{
				form.findRetrySub.value=form.findRetrySub.value+","+form.findRetry.value;
			}
			else
			{
				form.findRetrySub.value=form.findRetry.value;
			}	
		}		
	}//else end*/
}

function powerSearch() {//»ó¼¼°Ë»öpage-ÅëÇÕ°Ë»ö
	var form = document.powerForm;
	if (form.findValue.value=='' || form.findValue.value=='|' || form.findValue.value=='°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä') {
		alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À');
		form.findValue.focus();
		return false;
	}
}

function detailSearch() {//»ó¼¼°Ë»öpage-»ó¼¼°Ë»ö
	var form = document.detailForm;
	if (form.findValue.value=='' || form.findValue.value=='|' || form.findValue.value=='°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä') {
		alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À');
		form.findValue.focus();
		return false;
	}
}
/*/////////////////////////////////////////////////////
¿ÞÂÊ»ó´Ü ·Ñ¸µ °øÁö
/////////////////////////////////////////////////////*/
/*
function startText() {
	for (i = 0; i < ctnt.length; i++) {
		insertText(i) ;
	}
	window.setTimeout("scroll()", wait) ;
}

function insertText(i) {
	htmlstr = '<div style="left: 0px; width: 330px; position: absolute; top: ' + (height * i + 1) + 'px" id="scroll_area'+i+'">\n' ;
	htmlstr += ctnt[i] + '\n' + '</div>\n' ;
	document.write(htmlstr) ;
}

function scroll() {
	if (mouse && flag) {
		for (i = 0; i < ctnt.length;i++) {
			if (temp == 0 && imgflag) {
				for (j = 0; j < ctnt_i.length; j++) {
					tmp = document.getElementById('img_area'+j).style ;
					if (count % ctnt_i.length == j) {
						tmp.display = "" ;
					} else {
						tmp.display = "none"; 
					}
				}
				imgflag = false ;
				count++ ;
			}
			temp++ ;
			tmp = document.getElementById('scroll_area' + i).style ;
			tmp.top = parseInt(tmp.top) - speed ;

			if (parseInt(tmp.top) <= height * (-1)) {
				tmp.top = height * (ctnt.length - 1) ;
			}

			if (temp > (amount - 1) * ctnt.length) {
				flag = false ;
				temp = 0 ;
				window.setTimeout("flag=true;temp=0;imgflag=true;", wait) ;
			}
		}
	}
	window.setTimeout("scroll()", 1) ;
}

function scroll2() {
	this.name = "scroll";
	this.item = new Array();
	this.itemcount = 0;
	this.currentspeed = 0;
	this.scrollspeed = 20;
	this.pausedelay = 100;
	this.pausemouseover = false;
	this.stop = false;
	this.type = 1;
	this.height = 100;
	this.width = 100;
	this.stopHeight=0;
	this.add =function () {
		var text = arguments[0];
		this.item[this.itemcount] = text;
		this.itemcount = this.itemcount + 1;
	};
	this.start = function () {
		this.display();
		this.currentspeed = this.scrollspeed;
		setTimeout(this.name+'.scroll()',this.currentspeed);
	};
	this.display =function () {
		document.write('<div id="'+this.name+'" style="height:'+this.height+';width:'+this.width+';position:relative;overflow:hidden;" OnMouseOver="'+this.name+'.onmouseover();" OnMouseOut="'+this.name+'.onmouseout();">');
		for(var i = 0; i < this.itemcount; i++) {if ( this.type == 1) {
				document.write('<div id="'+this.name+'item'+i+'"style="left:0px;width:'+this.width+';position:absolute;top:'+(this.height*i+1)+'px;">');
				document.write(this.item[i]);
				document.write('</div>');
			}
			else if ( this.type == 2 ) {
				document.write('<div id="'+this.name+'item'+i+'"style="left:'+(this.width*i+1)+'px;width:'+this.width+';position:absolute;top:0px;">');
				document.write(this.item[i]);
				document.write('</div>');
			}
		}
		document.write('</div>');
	};
	this.scroll = function () {
		this.currentspeed = this.scrollspeed;if ( !this.stop ) {
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;if ( this.type == 1 ) {
					obj.top = parseInt(obj.top) - 1;
					if ( parseInt(obj.top) <= this.height*(-1) ) obj.top = this.height * (this.itemcount-1);
					if ( parseInt(obj.top) == 0 || ( this.stopHeight > 0 && this.stopHeight - parseInt(obj.top) == 0 ) ) this.currentspeed = this.pausedelay;
				}
				else if ( this.type == 2 ) {
					obj.left = parseInt(obj.left) - 1;
					if ( parseInt(obj.left) <= this.left*(-1) ) obj.left = this.left* (this.itemcount-1);
					if ( parseInt(obj.left) == 0 ) this.currentspeed = this.pausedelay;
				}
			}
		}
		window.setTimeout(this.name+".scroll()",this.currentspeed);
	};
	this.onmouseover = function () {
		if ( this.pausemouseover ) {
		this.stop = true;}
	};
	this.onmouseout = function () {
		if ( this.pausemouseover ) {
			this.stop = false;
		}
	}
}
*/

/*/////////////////////////////////////////////////////
ÇÃ·¡½Ã
/////////////////////////////////////////////////////*/
function Webpage_Flash(url,fwidth,fheight,f_opt){ //
 document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ fwidth +'" height="'+ fheight +'">');
 document.write('<param name="movie" value="'+ url +'">');
 document.write('<param name="quality" value="high">');
 if (f_opt=="tr"){
  document.write('<param name="wmode" value="transparent">');
 } else { document.write('<param name="wmode" value="opaque">'); }
 document.write('<embed src="'+ url +'" quality="high" pluginspage="https://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ fwidth +'" height="'+ fheight +'">');
 document.write('</embed>');
 document.write('</object>'); 
}

function Webpage_Flash2(url,fwidth,fheight,value){ //
 document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ fwidth +'" height="'+ fheight +'">');
 document.write('<param name="movie" value="'+ url +'">');
 document.write("	<param name='bgcolor' value='#ffffff' /> ");
 document.write('<param name="quality" value="high">');
 document.write('<param name="wmode" value="opaque">');
 document.write("<param name='flashVars' value='"+value+"'>");
 document.write('<embed src="'+ url +'" quality="high" pluginspage="https://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ fwidth +'" height="'+ fheight +'">');
 document.write('</embed>');
 document.write('</object>');
}


function DisplayMenu(divname,state) { //state°¡ 1ÀÌ¸é º¸¿©¶ó, 0ÀÌ¸é »ç¶óÁ®¶ó
		//thisMenu = eval(divname + ".style");
		if(state == 1) {			
			document.getElementById(divname).style.display = "";
		} 
		else {
			document.getElementById(divname).style.display = "none";
		}
}

/*/////////////////////////////////////////////////////
·Ñ¸µÀÌº¥Æ® - ÀÌ¹ÌÁö1°³¾¿
/////////////////////////////////////////////////////*/
function nsRollingImageTrans(imageName, thumbnailName, eventName, winName){
	this.Index = 0;
	this.ListItem = new Array(0);
	this.Name = imageName;
	this.Thumbnail = thumbnailName;
	this.tmRotate = null;
	this.nInterval = 5000;//7000;
	this.eventName = eventName;
	this.winTarget = winName;
	
	if(window.nsRollObject == null) window.nsRollObject = new Array(0);
	window.nsRollObject[this.Name] = this;

	//ÃÊ±âÈ­ ÇÔ¼ö
	this.install = function(){
		window.document.images[this.Name].onclick=this.goLink;
		if(this.ListItem.length == 0) return;
		this.tmRotate = setTimeout("window.nsRollObject['" + this.Name + "'].rotateTrans()" , this.nInterval);
		var icons = document.getElementsByName(this.Thumbnail);
		for(var i = 0; i < icons.length; i++){
			if(this.eventName == 'over') icons[i].onmouseover=new Function("window.nsRollObject['"+this.Name+"'].alterImage(" + i + ")");
			else icons[i].onclick=new Function("window.nsRollObject['"+this.Name+"'].alterImage(" + i + ")");
		}
	}
	//ÇØ´ç ¾ÆÀÌÅÛ Ãß°¡ 
	this.addItem = function(Link, ImgSrc, Icon1, Icon2 ){
		var itmX = {Link : "", ImgSrc : "", DefIcon : "", OvrIcon : ""};
		itmX.Link = Link;
		itmX.ImgSrc = ImgSrc;
		itmX.DefIcon = Icon1;
		itmX.OvrIcon = Icon2;
		this.ListItem[this.ListItem.length] = itmX;
	}
	//¼öµ¿ º¯°æ 
	this.alterImage = function(index){
		var icons = document.getElementsByName(this.Thumbnail);
		if(this.Index == index) return;
		if(this.ListItem[this.Index].DefIcon !="") icons[this.Index].src = this.ListItem[this.Index].DefIcon;

		this.Index = index;
		this.imgTrans();
		clearTimeout(this.tmRotate);
		this.tmRotate = null;
		this.tmRotate = setTimeout("window.nsRollObject['" + this.Name + "'].rotateTrans()" , this.nInterval);
	}
	//¸µÅ© Å¬¸¯
	this.goLink = function(){
		var name = this.getAttribute('name');
		var nsRoll = window.nsRollObject[name];
		clearTimeout(nsRoll.tmRotate);
		nsRoll.tmRotate = null;

		if(nsRoll.winTarget == '' || nsRoll.winTarget == null){
			window.location.href=nsRoll.ListItem[nsRoll.Index].Link;
		}else if(nsRoll.winTarget.toLowerCase().indexOf("javascript") == 0){
			alert( winTarget.replace(/javascript:/gi,'') )
		}else{
			window.open(nsRoll.ListItem[nsRoll.Index].Link, nsRoll.winTarget);
		}
	}
	//==
	this.rotateTrans = function(){
		var icons = document.getElementsByName(this.Thumbnail);
		var itmX = this.ListItem[this.Index];
		if(itmX.DefIcon !="") icons[this.Index].src = itmX.DefIcon;

		this.Index +=1;
		if(this.Index >= this.ListItem.length) this.Index = 0;

		this.imgTrans();
		
		clearTimeout(this.tmRotate);
		this.tmRotate = null;
		this.tmRotate = setTimeout("window.nsRollObject['" + this.Name + "'].rotateTrans()" , this.nInterval);
	}
	//==
	this.imgTrans = function(){
		var icons = document.getElementsByName(this.Thumbnail);
		var itmX = this.ListItem[this.Index];
		if(itmX.OvrIcon !=null  && itmX.OvrIcon !="") icons[this.Index].src = itmX.OvrIcon;
		try{
			document.images[this.Name].filters[0].apply();
			document.images[this.Name].src = itmX.ImgSrc;
			document.images[this.Name].filters[0].play();
		}catch(e){
			document.images[this.Name].src = itmX.ImgSrc;
		}
	}
}

//·Ñ¸µÀÌº¥Æ® LOW
function nsRollingImageTransLow(imageName, thumbnailName, eventName, winName){
	this.Index = 0;
	this.ListItem = new Array(0);
	this.Name = imageName;
	this.Thumbnail = thumbnailName;
	this.tmRotate = null;
	this.nInterval = 5000; //13590;
	this.eventName = eventName;
	this.winTarget = winName;
	
	if(window.nsRollObject == null) window.nsRollObject = new Array(0);
	window.nsRollObject[this.Name] = this;

	//ÃÊ±âÈ­ ÇÔ¼ö
	this.install = function(){
		window.document.images[this.Name].onclick=this.goLink;
		if(this.ListItem.length == 0) return;
		this.tmRotate = setTimeout("window.nsRollObject['" + this.Name + "'].rotateTrans()" , this.nInterval);
		var icons = document.getElementsByName(this.Thumbnail);
		for(var i = 0; i < icons.length; i++){
			if(this.eventName == 'over') icons[i].onmouseover=new Function("window.nsRollObject['"+this.Name+"'].alterImage(" + i + ")");
			else icons[i].onclick=new Function("window.nsRollObject['"+this.Name+"'].alterImage(" + i + ")");
		}
	}
	//ÇØ´ç ¾ÆÀÌÅÛ Ãß°¡ 
	this.addItem = function(Link, ImgSrc, Icon1, Icon2 ){
		var itmX = {Link : "", ImgSrc : "", DefIcon : "", OvrIcon : ""};
		itmX.Link = Link;
		itmX.ImgSrc = ImgSrc;
		itmX.DefIcon = Icon1;
		itmX.OvrIcon = Icon2;
		this.ListItem[this.ListItem.length] = itmX;
	}
	//¼öµ¿ º¯°æ 
	this.alterImage = function(index){
		var icons = document.getElementsByName(this.Thumbnail);
		if(this.Index == index) return;
		if(this.ListItem[this.Index].DefIcon !="") icons[this.Index].src = this.ListItem[this.Index].DefIcon;

		this.Index = index;
		this.imgTrans();
		clearTimeout(this.tmRotate);
		this.tmRotate = null;
		this.tmRotate = setTimeout("window.nsRollObject['" + this.Name + "'].rotateTrans()" , this.nInterval);
	}
	// ¸µÅ© Å¬¸¯
	this.goLink = function(){
		var name = this.getAttribute('name');
		var nsRoll = window.nsRollObject[name];
		clearTimeout(nsRoll.tmRotate);
		nsRoll.tmRotate = null;

		if(nsRoll.winTarget == '' || nsRoll.winTarget == null){
			window.location.href=nsRoll.ListItem[nsRoll.Index].Link;
		}else if(nsRoll.winTarget.toLowerCase().indexOf("javascript") == 0){
			alert( winTarget.replace(/javascript:/gi,'') )
		}else{
			window.open(nsRoll.ListItem[nsRoll.Index].Link, nsRoll.winTarget);
		}
	}
	//==
	this.rotateTrans = function(){
		var icons = document.getElementsByName(this.Thumbnail);
		var itmX = this.ListItem[this.Index];
		if(itmX.DefIcon !="") icons[this.Index].src = itmX.DefIcon;

		this.Index +=1;
		if(this.Index >= this.ListItem.length) this.Index = 0;

		this.imgTrans();
		
		clearTimeout(this.tmRotate);
		this.tmRotate = null;
		this.tmRotate = setTimeout("window.nsRollObject['" + this.Name + "'].rotateTrans()" , this.nInterval);
	}
	//==
	this.imgTrans = function(){
		var icons = document.getElementsByName(this.Thumbnail);
		var itmX = this.ListItem[this.Index];
		if(itmX.OvrIcon !=null  && itmX.OvrIcon !="") icons[this.Index].src = itmX.OvrIcon;
		try{

			document.images[this.Name].filters[0].apply();
			document.images[this.Name].src = itmX.ImgSrc;
			document.images[this.Name].filters[0].play();
		}catch(e){
			document.images[this.Name].src = itmX.ImgSrc;
		}
	}
}


/*/////////////////////////////////////////////////////
KCP¿¡½ºÅ©·Î °¡ÀÔÈ®ÀÎ Ç¥½Ã
/////////////////////////////////////////////////////*/
function escrowForm_check()
{
	var status  = "width=500 height=450 menubar=no,scrollbars=no,resizable=no,status=no";
	var obj     = window.open('', 'kcp_pop', status);

	document.escrow_check.method = "post";
	document.escrow_check.target = "kcp_pop";
	document.escrow_check.action = "http://admin.kcp.co.kr/Modules/escrow/kcp_pop.jsp";
	document.escrow_check.submit();
}

/*/////////////////////////////////////////////////////
top ÅØ½ºÆ®½ºÅ©·Ñ
/////////////////////////////////////////////////////*/
function banner_roll(div_id, banner_height, banner_delay, banner_speed, this_height)
{// banner_roll("divÅÂ±× id", ¹è³Ê1°³³ôÀÌ, µô·¹ÀÌ, 1Ä­ÀÌµ¿¼Óµµ, 0);
    var div_tag = document.getElementById(div_id);
    var a_tag, i;

    this_height ++;
    if(this_height < banner_height) {
        div_tag.style.top = -this_height;
        setTimeout("banner_roll('" + div_id + "', " + banner_height + ", " + banner_delay + ", " + banner_speed + ", " + this_height + ");", banner_speed);
    }
    else {
        a_tag = div_tag.getElementsByTagName("A");
        div_tag.appendChild(a_tag[0]);
        div_tag.style.top = 0;
        setTimeout("banner_roll('" + div_id + "', " + banner_height + ", " + banner_delay + ", " + banner_speed + ", 0);", banner_delay);
    }

    return true;
}


function popup_control()
{
	var popup = null;
	
	var pwidth = screen.width+500; 
	var pheight = screen.height+500;
	popup = window.open('','pop_control','width=0,height=0,left='+pwidth+',top='+pheight);
	self.close();

	if(!popup)
	{
		alert("ÆË¾÷Â÷´ÜÀ» ÇØÁ¦ÇØÁÖ¼¼¿ä.");
		return 0;
	}
	//popup.focus();
}