/*得到Html参数,Code By Nicenic.com, IceFire*/
function Request(strName)
{
 var strHref = window.document.location.href;
 var intPos = strHref.indexOf("?");
 var strRight = strHref.substr(intPos + 1);
 var arrTmp = strRight.split("&");
 for(var i = 0; i < arrTmp.length; i++) { 
	 var arrTemp = arrTmp[i].split("=");
	  if(arrTemp[0].toUpperCase() == strName.toUpperCase()) return arrTemp[1]; }
 return "";
}

function showUrl(){
	document.write(window.location.hostname);
}


// PNG纠正控件 1.0 For IE 5.5或更高.
// 作者:舜子

function isIE(){
if (navigator.appName!="Microsoft Internet Explorer") {return false}
return true
}
var is_correct_png = true;
function correctPNG() 
{
	if(!is_correct_png) return;
var iexit=eval('document.all.Loadding?1:0'); 
   for(var i=0; i<document.images.length; i++)
   {
	  var img = document.images[i]
	  var LW=img.width
	  var LH=img.height
	  var imgName = img.src.toUpperCase()
	  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	  { 
         img.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+img.src+", sizingmethod=scale);" 
         img.src="/bbx/images/transparent.gif"
         img.width=LW
         img.height=LH
	  }
   }
	if(document.getElementById('Loadding')) hideInfo();
}
if (isIE()) {window.attachEvent("onload", correctPNG);}

//cookie相关
function checkNum(nubmer)
{
    var re = /^[0-9]+.?[0-9]*$/;   //判断字符串是否为数字     //判断正整数 /^[1-9]+[0-9]*]*$/  
    
    if (re.test(nubmer))
    {
		return true;
    }
	return false;
}
/*
*@name  cookie 名字
*@value cookie 值
*@hours cookie 保存小时
*/
function SetCookie(name,value,hours)
{
	var hourstay = 30*24*60*60*1000; //此 cookie 将被默认保存 30 天
	if(checkNum(hours)){
		hourstay = hours;
	}
    
    var exp  = new Date();
    exp.setTime(exp.getTime() + hourstay*60*60*1000);
    document.cookie = name + "="+ escape(value) + ";expires=" + exp.toGMTString();
}
function getCookie(name)//取cookies函数        
{
    var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
    if(arr != null) return unescape(arr[2]); return null;
}
function delCookie(name)//删除cookie
{
    var exp = new Date();
    exp.setTime(exp.getTime() - 1);
    var cval=getCookie(name);
    if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
}
//表单是否显示
function showForm(){
	if(getCookie('userlogin')==1){
		var formIsShow = document.getElementsByTagName('div');
		for(var i=0;i<formIsShow.length;i++){
			if(formIsShow[i].name=="formIsShow"&&formIsShow[i].value==1){
				formIsShow[i].style.display='block';
			}
		}
	}
}

