
var EmbedStr = "";

function GetFlash(url,x,y) { 
	EmbedStr = "<object id='flash' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='" + x + "' height='" + y + "'>";
	EmbedStr += "<param name='allowScriptAccess' value='sameDomain' />";
	EmbedStr += "<param name='movie' value='" + url + "' />";
	EmbedStr += "<param name='quality' value='high' />";
	EmbedStr += "<param name='bgcolor' value='#ffffff' />";
	EmbedStr += "<param name='wmode' value='transparent' />";
	EmbedStr += "<embed src='" + url + "' quality='high' wmode='transparent' bgcolor='#ffffff' width='" + x + "' height='" + y + "' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />";
	EmbedStr += "</object>";
	
	document.write(EmbedStr);
	//document.getElementById("topFlash").outerHTML = EmbedStr;
	return;
}

function getDivFlash(url, x, y, divName) {
	var myObjElement = document.createElement("<object id='flash' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='" + x + "' height='" + y + "'><embed src='" + url + "' quality='high' wmode='transparent' bgcolor='#ffffff' width='" + x + "' height='" + y + "' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>" );
	myObjElement.appendChild(document.createElement("<param name='allowScriptAccess' value='sameDomain' />"));
	myObjElement.appendChild(document.createElement("<param name='movie' value='" + url + "' />"));
	myObjElement.appendChild(document.createElement("<param name='quality' value='high' />"));
	myObjElement.appendChild(document.createElement("<param name='bgcolor' value='#ffffff' />"));
	myObjElement.appendChild(document.createElement("<param name='wmode' value='transparent' />"));
	eval (divName + ".appendChild(myObjElement)");
}


function GetMPlayer(x,y,astart) { 
	EmbedStr = "<OBJECT id='MoviePlayer' classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' width='" + x + "' height='" + y + "' TYPE='application/x-oleobject' VIEWASTEXT >";
	EmbedStr += "<param name='autoStart' value='" + astart + "'>";
	EmbedStr += "<param name='windowlessVideo' value='false'>";
	EmbedStr += "<param name='uiMode' value='none'>";
	EmbedStr += "<param name='volume' value='100'>";
	EmbedStr += "<param name='stretchToFit' value='true'>";
	EmbedStr += "<param name='autoRewind' value='false'>";
	EmbedStr += "<param name='transparentAtStart' value='true'>";
	EmbedStr += "<param name='enableContextMenu' value='false'>";
	EmbedStr += "</OBJECT>";

	document.write(EmbedStr);
	return;
}

function infoshow(obj){
        if(obj.style.display == 'none')
                obj.style.display = "";
        else
                obj.style.display = "none";
}
function infomove(obj){
        obj.style.posLeft = event.clientX - 15;
        obj.style.posTop = event.clientY + 20 + document.body.scrollTop;
}

/**
 * ÄíÅ°°ªÀ» °¡Á® ¿Â´Ù. ÆË¾÷Ã¢ ¿­°í ´Ý±â ÇÒ¶§.
 **/
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 ""; 
} 

/**
 * ÄíÅ°°ªÀ» ¼³Á¤ ÇÑ´Ù. ÆË¾÷Ã¢ ¿­°í ´Ý±â ÇÒ¶§.
 * name : ÄíÅ°¸í, value : ÄíÅ°°ª, expiredays : Áö¼Ó ½Ã°£ (1ÀÌ¸é ÇÏ·ç)
 **/
function setCookie( name, value, expiredays ) {
    var todayDate = new Date();
    todayDate.setDate( todayDate.getDate() + expiredays );
    document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

/**
 * ¹®ÀÚ¿­ÀÇ ¾Õ µÚ °ø¹éÀ» Á¦°ÅÇØ ÁØ´Ù.
 **/
String.prototype.trim = function() { 
    return this.replace(/(^\s*)|(\s*$)/g, ""); 
} 

/**
 * span Å©±â¿¡ ¸Â°Ô ±ÛÀ» Â¥¸£°í Â¥¸¥ ±Û µÚ¿¡ ... À» ºÙ¿©¼­ ¹ÝÈ¯ÇÑ´Ù.
 **/
function cutString(w) {
		
	if (document.all) {
		cutStringIE(w);
	}
	else {
		cutStringFF(w);
	}
}

function cutStringIE(w) {
	try {
		var obj;
		if(ttl.length) {
			for( i = 0; i < ttl.length; i++ ) {							// ±Û °¹¼ö¸¸Å­ ¹Ýº¹ 
				obj = eval( "ttl[" + i + "]");
				if( obj.scrollWidth > w ) {								// ÇÑÁÙÀÌ ³Ñ¾î°¡´Â ±Û¿¡ ´ëÇØ¼­ 
					text = obj.innerText;								// text º¯¼ö¿¡ »ðÀÔÇÑ´Ù. 
					while( true ) {// ¹«ÇÑ loop 
						text = text.substring( 0, text.length - 1 );	// ÅØ½ºÆ®¸¦ ³¡¿¡¼­ ÇÑ±ÛÀÚ¾¿ Àß¶ó°¡¸é¼­ 
						obj.innerText = text;							// °ªÀ» ¼öÁ¤ÇÑ´Ù. 
						if( obj.scrollWidth < w ) break; 				// ÇÑÁÙÀÌ µÇ¸é loop ¸¦ ³¡³½´Ù. 
					}
					obj.innerText = text.trim() + "..."; 				// ³¡¿¡ °ø¹éÀÌ ÀÖ´Ù¸é ÀÚ¸¥ ´ÙÀ½  ... À» ºÙ¿©¼­ °ªÀ» ¼öÁ¤ÇÑ´Ù. 
				} 
			}
		}
		else {
			obj = ttl;
			if( obj.scrollWidth > w ) {
				text = obj.innerText;
				while( true ) {
					text = text.substring( 0, text.length - 1 );
					obj.innerText = text;
					if( obj.scrollWidth < w ) break;
				}
				obj.innerText = text.trim() + "...";
			}			
		}
	}
	catch (E) {
	}	
}

function cutStringFF(w) {
	var obj;
	obj = document.getElementsByName("ttl");
	try {
		for(var i = 0; i < obj.length; i++) {
			alert(obj(i).scrollWidth);
			if( obj(i).scrollWidth > w ) {								// ÇÑÁÙÀÌ ³Ñ¾î°¡´Â ±Û¿¡ ´ëÇØ¼­ 
				text = obj(i).innerText;								// text º¯¼ö¿¡ »ðÀÔÇÑ´Ù. 
				text = getInnerText(element.childNodes.item(i)); 
				alert(text);
				while( true ) {// ¹«ÇÑ loop 
					text = text.substring( 0, text.length - 1 );	// ÅØ½ºÆ®¸¦ ³¡¿¡¼­ ÇÑ±ÛÀÚ¾¿ Àß¶ó°¡¸é¼­ 
					obj(i).innerText = text;							// °ªÀ» ¼öÁ¤ÇÑ´Ù. 
					if( obj(i).scrollWidth < w ) break; 				// ÇÑÁÙÀÌ µÇ¸é loop ¸¦ ³¡³½´Ù. 
				}
				obj(i).innerText = text.trim() + "..."; 				// ³¡¿¡ °ø¹éÀÌ ÀÖ´Ù¸é ÀÚ¸¥ ´ÙÀ½  ... À» ºÙ¿©¼­ °ªÀ» ¼öÁ¤ÇÑ´Ù. 
			} 		
		}
	}
	catch(E) {
	}

}

/**
 * ¼ýÀÚ¸¸ ÀÔ·Â¹Þ´Â´Ù. ime-mode:disabled; ¿Í ÇÔ°Ô onKeyPress ÀÌº¥Æ®·Î Ã³¸®
 **/
function onlyNum() {
	if ((event.keyCode < 48)||(event.keyCode > 57)) {
		if (event.keyCode == 13) {
			event.returnValue;
		}
		else {
			event.returnValue = false;
		}
	}
}

/**
 * ÇÑ±Û 2ÀÚ ¿µ¹® 1ÀÚ·Î ÇØ¼­ °á°ú°ªÀ» ³Ñ±ä´Ù.
 **/
function getLength(str) {
	var tmplen = 0;
	for (var i = 0; i < str.length; i++) {
		if (str.charCodeAt(i) > 127) {
			tmplen += 2;
		}
		else {
			tmplen++;
		}
	}
	return tmplen;
}

function popImg(URL, name){
	window.open(URL, name, "");
}

//-->
