function clock(title) {
        var now=new Date()
        var hrs= now.getHours()
        var mins=now.getMinutes()
        var secs=now.getSeconds()
        var disp= title + " " + ((hrs>12) ? (hrs-12) : hrs) + ":"
        disp+=((mins<10) ? "0" + mins : mins) + ":" + ((secs<10) ? "0" + secs : secs)
        disp+=((hrs>12) ? " PM" : " AM")
        status=disp
// to make it in the form feild..just use the same
//scripting as above..but just add this next line in
//place off "status=disp"

        setTimeout("clock('"+title+"')", 0);
}
//////////////¸¶¿ì½º ¿À¸¥ÂÊ »ç¿ë¸øÇÏ°Ô ÇÏ±â//////////////////////
function click() {
   if ((event.button==2) || (event.button==3)) {
      //alert('¿À¸¥ÂÊ ¹öÆ° »ç¿ëÇÒ¼ö ¾ø¼Ò.');
      return false;
   }
}

document.onmousedown=click;
//document.onmouseup=click;
//Å°ÀÔ·ÂÃ¼Å©
document.onkeydown = CheckKeyPress;
document.onkeyup = CheckKeyPress;
function CheckKeyPress()
{
  //Å°ÀÔ·Â
  var ekey = event.keyCode;

  //¸®ÅÏ
  if(ekey == 18 || ekey == 17 || ekey == 25 || ekey == 122)
	{
	 return false;
	}
}



function Check_Korean(id_text){
	for ( var i=0; i < id_text.length; i++ ) {
		if ( id_text.charCodeAt(i) < 0xAC00 || id_text.charCodeAt(i) > 0xD7A3){
			if (( id_text.charCodeAt(i) < 12593 || id_text.charCodeAt(i) > 12643 ) && ( id_text.charCodeAt(i) != 32)) {
				return true;
			}
		}
	}	
	return false;
}	

var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");

function CheckUIElements(){
        var yMenuFrom, yMenuTo, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;

        if ( bNetscape4plus ) { // ³×Ã÷ÄÉÀÌÇÁ ¿ë ¼³Á¤
                yMenuFrom   = document["musicbest"].top;
                yMenuTo     = top.pageYOffset + 120;   // À§ÂÊ À§Ä¡ 91
        }
        else if ( bExplorer4plus ) {  // IE ¿ë ¼³Á¤
                yMenuFrom   = parseInt (musicbest.style.top, 10);
                yMenuTo     = document.body.scrollTop + 120; // À§ÂÊ À§Ä¡ 91
        }

        timeoutNextCheck = 100;

        if ( Math.abs (yButtonFrom - (yMenuTo + 152)) < 6 && yButtonTo < yButtonFrom ) {
                setTimeout ("CheckUIElements()", timeoutNextCheck);
                return;
        }


        if ( yButtonFrom != yButtonTo ) {
                yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 10 );
                if ( yButtonTo < yButtonFrom )
                        yOffset = -yOffset;

                if ( bNetscape4plus )
                        document["divLinkButton"].top += yOffset;
                else if ( bExplorer4plus )
                        divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;

                timeoutNextCheck = 10;
        }
        if ( yMenuFrom != yMenuTo ) {
                yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
                if ( yMenuTo < yMenuFrom )
                        yOffset = -yOffset;

                if ( bNetscape4plus )
                        document["musicbest"].top += yOffset;
                else if ( bExplorer4plus )
                        musicbest.style.top = parseInt (musicbest.style.top, 10) + yOffset;

                timeoutNextCheck = 10;
        }

        setTimeout ("CheckUIElements()", timeoutNextCheck);
}

// ·¹ÀÌ¾î Å×ÀÌºí ¿Ü°û¼± Ç¥½Ã
function setBorder(opt, color) {
	opt.style.borderColor = String(color);
}

function reSize(){
	    var ParentFrame	    =	boardmain.document.body;
	    var ContentFrame	=	document.all["boardmain"];
	    ContentFrame.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight);
	    ContentFrame.style.width = ParentFrame.scrollWidth + (ParentFrame.offsetWidth - ParentFrame.clientWidth);
}

function reSizeBoard(){
	    var ParentFrame	    =	boardmain.document.body;
	    var ContentFrame	=	document.all["boardmain"];
	    ContentFrame.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight);
	    ContentFrame.style.width = ParentFrame.scrollWidth + (ParentFrame.offsetWidth - ParentFrame.clientWidth);
}

function reSizeCate(){
	    var ParentFrame	    =	category.document.body;
	    var ContentFrame	=	document.all["category"];
	    ContentFrame.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight);
	    ContentFrame.style.width = ParentFrame.clientWidth;	    
}

function reSizeCommentFrm(){
	    var ParentFrame	    =	commentfrm.document.body;
	    var ContentFrame	=	document.all["commentfrm"];
	    ContentFrame.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight);
	    ContentFrame.style.width = ParentFrame.clientWidth;	    
}

function reSizeVisitFrm(){
	    var ParentFrame	    =	visitfrm.document.body;
	    var ContentFrame	=	document.all["visitfrm"];
	    ContentFrame.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight);
	    ContentFrame.style.width = ParentFrame.clientWidth;	    
}

function reSizeMakeFrm(){
	    var ParentFrame	    =	makefriendfrm.document.body;
	    var ContentFrame	=	document.all["makefriendfrm"];
	    ContentFrame.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight);
	    ContentFrame.style.width = ParentFrame.clientWidth;	    
}

function reSizeLinkFrm(){
	    var ParentFrame	    =	linkfriendfrm.document.body;
	    var ContentFrame	=	document.all["linkfriendfrm"];
	    ContentFrame.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight);
	    ContentFrame.style.width = ParentFrame.clientWidth;	    
}


function reSize0(){
	    var ParentFrame	    	= boardmain.document.body;
	    var ContentFrame		= document.all["boardmain"];
	    ContentFrame.style.height 	= ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight);
	    ContentFrame.style.width 	= ParentFrame.scrollWidth + (ParentFrame.offsetWidth - ParentFrame.clientWidth);
}



function reSize2(){
	    var ParentFrame	=	CommentFrm.document.body;
	    var ContentFrame	=	document.all["CommentFrm"];

	    ContentFrame.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight);
	    parent.reSize0();
}

function reSizeList(){
	    var ParentFrame	=	CommentFrm.document.body;
	    var ContentFrame	=	document.all["CommentFrm"];

	    ContentFrame.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight);
}

function reSize3(fno){
	    var ParentFrame	=	eval("tbFrm" + fno +  ".document.body");
	    var ContentFrame	=	eval("document.all.tbFrm" +fno);

	    ContentFrame.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight);
	    parent.reSize0();
}

function reSize4(){
	    var ParentFrame	=	listAlbumFrame.document.body;
	    var ContentFrame	=	document.all["listAlbumFrame"];

	    ContentFrame.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight);
	    parent.reSize0();
}

function cafeInit(){
	    parent.reSize();
}

function paperInit(){
	    parent.reSize();
}

function cafeCommentInit(){
	    parent.reSize2();
}

function cafeInit_list(){
	    parent.reSizeList();
}

function cafeInit_tb(fno){
	    parent.reSize3(fno);
}

function cafeInit_photo(){
	    parent.reSize4();
}

function diaryInit(){
	    parent.reSize();
}

function categoryInit(){
	    parent.reSizeCate();
}

function CommentFrmInit(){
	    parent.reSizeCommentFrm();
}

function VisitFrmInit(){
	    parent.reSizeVisitFrm();
}

function MakeFrmInit(){
	    parent.reSizeMakeFrm();
}

function LinkFrmInit(){
	    parent.reSizeLinkFrm();
}

function trim (strSource) {
	re = /^[\s¡¡]+|[\s¡¡]+$/g;

	return strSource.replace(re, '');
}

function ltrim (strSource) {
	re = /^[\s¡¡]+/g;

	return strSource.replace(re, '');
}

function rtrim (strSource) {
	re = /[\s¡¡]+$/g;

	return strSource.replace(re, '');
}

function swapImage(img, path){
	img.src = path;	
}

function fn_SpanView(id){

	for (var i = 1; i <= 4; i++)	{
		var spanMenu = eval(document.all["content"+i]);	
		if(i == id) {
			spanMenu.style.display = "";
		}
		else {
			spanMenu.style.display = "none";			
		}
	}

}

function fn_SpanLeft(id){

	for (var i = 1; i <= 3; i++)	{
		var spanMenu = eval(document.all["left"+i]);	
		if(i == id) {
			spanMenu.style.display = "";
		}
		else {
			spanMenu.style.display = "none";			
		}
	}

}

// ½½¶óÀÌµå¼î
function fn_GoSlideShow(url) {

	var w = 1000;
	var h = 710; 
	if(screen.height > 768)	{ 
		var winl = (screen.width - w) / 2; 
		var wint = (screen.height - h) / 2; 
	}
	else {
		var winl = 7; 
		var wint = 1; 		
	}	
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl;
	
	url = url + "&sx=1000&sy=750";
	win = window.open(url,"slide",'toolbar=0,location=0,directories=0, scrollbars=no, status=0,menubar=0,alwaysRaised=0,resizable=0,'+winprops);
}

// ½½¶óÀÌµå¼î
function fn_GoSlideShow1(reqCID, reqAlbumNO) {
	var w = 1014;
	var h = 654; 
	if(screen.width > 1024)	{ 
		var winl = (screen.width - w) / 2; 
		var wint = (screen.height - h) / 2 - 24; 
	}
	else	{
		var winl = 0; 
		var wint = 0; 		
	}	
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl;
	
	url = "/m_cafe/board/slide/photoGallery5.asp?albumNO="+reqAlbumNO+"&reqCID="+reqCID;
	win = window.open(url,"scrab",'toolbar=0,location=0,directories=0, scrollbars=no, status=0,menubar=0,alwaysRaised=0,resizable=0,'+winprops);
}

// Áö¿ª±¤°í
function fn_GoAD() {
	var w = 1010;
	var h = 644; 
	if(screen.width > 1024)	{ 
		var winl = (screen.width - w) / 2; 
		var wint = (screen.height - h) / 2 - 24; 
	}
	else	{
		var winl = 0; 
		var wint = 0; 		
	}	
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl;
	
	url = "/m_biz/map/map.asp";
	win = window.open(url,"ad",'toolbar=0,location=0,directories=0, scrollbars=no, status=0,menubar=0,alwaysRaised=0,resizable=0,'+winprops);
}

// ½½¶óÀÌµå¼î
function fn_GoDDabu() {

	var w = 1024;
	var h = 710; 
	if(screen.height > 768)	{ 
		var winl = (screen.width - w) / 2; 
		var wint = (screen.height - h) / 2; 
	}
	else	{
		var winl = 0; 
		var wint = 0; 		
	}	
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl;
	
	url = "/m_admin/mainFrame.asp";
	win = window.open(url,"ddabu",'toolbar=0,location=0,directories=0, scrollbars=no, status=0,menubar=0,alwaysRaised=0,resizable=0,'+winprops);
}


// µûºÎ¶óµð¿À
function fn_GoMusic(cid) {

	var w = 324;
	var h = 105; 
	//if(screen.height > 300)
	//{ 
	//	var winl = (screen.width - w) / 2; 
	//	var wint = (screen.height - h) / 2; 
	//}
	//else
	//{
		var winl = 420; 
		var wint = 203; 		
	//}
		
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl;
	
	url = "/m_music/musicplayer.asp?cid="+cid;
	win = window.open(url,"player",'toolbar=0,location=0,directories=0, scrollbars=no, status=0,menubar=0,alwaysRaised=0,resizable=0,'+winprops);
}

function fn_GoItem(seq, sType, price) {

	var w = 360;
	var h = 400; 
	var winl = 420; 
	var wint = 200; 		

	switch(sType){
	case 'buy' 	: url = "/m_item/ddabu_item_buy.asp?price="+price+"&seq="+seq;	
		break
	case 'gift' 	: url = "/m_item/ddabu_item_gift_buy.asp?price="+price+"&seq="+seq;
		break
	case 'musicBuy'	: url = "/m_item/ddabu_music_buy.asp?mType=buy&price="+price+"&seq="+seq;
		w = 290;
		h = 310;	
		break
	case 'musicGift': url = "/m_item/ddabu_music_buy.asp?mType=gift&price="+price+"&seq="+seq;
		w = 290;
		h = 380;	
		break
	case 'musicListen': url = "/m_item/ddabu_music_buy.asp?mType=listen&price="+price+"&seq="+seq;
		w = 290;
		h = 88;	
		break
	default: 
		break
	}

	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl;

	win = window.open(url,"itemBuy",'toolbar=0,location=0,directories=0, scrollbars=no, status=0,menubar=0,alwaysRaised=0,resizable=0,'+winprops);
}


function fn_GoMemoBitBox(reqID,idx,topIdx,subIdx) {
	top.location.href= "/m_item/ddabu_bitBox.asp?reqID="+reqID+"&idx="+idx+"&topIdx="+topIdx+"&subIdx="+subIdx;		
}

function fn_GoBitBox(reqID,idx,topIdx,subIdx) {

	var w = 500;
	var h = 543; 
	var winl = 420; 
	var wint = 200; 		

	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl;

	var url = "/m_item/ddabu_bitBox.asp?reqID="+reqID+"&idx="+idx+"&topIdx="+topIdx+"&subIdx="+subIdx;		


	win = window.open(url,"bitBox",'toolbar=0,location=0,directories=0, scrollbars=no, status=0,menubar=0,alwaysRaised=0,resizable=0,'+winprops);
}

function fn_GoBitBoxTemp(reqID,idx) {
	alert('ºñÆ®¹Ú½º´Â ÁØºñÁßÀÔ´Ï´Ù');
}

function fn_GoBitSite(bid){
	var url = "http://www.ddabu.com/"+bid;

	if(parent.opener == true){
		parent.opener.location.href = url;	
	}else{
		win = window.open(url, "win", "");
	}	
}

function fn_MakePhoto(reqID) {
	document.location.href = "/m_blog/index.asp?reqID="+reqID+"&site=/m_blog/board/photo_write.asp?s=";	
}

function fn_photoLogin(site) {
	document.location.href = "/m_user/user/memberLogin.asp?site="+site;	
}

function fn_GoSite(bid) {
	top.location.href = 'http://www.ddabu.com/' + bid;	
}

function fn_GoPost(bid, pid) {
	top.location.href = 'http://www.ddabu.com/' + bid + '/' + pid;	
}

function fn_GoCate(C00, C01) {
	document.location.href = "/theme_view.asp?C00="+C00+"&C01="+C01;
}

function fn_GoPhoto(itemno) {                                                                   
	url = "best_photo_detail.asp?photono="+itemno;              
	document.location.href = url;                               
}                                                                   
 
function fn_GoPhoto1(itemno, viewtype) {                                                                   
	url = "/m_photo/?thisview="+viewtype+"&photono="+itemno;              
	document.location.href = url;                               
}  
 
function fn_GoNews(itemno) {                                                                   
	document.location.href = "news_view.asp?itemno=" + itemno;
}   
                                                                    
function fn_GoPhotoCate(cate) {                                                                   
	document.location.href = "best_photo_view.asp?cate=" + cate;
}  

function fn_GoCafeSetup(site) {                                                                   
	boardmain.location.href = site;
}    

function fn_GoBlogSetup1(site) {                                                                   
	document.location.href = "/m_admin/category/"+site;
} 

function fn_GoUserSetup(site) {                                                                   
	document.location.href = site;
}     

function fn_GoCateMain(idx) {                                                                   
	document.location.href = "/m_cate/index.asp?idx=" + idx;
} 

function fn_GoSetup(reqID) {
	boardmain.location.href = "/m_admin/category/setup_blog.asp?reqID="+reqID;
}       

function fn_GoCafeWrite(reqCID, reqID, reqC03) {
	this.location.href = "/m_cafe/board/cafeBoard_write.asp?reqCID="+reqCID+"&reqID="+reqID+"&reqC03="+reqC03;
}

function fn_GoFindID()
{
	window.open('/m_user/user/find_id.asp','memo_view','scrollbars=no,width=500,height=310,toolbar=no,member=no,status=no,left=300,top=200');	
}

function fn_Login() {
	var w = 250;
	var h = 150; 
	if(screen.height > 300)	{ 
		var winl = (screen.width - w) / 2; 
		var wint = (screen.height - h) / 2; 
	}
	else	{
		var winl = 10; 
		var wint = 10; 		
	}	
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl;
	
	url = "/m_user/user/popup_login.asp";
	win = window.open(url,"login",'toolbar=0,location=0,directories=0, scrollbars=no, status=0,menubar=0,alwaysRaised=0,resizable=0,'+winprops);
} 

function fn_GoWordSearch(q){
	document.sList.idx.value = 98;
	document.sList.sType.value = 't';	
	document.sList.q.value = q;
	document.sList.submit();
}

function fn_GoPostMove(form, name) {
	if(selectcount(form, name) == 0) {
		alert('ÀÌµ¿ÇÒ ±ÛÀ» ¸ÕÀú ¼±ÅÃÇÏ¼¼¿ä');	
		return;
	}
	
	if(postMove.style.display == '') {
		postMove.style.display = "none";			
	}	
	else {
		postMove.style.display = "";		
	}
}       


function fn_GoToday(idx, cnt, reqID) {
	if(idx == 1)	{
		var title = 'µ¡±Û';
	}
	else if(idx == 2) {
		var title = 'Æ®·¢¹é';	
	}
	else	{
		var title = '¹æ¸í·Ï';	
	}

	if(cnt < 1)	{
		alert("¿À´Ã ÀÛ¼ºµÈ "+title+"ÀÌ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù");
		return;
	}
	else	{
		document.bFrame.location.href = "blog_today.asp?reqID="+reqID+"&idx="+idx;
	}	
}   


// ½ºÅ©·¦
function fn_GoScrab(reqID, intSeq) {
	var w = 340;
	var h = 250; 
	if(screen.height > 300)	{ 
		var winl = (screen.width - w) / 2; 
		var wint = (screen.height - h) / 2; 
	}
	else	{
		var winl = 10; 
		var wint = 10; 		
	}	
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl;
	
	url = "/m_blog/board/blog_scrab.asp?intSeq="+intSeq+"&reqID="+reqID;
	win = window.open(url,"scrab",'toolbar=0,location=0,directories=0, scrollbars=no, status=0,menubar=0,alwaysRaised=0,resizable=0,'+winprops);
}      

function tblOver(tbl,CafeBGColor) {
	tbl.style.backgroundColor = CafeBGColor;
}

function tblOut(tbl) {
	tbl.style.backgroundColor = "";
}

function topPage() { document.body.scrollTop = 0; }


function embedSWF(swfUrl,swfWidth,swfHeight,useWmode){ 
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+swfWidth+'" height="'+swfHeight+'" VIEWASTEXT ID="Object1">');
document.write('<param name="movie" value="'+swfUrl+'">');
document.write('<param name="quality" value="high">');
document.write('<param name="wmode" value="'+useWmode+'">');
//document.write('<embed src="'+swfUrl+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+swfWidth+'" height="'+swfHeight+'"></embed>');
document.write('</object>');
}

function DisplayWMP(media_url, width, height){
	var CLASSID = "22D6F312-B0F6-11D0-94AB-0080C74C7E95";
	var strValue = "<object id=\"MediaPlayer\" classid=\"clsid:" + CLASSID + "\" width=\"" + width + "\" height=\"" + height + "\" align=\"center\" VIEWASTEXT>"
    + "<param name=\"Filename\" value=\"" + media_url + "\">"
	+ "<param name=\"AutoStart\" value=\"1\">"
	+ "<param name=\"AnimationAtStart\" value=\"1\">"
	+ "<param name=\"DisplaySize\" value=\"0\">"
	+ "<param name=\"EnableContextMenu\" value=\"false\">"
	+ "<param name=\"EnablePositionControls\" value=\"-1\">"
	+ "<param name=\"EnableFullScreenControls\" value=\"0\">"
	+ "<param name=\"Mute\" value=\"0\">"
	+ "<param name=\"ShowCaptioning\" value=\"0\">"
	+ "<param name=\"ShowControls\" value=\"1\">"
	+ "<param name=\"ShowAudioControls\" value=\"1\">"
	+ "<param name=\"ShowDisplay\" value=\"0\">"
	+ "<param name=\"ShowGotoBar\" value=\"0\">"
	+ "<param name=\"ShowPositionControls\" value=\"-1\">"
	+ "<param name=\"ShowStatusBar\" value=\"1\">"
	+ "<param name=\"ShowTracker\" value=\"-1\">"
	+ "<param name=\"Volume\" value=\"100\">"
	+ "<param name=\"SendMouseClickEvents\" value=\"-1\">"
	+ "<embed animationatstart=\"1\" align=\"middle\" autosize=\"0\" autostart=\"1\" ClickToPlay=\"1\" displaybackcolor=\"black\" width=\"" + width + "\" height=\"" + height + "\" Name=\"MediaPlayer\" pluginspage=\"http://www.microsoft.com/korea/windows/windowsmedia/\" PreviewMode=\"0\" SelectionStart =\"1\" SelectionEnd =\"1\" ShowGotoBar=\"0\" SendKeyboardEvents=\"0\" sendMouseClickEvents=\"0\" SendMouseMoveEvents=\"0\" showcontrols=\"1\" showdisplay=\"0\" showstatusbar=\"1\" showtracker=\"1\" showpositioncontrols=\"0\" src=\"" + media_url + "\" type=\"video/x-ms-asf-plugin\"></embed>"
	+ "</object>";

	document.write(strValue);
}

                                             