function open_window( filename, option, name )
{
	if( !name )
	{
		name = 'new'
	}


        win = window.open( filename, name, option );

        return win
}

function window_open( page, name, top, left, width, height )
{
	option = "'toolbar=no," +
		"location=no," +
		"directories=no," +
		"status=no," +
		"menubar=no," +
		"scrollbars=yes," +
		"resizable=yes," +
		"width=" + width + "," +
		"height=" + height + "," +
		"top=" + top + "," +
		"left=" + left + "'"

	var w=window.open( page, name, option );
	w.focus();
}

function open_poll_pop( mode, no )
{
	page = '/front/php/poll_r.php?mode=' + mode + '&no=' + no;
	window_open( page, 'poll', 100, 300, 466, 382 );
}

/*Left menu ¹ÝÅõ¸í ·¹ÀÌ¾î ±¸Çö*/
function Layer_overload(LayerName,Status) 
{
    if (navigator.appName == "Netscape")
    {
		LayerN = document.getElementById(LayerName).style;
		if (Status == 'show') LayerN.visibility = 'visible';
		if (Status == 'hide') LayerN.visibility = 'hidden';
    }	
    else
    {
		LayerN = document.all[LayerName].style;
		if (Status == 'show') LayerN.visibility = 'visible';
		if (Status == 'hide') LayerN.visibility = 'hidden';
    }
}

/*Left menu±¸Çö*/
var old='';

function menu(name)
{
	submenu=eval("submenu_"+name+".style");
	if(old!=submenu)
	{
		if(old!='')
		{
			old.display='none';
		}
		submenu.display='block';
		old=submenu;
	}
	else
	{
		submenu.display='none';
		old='';
	}
}


function Layer_rollover(img_name,img_url)
{
	var menu;	
	//tmp = new String( "document."+img_name );
	menu=eval("document."+img_name);		
	menu.src = img_url;
	return;
}

function image_zoom( product_no, main_cate_no, display_group )
{
	//href = '/front/php/image_zoom.php?img='+image+'&product_no='+document.frm.product_no.value;
	href = '/front/php/image_zoom.php?product_no='+product_no+'&main_cate_no='+main_cate_no+'&display_group='+display_group;
	option = 'toolbar=no,scrollbars=no,resizable=yes,width=800,height=640,left=0,top=0';
	win_name = 'image'

	window.open( href, win_name, option );
}

/*
 * Ãâ¼®Ã¼Å© ÆË¾÷
 */
function attend_popup() 
{
	url = "/front/php/attend_event_popup.php";
	winname = "attend_event_popup" ;
	option = "toolbar=no location=no scrollbars=yes width=700 height=900";
	opener = window.open( url, winname, option ) ;
}

function blockError(){return true;}   
window.onerror = blockError; 


function bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;


function btn(id,after) 
{ 
eval(id+'.filters.blendTrans.stop();'); 
eval(id+'.filters.blendTrans.Apply();'); 
eval(id+'.src="'+after+'";'); 
eval(id+'.filters.blendTrans.Play();'); 
} 
         
function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}                        

 function xwzRollingImageTrans(imageName, thumbnailName, eventName, winName){
  this.Index = 0;
  this.ListItem = new Array(0);
  this.Name = imageName;
  this.Thumbnail = thumbnailName;
  this.tmRotate = null;
  this.nInterval = 7000;
  this.eventName = eventName;
  this.winTarget = winName;
  
  if(window.xwzRollObject == null) window.xwzRollObject = new Array(0);
  window.xwzRollObject[this.Name] = this;
 
  this.install = function(){
   window.document.images[this.Name].onclick=this.goLink;
   if(this.ListItem.length == 0) return;
   this.tmRotate = setTimeout("window.xwzRollObject['" + 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.xwzRollObject['"+this.Name+"'].alterImage(" + i + ")");
    else icons[i].onclick=new Function("window.xwzRollObject['"+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.xwzRollObject['" + this.Name + "'].rotateTrans()" , this.nInterval);
 
 }
 
  this.goLink = function(){
   var name = this.getAttribute('name');
   var xwzRoll = window.xwzRollObject[name];
   clearTimeout(xwzRoll.tmRotate);
   xwzRoll.tmRotate = null;
 
  if(xwzRoll.winTarget == '' || xwzRoll.winTarget == null){
    window.location.href=xwzRoll.ListItem[xwzRoll.Index].Link;
   }else if(xwzRoll.winTarget.toLowerCase().indexOf("javascript") == 0){
    alert( winTarget.replace(/javascript_:/gi,'') )
   }else{
    window.open(xwzRoll.ListItem[xwzRoll.Index].Link, xwzRoll.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.xwzRollObject['" + 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;
   }
  }
 }
