﻿// JScript 文件

//文本框接收回车、提交指定按钮
function submitKeyClick(button) 
{    
	if (event.keyCode == 13) 
	{
		event.keyCode=9; 
		event.returnValue = false; 
		document.all[button].click(); 
	} 
}

ie4=(document.all)?true:false;
ns4=(document.layers)?true:false;

//显示帮助提示信息
function showTips(){
	var args=showTips.arguments;
	if(args[1]=='Hide'){
		document.getElementById(args[0]).style.display='none';
	}
	else if(args[1]=='Show'){
		document.getElementById(args[0]).style.display='';
	}
	else{
		document.getElementById(args[0]).style.left=event.x + 10;
		document.getElementById(args[0]).style.top=event.y + 10;
	}
}     

//根据复选框显示指定元素
function showChecked(){
	var args=showChecked.arguments;
	if(!args[0].checked){
		document.getElementById(args[1]).style.display='none';
	}
	else{
		document.getElementById(args[1]).style.display='';
	}
}     

//展示flash
function showFlash(){
    var args=showFlash.arguments;
    for(var i= 1; i<= 4; i++)
    {
        document.getElementById('demo' + i).className = ''; 
    }
    document.getElementById(args[0]).className = 'current';
    document.getElementById(args[1]).innerHTML = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\"980\" height=\"615\" id=\"myFlash\"><param name=\"movie\" value=\"" + args[2] + "\" /><param name=\"quality\" value=\"high\" /><param name=\"wmode\" value=\"transparent\" /><param name=\"allowScriptAccess\" value=\"always\" /><param name=\"BGCOLOR\" value=\"#FFFFFF\" /><param name=\"allowFullScreen\" value=\"true\" /><embed src=\"" + args[2] + "\" width=\"980\" height=\"615\" allowfullscreen=\"true\" quality=\"high\" wmode=\"transparent\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" name=\"myFlash\" swliveconnect=\"true\" bgcolor=\"#FFFFFF\"></embed></object>"
}

function validChange() { 
    // Do nothing if client validation is not active 
    if (typeof (Page_Validators) == "undefined") return; 
    if(document.getElementById('ctl00_ContentPlaceHolder1_CreateUserWizard1_CreateUserStepContainer_CheckBoxSpecialist').checked==false) 
    { 
        ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_CreateUserWizard1_CreateUserStepContainer_RequiredFieldValidatorTextBoxTrueName'), false); 
    } 
} 

function validPages() { 
    var flag = document.getElementById('<%=hdf_flag.ClientID %>') 
    validChange(); 
    Page_ClientValidate(); 
    if (Page_IsValid) { //用于判断前台页面验证控件是否全部通过验证，通过为True 
        flag.value = "true"; 
    } else { 
        flag.value = "false"; 
    } 
} 

//全选
function checkAll(){
	var args = checkAll.arguments;
	var isChecked = args[0].checked;
    var objList=document.getElementsByTagName("input");
    for (var i=0;i<objList.length;i++){
        if(objList[i].type=="checkbox"){
            objList[i].checked=isChecked;
        }
    }
}

//获取url参数
function requestUrl(){ 
	var args = requestUrl.arguments;
    var url = location.href; 
    var paraString = url.substring(url.indexOf("?")+1,url.length).split("&"); 
    var paraObj = {}; 
    for (i=0; j=paraString[i]; i++){ 
        paraObj[j.substring(0,j.indexOf("=")).toLowerCase()] = j.substring(j.indexOf("=")+1,j.length); 
    } 
    var returnValue = paraObj[args[0].toLowerCase()]; 
    if(typeof(returnValue)=="undefined"){ 
        return ""; 
    }
    else{ 
        return returnValue; 
    } 
}
