function swf1(Url,Width,Height,idname){
	var obj_idname, emb_idname;
	obj_idname = idname ? " id='" + idname + "'" : "";
	emb_idname = idname ? " name='" + idname + "'" : "";
	document.writeln("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+Width+"' height='"+Height+"'"+obj_idname+">");
	document.writeln("<param name='movie' value='"+Url+"'>");
	document.writeln("<param name='quality' value='high'>");
	document.writeln("<param name='wmode' value='transparent'>");
	document.writeln("<embed src='"+Url+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+Width+"' height='"+Height+"'"+emb_idname+">");
	document.writeln("</object>");
}


function swf(Url,Width,Height,idname){
	var obj_idname, emb_idname;
	obj_idname = idname ? " id='" + idname + "'" : "";
	emb_idname = idname ? " name='" + idname + "'" : "";
	document.writeln("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+Width+"' height='"+Height+"'"+obj_idname+">");
	document.writeln("<param name='movie' value='"+Url+"'>");
	document.writeln("<param name='quality' value='high'>");
	document.writeln("<param name='wmode' value='transparent'>");
	document.writeln("<embed src='"+Url+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+Width+"' height='"+Height+"'"+emb_idname+">");
	document.writeln("</object>");
}


function menu(obj,num){
		eval(obj+num+".src='/common/site/images/"+ obj + num +"a.gif';");
}
function menuout(obj,num){
		eval(obj+num+".src='/common/site/images/"+ obj + num +".gif';");
}
function chimg(id,obj){
		document.getElementById(id).src="/common/site/images/"+ obj + ".gif";
}
/* Standard New Window */
function newWin(url,win,xv,yv) {
  var iwidth;
  var iheight;
  var str1;

  iwidth = (screen.width-xv)/2;
  iheight = (screen.height-yv)/2;

  str1 = "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,width="+xv+",height="+yv+",top="+iheight+",left="+iwidth;

  var popup = window.open(url, win, str1);

//  if( navigator.appName.substring(0,8) == "Netscape" ) {
//    popup.location = url;
//  }
}

/* Standard New Window */
function newWinRS(url,win,xv,yv,scroll,resize) {
  var iwidth;
  var iheight;
  var str1;

  iwidth = (screen.width-xv)/2;
  iheight = (screen.height-yv)/2;

  str1 = "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars="+scroll+",resizable="+resize+",width="+xv+",height="+yv+",top="+iheight+",left="+iwidth;

  var popup = window.open(url, win, str1);

//  if( navigator.appName.substring(0,8) == "Netscape" ) {
//    popup.location = url;
//  }
}


/* Remake New Window ( scroll option ) */
function newWinEx(url,win,xv,yv,scroll) {
  
  var iwidth;
  var iheight;
  var str1;
  
  if(win == "viewmember") {
    iwidth = 0;
    iheight = 0;
  }
  else {
    iwidth = (screen.width-xv)/2;
    iheight = (screen.height-yv)/2;
  }
  str1 = "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars="+scroll+",resizable=0,width="+xv+",height="+yv+",top="+iheight+",left="+iwidth;

  var popup = window.open(url, win, str1);

//  if( navigator.appName.substring(0,8) == "Netscape" ) {
//    popup.location = url;
//  }
}


/* Trim the string */
function alltrim(str) {
  var i;
  var ch;
  var retStr = '';
  var retStr1 = '';
  if (str.length == 0) return str;
  for(i=0;i<str.length;i++) {
    ch = str.charAt(i);
    if(ch == ' ' || ch == '\r' || ch == '\n') continue;
    retStr += ch;
  }
  return retStr;
}


/* All Checkbox reset of dest form */
function resetCheckbox(f) {
  if(f.elements) {
    for(i=0;i<f.elements.length;i++) {
      var e = f.elements[i];
      if (e.type == "checkbox") {
        e.checked = true;
      }
    }
  }
  return false;
}


/* All Checkbox mark of dest form */
function clearCheckbox(f) {
  if(f.elements) {
    for(i=0;i<f.elements.length;i++) {
      var e = f.elements[i];
      if (e.type == "checkbox") {
        e.checked = false;
      }
    }
  }
  return false;
}


function modalNewWin(url, name, width, height) {  // 모달 창
  var winObj = new Object();
  winObj.win = window;

  //winurl = "/mNewWin.htm?turl=" + url;
  winurl = url;
  var sFeatures = "dialogHeight: " + height + "px;dialogWidth: " + width + "px;status:0;dialogHide:1;help: No;scroll:No;resizable:No";
  window.showModalDialog(winurl, winObj, sFeatures)
}

function over(t)
{
  var lnk = t.src;

  r = /\.gif$/g;
  t.src = lnk.replace(r, '_up.gif');
}

function out(t)
{
  var lnk = t.src;

  r = /_up\.gif$/g;
  t.src = lnk.replace(r, '.gif');
}

 
function getCookie(name) { 
  var Found = false 
  var start, end 
  var i = 0 

  while(i <= document.cookie.length) { 
    start = i 
    end = start + name.length 
    if(document.cookie.substring(start, end) == name) { 
      Found = true 
      break 
    } 
    i++ 
  } 

  if(Found == true) { 
    start = end + 1 
    end = document.cookie.indexOf(";", start) 
    if(end < start) 
      end = document.cookie.length 
    return document.cookie.substring(start, end) 
  } 
  return "" 
} 

function setCookie( name, value, expiredays ) 
{
  var today = new Date();
  today.setDate( today.getDate() + expiredays );
  document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";";
}


function onmsg()
{
	var f, w, h, lsize;

	f = document.getElementById('msglayer');

	lsize = f.style.width;

	w = document.body.clientWidth + document.body.scrollLeft - (parseInt(lsize) + 10);

	f.style.left = w;

	showmsg();
}

function showmsg()
{
	var len = '';
	var newlen = '';
	var timerId, f, ff, s;

	f = document.getElementById('msglayer');

	len = f.style.height;

	s = parseInt(len);
	s = s + 5;
		
	newlen = s + 'px';

	f.style.height = newlen;

	h = document.body.clientHeight + document.body.scrollTop - (10 + s);
	f.style.top = h;

	timerId = setTimeout("showmsg()", 30);

	if (f.style.height == '100px')
	{
		clearTimeout(timerId);
		setTimeout("closemsg()", 5000)
		posmsg();
	}
}

function posmsg()
{
	f = document.getElementById('msglayer');

	lsize = f.style.width;
	hsize = f.style.height;

	w = document.body.clientWidth + document.body.scrollLeft - (parseInt(lsize) + 10);
	h = document.body.clientHeight + document.body.scrollTop - (parseInt(hsize) + 10);

	f.style.left = w;
	f.style.top = h;

	setTimeout("posmsg()", 20);
}

function closemsg()
{
	var len = '';
	var newlen = '';
	var timerId, f, s;

	f = document.getElementById('msglayer');

	len = f.style.height;

	s = parseInt(len);
	s = s - 5;
		
	newlen = s + 'px';

	f.style.height = newlen;

	h = document.body.clientHeight + document.body.scrollTop - (10 + s);
	f.style.top = h;

	timerId = setTimeout("closemsg()", 30);

	if (f.style.height == '0px')
	{
		clearTimeout(timerId);
		f.style.display = 'none';
	}
}

function setadmbtn()
{
	f = document.getElementById('admbtn');
	lsize = f.width;

	w = document.body.clientWidth + document.body.scrollLeft - (parseInt(lsize) + 10);
	h = document.body.clientHeight + document.body.scrollTop - 90;

//    f.style.left = 10;
	f.style.left = w;
	f.style.top = h;

	setTimeout("setadmbtn()", 200);
}

function setholdbtn()
{
	ff = document.getElementById('holdbtn');
	lsize = f.width;

	w = document.body.clientWidth + document.body.scrollLeft - (parseInt(lsize) + 10);
	h = document.body.clientHeight + document.body.scrollTop - 180;

//    f.style.left = 10;
	ff.style.left = w;
	ff.style.top = h;

	setTimeout("setholdbtn()", 200);
}

function urlencode (q)
{
	return escape(q).replace(/\+/g, "%2B") ;
}

function gourl(t)
{
	if (t) location.href = t;
}

//플래쉬 패치
function MakeFlash(Url,Width,Height){                 
	document.writeln("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"" + Width + "\" height=\"" + Height + "\">"); 
	document.writeln("<param name=\"movie\" value=\"" + Url + "\">"); 
	document.writeln("<param name=\"quality\" value=\"high\" />");     
	document.writeln("<param name=\"wmode\" value=\"transparent\">"); 
	document.writeln("<embed src=\"" + Url + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + Width + "\"  height=\"" + Height + "\">"); 
	document.writeln("</object>");     
} 

//롤오버이미지
function img_change(obj,mode)
{
	var reg = /(menu.+)_(on|off)/;
	var find = obj.src.match(reg)[0];
	var name = obj.src.match(reg)[1];
		
	obj.src = obj.src.replace(find,name+'_'+mode);
} 


// 팝업영상

function view_popup(uu){
	window.open("/modules/include/include.popup.php?url="+uu,"1","width=600,height=680");
}
function go_filmo(uu){
	window.open("/modules/include/include.popup_filmo.php?no="+uu,"1","width=800,height=600");
}
function view_map(){
	window.open("/modules/include/include.map.php?sort=1","1","width=600,height=680");
}
function view_sample(uu){
	window.open("/modules/include/include.sample.php","1","width=600,height=680");
}
function popup(uu,xx,yy){
	window.open(uu,"1","width="+xx+",height="+yy);
}