var OG = jQuery.noConflict();
var gothis = false;

function test(){
	alert('稍后开放...');
}

function showWIN(aid,pid){
	var win = document.createElement("div");
	win.id = "windows";  
	win.style.width = "352px";  
	win.style.height = "252px";  
	win.style.left = "35%";  
	win.style.top = "100px";  
	win.style.position = "absolute";
	win.style.zIndex = "2000";
	win.style.backgroundColor = "#FFFFFF";
	win.style.border = "1px solid #fabe7f";
	document.body.appendChild(win);
	OG("#windows").load("/lib/ajax_form.php?aid="+aid+"&pid="+pid);
	gothis = true;
}

function goscroll(){
	var t;
	 if (document.documentElement && document.documentElement.scrollTop) 
	 t = document.documentElement.scrollTop;
	 else if (document.body)
	 t = document.body.scrollTop;
	OG("#windows").css("top",t+100);
}

function submitAjax(){
	var Href=window.location.href;

	if (OG("#name").val()=="")
		{
		  alert("请输入姓名！")
		  OG("#name").focus()
		  return false
		 }

/*
if(OG("#mobile").val().length<11)
	{
	alert("手机号码输入错误！");
	OG("#mobile").focus();
	return false;
	}
	*/

	OG.ajax({
		type:"POST",
		url:"/lib/app.inc.php?do=baoming",
		data:{name:OG("#name").val(),mobile:OG("#mobile").val(),sex:OG("#sex").val(),memo:OG("#memo").val(),getInfo:OG("#getInfo").val(),aim:OG("#aim").val(),aid:OG("#aid").val(),pid:OG("#pid").val(),classname:OG("#classname").val(),shangke:OG("#shangke").val(),sendurl:Href},
		success:function(data){
			alert('提交成功,24小时内与您联系。');
			window.document.location.reload();
 			gothis = false;
			document.body.removeChild(document.getElementById("windows"));
		}
	});
}

function submitclose(){
gothis = false;
document.body.removeChild(document.getElementById('windows'));
}
//window.onscroll = function (){if(gothis == true)goscroll();}
window.onload = function(){window.setInterval(function(){if(gothis == true)goscroll();},100)}



function yuyue(){
	var Href=window.location.href;
 
	if (OG("#name").val()=="")
		{
		  alert("请输入姓名！")
		  OG("#name").focus()
		  return false
		 }

if(OG("#mobile").val().length<11)
	{
	alert("手机号码输入错误！");
	OG("#mobile").focus();
	return false;
	}

	OG.ajax({
		type:"POST",
		url:"/lib/app.inc.php?do=yuyue",
		data:{name:OG("#name").val(),mobile:OG("#mobile").val(),classname:OG("#classname").val(),memo:OG("#memo").val(),getInfo:OG("#getInfo").val(),aim:OG("#aim").val(),aid:OG("#aid").val(),pid:OG("#pid").val(),classname:OG("#classname").val(),shangke:OG("#shangke").val(),sendurl:Href},
		success:function(data){
			alert('感谢您预约成功！1月18日-1月31日佳禾学校春节放假！2月1日与您联系为您安排课程！');
			window.document.location.reload();
  		}
	});
}

