var isNav, isIE, isIE5, isIE50;
var coll = "";
var styleObj = "";
if (parseInt(navigator.appVersion) >= 4) {
  if (navigator.appName == "Netscape") {
    isNav = true;
  }
  else {
    isIE = true;
    coll = "all.";
    styleObj = ".style";
    if ((navigator.userAgent.indexOf("MSIE 5") != -1) ||
        (navigator.userAgent.indexOf("MSIE 6") != -1) ) {
		isIE5 = true;
      if (navigator.userAgent.indexOf("MSIE 5.0") != -1) {
        isIE50 = true;
      }
    }
  }
}
function getObjectStyle(obj) {
	return "document."+coll+obj+styleObj;
}
function getObjectName(obj) {
	return "document."+coll+obj+'.name';
}
function show(obj) {
	var theObj = getObjectStyle(obj);
	eval(theObj + '.position = "relative";');
	eval(theObj + '.visibility = "visible";');
}

function hide(obj) {
	var theObj = getObjectStyle(obj);
	eval(theObj + '.position = "absolute";');
	eval(theObj + '.visibility = "hidden";');
}
/*------------------------------------------------------------------------*/
//  °Ë»ö°ü·Ã layer ÆË¾÷ ¿­±â
/*------------------------------------------------------------------------*/
function duplicationid_layer(str) {
	popupLayer_center("/main/unionpgm/duplicationid_layer.html?checkid="+str,350,250);
}
function duplicationemail_layer(str) {
	popupLayer_center("/main/unionpgm/duplicationemail_layer.html?checkemail="+str,350,250);
}
function post_find_layer(str) {
	popupLayer_center("/main/unionpgm/postcheck_layer.html?what="+str,400,250);
}
/*------------------------------------------------------------------------*/
//  °Ë»ö°ü·Ã ÆË¾÷Ã¢ ¿­±â
/*------------------------------------------------------------------------*/
function post_find(str) {
  window.open('../../main/unionpgm/postcheck.html?what='+str,'POST_FIND','resizable=no,scrollbars=yes, width=520,height=242'); 
}
function user_find(str) {
  window.open('../../main/unionpgm/recuserid.html?'+str,'IdSearch','resizable=no,scrollbars=yes, width=366,height=200'); 
}
function duplicationid_find(str) {
  window.open('../../main/unionpgm/duplicationid.html?checkid='+str,'UserIdCheck','resizable=no,scrollbars=no, width=400,height=242'); 
}
function duplicationemail_find(str) {
  window.open('../../main/unionpgm/duplicationemail.html?checkemail='+str,'UserEmailCheck','resizable=no,scrollbars=no, width=400,height=242'); 
}
function nameconfirm_find(username,jumin1,jumin2) {
  window.open('../../main/joinus/popconfirm.html?usernm='+username+'&jumin1='+jumin1+'&jumin2='+jumin2,'NameConfirm','scrollbars=no,width=500,height=415');
}
function nameconfirm_find2() {
  window.open('../../main/userinfo/nameconfirm.html?','NameConfirm','scrollbars=no,width=500,height=415');
}
function confirm_pwd(url) {
  window.open(url,'ConfirmPwd','resizable=no,scrollbars=no, width=450,height=143'); 
}
function SmsApplication() {
	window.open('../../main/userinfo/sms.html?','SmsApplication','scrollbars=no,width=250,height=200');
}
function OpenEBook(url)
{	
	var Width = screen.availwidth - 8;
	var Height = screen.availheight;
	window.open( url ,"EBook","width="+Width+",height="+Height+",left=0,top=0")
}
/*------------------------------------------------------------------------*/
//  ¸Þ´ºÁ¤ÀÇ
/*------------------------------------------------------------------------*/
function Home(){	
	top.location.href = "../../main/frame/main.html";
}
function GoMain( code ){	
	if ( code == null || code == "" ) code = "frame";
	if ( code != "menu01" && code != "menu02" && code != "menu03" && code != "menu04" && code != "menu05" && code != "menu07") {
//		alert("¾ÆÁ÷ ÁØºñ°¡ µÇÁö ¾Ê¾Ò½À´Ï´Ù.");
	} else {
		location.href = "../../main/"+code+"/main.html?";
	}
}
function GoSubMenu( code ){	
	location.href = "../../main/frame/submain.html?code="+code;
}

function GoBoard( tabletype , code , viewtype ){
	var filename;
	if ( tabletype ) {
		if ( tabletype=="boardcolumn" ) viewtype = "VIEW";
		if ( tabletype=="boardhtml" ) viewtype = "VIEW";
		
		if ( viewtype == "INPUT" ) filename = "boardinput.html";
		else if ( viewtype == "VIEW" ) filename = "boardcontent.html"; 
		else filename = "boardlist.html";
		location.href = "../../main/"+tabletype+"/"+filename+"?code="+code;
	} else {
		location.href = "../../main/frame/submain.html?code="+code;
	}
}

function GoBoardView( code ,no ,tabletype, multino ){
	if ( multino == null ) multino = "";

	if ( tabletype == "boardgallery" ) {
		window.open( "../../main/"+tabletype+"/popcontent.html?code="+code+"&no="+no ,"GalleryView","width=720,height=600")
	} else if ( tabletype == "boardvod" ) {
		window.open( "../../main/"+tabletype+"/viewer.html?code="+code+"&no="+no+"&multino="+multino ,"Viewer","width=572,height=440")
	} else if ( tabletype ) {
		location.href = "../../main/"+tabletype+"/boardcontent.html?code="+code+"&no="+no;
	} else {
		location.href = "../../main/frame/submain.html?show=VIEW&code="+code+"&no="+no;
	}
}
function GoCeremony( code ){	
	parent.location.href = "../../main/boardedit/boardlist.html?code="+code;
}
function Onair( code ,no ,multino ){
	if ( multino == null ) multino = "";
	window.open( "../../main/boardcalendar/onair.html?code="+code+"&no="+no+"&multino="+multino ,"OnAir","width=451,height=432")
}
function GoLecture( code ,no ,tabletype, multino ){
	if ( multino == null ) multino = "";
	window.open( "../../main/"+tabletype+"/viewer.html?code="+code+"&no="+no+"&multino="+multino ,"Viewer","width=572,height=440")
}
function GoTutorInfo( no ){
	window.open( "../../main/boardlecture/tutor.html?no="+no ,"Tutor","width=400,height=250")
}
/*------------------------------------------------------------------------*/
//  °Ô½ÃÆÇ °ü·Ã
/*------------------------------------------------------------------------*/
function GoPrint(code,no) {
	window.open('../../main/boardcommon/print.html?code='+code+'&no='+no,'PrintView','scrollbars=yes,width=610,height=600'); 
}
function GoMail(code,no) {
	window.open('../../main/boardcommon/mailto.html?code='+code+'&no='+no,'MailTo','width=592,height=525'); 
}
function GoSource(code,no) {
	window.open('../../main/boardcommon/source.html?code='+code+'&no='+no,'SOURCE','width=592,height=440'); 
}
function board_find(no) {
	window.open('../../main/boardcommon/findboard.html?no='+no,'FindBoard','resizable=no,scrollbars=yes, width=520,height=242'); 
}
function photo_find() {
	window.open('../../main/boardcommon/findphoto.html?','FindPhoto','resizable=no,scrollbars=yes, width=520,height=242'); 
}
function vod_find() {
	window.open('../../main/boardcommon/findvod.html?','FindVod','resizable=no,scrollbars=yes, width=520,height=242'); 
}

/*------------------------------------------------------------------------*/
//  µ¿¿µ»ó ÇÃ·¡½¬ ½ÇÇà
/*------------------------------------------------------------------------*/
function FlashPlay( src, width, height){	
	document.write ('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write ('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="');
	document.write (width);
	document.write ('" height="');
	document.write (height);
	document.write ('">');
	document.write ('<param name="movie" value="');
	document.write (src);
	document.write ('">');
	document.write ('<param name="quality" value="high">');
	document.write ('<param name="wmode" Value="Transparent">');
	document.write ('<embed src="');
	document.write (src);
	document.write ('" quality="high" ');
	document.write ('pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="');
	document.write (width);
	document.write ('" height="');
	document.write (height);
	document.write ('">');
	document.write ('</embed>');
	document.write ('</object>');
}
function VodPlay( src, width, Height ){	
	document.write ('<div style="width:');
	document.write (width);
	document.write ('px;height:240px">');
	document.write ('<object id=WMP_Player classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" ');
	document.write ('style="width:');
	document.write (width);
	document.write ('px;height:');
	document.write (Height);
	document.write ('px;border:0 ');
	document.write ('inset silver;">');
	document.write ('<param name=URL value="');
	document.write (src);
	document.write ('">');
	//document.write ('<param name=uiMode value=none>');
	document.write ('</object>');
	document.write ('</div>');
}
function VodPlay_1( src , flag ,playerId, width ,height){	
    document.write ('<OBJECT ID="'+playerId+'" ');
    document.write ('CLASSID=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 ');
    document.write ('CODEBASE=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715 ');
    document.write ('standby="Loading Microsoft Windows Media Player components..." ');
    document.write ('TYPE="application/x-oleobject" VIEWASTEXT ');
	if( width ==null ) width=320;
	if ( width != "" && width != null ) {
		if ( height == "" || height == null ) height = 240;
		if ( flag == 1 ) height = height + 45;
		document.write ('style="width:');
		document.write (width);
		document.write ('px;height:'+height+'px;"');
	}			
	document.write ('>');
    document.write ('<PARAM NAME="FileName" VALUE="');
	document.write (src);
	document.write ('">');
	document.write ('<param name="ShowControls" value="');
	document.write (flag);
	document.write ('">');
    document.write ('</OBJECT>');
}
function LOAD_LIVE(src, width){
	document.write("<OBJECT ID='WMP_Player' width="+width+" height=313 classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/MediaPlayer1/en/nsmp2inf.cab#Version=6,4,5,715' standby='Loading Microsoft?Windows?Media Player components...' type='application/x-oleobject'>");
	document.write("<param NAME='url' value='"+src+"'>");
	document.write("<param NAME='Filename' value='"+src+"'>");
	document.write("<param NAME='transparentAtStart' VALUE='True'>");
	document.write("<param NAME='transparentAtStop' VALUE='True'>");
	document.write("<param NAME='AnimationAtStart' VALUE=0>");
	document.write("<param NAME='AutoStart' VALUE='True'>");
	document.write("<param NAME='AutoRewind' VALUE='True'>");
	document.write("<param NAME='SendMouseClickEvents' VALUE='True'>");
	document.write("<param NAME='DisplaySize' VALUE='1'>");
	document.write("<param NAME='AutoSize' VALUE='0'>");
	document.write("<param NAME='AutoResize' VALUE='0'>");
	document.write("<param name='ShowStatusBar' value=1>");
	document.write("<param name='ShowControls' value=1>");
	document.write("<param NAME='ShowPositionControls' VALUE='0'>");
	document.write("<param NAME='Enabled' VALUE='1'>");
	document.write("<param NAME='EnableContextMenu' VALUE='0'>");
	document.write("<param NAME='EnablePositionControls' VALUE='1'>");
	document.write("<param NAME='EnableFullScreenControls' VALUE='0'>");
	document.write("<param NAME='StartPosition' VALUE='0'>");
	document.write("<param NAME='Mute' VALUE='0'>");						
	document.write("<param NAME='ClickToPlay' VALUE='1'>");
	document.write("<param NAME='CursorType' value='1'>");
	document.write("</object>")
}
/*------------------------------------------------------------------------*/
//  ÀÌ¹ÌÁö Ãâ·Â
/*------------------------------------------------------------------------*/
function ResizeImage(img_obj,max_width,max_height,swap) {
	imgobj =  eval("document."+img_obj);

	if ( swap == "SWAP" ) {
		if ( imgobj.width < imgobj.height ) {
			swaptmp = max_width;
			max_width = max_height;
			max_height = swaptmp;
		}
	}
	var tmp = 1;
	if ( imgobj.width > max_width) {
		tmp = max_width / imgobj.width ;	//width°¡ maxwidthº¸´Ù Å«°æ¿ìÃà¼ÒÀ²
		if ( Number( imgobj.height * tmp ) > max_height) {
			tmp = Number(tmp * (max_height / (imgobj.height*tmp)));
		}
	} else if ( imgobj.height > max_height )	{ //width°¡ maxwidthº¸´Ù Å«°æ¿ìÃà¼ÒÀ²
		 tmp = Number(max_height / imgobj.height) ;
	}
	imgobj.width = Number( imgobj.width * tmp );
}
function img_View(img_name,width,height) {

	if ( img_name != null && img_name != "" ) {

		var win_scrollbars = 'no';
		var width_plus = 0;

		if (height > 800) {
			var win_scrollbars = 'yes';
			height = 800;
			var width_plus = 20;
		} 
		if (width > 800) {
			var win_scrollbars = 'yes';
			width = 800;
			var width_plus = 20;
		}

		var openwidth = Number(width) + width_plus + 2;
		var openheight = Number(height) + width_plus + 2;

		window.open('../../main/unionpgm/imgView.php3?img='+img_name,'','width='+openwidth+',height='+openheight+', toolbar=0,menubar=0,resizable=yes,scrollbars='+win_scrollbars+', top=50, left=50');
	}
}

function setCookie( name, value, expiredays ) 
{ 
	var todayDate = new Date(); 
	todayDate.setDate( todayDate.getDate() + expiredays ); 

	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
} 
function GetCookie(cName){
	var a = document.cookie.split("; "); 
		for (var i=0; i < a.length; i++){
			var aa=a[i].split("=");
				if (cName == aa[0] && aa[1] != null){
						return unescape(aa[1]); 
				}       
		}
		return null;
}

