function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

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 memberRegist()
{
//¾à°üµ¿ÀÇ µµÀÔ½Ã	document.location = "/login/agreement.html";
	document.location = "/login/regist_form.asp";
}
function findidnpass()
{
	document.location = "/login/findidnpass.asp";
}
function delUser()
{
	document.location = "/login/delUser.asp";
}
function editUser()
{
	document.location = "/login/edit_form.asp";
}
function go2myalbum()
{
	document.location = "/solo/MyAlbum.asp";
}
function refillJelly()
{
	document.location = "/refill/refill_Jelly.asp";
}
function chkLength()
	{
		//alert(getStrLen(fm.str.value))
		if(getStrLen(fm.str.value) <= 2)
		{
			alert("°Ë»öÀº 2ÀÚÀÌ»ó °¡´É ÇÕ´Ï´Ù.") ; 
			fm.str.select();
			return false ; 
		}
		fm.submit();
		return false ; 
	}
function chkkey(){
	if (event.keyCode == 13)
	{
		chkLength();
		return false;
	}
}
function getStrLen(str)
{
	var l = str.length;
	var repl = /[^0-9a-zA-Z]/;
	var tmpl = 0;
	for(var i=0;i<l;i++)
	{
		if(repl.test(str.substr(i,1)))
		{
			tmpl = tmpl + 2;
		}
		else
		{
			tmpl++;
		}
	}
	return tmpl;
}

function rtrim(str){
	var ret = ""
	for(var i = str.length-1; i >= 0; i--){
		if(str.substr(i,1) == " "){
			str = str.substr(0,str.length-1);
		}else{
			break;
		}
	}
	return str;
}

function CanfileCmt(fcode)
{
	var width=650, height=500;
	var left, top;
	var winpos, winstyle;
	var realstcode = 0;
	
	left = (window.screen.width-width)/2;
	top = (window.screen.height-height)/2;
	
	winpos = "left=" + left + ",top=" + top;
	winstyle = "width="+width+",height="+height+",status=no,toolbar=no,menubar=no, location=no, resizable=no,scrollbars=yes,copyhistory=no," + winpos;

	var wind = window.open ("/solo/canfileCmt.asp?fcode=" + fcode +"", "popup", winstyle);
	if (wind) wind.focus();
	//return false;
}


function jjim(fcode)
{
	var width=1, height=1;
	var left, top;
	var winpos, winstyle;
	
	left = 0;
	top = 0;
	
	winpos = "left=" + left + ",top=" + top;
	winstyle = "width="+width+",height="+height+",status=no,toolbar=no,menubar=no, location=no, resizable=no,scrollbars=no,copyhistory=no," + winpos;

	var wind = window.open ("http://canweb.lemonball.com/jjim/jjim.asp?fcode=" + fcode + "", "popup", winstyle);
	if (wind) wind.focus();
	return false;
}

var vos_idx = 0; 

function deleteComent(idx , page , c_page , seq )	//080118 c_page
{
	var ansure
	ansure = confirm("Á¤¸»·Î Áö¿ì½Ã°Ú½À´Ï±î?")
	if (ansure == true)
	{
		document.location="delcomment.asp?idx=" + idx + "&seq=" + seq + "&page=" + page + "&c_page=" + c_page
	}
}

function editComent(idx , page , c_page , seq )	//080118 c_page
{
	document.location="contents.asp?idx=" + idx + "&c_seq=" + seq + "&page=" + page + "&c_page=" + c_page + "&EditComment=1&viewcntUp=0#writeCmt"	//071221 viewcntUp
}

function checkEnter(){
	if(event.keyCode == 13) {
		login.submit();
		return false;
	}
}

//=====================================================================================================================
//		»ç¿ë : <SCRIPT>mEmbed('file=¿ø¼Ò½ºURL','src=/inc/flvplayer.swf','width=320','height=240');</SCRIPT>
//=====================================================================================================================

function GET(arrayKey, arrayValue, Value) {
	count = arrayKey.length;
	for(i=0;i<count;i++) {
		if(arrayKey[i]==Value) {
			return arrayValue[i];
			break;
		}
	}
}

function mEmbed() {
	var key = new Array();
	var value = new Array();
	error_check=0;
	for(i=0;i<mEmbed.arguments.length;i++) {
		data = mEmbed.arguments[i].split('=');
		key[i] = data[0];
		value[i] = data[1];
	}

	contents = '';
	srcdata = GET(key,value,'src');
	if(/\.(...)$/.test(srcdata)) {
		flashon = 1;
	}

	classid = GET(key,value,'classid');
	codebase = GET(key,value,'codebase');
	if(flashon==1) {
		classid = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';
		codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0';
	}
	if(classid && codebase) {
		contents += '<object';
		if(classid) {
			contents += ' classid="' + classid + '"';
		}
		if(codebase) {
			contents += ' codebase="' + codebase + '"';
		}
		count = key.length;
		for(i=1;i<count;i++) {
			if(value[i]!='') {
				if(key[i]!='src') {
					contents += ' ' + key[i] + '="' + value[i] + '"';
				}
			}
		}
		contents += '>';
		for(i=1;i<count;i++) {
			if(value[i]!='') {
				if(flashon==1 && key[i]=='src') {
					contents += '<param name="movie" value="' + value[i] + '?' + key[0] + '=' + value[0] + '" />';
				} else {
					contents += '<param name="' + key[i] + '" value="' + value[i] + '" />';
				}
			}
		}
	}
	contents += '<embed';
	for(i=1;i<count;i++) {
		if(value[i]!='') {
			if(flashon==1 && key[i]=='src') {
				contents += ' ' + key[i] + '="' + value[i] + '?' + key[0] + '=' + value[0] + '"';
			}
			else {
				contents += ' ' + key[i] + '="' + value[i] + '"';
			}
		}
	}
	contents += '>';
	contents += '</embed>';
	if(classid && codebase) {
		contents += '</object>';
	}
	//window.alert(contents);
	document.write(contents);
}

function openInfo(uid) {
	var width=870, height=580;
	
	var left, top;
	var winpos, winstyle;
	
	left = (window.screen.width-width)/2;
	top = (window.screen.height-height)/2;
	
	winpos = "left=" + left + ",top=" + top;
	winstyle = "width="+width+",height="+height+",status=no,toolbar=no,menubar=no, location=no, resizable=no,scrollbars=no,copyhistory=no," + winpos;
	var userinfo = window.open("/userinfo/userinfo.asp?uid=" + uid, "USERINFO", winstyle);
	userinfo.focus();
	return false;
}
function setkeycheck(code) {
	if(code == 0)
		document.all.login.g_uid.value = document.all.login.g_uid.value.replace('¾ÆÀÌµð','');
	else if(code == 1)
		document.all.login.g_pass.value = document.all.login.g_pass.value.replace('ºñ¹Ð¹øÈ£','');
}

