function onMouseOverCategory(oMenu,oTable, category_id){
	var osub = document.getElementById("category_"+category_id);
	var otb = document.getElementById(oTable);

	osub.style.top =  oMenu.offsetTop;
	osub.style.left =  oMenu.offsetLeft+130;
	osub.style.display = "block";


	if(osub.innerHTML == ""){
		var xmlHttp_ = new XMLHttp();
		ret = xmlHttp_.request("get", "/shop/category_sub.php?depth=1&cid="+category_id, false);
		osub.innerHTML = ret.responseText;
	}

}


function onMouseOutCategory(category_id){
	document.getElementById("category_"+category_id).style.display = "none";
}

function readCookie(cookiename)
{

  var Found = false;

  cookiedata = document.cookie;
  if ( cookiedata.indexOf(cookiename) > 0 ){
    Found = true;

  }

  return Found;
}

function MainPopUpWindow(mypage, w, h, t, l, myname, scroll) {

	if(t == 0 && l == 0){
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
	}else{
		var winl = l;
		var wint = t;
	}
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',menubar=no,status=no,toolbar=no,resizable=yes'
	win = window.open(mypage, myname, winprops)
	//if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

//ÇÃ·¡½¬ Àç»ý ¼Ò½º
function generate_flash(file_, width_, height_){

	var mstring="";

	mstring = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+width_+'" height="'+height_+'" id="falsh_" align="middle"> \n';
	mstring += '<param name="allowScriptAccess" value="always" /> \n';
	mstring += '<param name="movie" value="'+file_+'" /> \n';
	mstring += '<param name="quality" value="high" /> \n';
	mstring += '<param name="wmode" value="Transparent" /> \n';
	mstring += '<param name="bgcolor" value="#ffffff" /> \n';
	mstring += '<embed src="'+file_+'" quality="high" bgcolor="#ffffff" width="'+width_+'" height="'+height_+'" name="flash_" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> \n';
	mstring += '</object> \n';

	document.write(mstring);
}




function mScroll()
{
	/*********************************
	 * eScroll ( eNamoo scroll script )
	 * by mirrh
	 * 2006.07.16
	 ********************************/

	var thisObj = this;
	this.timeObj = null;

	/*** ¼³Á¤º¯¼ö ***/
	this.mode = "top";				// ½ºÅ©·Ñ ¹æÇâ (top|left)
	this.width = "100%";			// ¶óÀÎ´ç °¡·Î°ª (pixel)
	this.height = 20;				// ¶óÀÎ´ç ³ôÀÌ°ª (pixel)
	this.line = 1;					// Ãâ·Â ¶óÀÎ¼ö
	this.delay = 110;				// ½ºÅ©·ÑÈÄ µô·¹ÀÌ ½Ã°£
	this.speed = 1;					// ½ºÅ©·Ñ ¼Óµµ (ÀÛÀ»¼ö·Ï ºü¸§)
	this.id = 'obj_eScroll';		// °´Ã¼ id (Å¬·¡½º ´ÙÁß »ç¿ë½Ã id ´Ù¸£°Ô ÁöÁ¤ ¿ä¸Á)
	this.contents = new Array();	// Ãâ·Â ³»¿ë (¹è¿­·Î ³»¿ë ÁöÁ¤ ¿ä¸Á)
	this.align = "left";			// ³»¿ë aligne
	this.valign = "middle";			// ³»¿ë valigne

	/*** ³»Àåº¯¼ö ***/
	this.gap = 0;
	this.direction = 1;

	this.add = add;
	this.exec = exec;
	this.start = start;
	this.stop = stop;
	this.scroll = scroll;
	this.direct = direct;
	this.go = go;

	function add(str)
	{
		this.contents[this.contents.length] = str;
	}

	function exec()
	{
		this.basis = (this.mode == "left") ? this.width : this.height;
		var outWidth = this.width * ((this.mode == "left") ? this.line : 1);
		var outHeight = this.height * ((this.mode == "top") ? this.line : 1);

		var outline = "<div id=" + this.id + " style='overflow:hidden;width:" + outWidth + ";height:" + outHeight + "'><table></table></div>";
		document.write(outline);
		this.obj = document.getElementById(this.id);

		var tb = this.obj.appendChild(document.createElement("table"));
		var tbody = tb.appendChild(document.createElement("tbody"));
		tb.cellPadding = 0 ;
		tb.cellSpacing = 0 ;
		tb.onmouseover = function(){thisObj.stop()};
		tb.onmouseout = function(){thisObj.start()};

		if (this.mode=="left") var tr = tbody.appendChild(document.createElement("tr"));
		for (k=0;k<this.contents.length;k++){
			if (this.mode=="top") var tr = tbody.appendChild(document.createElement("tr"));
			var td = tr.appendChild(document.createElement("td"));
			td.noWrap = true;
			td.style.width = this.width;
			td.style.height = this.height;
			td.style.textAlign = this.align;
			td.style.verticalAlign = this.valign;
			td.innerHTML = this.contents[k];
		}

		var len = (this.contents.length<this.line) ? this.contents.length : this.line;
		for (i=0;i<len;i++){
			if (this.mode=="top") var tr = tbody.appendChild(document.createElement("tr"));
			td = tr.appendChild(document.createElement("td"));
			td.noWrap = true;
			td.style.width = this.width;
			td.style.height = this.height;
			td.style.textAlign = this.align;
			td.style.verticalAlign = this.valign;
			td.innerHTML = this.contents[i];
		}

		this.obj.parent = this;
		this.tpoint = this.basis * this.contents.length;
		this.start();
	}

	function scroll()
	{
		var out = (this.mode=="left") ? this.obj.scrollLeft : this.obj.scrollTop;
		if (out%this.basis==0){
			this.gap++;
			if (this.gap>=this.delay) this.gap = 0;
		}
		if (!this.gap){
			var ret = (out==this.tpoint) ? this.direction : out + this.direction;
			if (ret<0) ret = this.tpoint + ret;
			if (this.mode=="left") this.obj.scrollLeft = ret;
			else this.obj.scrollTop = ret;
		}
	}

	function start()
	{
		this.timeObj = window.setInterval("(document.getElementById('" + this.id + "')).parent.scroll()",this.speed);
	}

	function stop()
	{
		clearTimeout(this.timeObj);
	}

	function direct(d)
	{
		this.direction = d;
	}

	function go()
	{
		this.stop();
		var out = (this.mode=="left") ? this.obj.scrollLeft : this.obj.scrollTop;
		var ret = (parseInt(out / this.basis) + this.direction) * this.basis;
		if (ret<0) ret = this.tpoint + ret;
		if (ret>this.tpoint) ret = this.basis;
		if (this.mode=="left") this.obj.scrollLeft = ret;
		else this.obj.scrollTop = ret;
	}

}

function pstCLog(link,title,thumbnail,summary,writer) {
	var href = "http://csp.cyworld.com/bi/bi_recommend_pop.php?url=" + encodeURIComponent(link) + "&thumbnail=" + encodeURIComponent(thumbnail) + "&summary=" + encodeURIComponent(summary) + "&writer=" + encodeURIComponent(writer);
	var a = window.open(href, 'clog', 'width=400, height=364, scrollbars=no, resizable=no');
	if ( a ) {
		a.focus();
	}
}

function pstTwitter(msg,url) {
	//var href = "http://twitter.com/home?status=" + encodeURIComponent(msg) + " " + encodeURIComponent(url);
	var href = "http://twitter.com/intent/tweet?text="+encodeURIComponent(msg)+"&url="+encodeURIComponent(url);
	var a = window.open(href, 'twitter', '');
	if ( a ) {
		a.focus();
	}
}
function pstMe2Day(msg,url,tag) {
	var href = "http://me2day.net/posts/new?new_post[body]=" + encodeURIComponent(msg) + " " + encodeURIComponent(url) + "&new_post[tags]=" + encodeURIComponent(tag);
	var a = window.open(href, 'me2Day', '');
	if ( a ) {
		a.focus();
	}
}


function pstFaceBook(msg,url,tag) {

	var href = "http://www.facebook.com/sharer.php?s=100&p[url]="+encodeURIComponent(url)+"&p[summary]="+encodeURIComponent(tag)+"&p[title]="+encodeURIComponent(msg);
	var a = window.open(href, 'facebook', '');
	if ( a ) {
		a.focus();
	}
}

function post_facebook(url,title,content,img){
	var href = "http://www.facebook.com/sharer.php?s=100&p[url]="+encodeURIComponent(url)+"&p[title]="+encodeURIComponent(title)+"&p[summary]="+encodeURIComponent(content)+"&p[images][0]="+encodeURIComponent(img);
	var a = window.open(href, 'facebook', '');
	if ( a ) {
		a.focus();
	}
}

function pstYozmDaum(link,prefix,parameter) {
	var href = "http://yozm.daum.net/api/popup/prePost?sourceid=54&link=" + encodeURIComponent(link) + "&prefix=" + encodeURIComponent(prefix) + "&parameter=" + encodeURIComponent(parameter);
	var a = window.open(href, 'yozm', 'width=466, height=356');
	if ( a ) {
		a.focus();
	}
}
