﻿// 跳转到免责声明
function show(){	window.showModalDialog("post.aspx",window,"status:no;resizable:no;dialogWidth:380px;dialogHeight:500px;unadorne:yes");
}
function show2(){	window.showModalDialog("service.aspx",window,"status:no;resizable:no;dialogWidth:300px;dialogHeight:300px;unadorne:yes");
}

String.prototype.Trim = function() {  
  var m = this.match(/^\s*(\S+(\s+\S+)*)\s*$/);  
  return (m == null) ? "" : m[1];  
}

//滚动条滚动
window.onscroll=function(){
document.getElementById('divqq').style.top=document.documentElement.scrollTop+200;
}
 //培训课程手机号码申请
    function shengqing()
    {
         if(document.getElementById("shengphone").value=="")
        {
        alert('请输入手机号码！');
        document.getElementById("shengphone").focus();
        }
        else if(document.getElementById("shengphone").value.isMobile())
        {
        var url=" http://"+window.location.host;
            url+="/shengqing.ashx?shengphone="+document.getElementById("shengphone").value;
            send(null,url);
        }
         else
        {
            alert("请输入正确的手机号码\n\n例如:13916752109"); 
            document.getElementById("shengphone").focus();            
        }        
    }
//在线服务的位置
function scall()
{
    document.getElementById("divqq").style.top=(document.documentElement.scrollTop+(document.documentElement.clientHeight-document.getElementById("divqq").offsetHeight)/2)+"px";    
} 
//隐藏在线服务层
 function find()
    {
        if(document.getElementById("divqq").style.display=="none")
        {
            
            document.getElementById("divqq").style.display="";
            scall();
        }
        else
        {   
           
            document.getElementById("divqq").style.display="none";
            scall();
        }
        
    }
    //验证手机格式 
String.prototype.isMobile = function() 
{  
    return (/^(0?1[358]\d{9})$|^((0(10|2[1-3]|[3-9]\d{2}))?[1-9]\d{6,7})$/.test(this.Trim()));
}
String.prototype.isTel = function()
{
   return (/^(([0\+]\d{2,3}-)?(0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/.test(this.Trim()));
}

    var req;
    function send(str,url)//发送请求
    {	
        if(window.XMLHttpRequest)
        {
        req=new XMLHttpRequest();//mozilla浏览器
        }
        else if(window.ActiveXObject)
        {
        try
        {
            req=new ActiveXObject("Msxml2.XMLHTTP");//ＩＥ旧版本
        }
        catch(e)
        {
        }
        try
        {
            req=new ActiveXObject("Microsoft.XMLHTTP");//ＩＥ新版本
        }
        catch(e)
        {
        }
        if(!req)
        {
            window.alert("不能创建XMLHTTPREQUEST对象!");
            return false;
        }
    }
    if(req){		    		
		req.open("post",url,true); 					
		req.onreadystatechange = callTextBack;
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
		req.send(str);			
    	}
	}
	function callTextBack()//回调函数
	{	   		
		if(req.readyState==4&&req.status==200){				
			 var s = req.responseText;					      
				showAlert(s);				
		}else{				    		
			alert(req.status);
		}
		
	}
	function showAlert(str)
	{
	    alert(str);
    }
    //显示主力资金,大盘资金，在线订购提示层
    function showdiv()
    {
        document.getElementById("show_div").style.display="";　//这就是一个好大的，颜色的灰色的层，就是看到的背景灰色层，它一开始是不显示的
        document.getElementById("div_noLogin").style.display="";　　//这就是那个提示要它登录的层，
        document.getElementById("div_noLogin").style.left=(window.screen.availWidth/2-100)+"px";//提示层显示的位置
        document.getElementById("div_noLogin").style.top=300+"px";
    }
     //隐藏提示层
    function hidde_div()
    {
        document.getElementById("show_div").style.display="none";　//当点击确定时，灰色背景层不显示
        document.getElementById("div_noLogin").style.display="none";　//提示层也不显示
        document.getElementById("div_uc").style.display="none";
    }
    //显示uc
   function showuc()
   {
      document.getElementById("show_div").style.display="";　
      document.getElementById("div_uc").style.display="";
        document.getElementById("div_uc").style.left=(window.screen.availWidth/2-100)+"px";
        document.getElementById("div_uc").style.top=300+"px";
   }
   
    //首页播放视频
    function dian(src)
    {
      document.getElementById("video2").innerHTML="<object id='shi' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' height='400' title='大智慧视频课程' viewastext='' width='100%' style='z-index:-10;'><param name='movie' value='"+src+"' /><param name='quality' value='high' /><param name='wmode' value='opaque' /><embed src='"+src+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer ' type='application/x-shockwave-flash' width='100%' height='400'> </embed></object>";
    }
    //计算单价乘以数量
 function ride() 
    { 
      var a=  document.getElementById("ctl00$ContentPlaceHolder1$Tbprice"); 
      var b=  document.getElementById("ctl00$ContentPlaceHolder1$Tbnum"); 
      var c=  document.getElementById("ctl00_ContentPlaceHolder1_Tbmoney")
      if(a.value=="" ||b.value=="") 
      { 
        alert("数量不能为空！！"); 
        return false; 
      } 
      c.value=a.value * b.value;
    } 
    //注册手机验证
    function cell()
    {
          if(document.getElementById("Tbmobile").value=="")
        {
        alert('请输入手机号码！');
        document.getElementById("Tbmobile").focus();
        }
        else if(document.getElementById("Tbmobile").value.isMobile())
        {
       
        }
         else
        {
            alert("请输入正确的手机号码\n\n例如:13916752109"); 
            document.getElementById("Tbmobile").focus();            
        }        
    }
    
 //图片轮换
 function slideShow() { 
  var imageList = new Array('101.jpg','102.jpg'); 
  var imageNumber=0;
  document.slideShow.src = "img/"+imageList[imageNumber]; 
  imageNumber++; 
  if(imageNumber==imageList.length)
   imageNumber=0; 
  window.setTimeout("slideShow()",3000); 
}
    
   
    




