﻿/* Javascript Document 
.....................................................................................
.. www.jingqu.cn V 3.2.1 Public Javascript	for huangguoshu         	    	  		    ..
..	说明：忽略所有javascript 错误                                                     ..
..	设计：xyb www.ectrip.com Design Time: 2008.10.23 Edit Time: 2009.09.04           ..
......................................................................................*/
//隐藏错误
var mainTitle = "武当山旅游电子商务网";
var errTitle = mainTitle + "温馨提示您：";
var online = new Array(); //QQ online
var endHours = 15;
var errImgErr = "<img src=\'/images/li_err.gif\' id='\li_err\' align=\'absmiddle\'  height=\'16\'/>";
var errImgOk = "<img src=\'/images/li_ok.gif\' id='\li_ok\' align=\'absmiddle\' height=\'16\'/>";
/*function killErrors() {
return true; 
}
window.onerror = killErrors;*/
function getDiv(divid) {
	return document.getElementById(divid);
}
function MM_swapImgRestore() { //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 MM_swapImage() { //v3.0
	var i, j = 0,
	x, a = MM_swapImage.arguments;
	document.MM_sr = new Array;
	for (i = 0; i < (a.length - 2); i += 3) if ((x = MM_findObj(a[i])) != null) {
		document.MM_sr[j++] = x;
		if (!x.oSrc) x.oSrc = x.src;
		x.src = a[i + 2];
	}
}
function MM_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;
}
//浏览器
var localUrl = function(mode) {
	var mode = mode || 'href';
	var l = window.location;
	var lPath = (l.pathname + l.search).toString();
	lPath = lPath.indexOf("/user/") != -1 ? "/": lPath;
	switch (mode) {
	case 'href':
	case 'host':
	case 'hash':
		return eval("window.location." + mode);
		break;
	case 'root':
		return l.protocol + "//" + l.host + ":" + l.port;
		break;
	case 'path':
		return {
			"uncode":
			encodeURI(lPath),
			"code": encodeURIComponent(lPath)
		};
		break;
	}
}
function strDate(str) {
	var tempdate = new Date();
	var datearray = str.split("-");
	var yearstr = parseInt(datearray[0], 10);
	var monthstr = parseInt(datearray[1], 10);
	var datestr = parseInt(datearray[2], 10);
	//alert(yearstr+"monthstr"+monthstr+"datestr"+datestr);
	/*	tempdate.setUTCFullYear(yearstr);
tempdate.setUTCMonth(monthstr-1);
tempdate.setUTCDate(datestr);*/
	//alert("tempdate:"+tempdate+"\nnew Date:"+new Date(yearstr, monthstr-1, datestr));
	//return tempdate;
	return new Date(yearstr, monthstr - 1, datestr, tempdate.getHours(), tempdate.getMinutes(), tempdate.getSeconds());
}
function setHomepage() {
	var homeUrl = localUrl();
	if (document.all) {
		document.body.style.behavior = 'url(#default#homepage)';
		document.body.setHomePage(homeUrl);
	} else if (window.sidebar) {
		if (window.netscape) {
			try {
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
				var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
				prefs.setCharPref('browser.startup.homepage', homeUrl);
			} catch(e) {
				alert("该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true");
			}
		}
	}
}
function bookmark(url, title) {
	var title = title || document.title;
	var url = url || document.location.href;
	if (window.sidebar) window.sidebar.addPanel(title, url, "");
	else if (window.opera && window.print) {
		var mbm = document.createElement('a');
		mbm.setAttribute('rel', 'sidebar');
		mbm.setAttribute('href', url);
		mbm.setAttribute('title', title);
		mbm.click();
	} else if (document.all) window.external.AddFavorite(url, title);
}
//浏览器客户端属性
var getBrowser = function(mode) {
	var mode = mode || 1;
	var agt = navigator.userAgent.toLowerCase();
	var data = 'agt=' + escape(agt) + '&r=' + escape(document.referrer) + '&aN=' + escape(navigator.appName) + '&lg=' + escape(navigator.systemLanguage) + '&OS=' + escape(navigator.platform) + '&aV=' + escape(navigator.appVersion) + '&ntime=0.34535600 1225763187&showp=' + escape(screen.width + 'x' + screen.height);
	switch (mode) {
	case 9:
		return data;
		break;
	default:
		return data;
		break;
	}
}
function randomNumber(limit) {
	return Math.floor(Math.random() * limit + 1);
}
function tabs(tabsId, j) {
	var tab = tabsId.find(".tabs");
	tab.hide();
	tab.eq(j).show();
}
function priceInt() { //保留整数
	var priceIntArry = $("span.priceInt");
	for (var t = 0; t < priceIntArry.length; t++) if (!isNaN(parseInt(priceIntArry.eq(t).text()))) priceIntArry.eq(t).text(parseInt(priceIntArry.eq(t).text()).toString());
}
function openwin(url, wid, hei, reload) {
	var str;
	if (url == null) {
		alert('您的URL不能为空!');
		return;
	}
	if (wid == null || wid == '') wid = 450;
	if (hei == null || hei == '') hei = 360;
	str = window.showModalDialog('/system/openwin.html', url, 'dialogWidth:' + wid + 'px;dialogHeight:' + hei + 'px;status:no;scrollbars=no;help:0;center:1');
	if (reload == true && str != "login" && str != "no" && eval("typeof(" + str + ")") != 'undefined') {
		location.reload();
	}
	if (str == "login") top.window.location.replace("/user/UserLogin.jsp?url=" + DeleteDomain(top.window.location));
	return str;
}
function closewindow() {
	window.close();
}
function gotoS(LocationUrl) {
	if (LocationUrl == "/") window.location = "/index.html";
	else window.location = LocationUrl;
}
function gotoP(LocationUrl, type) {
	if (LocationUrl == "/") LocationUrl = "/index.html";
	if (typeof type == "undefined") top.window.location.replace(LocationUrl);
	else self.window.location.replace(LocationUrl);
}
function MM_openBrWindow(theURL, winName, features) { //v2.0
	window.open(theURL, winName, features);
}
function gotoN(LocationUrl) {
	MM_openBrWindow(LocationUrl, 'windows_' + randomNumber(10000), 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
}
function goback() {
	window.history.back();
}
//添加提交信息
function _subSub(id, info, classType, jQNo) {
	if (typeof jQNo != "undefined") if (jQNo == 1) $ = jQuery;
	if ($("#main_errors") && id != "#main_errors") $("#main_errors").hide();
	//if (id!="main_errors"){
	if (typeof classType == "undefined") $(id).addClass("submitInfo");
	if (typeof classType != "undefined") //不添加样式
	if (classType != 0) //不添加样式
	$(id).addClass(classType);
	$(id).show();
	//$(id).css("color","#669900");
	//}
	if (typeof info == "undefined") info = "数据提交中";
	else if (info == "" || info == null) info = "数据提交中";
	else if (info == "loading") info = "加载中";
	$(id).html("<img src=\"/images/loading.gif\" alt=\"loading\" width=\"16\" height=\"16\" align=\"absmiddle\" class=\"user\" />&nbsp;&nbsp;" + info + "......");
	setTimeout(function() {
		if ($(id).html().indexOf("数据提交中") != -1 || $(id).html().indexOf(info) != -1) {
			$(id).html("<img src=\"/images/li_err.gif\" alt=\"loading\" width=\"16\" height=\"16\" align=\"absmiddle\" class=\"user\" />&nbsp;&nbsp;<span class=\"red\">非常抱歉，服务器连接超时，请重新刷新页面！<a href=\"#\" onclick=\"window.location.reload();return false;\">[立即刷新]</a>");
			$("form").submit(function() {
				return false;
			});
			return false;
		}
	},
	30000);
}
//添加错误信息
function addErr(info, ErrId) {
	var str = "";
	var ErrIdD = "main_errors";
	if (info.indexOf(",") != -1) {
		for (var i = 0; i < info.split(",").length; i++) if (info.split(",")[i] != "") str += "<li>" + info.split(",")[i] + "</li>";
	} else {
		str = "<li>" + info + "</li>";
	}
	if (typeof ErrId != "undefined") {
		ErrIdD = ErrId;
	}
	var errObj = $("#" + ErrIdD);
	if (errObj.length != 0 && str != "") {
		errObj.html("<div class=\"main_errors_title\">" + errTitle + "</div><ul>" + str + "</ul>");
		if (errObj.css("display") != "block") {
			errObj.slideDown("fast");
		}
	}
}
function checkClass(name, divName, MsgClass, MsgImg, Msg) {
	//alert(MsgImg);
	if (name != "") {
		if (MsgClass == "MsgErr") {
			var nameO = $("#" + name)[0];
			nameO.focus();
			nameO.select();
		}
	}
	if (divName != "") {
		var divName = $("#" + divName)[0];
		divName.className = MsgClass;
		divName.innerHTML = MsgImg + Msg;
	}
	if (MsgClass == "MsgOk") {
		return true;
	} else {
		return false;
	}
}
//错误信息判断
function hideErrId() {
	var main_errors = jQuery("#main_errors");
	if (main_errors.length == 0 || main_errors.length > 1) main_errors = jQuery("div[@className^='main_errors']");
	if (main_errors.length > 0) {
		for (i = 0; i < main_errors.length; i++) {
			if (main_errors.eq(i).find("li").length == 0) {
				main_errors.eq(i).hide(); //MM_showHideLayers(strtype,'','hide');//hide("main_errors");
			} else {
				main_errors.eq(i).slideDown("fast");
				main_errors.eq(i).html(main_errors.eq(i).html().replace("系统提示:", errTitle));
			}
		}
	}
}
//分页判断
function hidePageId() {
	var publicPage = jQuery("#publicPage");
	publicPage.length == 0 ? publicPage = jQuery(".publicPage") : publicPage = publicPage;
	publicPage.each(function(i) {
		var thisEq = publicPage.eq(i);
		if (thisEq.find("a").length > 0) thisEq.show();
	});
}
function isValidUsid(s) {
	noUsid = new Array("admin", "blog", "travel", "trip", "ectrip", "hotel", "ticket", "cms", "bbs", "help", "price", "line", "custom", "manage", "system", "root", "daoyou", "user", "article", "ask", "order", "ciceroni", "air", "train", "bus", "home");
	for (i = 0; i < noUsid.length; i = i + 1) {
		if (s == noUsid[i]) return false;
	}
	return true;
}
function setInputCheck(checkInfo, tForm) {
	var subtype = new Array("id", "dataType", "msg", "min", "max", "Require", "to", "operator"); //operator 如：GreaterThanEqual，需要和to一起使用
	//var info="usid,Username,请正确输入用户名,2,16,,,||password,Password,请正确输密码,8,16,,,||random,Code,请正确输入验证码,,,,,";
	var info = "";
	var tForm = tForm || "";
	if (eval("typeof(" + "checkInfo" + ")") != 'undefined') {
		info = checkInfo.toString();
		var infoArr = new Array();
		infoArr = info.split("||");
		if (infoArr.length != 0) {
			var inputFirstN = infoArr[0].split(",")[0];
			var inputFirst = jQuery("*[name=" + inputFirstN + "]").eq(0);
			inputFirst = inputFirst.length == 0 ? jQuery("#" + inputFirstN).eq(0) : inputFirst;
			tForm = tForm == "undefined" ? jQuery("#" + tForm) : inputFirst.parents("form").eq(0);
			for (var q = 0; q <= infoArr.length - 1; q++) {
				var infoOneArr = new Array();
				infoOneArr = infoArr[q].split(",");
				var thisQname = infoOneArr[0];
				var inputObj = tForm.find("*[name=" + thisQname + "]");
				if (inputObj.length == 0) {
					inputObj = jQuery("#" + thisQname).eq(0);
				}
				if (inputObj.length > 0) {
					for (var i = 0; i <= infoOneArr.length - 1; i++) {
						if (infoOneArr[i] != "" && i > 0) {
							try {
								var n = subtype[i];
								var str = infoOneArr[i];
								if (str.indexOf("[oldmsg]") != -1) {
									inputObj.each(function() {
										var _this = jQuery(this);
										_this.attr(n, str.replace("[oldmsg]", " [" + _this.attr("oldmsg") + "] "));
									});
								} else {
									inputObj.eq(0).attr(n, str);
								}
								if (infoOneArr[1] == "Filter") {
									inputObj.attr("accept", infoOneArr[7]);
								}
								if (infoOneArr[6] == "" && infoOneArr[7] != "") {
									inputObj.attr("format", infoOneArr[7]);
								}
							} catch(e) {}
						}
					}
				}
			}
		}
	}
}
//电话号码和email调用：
//var telinfo="服务热线：||tel||1||1&24小时值班电话：<br/>||24tel||0||0";
//参数说明:名称||类别||是否加粗(1为加粗)||颜色选择(1为red，2为yellow，0为默认颜色)
function tel_all(telinfo) {
	subtel = new Array("0719-5668369", "0719-5668369", "0719-5668369", "0719-5668369", "0719-5668369", "", "001", "002", "wds36901@hotamil.com", "wds36902@hotmail.com", "wds36903@hotmail.com", "webmaster@wds369.com");
	subtype = new Array("tel", "ordertel", "hottel", "24tel", "fax", "mobi", "QQ1", "QQ2", "MSN1", "MSN2", "MSN3", "email");
	//电话,24小时值班电话,预订热线,服务热线传真,应急电话,QQ1,QQ2,msn1,msn2,msn3,email
	//Type: tel,ordertel,hottel,24tel,fax,mobi,QQ1,QQ2,msn1,msn2,msn3,email
	var tel_content;
	tel_content = "";
	for (var q = 0; q <= telinfo.split("&").length - 1; q++) {
		for (var i = 0; i <= subtype.length - 1; i++) {
			if (telinfo.split("&")[q].split("||")[1] == subtype[i]) {
				if (telinfo.split("&")[q].split("||")[2] == "1") {
					if (telinfo.split("&")[q].split("||")[3] == "1") {
						tel_content += telinfo.split("&")[q].split("||")[0] + "<span class='red'><strong>" + subtel[i] + "</strong></span>";
					} else if (telinfo.split("&")[q].split("||")[3] == "2") {
						tel_content += telinfo.split("&")[q].split("||")[0] + "<span class='yellow'><strong>" + subtel[i] + "</strong></span>";
					} else {
						tel_content += telinfo.split("&")[q].split("||")[0] + "<strong>" + subtel[i] + "</strong>";
					}
				} else {
					if (telinfo.split("&")[q].split("||")[3] == "1") {
						tel_content += telinfo.split("&")[q].split("||")[0] + "<span class='red'>" + subtel[i] + "</span>";
					} else if (telinfo.split("&")[q].split("||")[3] == "2") {
						tel_content += telinfo.split("&")[q].split("||")[0] + "<span class='yellow'>" + subtel[i] + "</span>";
					} else {
						tel_content += telinfo.split("&")[q].split("||")[0] + subtel[i];
					}
				}
				break;
			} else {
				tel_content += "";
				continue;
			}
		}
	}
	document.write(tel_content);
}
//v1.7
// Flash Player Version Detection
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true: false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true: false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true: false;
function ControlVersion() {
	var a;
	var b;
	var e;
	try {
		b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		a = b.GetVariable("$version")
	} catch(e) {}
	if (!a) {
		try {
			b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			a = "WIN 6,0,21,0";
			b.AllowScriptAccess = "always";
			a = b.GetVariable("$version")
		} catch(e) {}
	}
	if (!a) {
		try {
			b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			a = b.GetVariable("$version")
		} catch(e) {}
	}
	if (!a) {
		try {
			b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			a = "WIN 3,0,18,0"
		} catch(e) {}
	}
	if (!a) {
		try {
			b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			a = "WIN 2,0,0,11"
		} catch(e) {
			a = -1
		}
	}
	return a
}
function GetSwfVer() {
	var a = -1;
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var b = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0": "";
			var c = navigator.plugins["Shockwave Flash" + b].description;
			var d = c.split(" ");
			var e = d[2].split(".");
			var f = e[0];
			var g = e[1];
			var h = d[3];
			if (h == "") {
				h = d[4]
			}
			if (h[0] == "d") {
				h = h.substring(1)
			} else if (h[0] == "r") {
				h = h.substring(1);
				if (h.indexOf("d") > 0) {
					h = h.substring(0, h.indexOf("d"))
				}
			}
			var a = f + "." + g + "." + h
		}
	} else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) a = 4;
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) a = 3;
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) a = 2;
	else if (isIE && isWin && !isOpera) {
		a = ControlVersion()
	}
	return a
}
function DetectFlashVer(a, b, c) {
	versionStr = GetSwfVer();
	if (versionStr == -1) {
		return false
	} else if (versionStr != 0) {
		if (isIE && isWin && !isOpera) {
			tempArray = versionStr.split(" ");
			tempString = tempArray[1];
			versionArray = tempString.split(",")
		} else {
			versionArray = versionStr.split(".")
		}
		var d = versionArray[0];
		var e = versionArray[1];
		var f = versionArray[2];
		if (d > parseFloat(a)) {
			return true
		} else if (d == parseFloat(a)) {
			if (e > parseFloat(b)) return true;
			else if (e == parseFloat(b)) {
				if (f >= parseFloat(c)) return true
			}
		}
		return false
	}
}
function AC_AddExtension(a, b) {
	if (a.indexOf('?') != -1) return a.replace(/\?/, b + '?');
	else return a + b
}
function AC_Generateobj(a, b, c) {
	var d = '';
	if (isIE && isWin && !isOpera) {
		d += '<object ';
		for (var i in a) {
			d += i + '="' + a[i] + '" '
		}
		d += '>';
		for (var i in b) {
			d += '<param name="' + i + '" value="' + b[i] + '" /> '
		}
		d += '</object>'
	} else {
		d += '<embed ';
		for (var i in c) {
			d += i + '="' + c[i] + '" '
		}
		d += '> </embed>'
	}
	document.write(d)
}
function AC_FL_RunContent() {
	var a = AC_GetArgs(arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000", "application/x-shockwave-flash");
	AC_Generateobj(a.objAttrs, a.params, a.embedAttrs)
}
function AC_SW_RunContent() {
	var a = AC_GetArgs(arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000", null);
	AC_Generateobj(a.objAttrs, a.params, a.embedAttrs)
}
function AC_GetArgs(a, b, c, d, e) {
	var f = new Object();
	f.embedAttrs = new Object();
	f.params = new Object();
	f.objAttrs = new Object();
	for (var i = 0; i < a.length; i = i + 2) {
		var g = a[i].toLowerCase();
		switch (g) {
		case "classid":
			break;
		case "pluginspage":
			f.embedAttrs[a[i]] = a[i + 1];
			break;
		case "src":
		case "movie":
			a[i + 1] = AC_AddExtension(a[i + 1], b);
			f.embedAttrs["src"] = a[i + 1];
			f.params[c] = a[i + 1];
			break;
		case "onafterupdate":
		case "onbeforeupdate":
		case "onblur":
		case "oncellchange":
		case "onclick":
		case "ondblclick":
		case "ondrag":
		case "ondragend":
		case "ondragenter":
		case "ondragleave":
		case "ondragover":
		case "ondrop":
		case "onfinish":
		case "onfocus":
		case "onhelp":
		case "onmousedown":
		case "onmouseup":
		case "onmouseover":
		case "onmousemove":
		case "onmouseout":
		case "onkeypress":
		case "onkeydown":
		case "onkeyup":
		case "onload":
		case "onlosecapture":
		case "onpropertychange":
		case "onreadystatechange":
		case "onrowsdelete":
		case "onrowenter":
		case "onrowexit":
		case "onrowsinserted":
		case "onstart":
		case "onscroll":
		case "onbeforeeditfocus":
		case "onactivate":
		case "onbeforedeactivate":
		case "ondeactivate":
		case "type":
		case "codebase":
			f.objAttrs[a[i]] = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,19,0";
			break;
		case "id":
			f.objAttrs[a[i]] = a[i + 1];
			break;
		case "width":
		case "height":
		case "align":
		case "vspace":
		case "hspace":
		case "class":
		case "title":
		case "accesskey":
		case "name":
		case "tabindex":
			f.embedAttrs[a[i]] = f.objAttrs[a[i]] = a[i + 1];
			break;
		default:
			f.embedAttrs[a[i]] = f.params[a[i]] = a[i + 1]
		}
	}
	f.objAttrs["classid"] = d;
	if (e) f.embedAttrs["type"] = e;
	return f
}
function _sFocus(imgStr, w, h, h_t, id) {
	var focus_width = w;
	var focus_height = h;
	var text_height = h_t;
	var swf_height = focus_height + text_height;
	var imgArr = imgStr;
	var imgArrL = imgStr.length;
	//	var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3+"|"+imgUrl4+"|"+imgUrl5
	//	var links=imgLink1+"|"+imgLink2+"|"+imgLink3+"|"+imgLink4+"|"+imgLink5
	//	var texts=imgtext1+"|"+imgtext2+"|"+imgtext3+"|"+imgtext4+"|"+imgtext5
	var pics = "";
	var links = "";
	var texts = "";
	for (var i = 0; i < imgArrL; i = i + 3) {
		if (i == 0) {
			texts += imgArr[i];
			pics += imgArr[i + 1];
			links += imgArr[i + 2];
		} else {
			texts += "|" + imgArr[i];
			pics += "|" + imgArr[i + 1];
			links += "|" + imgArr[i + 2];
		}
	}
	if (pics !== "") {
		//'wmode','transparent',
		AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0', 'name', id, 'width', focus_width, 'height', swf_height, 'align', 'middle', 'id', id, 'FlashVars', 'pics=' + pics + '&links=' + links + '&texts=' + texts + '&borderwidth=' + focus_width + '&borderheight=' + focus_height + '&textheight=' + text_height, 'src', '/media/focus', 'menu', 'false', 'quality', 'high', 'scale', 'noscale', 'bgcolor', '#FFFFFF', 'wmode', 'transparent', 'allowscriptaccess', 'sameDomain', 'allowfullscreen', 'false', 'pluginspage', 'http://www.macromedia.com/go/getflashplayer', 'movie', '/media/focus');
	}
}
function getPlayer(url, w, h, s, e, m, mode) {
	var urlType;
	var urlName;
	if (url.indexOf("://") != -1) {
		var pathArr = url.split("://")[1];
		var pathArr = pathArr.split("/");
		urlType = pathArr[pathArr.length - 1];
	}
	urlType = urlType.split(".")[1].toLowerCase();
	urlName = "viedo_" + urlType.split(".")[0].toLowerCase();
	var w = w || "420";
	var h = h || "300";
	if (urlType.indexOf("?w=") != -1) {
		var wArr = urlType.split("?w=");
		urlType = wArr[0];
		if (wArr[1].indexOf("|") != -1) {
			var wArrstr = wArr[1].split("|");
			w = wArrstr[0];
			h = wArrstr[1];
		}
	} else if (urlType.indexOf("?") != -1) {
		urlType = urlType.split("?")[0];
	}
	var videoStr = "";
	var msgStr = "";
	msgStr = "格式：" + urlType;
	url = encodeURI(url);
	if (urlType != "") {
		switch (urlType) {
			//mid,mp3,wma,wav,mpeg,mpg,wmv,avi,rm,rmvb,swf
		case "mid":
		case "mp3":
		case "wma":
		case "wav":
		case "asx":
			videoStr = '<EMBED src="' + url + '" id="' + urlName + '" name="' + urlName + '" type=audio/mpeg AUTOSTART="1" loop="0" width="' + w + '" height="68" showstatusbar="true" showcontrols="true" showaudiocontrols="true" ></EMBED>';
			break;
		case "mpeg":
		case "mpg":
		case "wmv":
			videoStr = '<object  id="' + urlName + '" name="' + urlName + '" width="' + w + '" height="' + h + '" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"><param NAME="AutoStart" VALUE="-1"><param NAME="Balance" VALUE="0"><param name="enabled" value="' + e + '"><param NAME="EnableContextMenu" VALUE="' + m + '"><param NAME="url" VALUE="' + url + '"><param NAME="PlayCount" VALUE="1"><param name="rate" value="1"><param name="currentPosition" value="0"><param name="currentMarker" value="0"><param name="defaultFrame" value=""><param name="invokeURLs" value="0"><param name="baseURL" value=""><param name="stretchToFit" value="-1"><param name="volume" value="50"><param name="mute" value="0"><param name="uiMode" value="' + mode + '"><param name="windowlessVideo" value="0"><param name="fullScreen" value="0"><param name="enableErrorDialogs" value="-1"></object>';
			break;
		case "aviT":
			//clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA
			videoStr = '<object  id="' + urlName + '" name="' + urlName + '" width="' + w + '" height="' + h + '" border="0" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"><param name="ShowDisplay" value="0"><param name="ShowControls" value="1"><param name="AutoStart" value="1"><param name="AutoRewind" value="0"><param name="PlayCount" value="1"><param name="Appearance value="0 value="""><param name="BorderStyle value="0 value="""><param name="MovieWindowHeight" value="' + h + '"><param name="MovieWindowWidth" value="' + w + '"><param name="FileName" value="' + url + '"><embed  width="' + w + '" height="' + h + '" border="0" showdisplay="0" showcontrols="1" autostart="1" autorewind="0" playcount="0" moviewindowheight="' + h + '" moviewindowwidth="' + w + '" filename="' + url + '" src="' + url + '"></embed></object>';
			break;
		case "rm":
		case "rmvb":
			videoStr += '<object  id="rmVideo" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="' + w + '" height="' + h + '">';
			videoStr += '<param name="_ExtentX" value="3016" />';
			videoStr += '<param name="_ExtentY" value="2646" />';
			videoStr += '<param name="AUTOSTART" value="-1" />';
			videoStr += '<param name="SHUFFLE" value="0" />';
			videoStr += '<param name="PREFETCH" value="0" />';
			videoStr += '<param name="NOLABELS" value="-1" />';
			videoStr += '<param name="SRC" value="' + url + '"; />';
			videoStr += '<param name="CONTROLS" value="Imagewindow" />';
			videoStr += '<param name="CONSOLE" value="clip1" />';
			videoStr += '<param name="LOOP" value="0" />';
			videoStr += '<param name="NUMLOOP" value="0" />';
			videoStr += '<param name="CENTER" value="0" />';
			videoStr += '<param name="MAINTAINASPECT" value="0" />';
			videoStr += '<param name="BACKGROUNDCOLOR" value="#000000" />';
			videoStr += '</object>';
			videoStr += '<object  id="rmVideo2" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"  width="' + w + '" height=30>';
			videoStr += '<param name="_ExtentX" value="11298" />';
			videoStr += '<param name="_ExtentY" value="794" />';
			videoStr += '<param name="AUTOSTART" value="-1" />';
			videoStr += '<param name="SHUFFLE" value="0" />';
			videoStr += '<param name="PREFETCH" value="0" />';
			videoStr += '<param name="NOLABELS" value="-1" />';
			videoStr += '<param name="SRC" value="' + url + '" />';
			videoStr += '<param name="CONTROLS" value="ControlPanel" />';
			videoStr += '<param name="CONSOLE" value="clip1" />';
			videoStr += '<param name="LOOP" value="0" />';
			videoStr += '<param name="NUMLOOP" value="0" />';
			videoStr += '<param name="CENTER" value="0" />';
			videoStr += '<param name="maintainaspect" value="0" />';
			videoStr += '<param name="BACKGROUNDCOLOR" value="#000000" />';
			videoStr += '</object>';
			break;
		case "swf":
			videoStr = '<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="' + w + '"  id="' + urlName + '" name="' + urlName + '" height="' + h + '"> <param name="movie" value="' + url + '"> <param name="quality" value="high"> <embed src="' + url + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"’ target="_blank" >http://www.macromedia.com/go/getflashplayer"; type="application/x-shockwave-flash"  width="' + w + '" height="' + h + '"> </embed> </object> ';
			break;
		default:
			videoStr = '<EMBED src="' + url + '"  id="' + urlName + '" name="' + urlName + '" type=audio/mpeg AUTOSTART="1" loop="0" showstatusbar="true" showcontrols="true" showaudiocontrols="true" ></EMBED>';
			break;
		}
	}
	return videoStr;
	//$("#video_msg").html(msgStr);
	//$("#playerShow").html(videoStr);
}
