// JavaScript Document

//用指定的sptr1替换掉字符串str中的所有sptr
function replaceAll(str,sptr,sptr1)
{
	while(str.indexOf(sptr) >= 0)
	{
		str = str.replace(sptr,sptr1);
	}
	return str;
}

//去空格
function strim(str)
{
	while(str.indexOf(" ")!=-1)
	{
		str=str.replace(" ","");	
	}
	return str;
}

//去除两端的空格
function javatrim(str){
    return str.replace(/(^\s+)|(\s+$)/g, "");
}

//获取指定对象
function GetObj(objName){
	if(document.getElementById)
		return eval('document.getElementById("' + objName + '")');
	else if(document.layers)
		return eval("document.layers['" + objName +"']");
	else
		return eval('document.all.' + objName);
}

function killErrors() {
return true;
}

function addFlashTabs(pics,links,texts,focus_width,focus_height,text_height) {
	var swf_height = focus_height+text_height
	
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
	document.write('<param name="allowScriptAccess" value="sameDomain">')
	document.write('<param name="movie" value="/images/focus.swf">')
	document.write('<param name="quality" value="high">')
	document.write('<param name="bgcolor" value="#F0F0F0">');
	document.write('<param name="menu" value="false">')
	document.write('<param name=wmode value="opaque">');
	document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
	document.write('<embed src="/images/focus.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#F0F0F0" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}

function addFlashAds(width,height,src) {
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width=" + width + " height=" + height + ">")
	document.write("<param name='movie' value='../../inc/js/"+ src +"'>")
	document.write("<param name='quality' value='high'>")
	document.write("<param name='wmode' value='transparent'>")
	document.write("<embed src='../../inc/js/"+ src +"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width=" + width + " height='" + height + "'></embed>")
	document.write("</object>");
}

