﻿// JScript 文件公用的JS


//解析URL
function request(requestName)
{
    var Url=window.location.search;
    var requestValue="";
    if(Url.indexOf("?")!=-1)   
    {   
        var str=Url;
        var ParamCount="";
        var name=new Array();
        var value=new Array();
        var ToTalParam=str.substring(str.indexOf("?")+1);//鍙栧嚭锛熷彿鍚庣殑鎵€鏈夊弬鏁?
 	       ParamCount=ToTalParam.split("&").length;//寰楀埌鍙傛暟涓暟
 	       for(i=0;i<ParamCount;i++)
 	       {
 	       name[name.length]=ToTalParam.split("&")[i].split("=")[0];
 	       value[value.length]=ToTalParam.split("&")[i].split("=")[1];
 	       }
 	       for (i=0;i<name.length;i++)
 	       {
 	            if(name[i]==requestName)
 	            {
 	                requestValue=value[i];
 	                break;
 	            }
 	       }
 	      
     }
     return requestValue;
}

//创建一个层
//
//参数：id 层唯一的标识； left 与父容器左边距 ；top 与父容器上边距；width 层的宽度；height 层的高度；content 内容
//      bgcolor 背景颜色；fontcolor； 字体的颜色 bordercolor； 边框颜色；opacity 透明度；zIndex Z轴
//
function createDiv(id,left,top,width,height,content,bgcolor,fontcolor,bordercolor,borderWidth,opacity,zIndex)
{
    if(!left){ left=0; }
	if(!top){ top=0; }
    if(!width){	width = 200;}
	if(!height){height = 200;}
	if(!zIndex){ zIndex=1; }
	if(!opacity){ opacity = 0.8;}
	if(!fontcolor){	fontcolor = "fontcolor";}
	if(!bordercolor){bordercolor = "fontcolor";}
	if(!bgcolor){bgcolor="White";}
	if(!content){content="";}
	var div = document.createElement("Div");
	div.id=id;
	div.style.left = left+"px";
	div.style.top = top+"px";
	div.style.width = width+"px";
	div.style.height = height+2+"px";
	div.style.position = "absolute";
	div.style.zIndex = zIndex;
	div.style.filter="alpha(opacity="+opacity*100+")";
	div.style.opacity=opacity;
	div.innerHTML=content; 
	div.style.backgroundColor = bgcolor;
	div.style.color=fontcolor;
	div.style.fontSize="12px";
	div.style.border=borderWidth+"px solid "+bordercolor;
	window.document.form1.appendChild(div);
}
 //加载Flash 
function loadFlash(name,height,width,url)
{
    var str="";
    str="<object height=\""+height+"\" width=\""+width+"\" id="+name+" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 \" style=\" z-index:0\">";
    str +="<param name=\"movie\" value=\""+url+"\"/><param name=\"quality\" value=\"high\" />";
    str +="<embed src=\""+url+"\" name="+name+" swLiveConnect=\"true\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\"  wmode=\"transparent\" width=\""+width+"\" height=\""+height+"\"></embed></object> ";       
    document.write(str);
}
//去空&nbspHTML;
function clearNbsp(name)
{
    name=name.replace("&nbsp;","");
    name=name.replace(/\<[^>]*>/g,""); 
    return name;
}

function loading()
{
    return "<img src=\"images/loading.gif\">";
}