 function showQQnewsAjax(divId,channelid,size,type){
     jQuery.ajax({
	    type:'post',
	    url:"/home/news.do",
	    data:{type:type,channelid:channelid,size:size},
	    beforeSend: function() {
          //   $("#"+divId).html("<img src='images/load.gif' /> 正在读取数据,请稍后...");
      },
		  error:function(){
		    $("#"+divId).html("服务繁忙,请稍后再试!");
		  },
	    success:function(html){
	    	$("#"+divId).html(html);
	    }
	  });
 }
 
  function showPicNewssAjax(channelid,size){
     jQuery.ajax({
	    type:'post',
	    url:"/home/picNews.do",
	    data:{channelid:channelid,size:size},
	    beforeSend: function() {
          //   $("#"+divId).html("<img src='images/load.gif' /> 正在读取数据,请稍后...");
      },
		  error:function(){
		    $("#home_gttp").html("服务繁忙,请稍后再试!");
		  },
	    success:function(html){
	    	$("#home_gttp").html(html);
	    }
	  });
 }
  
   function showSuitAjax(channelid,size){
     jQuery.ajax({
	    type:'post',
	    url:"/home/suit.do",
	    data:{channelid:channelid,size:size},
	    beforeSend: function() {
          //   $("#"+divId).html("<img src='images/load.gif' /> 正在读取数据,请稍后...");
      },
		  error:function(){
		    $("#showSuit").html("服务繁忙,请稍后再试!");
		  },
	    success:function(html){
	    	$("#showSuit").html(html);
	    }
	  });
 }
   
function checkSubmit(){
		 if(document.getElementById("name").value == ''){
		    alert('请输入宝宝姓名！');
		    document.getElementById("name").focus();
		    return false;

		 }
		 if(document.getElementById("shootTime").value == ''){
		    alert('请输入希望拍摄时间！');
		    document.getElementById("shootTime").focus();
		    return false;

		 }
		 if(document.getElementById("telphone").value == ''){
		    alert('请输入电话！');
		    document.getElementById("telphone").focus();
		    return false;
		 }else{
			 var p1 = /^(([0\+]\d{2,3}-)?(0\d{2,3})-)?(\d{7,8})(-(\d{3,}))?$/;
			 var me = false;   
			 if (p1.test(document.getElementById("telphone").value))me=true;   
			 if (!me){   
			 document.getElementById("telphone").value='';   
			 alert('对不起，您输入的电话号码有错误。区号和电话号码之间请用-分割');   
			document.getElementById("telphone").focus();
			 return false;   
			}   
		 }
	     if(getRadioValue('shootType')==''){
	       alert('请选择拍照内容!');
	       return;
 	     }
			
		 if(document.getElementById("email").value == ''){
		    alert('请输入E-mail！');
		    document.getElementById("email").focus();
		    return false;
		 }else{
			  reg = new RegExp('^[a-zA-Z0-9]+@[a-zA-Z0-9]+.[a-z][a-z.]{2,8}$');
			  if(!reg.test(document.getElementById("email").value)){
			    alert('请输入有效E-mail！');
		    	document.getElementById("email").focus();
		    	return false;
			  }
		 }
		if($("#nickname_text").val()==''){
		 	   alert('昵称不能为空!');
		     return;
		 }
	   jQuery.ajax({
	    type:'post',
	    url:"/order/fastOrder/saveOrder.do",
	    contentType: "application/x-www-form-urlencoded; charset=utf-8",
	    data:{name:$("#name").val(),sex:getRadioValue('sex'),shootTime:$("#shootTime").val(),telphone:$("#telphone").val(),mobile:$("#mobile").val(),shootType:getRadioValue('shootType'),email:$("#email").val(),content:$("#contents").val()},
	    beforeSend: function() {
        },
		  error:function(){
		    alert('服务繁忙,请稍后再试!');
		    
		  },
	    success:function(html){
			  alert(html);
			  $('#form1')[0].reset();
	    }
	  });
	   
	   function getRadioValue( checkboxname ) {
		var ret = "";
		var num = document.getElementsByName(""+checkboxname+"").length;
		for(var i=0;i<num;i++) {
			obj = document.getElementsByName(""+checkboxname+"")[i];
			if (obj.name==checkboxname && obj.checked){
				v = obj.value+",";
				if( ret.indexOf( v ) <0 )
					ret += v;
			}
		}
		if( ret.length > 0 )
			ret = ret.substring(0, ret.length-1);
		return ret;
	}
}
