Browser=(navigator.appName=="Netscape") ? false : true ;
request=Browser ? new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();
colorKey="";
//upload--------------------------------------------------------------------------------
function form_upfilePop(){
	p=window.open('/img/upfile.php','me','width=480 height=480');
}
function form_upfileAdd(t){
	tmp=document.getElementById("upfileList");
	opt=new Option(t,t);
	tmp.options.add(opt);
	for(i=0,str="",j=tmp.options.length;i<j;i++)str+=tmp.options[i].value+"|";
	document.getElementById("upfile").value=str;
}
function form_upfileDel(){
	tmp=document.getElementById("upfileList");
	for(i=0,j=tmp.options.length;i<j;i++)
		if(tmp.options[i]!=null&&tmp.options[i].selected==true)tmp.options[i]=null;
	for(i=0,str="",j=tmp.options.length;i<j;i++)str+=tmp.options[i].value+"|";
	document.getElementById("upfile").value=str;
}

function isSpace(_s){
	if(_s.search(/\s/)!=-1)return true;
	return false;
}
function isSep(_s){
	if(_s.search(/,/)!=-1)return true;
	return false;
}
function isEmail(_s){
	if(isSpace(_s))return false;
	if(isSep(_s))return false;
	regExp=/(\S+)@(\S+)[.](\S+)*/i;
	if(!regExp.test(_s))return false;
	return true;
}
function isHangul(s){
	for(var i=0,j=s.length;i<j;i++){
		if(s.charCodeAt(i)!=32&&(s.charCodeAt(i)<44032||s.charCodeAt(i)>55203))return false;
	}
	return true;
}
function isNum(s){
	for(var i=0,j=s.length;i<j;i++)
		if(s.charCodeAt(i)<48||s.charCodeAt(i)>57)return false;
	return true;
}
function isAlpha(s){
	for(var i=0,j=s.length;i<j;i++)
		if(s.charCodeAt(i)<65||s.charCodeAt(i)>122)return false;
	return true;
}

//util--------------------------------------------------------------------------------
function tdHandler(obj,color){
	if(obj.isOver){
		obj.isOver=false;
		obj.style.backgroundColor=obj.oCol;
	}else{
		obj.isOver=true;
		obj.oCol=obj.style.backgroundColor;
		obj.style.backgroundColor=color;
	}
}
function removeSpace(s){
	return s.replace(/\s/,"");
}
function trim(s){
	return s.replace(/^\s*/,"").replace(/\s*$/,"");
}
function dw(str){
	document.write(str);
}
function error(n){
	alert(errorArr[n]);
}
//site-------------------------------------------------------------------------------
function showLetterAdd(){
	var tmpObj=document.getElementById("email");
	if(trim(tmpObj.value)==''){
		alert("E-mailÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		tmpObj.value='';
		tmpObj.focus();
		return false;
	}
	if(!isEmail(tmpObj.value)){
		alert("E-mailÀ» È®ÀÎÇØÁÖ¼¼¿ä.");
		tmpObj.value='';
		tmpObj.focus();
		return false;
	}
	var email=tmpObj.value;

	document.letterNew.email_send.value=email;
//	document.letterNew.target='_top';
	document.letterNew.target='main';
	document.letterNew.submit();

//	document.getElementById("showLetterAdd").style.display="block";
//	document.getElementById("letterAdd").src="letterAdd.php?email="+email;
}
function openPop(url,r){
	window.open(url+'?r='+r,'gallery','width=250,height=163');
}
function sliderInit(id){
	tmp=document.getElementById(id);
	tmp.style.left=0;
}
function sliderMove(s,id){
	moveX=s;
	tmp=document.getElementById(id);
	if(moveX>0){
		if(parseInt(tmp.style.left)+((total-1)*cellWidth)>0){
			tmp.style.left=parseInt(tmp.style.left)-cellWidth+18;
		}
	}else if(moveX<0){
		if(parseInt(tmp.style.left)<0){
			tmp.style.left=parseInt(tmp.style.left)+cellWidth-18;
		}
	}
}
fldArr=new Array('title','contents');
searchArr=new Array('SUBJECT','CONTENT');
function changeChk(tmp){
	searchForm.f.value=fldArr[tmp];
	for(var i=0,j=searchArr.length;i<j;i++){
		document.getElementById("chk"+i).innerHTML=tmp==i ? "+"+searchArr[i] : "-"+searchArr[i];
	}
}
function vodChange(type,r){
	document.getElementById('player').src='vodPlayer.php?t='+type+'&r='+r;
}
function vodChange_main(type,r){
	document.getElementById('player').src='vodPlayer_main.php?t='+type+'&r='+r;
}
function vodPlay(src,w,h,control){
	html = '';
	html += '<object name="vodpalyer" WIDTH="'+w+'" HEIGHT="'+h+'" CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" ';	
	html += 'style="filter: gray()" ';
	html += 'CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" ';
	html += 'STANDBY="Loading Microsoft Windows Media Player components..." TYPE="application/x-oleobject">';
	html += '<PARAM NAME="AutoStart" VALUE="true" >';
	html += '<PARAM NAME="Filename" VALUE="'+src+'" >';
	html += '<param name="ShowControls" value="'+control+'">';
	html += '</object> '; 
	
	document.write(html);
}

// UCCµ¿¿µ»ó È£½ºÆÃ ¹æ½ÄÀ¸·Î ¼öÁ¤: vodPlayer_main.php ÆÄÀÏ Ãß°¡ »ý¼º, vodPlay_main ÇÔ¼ö Ãß°¡ »ý¼º  (2009.03.26)
function vodPlay_main2(src,w,h,control){
	html = '';
	html += '<object width='+w+' height='+w+'><param movie="http://fluxusmusic.cafe24.com/player/simpleplayer.swf?own=fluxusmusic&key=10620" />';
	html += '<param quality="true" /><param AllowScriptAccess="always" /><param allowFullScreen="true" />';
	html += '<embed width="'+w+'" height="'+h+'" allowfullscreen="true" allowscriptaccess="always" quality="true" bgcolor="#000000" ';
	html += 'src="'+src+'" type="application/x-shockwave-flash" /></object>';
	document.write(html);
}

function vodPlay_main(src,w,h,control){
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='"+w+"' height='"+h+"' id='topMenu' align='middle'>");
	document.write("<param name='allowScriptAccess' value='sameDomain' />");
	document.write("<param name='allowFullScreen' value='false' />");
	document.write("<param name='movie' value='"+src+"' />");
	document.write("<param name='quality' value='high' />");
	document.write("<param name='wmode' value='transparent' />");
	document.write("<param name='bgcolor' value='#ffffff' />");
	document.write("<embed src='"+src+"' quality='high' wmode='transparent' bgcolor='#ffffff' width='"+w+"' height='"+h+"' name='topMenu' align='middle' allowScriptAccess='sameDomain' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
	document.write("</object>");
}

//editor--------------------------------------------------------------------------------
function editCommand(excute,values){
	if(!values){
		textFrame.execCommand(excute);
	}else{
		textFrame.execCommand(excute,"",values);
	}
}
function insertImage(f,i){
	textArea.value=textFrame.body.innerHTML;
	textArea.value+='<img src="'+f+i+'">';
	textFrame.body.innerHTML=textArea.value;
}
function viewEditorMode(){
	document.getElementById('editorMode').innerHTML=isHTML ? 'HTML' : 'Design';
}
function toggleHTML(){
	if(!isHTML){
		isHTML=true;
		textArea.value=textFrame.body.innerHTML;
		textArea.style.display='block';
		document.getElementById('contentsFrame').style.display='none';
		viewEditorMode();
	}
}
function toggleDesign(){
	if(isHTML){
		isHTML=false;
		textFrame.body.innerHTML=textArea.value;
		textArea.style.display='none';
		document.getElementById('contentsFrame').style.display='block';
		viewEditorMode();
	}
}
function heditorSubmit(){
	if(!isHTML)textArea.value=textFrame.body.innerHTML;
}
function palette(t){
	tmpObj=document.getElementById('colorPalette');
	if(t=='c'){
		tmpObj.style.display='none';
		return;
	}
	tmpObj.style.display='block';
	if(t=='f'){
		tmpObj.style.left=foreLeft;
		tmpObj.style.top=foreTop;
		colorKey='ForeColor'
	}else{
		tmpObj.style.left=backLeft;
		tmpObj.style.top=backTop;
		colorKey='BackColor'
	}
}
function cPalette(){
	dw('<div id="colorPalette">'+
	'<img src="img/editorColor.gif" usemap="#palmap" class="block">'+
	'<map name="palmap">'+
	'<area href="javascript:editCommand(colorKey,\'#FFFFFF\');palette(\'c\')" coords="5,5,17,17">'+
	'<area href="javascript:editCommand(colorKey,\'#CCCCCC\');palette(\'c\')" coords="23,5,35,17">'+
	'<area href="javascript:editCommand(colorKey,\'#808080\');palette(\'c\')" coords="41,5,53,17">'+
	'<area href="javascript:editCommand(colorKey,\'#333333\');palette(\'c\')" coords="59,5,71,17">'+
	'<area href="javascript:editCommand(colorKey,\'#000000\');palette(\'c\')" coords="77,5,89,17">'+
	'<area href="javascript:editCommand(colorKey,\'#FFCC00\');palette(\'c\')" coords="5,23,17,35">'+
	'<area href="javascript:editCommand(colorKey,\'#FF6600\');palette(\'c\')" coords="23,23,35,35">'+
	'<area href="javascript:editCommand(colorKey,\'#FF0000\');palette(\'c\')" coords="41,23,53,35">'+
	'<area href="javascript:editCommand(colorKey,\'#660000\');palette(\'c\')" coords="59,23,71,35">'+
	'<area href="javascript:editCommand(colorKey,\'#663399\');palette(\'c\')" coords="77,23,89,35">'+
	'<area href="javascript:editCommand(colorKey,\'#66CCCC\');palette(\'c\')" coords="5,41,17,53">'+
	'<area href="javascript:editCommand(colorKey,\'#66CCFF\');palette(\'c\')" coords="23,41,35,53">'+
	'<area href="javascript:editCommand(colorKey,\'#6699CC\');palette(\'c\')" coords="41,41,53,53">'+
	'<area href="javascript:editCommand(colorKey,\'#0066CC\');palette(\'c\')" coords="59,41,71,53">'+
	'<area href="javascript:editCommand(colorKey,\'#003399\');palette(\'c\')" coords="77,41,89,53">'+
	'<area href="javascript:editCommand(colorKey,\'#CCFF99\');palette(\'c\')" coords="5,59,17,71">'+
	'<area href="javascript:editCommand(colorKey,\'#66CC66\');palette(\'c\')" coords="23,59,35,71">'+
	'<area href="javascript:editCommand(colorKey,\'#339933\');palette(\'c\')" coords="41,59,53,71">'+
	'<area href="javascript:editCommand(colorKey,\'#006600\');palette(\'c\')" coords="59,59,71,71">'+
	'<area href="javascript:editCommand(colorKey,\'#663300\');palette(\'c\')" coords="77,59,89,71">'+
	'<area href="javascript:palette(\'c\')" alt="link" coords="53,76,89,90">'+
	'</map>'+
	'</div>')
}



function cwin(url, w, h,idx) {
		
	if (screen.width < 1025){
		LeftPosition=0;
		TopPosition=0;
	} else {
		LeftPosition=(screen.width)?(screen.width-w)/2:100;
		TopPosition=(screen.height)?(screen.height-h)/2:100;
	}
	window.open(url, idx, "width="+w+",height="+h+",top="+TopPosition+",left="+LeftPosition+", scrollbars=no");
}



/* ¸ÞÀÎ ¹öÆ° ÇÃ·¡½¬ */
function menu(){
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='514' height='320' id='topMenu' align='middle'>");
	document.write("<param name='allowScriptAccess' value='sameDomain' />");
	document.write("<param name='allowFullScreen' value='false' />");
	document.write("<param name='movie' value='video/menu.swf' />");
	document.write("<param name='quality' value='high' />");
	document.write("<param name='wmode' value='transparent' />");
	document.write("<param name='bgcolor' value='#ffffff' />");
	document.write("<embed src='video/menu.swf' quality='high' wmode='transparent' bgcolor='#ffffff' width='514' height='320' name='topMenu' align='middle' allowScriptAccess='sameDomain' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
	document.write("</object>");
}


