<!--

/* ???? ?? ?????? Function */
/* ??? : ???                               */
/* ????? : 2006.08.02                    */



/* ??? ??? */
var top_Navi_on = ""; //?? on ?? objName

// ImgRollOver(?????, ??????)
function ImgRollOver_topNavi_init(objName, imgName)
{
	ImgRollOver_topNavi(objName, imgName);
	top_Navi_on = objName;

}

// ImgRollOver(?????, ?????)
function ImgRollOver_topNavi(objName, imgName)
{
	//alert(top_Navi_on+","+objName);
	if ( eval("document."+objName) && top_Navi_on != objName )
	{
		obj = eval("document.all."+objName);

		obj.src = imgName;
	}

}

function viewer(imgStr,w,h)
{
	document.write(viewerStr(imgStr,w,h));
}

	function doPreViewPhoto()
	{
       if(document.frmReg.photo.value !=""){
		  //document.frmReg.dfPhotoIdx.value = "";
	      document.all.introPhoto.src = document.frmReg.photo.value;
		}
	}


// ???, ??? ???
function viewerStr(imgStr,w,h)
{
	width_str = "";
	height_str = "";
	dot_cnt = imgStr.lastIndexOf(".");
	ext = (imgStr.substring(dot_cnt+1)).toLowerCase();

	if ( ext == "jpg" || ext=="jpge" || ext=="gif" || ext=="png" )
	{
		if ( w > 0 )	width_str = "width='"+w+"' ";
		if( h> 0) height_str = " height='"+h+"' ";
		retStr = "<img src=\""+imgStr+"\" "+width_str+height_str+" border=0 align=absmiddle>";
	} else if ( ext == "swf" )
	{
		id = ""
		vars = ""
		bg = ""
		win = "transparent"
		if(w==0) w = 200;
		if(h==0) h=200;
			// ??? ?? ??
		var retStr=
		"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
		"<param name='allowScriptAccess' value='always' />"+
		"<param name='movie' value='"+imgStr+"' />"+
		"<param name='FlashVars' value='"+vars+"' />"+
		"<param name='wmode' value='"+win+"' />"+
		"<param name='menu' value='false' />"+
		"<param name='quality' value='high' />"+
		"<param name='bgcolor' value='"+bg+"' />"+
		"<embed src='"+imgStr+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
		"</object>";
	}

	return retStr;
}


// flashWrite(????, ??, ??, ???, ???, ??, ?????)
function flashWrite(url,w,h,id,bg,vars,win){

	// ??? ?? ??
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='FlashVars' value='"+vars+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";

	// ??? ?? ??
	document.write(flashStr);

}

function flashWriteSSL(url,w,h,id,bg,vars,win){

	// ??? ?? ??
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='FlashVars' value='"+vars+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";

	// ??? ?? ??
	document.write(flashStr);

}

// ??? show hide

if (document.all) {
  layerview='document.all'
  styleview='.style.'
} else if (document.layers) {
  layerview='document.layers'
  styleview='.'
}
function show(p){
  eval(layerview+'.'+p+styleview+'visibility="visible"');
}
function hide(p){
  eval(layerview+'.'+p+styleview+'visibility="hidden"');
}



// ???
function URLEncode(plaintext)
{
	// The Javascript escape and unescape functions do not correspond
	// with what browsers actually do...
	var SAFECHARS = "0123456789" +					// Numeric
					"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +	// Alphabetic
					"abcdefghijklmnopqrstuvwxyz" +
					"-_.!~*'()";					// RFC2396 Mark characters
	var HEX = "0123456789ABCDEF";

	var encoded = "";
	for (var i = 0; i < plaintext.length; i++ ) {
		var ch = plaintext.charAt(i);
	    if (ch == " ") {
		    encoded += "+";				// x-www-urlencoded, rather than %20
		} else if (SAFECHARS.indexOf(ch) != -1) {
		    encoded += ch;
		} else {
		    var charCode = ch.charCodeAt(0);
			if (charCode > 255) {
			    alert( "Unicode Character '"
                        + ch
                        + "' cannot be encoded using standard URL encoding.\n" +
				          "(URL encoding only supports 8-bit characters.)\n" +
						  "A space (+) will be substituted." );
				encoded += "+";
			} else {
				encoded += "%";
				encoded += HEX.charAt((charCode >> 4) & 0xF);
				encoded += HEX.charAt(charCode & 0xF);
			}
		}
	} // for

	return encoded;
}

// ???
function URLDecode(encoded)
{
   // Replace + with ' '
   // Replace %xx with equivalent character
   // Put [ERROR] in output if %xx is invalid.
   var HEXCHARS = "0123456789ABCDEFabcdef";
   var plaintext = "";
   var i = 0;
   while (i < encoded.length) {
       var ch = encoded.charAt(i);
	   if (ch == "+") {
	       plaintext += " ";
		   i++;
	   } else if (ch == "%") {
			if (i < (encoded.length-2)
					&& HEXCHARS.indexOf(encoded.charAt(i+1)) != -1
					&& HEXCHARS.indexOf(encoded.charAt(i+2)) != -1 ) {
				plaintext += unescape( encoded.substr(i,3) );
				i += 3;
			} else {
				alert( 'Bad escape combination near ...' + encoded.substr(i) );
				plaintext += "%[ERROR]";
				i++;
			}
		} else {
		   plaintext += ch;
		   i++;
		}
	} // while
   return plaintext;
}

// ????
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( name )
{
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length )
	{
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
				endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
			break;
	}
	return "";
}




function AllTrim(a)
{
	for (; a.indexOf(" ") != -1 ;)
  {
  	a = a.replace(" ","")
  }
  return a;
}



// ??? ??? ???
	function img_resize()
	{
		if(typeof(document.all.upimg) != 'undefined'){
			for(i=0;i<document.all.upimg.length;i++)
			{
				width = document.all.upimg[i].width;
				if ( width > 440 ) { document.all.upimg[i].width = 440; }
			}
		}
	}



// ???? ??
//allCheckBox_flag = true;
function allCheckBox(obform, obname, chname)
{
    flag = obform[chname].checked;

	var obj = obform[obname];


	array_sum = IsArray(obform,obname);

	if ( array_sum>1 )
	{
		for( var i=0; i<obj.length; i++) {
			obj[i].checked = flag;
		}
	} else if (array_sum == 1){
		obform[obname].checked = flag;
	} else  {
	}

    return;
}


//???? ??
function IsArray(obj, str)
{
    var len = obj.elements.length;
    var sum = 0;

    for (var i=0; i<len; ++i)
    {
        if (obj.elements[i].name == str)
        {
            ++sum;
        }
    }

    return sum;
}

function mediaPlay(mUrl,mId,mWidth,mHeight)
{
	var movieWrite = "";
	movieWrite = " <OBJECT id="+mId+" hideFocus style='LEFT: 0px; WIDTH: "+mWidth+"px; TOP: 0px; HEIGHT: "+mHeight+"px' type=application/x-oleobject standby='Microsoft Windows Media Player ????? ??????.' classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 name="+mId+" VIEWASTEXT AutoStart='1'>"
	movieWrite = movieWrite + " <PARAM NAME='URL' VALUE='"+mUrl+"'>            "
	movieWrite = movieWrite + " <PARAM NAME='rate' VALUE='1'>                     "
	movieWrite = movieWrite + " <PARAM NAME='DisplaySize' VALUE='4'>              "
	movieWrite = movieWrite + " <PARAM NAME='balance' VALUE='0'>                  "
	movieWrite = movieWrite + " <PARAM NAME='currentPosition' VALUE='4.315449'>   "
	movieWrite = movieWrite + " <PARAM NAME='defaultFrame' VALUE='0'>             "
	movieWrite = movieWrite + " <PARAM NAME='playCount' VALUE='1'>                "
	movieWrite = movieWrite + " <PARAM NAME='autoStart' VALUE='1'>                "
	movieWrite = movieWrite + " <PARAM NAME='currentMarker' VALUE='0'>            "
	movieWrite = movieWrite + " <PARAM NAME='invokeURLs' VALUE='-1'>              "
	movieWrite = movieWrite + " <PARAM NAME='baseURL' VALUE=''>                   "
	movieWrite = movieWrite + " <PARAM NAME='volume' VALUE='80'>                  "
	movieWrite = movieWrite + " <PARAM NAME='uiMode' VALUE='none'>                "
	movieWrite = movieWrite + " <PARAM NAME='stretchToFit' VALUE='0'>             "
	movieWrite = movieWrite + " <PARAM NAME='windowlessVideo' VALUE='0'>          "
	movieWrite = movieWrite + " <PARAM NAME='enabled' VALUE='-1'>                 "
	movieWrite = movieWrite + " <PARAM NAME='enableContextMenu' VALUE='0'>        "
	movieWrite = movieWrite + " <PARAM NAME='fullScreen' VALUE='0'>               "
	movieWrite = movieWrite + " <PARAM NAME='SAMIStyle' VALUE=''>                 "
	movieWrite = movieWrite + " <PARAM NAME='SAMILang' VALUE=''>                  "
	movieWrite = movieWrite + " <PARAM NAME='SAMIFilename' VALUE=''>              "
	movieWrite = movieWrite + " <PARAM NAME='captioningID' VALUE=''>              "
	movieWrite = movieWrite + " <PARAM NAME='enableErrorDialogs' VALUE='0'>       "
	movieWrite = movieWrite + " <PARAM NAME='_cx' VALUE='0'>                      "
	movieWrite = movieWrite + " <PARAM NAME='_cy' VALUE='0'>                      "
	movieWrite = movieWrite + " <PARAM NAME='ShowDisplay' value='true'>           "
	movieWrite = movieWrite + " <PARAM NAME='ShowControls' value='true'>          "
	movieWrite = movieWrite + " <PARAM NAME='ShowTracker' value='True'>           "
	movieWrite = movieWrite + " </OBJECT> "
	document.write(movieWrite);
}

function mediaPlay2(mUrl,mId,mWidth,mHeight){
	var movieWrite = "";
	movieWrite = "<object id='"+mId+"' name='"+mId+"' classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715' width='"+mWidth+"' height='"+mHeight+"'>"
	movieWrite = movieWrite + "<param name='FileName' value='"+mUrl+"'>"
	movieWrite = movieWrite + "<param name='AutoStart' value='true'>          "
	movieWrite = movieWrite + "<param name='ShowTracker' value='true'>        "
	movieWrite = movieWrite + "<param name='ShowControls' value='false'>      "
	movieWrite = movieWrite + "<param name='ShowGotoBar' value='false'>       "
	movieWrite = movieWrite + "<param name='ShowDisplay' value='false'>       "
	movieWrite = movieWrite + "<param name='ShowStatusBar' value='false'>     "
	movieWrite = movieWrite + "<param name='AutoSize' value='false'>          "
	movieWrite = movieWrite + "<param name='Loop' value='true'>               "
	movieWrite = movieWrite + "<param name='DisplaySize' value='4'>           "
	movieWrite = movieWrite + "<embed src='"+mUrl+"' AutoStart='true' ShowTracker='true' ShowControls='false' ShowGotoBar='false' ShowDisplay='false' ShowStatusBar='false' AutoSize='false' Loop='true' pluginspage='http://www.microsoft.com/windows/windowsmedia/download/' width='"+mWidth+"' height='"+mHeight+"'></embed></object>"
	document.write(movieWrite);
}

function mediaPlay3(mUrl,mId,mWidth,mHeight){
	var movieWrite = "";
	movieWrite = "<embed src='"+mUrl+"' AutoStart='true' ShowTracker='true' ShowControls='true' ShowGotoBar='false' ShowDisplay='false' ShowStatusBar='false' AutoSize='false' Loop='true' pluginspage='http://www.microsoft.com/windows/windowsmedia/download/' width='"+mWidth+"' height='"+mHeight+"'></embed></object>"
	document.write(movieWrite);
}


function imgview(img_name){
		window.open("/zhdhwmdmep_kj/pop_img.asp?img="+img_name, "bigphotoremote","toolbar=no,menubar=no,width=1,HEIGHT=1, left=100, top=100");
}

function mediaMovie(playUrl)
{
	document.write (" <OBJECT id=objMUSIC hideFocus style='LEFT: 0px; WIDTH: 320px; TOP: 0px; HEIGHT: 240px' type=application/x-oleobject standby='Microsoft Windows Media Player ????? ??????.' classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 name=objMUSIC VIEWASTEXT AutoStart='1'>");
	document.write (" <PARAM NAME='URL' VALUE='"+playUrl+"'>            ");
	document.write (" <PARAM NAME='rate' VALUE='1'>                     ");
	document.write (" <PARAM NAME='balance' VALUE='0'>                  ");
	document.write (" <PARAM NAME='currentPosition' VALUE='4.315449'>   ");
	document.write (" <PARAM NAME='defaultFrame' VALUE='0'>             ");
	document.write (" <PARAM NAME='playCount' VALUE='1'>                ");
	document.write (" <PARAM NAME='autoStart' VALUE='1'>                ");
	document.write (" <PARAM NAME='currentMarker' VALUE='0'>            ");
	document.write (" <PARAM NAME='invokeURLs' VALUE='-1'>              ");
	document.write (" <PARAM NAME='baseURL' VALUE=''>                   ");
	document.write (" <PARAM NAME='volume' VALUE='80'>                  ");
	document.write (" <PARAM NAME='uiMode' VALUE='none'>                ");
	document.write (" <PARAM NAME='stretchToFit' VALUE='0'>             ");
	document.write (" <PARAM NAME='windowlessVideo' VALUE='0'>          ");
	document.write (" <PARAM NAME='enabled' VALUE='-1'>                 ");
	document.write (" <PARAM NAME='enableContextMenu' VALUE='0'>        ");
	document.write (" <PARAM NAME='fullScreen' VALUE='0'>               ");
	document.write (" <PARAM NAME='SAMIStyle' VALUE=''>                 ");
	document.write (" <PARAM NAME='SAMILang' VALUE=''>                  ");
	document.write (" <PARAM NAME='SAMIFilename' VALUE=''>              ");
	document.write (" <PARAM NAME='captioningID' VALUE=''>              ");
	document.write (" <PARAM NAME='enableErrorDialogs' VALUE='0'>       ");
	document.write (" <PARAM NAME='_cx' VALUE='0'>                      ");
	document.write (" <PARAM NAME='_cy' VALUE='0'>                      ");
	document.write (" <PARAM NAME='ShowDisplay' value='true'>           ");
	document.write (" <PARAM NAME='ShowControls' value='true'>          ");
	document.write (" <PARAM NAME='ShowTracker' value='True'>           ");
	document.write (" </OBJECT> ");
}

//-->


 
