function flashObj(fileName, width, height, id, fileid, quality, wmode, allowFullScreen, allowScriptAccess, base){
        document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="'+width+'" height="'+height+'" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="'+id+'">'
        +'<param name="movie" value="'+fileName+"?"+fileid+'">'
        +'<param name="quality" value="'+quality+'">'
        +'<param name="wmode" value="'+wmode+'">'
		+'<param name="allowFullScreen" value="'+allowFullScreen+'" />'
        +'<param name="allowScriptAccess" value="'+allowScriptAccess+'" />'
		+'<param name="FlashVars" value="'+fileid+'" />'
		+'<param name="base" value="'+base+'" />'
        +'<embed src="'+fileName+'?'+fileid+'" quality="'+quality+'" allowFullScreen="'+allowFullScreen+'" base="'+base+'" wmode="'+wmode+'" pluginspage="http://www.macromedia.com/go/getflashplayer" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash" showLiveConnect="true" name="'+id+'" allowScriptAccess="'+allowScriptAccess+'"></embed>'
        +'</object>');
}

function flashObj2(fileName, width, height, id, fileid, quality, wmode, allowFullScreen, allowScriptAccess){
        document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="'+width+'" height="'+height+'" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="'+id+'">'
        +'<param name="movie" value="'+fileName+"?"+fileid+'">'
        +'<param name="quality" value="'+quality+'">'
        +'<param name="wmode" value="'+wmode+'">'
		+'<param name="allowFullScreen" value="'+allowFullScreen+'" />'
        +'<param name="allowScriptAccess" value="'+allowScriptAccess+'" />'
		+'<param name="FlashVars" value="'+fileid+'" />'
        +'<embed src="'+fileName+'?'+fileid+'" quality="'+quality+'" allowFullScreen="'+allowFullScreen+'" wmode="'+wmode+'" pluginspage="http://www.macromedia.com/go/getflashplayer" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash" showLiveConnect="true" name="'+id+'" allowScriptAccess="'+allowScriptAccess+'"></embed>'
        +'</object>');
}


function checkNumber(str) { 
		var flag=true; 
		if (str.length > 0) { 
			for (i = 0; i < str.length; i++) {  
				if (str.charAt(i) < '0' || str.charAt(i) > '9') { 
					flag=false; 
				} 
			} 
		}
		return flag; 
	}

function returnTime(time) {
		var result = "00:00:00";
		if( time >= 3600 ) {
			result = changeCipher(Math.floor( time / 3600 )) + ":";
			time = time % 3600;
		} else 
			result = "00:";
		if( time >= 60 ) {
			result += changeCipher(Math.floor( time / 60 )) + ":";
			time = time % 60;
		} else {
			result += "00:";
		}
		result +=changeCipher(time);
		return result;
	}

	function changeCipher(num) {
		if(num<10) 
			return "0"+num;
		else
			return num;
	}

function popupCenter(theURL,winName,features) {
// window move to screen center
  var leftPosition = screen.width - getValue(features, "width");
  var topPosition = screen.height - getValue(features, "height");

  leftPosition = (leftPosition < 0) ? 0 : leftPosition/2;
  topPosition  = (topPosition < 0)  ? 0 : topPosition /2;
  features += ',top=' + topPosition + ',left=' + leftPosition;
  var popwin = window.open(theURL,winName,features);
}


function clibit(addr)
{
window.clipboardData.setData('Text',addr);
alert('RSS ÁÖ¼Ò°¡ º¹»çµÇ¾ú½À´Ï´Ù. RSS Reader ÇÁ·Î±×·¥¿¡ ÀÔ·ÂÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.');
}


function getValue(string, key) {
  var startIdx = string.indexOf(key);
  var endIdx   = string.indexOf(",", startIdx);
  if (endIdx == -1) {
    endIdx = string.length;
  }
  return string.substring(startIdx+key.length+1 , endIdx);
}

// popupCenter('about:blank','pop','scrollbars=no,resizable=no,width=390, height=741')

function trim2(src) {
	var return_text = '';
	var sp = 0;
	var ep = 0;
	
	for(i=0; i<src.length; i++) {
		if(src.charAt(i) != " ") {
			sp = i;
			break;
		}
	}
	
	for(i=(src.length-1); i>=0; i--) {
		if(src.charAt(i) != " ") {
			ep = i;
			break;
		}
	}
	
	for(i=sp; i<=ep; i++) {
		return_text = return_text + src.charAt(i);
	}
	
	return return_text;
}
  
function goMemoPopup(userId) {  
  fn_popup("./memo/ReceiveMemoList.jsp?userId=" + userId , "987", "717", 1, 1, 1, 1, 1, 1);
  
}
function fn_popup(url, width, height, toolbar, directories, status, menubar, scrollbars, resizable) {
  var position = "width=" + width + ", height=" + height + ", left=" + ((screen.width - width) / 2) + ", top=" + ((screen.height - height) / 2) + ", toolbar=" + toolbar + ", directories=" + directories + ", status=" + status + ", menubar=" + menubar + ", scrollbars=" + scrollbars+ ", resizable=" + resizable + "";
  window.open( url, '', position);
}

function sendMemo(id,receiveid)
{

  fn_popup("./memo/sendMemoPop.jsp?userId="+id+"&receiveid="+receiveid+"&cnt=0", "560", "360", 0, 0, 0, 0, 0, 0);

}
  
function textCounter(field, maxlimit) {
  if (field.value.length > maxlimit) {
    field.value = field.value.substring(0, maxlimit);
  }
}

// XMLHttpRequest ?? start
var req;
function request(url,handler,queryString) {
    //alert(url+'\n'+handler+'\n'+queryString);
    init(url);
    req.onreadystatechange = handler;
    req.send(queryString);
}

function init(url) {
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
    }
    req.open("POST", url, true);
    req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
//    req.setRequestHeader("Content-Type", "text/xml; charset=utf-8" ) ;  
}
// XMLHttpRequest ?? end


function reSize() {
  //self.resizeTo(document.body.scrollWidth, document.body.scrollHeight)
}


function sendMemo1(){
  sendMemo(myId,userId);
}
function goBlog(){
  //window.location.href=userId+'.blog';
  parent.location.href=userId+'.blog';
}

function sendFooter(){
   
    parent.main.location.href="/blog.my.footprint.list.ui?owner="+superadmin+"&boardId="+VboardId+"&src="+RssUrl+"&amp;css_file="+CssStyle;
	//location.href="http://www.yahoo.co.kr";
	//parent.main.location.href="/blog.my.footprint.list.ui?owner=admin&boardId=98&src=http://rss.news.yahoo.com/imgrss/441&amp;css_file=basic.css";
}
function goScrap(){
  //window.location.href=userId+'.blog';
  var addr ="";
  addr=siteUrl+"/jsps/UI/podcast/my/nfeedviewer.jsp?src="+BoardId+"&amp;cate="+CategoryId+"&amp;css_file="+CssStyle;
  clibit(addr);
  
}

/***********************************************
* Pop-it menu- ¨Ï Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var defaultMenuWidth="150px" ; //set default menu width.

//var myId= '';
//var userId= '';
//var myName= '';
//var userName= '';
var superadmin= '';
var VboardId= '';
var RssUrl= '';
var CssStyle= '';
var siteUrl= '';
var BoardId= '';
var CategoryId= '';




var linkset=new Array();
//SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT
linkset[0]='<a href="javascript:sendMemo1()">ÂÊÁöº¸³»±â</a>';

linkset[1]='<a href="javascript:sendFooter()">¹æ¸í·Ï</a>';
//linkset[1]+='<hr>' ;//Optional Separator
linkset[1]+='<a href="javascript:goScrap()">ÆÛ°¡±â</a>';

linkset[2]='<a href="javascript:goBlog()">ºí·Î±×¹æ¹®</a>';

////No need to edit beyond here

var ie5=document.all && !window.opera
var ns6=document.getElementById

if (ie5||ns6)
  document.write('<div id="popitmenu" onMouseover="clearhidemenu();" onMouseout="dynamichide(event)"></div>')

function iecompattest(){
  return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body
}

//function showmenu(e, which, optWidth, superadmin, VboardId, RssUrl, CssStyle, siteUrl, BoardId, CategoryId ){
	function showmenu(e, which, optWidth, a, b, c, d, e, f, g ){



 
  superadmin= a;
  
  VboardId= b;
  
  RssUrl= c;
 
  CssStyle= d;
  
  siteUrl=  e;
 
  BoardId= f;
  
  CategoryId= g;
  

  if (!document.all&&!document.getElementById)
  return
  clearhidemenu()
  menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu")
  menuobj.innerHTML=which
  menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth
  menuobj.contentwidth=menuobj.offsetWidth
  menuobj.contentheight=menuobj.offsetHeight
  eventX=ie5? event.clientX+50 : e.clientX+50
  eventY=ie5? event.clientY+50 : e.clientY+50
  //Find out how close the mouse is to the corner of the window
  var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX
  var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY
  //if the horizontal distance isn't enough to accomodate the width of the context menu
  if (rightedge<menuobj.contentwidth)
  //move the horizontal position of the menu to the left by it's width
  menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px"
  else
  //position the horizontal position of the menu where the mouse was clicked
  menuobj.style.left=ie5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px"
  //same concept with the vertical position
  if (bottomedge<menuobj.contentheight)
  menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px"
  else
  menuobj.style.top=ie5? iecompattest().scrollTop+event.clientY+"px" : window.pageYOffset+eventY+"px"
  menuobj.style.visibility="visible"
  return false
	  
}

function contains_ns6(a, b) {
  //Determines if 1 element in contained in another- by Brainjar.com
  while (b.parentNode)
    if ((b = b.parentNode) == a)
      return true;
      return false;
}

function hidemenu(){
  if (window.menuobj)
    menuobj.style.visibility="hidden"
}

function dynamichide(e){
  if (ie5&&!menuobj.contains(e.toElement))
    hidemenu()
  else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
    hidemenu()
}

function delayhidemenu(){
  delayhide=setTimeout("hidemenu()",500)
}

function clearhidemenu(){
  if (window.delayhide)
    clearTimeout(delayhide)
}

if (ie5||ns6)
document.onclick=hidemenu
