var title_img = '';

function categorySelected(){

 var url = document.URL;
 var url_no ='';
 var img_no ='';
 var s = url.indexOf('gonggu');

 if (s != '-1') {
  s= url.indexOf('main_cate_no');
  var e = url.indexOf('&',s);
  url_no = url.substring(s+13, e);

 } else {
  var x = url.indexOf('main_cate_no');

  if (x != '-1'){
   var e = url.indexOf('&',x);
   url_no = url.substring(x+13, e);

  } else {
   var url_Len = url.indexOf('=');
   url_no = url.substring(url_Len+1, url.length);

  }
 }
  

 switch(url_no){
	case '4':
		img_no ='4';
		break;
	case '7':  case '9':  case '8':  case '31':  case '73':
		img_no ='7';
		break;
	case '12': case '32': case '33': case '35': case '37': case '36':
		img_no ='12';
		break;
	case '30': case '74': case '42': case '40': case '41': case '39': case '38':
		img_no ='30';
		break;
	case '29':
		img_no ='29';
		break;
	case '53': case '57': case '56': case '55':
		img_no ='53';
		break;
	case '58': case '61': case '60': case '59':
		img_no ='58';
		break;
	case '54':
		img_no ='54';
		break;
	case '55': case '51': case '50': case '49':
		img_no ='55';
		break;
	case '24': case '70': case '71': case '72':
		img_no ='24';
		break;
         case '14': 
         case '15':
                  img_no = '0';
                  break;
	default:
                  img_no = url_no;
 }

return img_no;


}

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 + "'"

        window.open( page, name, option );
}

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 );
}



	var MaxtopQuantity=0; // max Top
	var MaxleftQuantity=0; // maxLeft

	var isDOM = (document.getElementById ? 1 : 0); 
	var isIE4 = ((document.all && !isDOM) ? 1 : 0);
	var isNS4 = (document.layers ? 1 : 0);

	function getRef(id) { // get Document Obj
		if (isDOM) return document.getElementById(id);
		if (isIE4) return document.all[id];
		if (isNS4) return document.layers[id];
	}

	var isNS = navigator.appName == "Netscape";
	function movingSlide() {
		var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck;
		if (isNS4) {
			yMenuFrom   = scrollingBanner.top;
			yMenuTo     = windows.pageYOffset+10;
		} else if (isDOM) {
			yMenuFrom   = parseInt (scrollingBanner.style.top, 10);
			yMenuTo     = (isNS ? window.pageYOffset : document.body.scrollTop)+10;
		}
		if(yMenuTo<MaxtopQuantity) yMenuTo = MaxtopQuantity;

		timeoutNextCheck = 500;

		if (yMenuFrom != yMenuTo) {
			yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 10);
			if (yMenuTo < yMenuFrom) yOffset = -yOffset;
			if (isNS4) scrollingBanner.top += yOffset;
			else if (isDOM) scrollingBanner.style.top = parseInt (scrollingBanner.style.top, 10) + yOffset;
			timeoutNextCheck = 10;
		}
		setTimeout ("movingSlide()", timeoutNextCheck);
	}


function bookmark(){
window.external.AddFavorite('http://www.m2m.ne.kr', 'Áñ°Å¿î ¼îÇÎ°ø°£!! ³²¼ºÀÇ·ù ¿¥Åõ¿¥(m2m)')
}

function set_Embed()
{
  var obj = new String;
  var parameter = new String;
  var embed = new String;
  var html = new String;
  var allParameter = new String;
  var clsid = new String;
  var codebase = new String;
  var pluginspace = new String;
  var embedType = new String;
  var src = new String;

  var width = new String;
  var height = new String;

  var ServerIp = new String;
  var UserId = new String;
  var PassiveMode = new String;
  var Port = new String;
  var Status = new String;
  var Banner = new String;
  var ECHosting = new String;
  var FilelinkService = new String;
  var FilelinkServer = new String;

  this.init = function( s ,w , h, getType ) {
      getType = (getType != undefined)? getType :'flash';
      if ( getType == "flash")
      {
        clsid = "D27CDB6E-AE6D-11cf-96B8-444553540000";
        codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0";
        pluginspage = "http://www.macromedia.com/go/getflashplayer";
        embedType = "application/x-shockwave-flash";

        parameter += "<param name='movie' value='"+ s + "'>\n";
        parameter += "<param name='quality' value='high'>\n";
        parameter += "<Param name='bgcolor' value=#FFFFFF>\n";

      }
      else if ( getType == 'webftp')
      {
        clsid = "EF256D78-3982-4F12-900B-AD8B254A43BD";
        codebase = "http://echosting.cafe24.com/ftpclient/Cafe24FtpCtl21.cab#version=1,0,2,7";
      }
      else if ( getType == 'filelinkftp')
      {
        clsid = "EF256D78-3982-4F12-900B-AD8B254A43BD";
        codebase = "http://echosting.cafe24.com/ftpclient/Cafe24FtpCtl14.cab#version=1,0,2,4";
      }



      src = s;
      width = w;
      height = h;
  }
}