<!--
//function killErrors()
//{   
//	return true;   
//}   
//window.onerror = killErrors;



/*******************************************************************************************************/
//以下为与特定项目结合使用的函数，当前项目：chuhezhe
/*******************************************************************************************************/

function menu_li_on(menuLiIndex)
{
    $("#menu_li_" + menuLiIndex).addClass("on");
}

function lSubMenu_li_on(menuLiIndex)
{
    $("#lSubMenu_" + menuLiIndex).addClass("on");
}

function setLTagBoxLiMouse()
{
    $(".lTagBox .item ul li").bind("mouseover", function(){
        var liCount = $(".lTagBox .item ul li").length;
        var tempCi = 0;
        for(var i = 0;i < liCount;i++)
        {
            $(".lTagBox .item ul li:eq(" + i + ")").attr("class","");
            $(".lTagBox .content ul:eq(" + i + ")").css("display","none");
            
            if(this.innerHTML == $(".lTagBox .item ul li:eq(" + i + ")").html())
            {
                tempCi = i;
            }
        }
        this.className = "on";
        $(".lTagBox .content ul:eq(" + tempCi + ")").css("display","block");
    }); 
}

/*******************************************************************************************************/
//以下为与网站结合使用的函数
/*******************************************************************************************************/

//点击后出现验证码
function showCodeImg()
{
	$("#codeTxt_").css("display","none");
	$("#codeImg_").css("display","inline");
}
//点击后刷新验证码图片
function refreshCodeImg(o)
{
	o.src = o.src.substring(0,o.src.indexOf(".aspx")+5) + "?" + (new Date());
}

//提交按钮设置为不可用，防重复点击
function submitBtnDis()
{
	var subBtn = $("#send_btn_");
	subBtn.attr("disabled","true");
	subBtn.attr("value","数据提交中..");

	return true;
}



/*******************************************************************************************************/
//以下为通用函数
/*******************************************************************************************************/

//取得id的obj
function $$$()
{
	if(typeof(arguments[0]) == "string")
	{
		return document.getElementById?document.getElementById(arguments[0]):eval(arguments[0]);
	}
	else
	{
		return arguments[0];
	}
}

//是否跳转到该URL（执行某些功能）
function hintandturn(str,url)
{
	if(confirm(str))
	{
		window.location.href = url;
		return true;
	}
	else
	{
		return false;
	}
}

//取url中的域名
function getHost(url)
{ 
	var host = "null";
	if(typeof url == "undefined" || null == url) url = window.location.href;
	var regex = /.*\:\/\/([^\/]*).*/;
	var match = url.match(regex);
	if(typeof match != "undefined" && null != match) host = match[1];
	return host;
}

//去除域名
function removeDomain(url)
{
	var tempUrl = url;
	var firstX = -1;
	if(tempUrl.toLowerCase().substring(0,7) == "http://")
	{
		tempUrl = tempUrl.substring(7,tempUrl.length);

		firstX = tempUrl.indexOf("/");
		if(firstX >= 0)
		{
			tempUrl = tempUrl.substring(firstX,tempUrl.length);
		}
	}

	return tempUrl;
}

//文件是否是图片
function fileIsImage(fileName)
{
	var fileType = "other";
	var lastD = fileName.lastIndexOf(".");
	var isImg = false;
	if(lastD >= 0)
	{
		var fileExt = fileName.substring(lastD,fileName.length);
		fileExt = fileExt.replace(".","").toLowerCase();
		fileExt = "," + fileExt + ",";
		if (",png,jpg,jpeg,gif,bmp,".indexOf(fileExt) >= 0)
		{
			isImg = true;
		}
	}
	return isImg;
}

//文件按等比重置宽高度。使用例子：<img src="..." onload='imgSizeReSet(this,120,120);'>
function imgSizeReSet(ImgD,w,h) {
	var maxWidth = w;
	var maxHeight = h;
	var image = new Image();
	image.src = ImgD.src;
	if (image.width > 0 && image.height > 0) {
		if (image.width / image.height >= maxWidth / maxHeight) {
			if (image.width > maxWidth) {
				ImgD.width = maxWidth;
				ImgD.height = (image.height * maxWidth) / image.width;
			} else {
				ImgD.width = image.width;
				ImgD.height = image.height;
			}
		} else {
			if (image.height > maxHeight) {
				ImgD.height = maxHeight;
				ImgD.width = (image.width * maxHeight) / image.height;
			} else {
				ImgD.width = image.width;
				ImgD.height = image.height;
			}
		}
	}
}

//字符串取左
function left(mainStr,lngLen)
{
	if (lngLen>0)
	{
		return mainStr.substring(0,lngLen);
	}
	else
	{
		return "";
	}
}

//字符串取右
function right(mainStr,lngLen)
{
	if (mainStr.length-lngLen>=0 && mainStr.length>=0 && mainStr.length-lngLen<=mainStr.length)
	{
		return mainStr.substring(mainStr.length-lngLen,mainStr.length);
	}
	else
	{
		return "";
	}
}

//仿vbscript的mid
function mid(mainStr,starnum,endnum)
{
	if (mainStr.length>=0)
	{
		return mainStr.substr(starnum,endnum);
	}
	else
	{
		return "";
	}
}

//删除左右两端的空格
function trim(str)
{
	return str.replace(/(^\s*)|(\s*$)/g, "");
}

//js点击某个超链接
function aLinkClick(id)
{
	if(document.all)
	{ 
		document.getElementById(id).click();
		return true;
	} 
	else
	{ 
		//var evt = document.createEvent("MouseEvent");
		//evt.initEvent("click",true,true);
		//document.getElementById(id).dispatchEvent(evt);
		return false;
	} 
} 

//将数值 取小数点后两位
function returnFloat(value)
{
	value = Math.round(parseFloat(value) * 100) / 100;
	if (value.toString().indexOf(".") < 0)
	{
		value = value.toString() + ".00";
	}
	return value;
}

//预载入图片
function MM_preloadImages() { //v3.0
  var d=document;if(d.images){if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments;for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){d.MM_p[j]=new Image;d.MM_p[j++].src=a[i];}}
}

//秒数格式化为（时：分：秒）的格式
function formatSecondTime(time_length){
	var hour = time_length/3600|0;
	var min = (time_length%3600)/60|0;
	var sec = (time_length%3600)%60;
	if(hour<10){
		hour = "0"+hour;
	}
	if(min<10){
		min = "0"+min;
	}
	if(sec<10){
		sec = "0"+sec;
	}
	return hour+":"+min+":"+sec;
}

//转为整型
function cint(inStr)
{
	var temp = parseInt(inStr);
	if(isNaN(temp))temp = 0;
	
	return temp;
}

//提交按钮设置为不可用，防重复点击
function submitBtnDis_(sb_,v_)
{
	var subBtn = $("#" + sb_);
	subBtn.attr("disabled","true");
	subBtn.attr("value",v_);

	return true;
}


function swf(src,w,h,s){
	html = '';
	html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="param" width="'+w+'" height="'+h+'">';
	html += '<param name="movie" value="'+src+'?sub_select='+s+'">';
	html += '<param name="quality" value="high">';
//	html += '<param name="bgcolor" value="#ffffff">';
	html += '<param name="swliveconnect" value="true">';
	html += '<embed src="'+src+'?sub_select='+s+'" quality=high width="'+w+'" height="'+h+'" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>';
	html += '<\/object>';
	document.write(html);
}

function swftm(src,w,h,s){
	htmltm = '';
	htmltm += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="param" width="'+w+'" height="'+h+'">';
	htmltm += '<param name="movie" value="'+src+'?sub_select='+s+'">';
	htmltm += '<param name="quality" value="high">';
//	html += '<param name="bgcolor" value="#ffffff">';
	htmltm += '<param name="swliveconnect" value="true">';
	htmltm += '<param name="wmode" value="transparent">';
	htmltm += '<embed src="'+src+'?sub_select='+s+'" quality=high width="'+w+'" height="'+h+'" wmode="transparent" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>';
	htmltm += '<\/object>';
	document.write(htmltm);
}
//-->
