//flash幻灯广告
var getFlashAdvs = function(xml,w,h,ofocus){
	var focus_width=w; //图片框的宽度 
	var focus_height=h; //图片框的高度 
	
	html = "";
	html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '
	html += ' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"';
	html += ' width="'+ focus_width +'" height="'+ focus_height +'">'; 
	html += '<param name="allowscriptAccess" value="sameDomain"><param name="movie" value="'+ofocus+'">';
	html += '<param name="quality" value="high"><param name="bgcolor" value="#F2F2F2">'; 
	html += '<param name="menu" value="false"><param name=wmode value="opaque">'; 
	html += '<param name="FlashVars" value="bcastr_xml_url='+xml+'">'; 
	html += '<embed src="'+ofocus+'" wmode="opaque" FlashVars="bcastr_xml_url='+xml+'" menu="false"';
	html += ' bgcolor="#F2F2F2" quality="high" width="'+ focus_width +'" height="'+ focus_height +'"'
	html += 'allowscriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
	return html;
}
//标签切换
function nTabs(tabObj,obj){
	var tabList = document.getElementById(tabObj).getElementsByTagName("li");	
	for(i=0; i <tabList.length; i++){
		if (tabList[i].id == obj.id){
			document.getElementById(tabObj+"_te_"+i).className = "sli"; 
    		document.getElementById(tabObj+"_co_"+i).style.display = "block";
		}else{
			document.getElementById(tabObj+"_te_"+i).className = ""; 
			document.getElementById(tabObj+"_co_"+i).style.display = "none";
		}
	}	
}
//FLV视频播放
function getFlv(w,h,t,f){
	var PUBLIC = "http://dcgz2011.gywb.cn/Public";
	var swf_width=w //445
	var swf_height=h //301
	var texts=t //'男左女右'
	var files=f//'http://www.yxgz.cn/Files/adminFiles/jzt/ok2_3.flv'
	
	//var files='1.flv|2.flv'
	var strText = "";
	
	strText = strText+'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"';
	strText = strText+'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+swf_height +'">';
	strText = strText+'<param name="movie" value="'+PUBLIC+'/flash/vcastr22/vcastr22.swf"><param name="quality" value="high">';
	strText = strText+'<param name="menu" value="false"><param name="allowFullScreen" value="true" />';
	strText = strText+'<param name="FlashVars" value="vcastr_file='+files+'&vcastr_title='+texts+'&IsAutoPlay=0&IsContinue=1">';
	strText = strText+'<embed src="'+PUBLIC+'/flash/vcastr22/vcastr22.swf" allowFullScreen="true" FlashVars="vcastr_file='+files+'&vcastr_title='+texts+'&IsAutoPlay=0&IsContinue=1"';
	strText = strText+' menu="false" quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash"';
	strText = strText+' pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
	
	return strText;
}

//加入收藏
function AddFavorite(sURL,sTitle){
	try{
		window.external.addFavorite(sURL, sTitle);
	}catch (e){
		try
	{
		window.sidebar.addPanel(sTitle, sURL, "");
	}catch (e){
		alert("加入收藏失败，请使用Ctrl+D进行添加");
		}
	}
}
//设为首页
function SetHome(obj,vrl){
	try{
		obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
	}catch(e){
		if(window.netscape){
			try{
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
			}catch (e){
				alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。");
			}
			var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
			prefs.setCharPref('browser.startup.homepage',vrl);
		}
	}
}

function getFlash(setWidth,setHeight,setUrl){
	if(parseInt(setHeight)<1){
		setHeight = "100%";	
	}
	if(parseInt(setWidth)<1){
		setWidth = "100%";	
	}
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width='+setWidth+' height='+setHeight+'>')
	document.write('<param name="movie" value='+setUrl+'>')
	document.write('<param name="quality" value="high">')
	document.write('<param name="wmode" value="transparent" /> ')
	document.write('<embed src='+setUrl+' quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width='+setWidth+' height='+setHeight+' wmode="transparent"></embed></object>')
}

function isopenmenu(prid,isid){
	$(prid).hover(function(){
		$(isid).slideDown("slow");
	},
	
	function(){
		$(isid).slideUp('slow');
	});
}
