

// flashWrite(path, width, height, id, backgroundcolor, vars)
function flashWrite(url,w,h,id,bg,vars){
	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='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	//"<param name='bgcolor' value='"+bg+"' />"+
	"<param name='wmode' value='transparent' />"+
	"<embed src='"+url+"' FlashVars='"+vars+"' menu='false' quality='high' wmode='transparent' 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);
}


/* global */
function global(site,num) {
	var d=document,a=global.arguments;
	for ( i=1 ; d.getElementById("global0"+i+"_img") ; i++ ) {
		var dimg=d.getElementById("global0"+i+"_img"),dsub=d.getElementById("globals0"+i);
		if ( i == a[1] ) {
			dimg.src='/html/'+a[0]+'/images/navi/global_on_0'+i+'.gif';
			if ( dsub!=null ) { dsub.style.left=0; }
		} else {
			dimg.src='/html/'+a[0]+'/images/navi/global_0'+i+'.gif';
			if ( dsub!=null ) { dsub.style.left="-3000px"; }
		}
	}
}


/* tsidmenu */
function tsidemenu(num) {
	var d=document,a=tsidemenu.arguments;
	for ( i=1 ; d.getElementsByName("sm"+i).length > 0 ; i++ ) {
		var lsub=d.getElementById("sidemenu_sub"+i);
		if ( i == a[0] && lsub!=null ) {
			lsub.style.position="relative";
			lsub.style.left=0;
		}
		else if ( lsub!=null ) {
			lsub.style.position="absolute";
			lsub.style.left="-3000px";
		}
	}
}

/** rollover **/
function rollover_off() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function rollover_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function rollover_on() { //v3.0
  var i,j=0,x,a=rollover_on.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=rollover_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



/* sitemap */
function sitemap(val) {
	var d=document;
	var obj=d.getElementById("sitemaparea");
	if ( val == 'on' ) obj.style.left="-400px";
	else obj.style.left="-4000px";
}

var gTTS = 0;

var nowZoom = 100;
var maxZoom = 500;
var minZoom = 80;

function zoomIn() { 
	if (nowZoom < maxZoom) { 
		nowZoom += 10;
	} else { 
		return; 
	} 
	document.body.style.zoom = nowZoom + "%"; 
} 

function zoomOut() { 
	if (nowZoom > minZoom) { 
		nowZoom -= 10;
	} else { 
		return; 
	} 
	document.body.style.zoom = nowZoom + "%"; 
} 

function zoomDefault() { 
	nowZoom = 100; 
	document.body.style.zoom = nowZoom + "%"; 
} 

function SoundOnOff()	{
	if (gTTS == 0) {
		eval("document.all['VoiceStart']").src = "/image/speech/english/btn_on.jpg";
		eval("document.all['VoiceStart']").alt="voice off";
		eval("document.all['VoiceStart']").title="voice off";
		gTTS = 1;
	} else {
		eval("document.all['VoiceStart']").src = "/image/speech/english/off.gif";
		eval("document.all['VoiceStart']").alt="voice on";
		eval("document.all['VoiceStart']").title="voice on";		
		gTTS = 0;
	}
	activevoice1.SoundOnOff = gTTS;
}

function ttscontrol() {
	var ttscontrol_tag = "";
	ttscontrol_tag =  '<div id="ttscontrol" align="right">';
	
	ttscontrol_tag += '<table border="0" cellsacing="0" cellpadding="0" bgcolor="black">';
	ttscontrol_tag += '<tr><td align="right">';

	ttscontrol_tag += '<table border="0" cellspacing="0" cellpadding="2" bgcolor="#faf2e4">';
	ttscontrol_tag +='		<tr>';
	ttscontrol_tag +='			<td width="5" bgcolor="#A27272"><img src="/image/space.gif" width="5" alt="" title="" border="0" valign="middle"></td>';
	ttscontrol_tag +='			<td style="font-size:9pt;">Voice Service</td>';
	ttscontrol_tag +='			<td><a  title="voice on button" href="javascript:SoundOnOff();"><img name="VoiceStart" ID="VoiceStart" src="/image/speech/english/off.gif" alt="voice on" title="voice on" border="0"/></a></td>';
	ttscontrol_tag +='			<td><img src="/image/space.gif" width="5" alt="" title="" border="0" valign="middle"></td>';
	ttscontrol_tag +='			<td style="font-size:9pt;">Speed</td>';
	ttscontrol_tag +='			<td><a href="javascript:SpeedUp();" alt="speed up button" title="speed up button"><img src="/image/speech/english/up.gif" alt="speed up button" title="speed up button"  border="0"/></a></td>';
	ttscontrol_tag +='			<td><a href="javascript:SpeedDown();" alt="speed down button" title="speed down button"><img src="/image/speech/english/down.gif" alt="speed down button" title="speed down button"  border="0"/></a></td>';
	ttscontrol_tag +='			<td><img src="/image/space.gif" width="5" alt="" title="" border="0" valign="middle"></td>';
	ttscontrol_tag +='			<td style="font-size:9pt;">Screen Size</td>';
	ttscontrol_tag +='			<td><a href="javascript:zoomIn();"  alt="size up button"  title="size up button"><img src="/image/speech/english/up.gif" alt="size up button"  title="size up button"  border="0"/></a></td>';
	ttscontrol_tag +='			<td><a href="javascript:zoomOut();" alt="size down button"  title="size down button"><img src="/image/speech/english/down.gif" alt="size down button"  title="size down button"  border="0"/></a></td>';
	ttscontrol_tag +='	</tr>';
	ttscontrol_tag +='</table>';

	ttscontrol_tag += '</td></tr>';
	ttscontrol_tag += '</table>';

	ttscontrol_tag += '<table border="0" cellpadding="0" cellspacing="0">';
	ttscontrol_tag += '<tr>';
	ttscontrol_tag += '<td><a href="http://sunchang.go.kr"><img src="/image/Korean.gif" width="51" height="15" border="0"></a></td>';
	//ttscontrol_tag += '<td><a href="http://english.sunchang.go.kr"><img src="/image/English.gif" width="62" height="15" border="0"></a></td>';
	ttscontrol_tag += '<td style="padding-right:2px;"><a href="http://japanese.sunchang.go.kr"><img src="/image/Japanese.gif" width="48" height="15" border="0"></a></td>';
	ttscontrol_tag += '</tr>';
	ttscontrol_tag += '</table>';

	ttscontrol_tag +='</div>';
	
	document.write(ttscontrol_tag);
}

function flash(c,d,e) {
	var flash_tag = "";
	flash_tag = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
	flash_tag +='codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" ';
	flash_tag +='WIDTH="'+c+'" HEIGHT="'+d+'" >';
	flash_tag +='<param name="movie" value="'+e+'">';
	flash_tag +='<param name="quality" value="high">';
	flash_tag +='<param name="wmode" value="transparent">';
	flash_tag +='<embed src="'+e+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" ';
	flash_tag +='type="application/x-shockwave-flash"  WIDTH="'+c+'" HEIGHT="'+d+'"></embed></object>'
	
	document.write(flash_tag);
}

function tts() {
	var tts_tag = "";
	tts_tag = '<OBJECT ID="activevoice1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:F0491F4A-FF7D-46CB-9168-BA933621FA3A" CODEBASE="/activevoice.cab#version=3,9,0,1">';
	tts_tag +='<PARAM NAME="ServerIP" VALUE="fd655928078f5a920fed2be241e89da4">';
	tts_tag +='<PARAM NAME="ServerPort" VALUE="7000">';
	tts_tag +='<PARAM NAME="SoundOnOff" VALUE=' + gTTS + '>';
	tts_tag +='<PARAM NAME="Speaker" VALUE=100>';
	tts_tag +='<PARAM NAME="VoiceEffect" VALUE=0>';
	tts_tag +='<PARAM NAME="Speed" VALUE=-2>';
	tts_tag +='<PARAM NAME="DictNum" VALUE=1>';
	tts_tag +='<PARAM NAME="DelaySpeak" VALUE=500>';
	tts_tag +='<PARAM NAME="TitleOnOff" VALUE=0>';
	tts_tag +='<PARAM NAME="IncludeDomain" VALUE="92318d5a627f9b9151e0a744df503a57de112ee60eef8fbf">';
	//tts_tag +='<PARAM NAME="ExcludeDomain" VALUE="c7f5d6ae00a7838a822385dd59c820e9876637fe5169979e">';
	tts_tag +='</OBJECT>';
	
	document.write(tts_tag);
}

function SetSpeaker(nSpeaker) {
	activevoice1.Speaker = nSpeaker;
	str = activevoice1.Speaker;
}

function SpeedDown() {
	str = activevoice1.Speed-1;
	// if (activevoice1.SetSpeed(str)) {		
	// 	Speed.innerText="ΌΣ΅΅ " + str;
	// }
}

function SpeedUp() {
	str = activevoice1.Speed+1;
	// if (activevoice1.SetSpeed(str)) {
	// 	Speed.innerText="ΌΣ΅΅ " + str;
	// }
}
