
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, "");
}

//-->

