var now = new Date();
var s;
s = now.getYear() + "-"; 
s += (now.getMonth() + 1) + "-";
s += now.getDate(); 

function isSkypeURL(){
	var acurl = document.getElementById('acurl').value;
	var tel = document.getElementById('tel').value;
	if(acurl.length == 0){
		alert("请输入活动网址！");
		return false;
	}
	if(acurl.indexOf("http://") == -1){
		alert("请输入正确的网址！");
		return false;
	}
	if(acurl.indexOf("skype.tom.com") == -1){
		alert("请注意，您输入的网址是非skype官方网站！");
		return false;
	}
	if(tel.length != 0 && (tel != '68730066' && tel != '67888180' &&  tel != '01068730066' &&  tel != '01067888180')){
		alert("请注意，您输入的电话是非skype官方联系电话！");
		return false;
	}
	var skype_start = acurl.indexOf("skype.tom.com");
	var http_start = acurl.indexOf("http://");
	var before_skype = acurl.substring((http_start + 7),(skype_start));
	if(acurl.indexOf("skype.tom.com") != -1 && before_skype.indexOf("/") != -1){
		alert('请注意，您输入的网址是非skype官方网站！');
		return false;
	}
	if(acurl.indexOf("skype.tom.com") != -1 && (acurl.substring(skype_start+13,skype_start+14) != '/' && acurl.substring(skype_start+13,skype_start+14) != '')){
		alert('请注意，您输入的网址是非skype官方网站！');
		return false;
	}
	alert('您输入的信息属于skype官方活动网址及联系电话！');
	return true;
}

String.prototype.isDate = function()
{
   var r = this.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);
   if(r==null)return false; var d = new Date(r[1], r[3]-1, r[4]);
   return (d.getFullYear()==r[1]&&(d.getMonth()+1)==r[3]&&d.getDate()==r[4]);
}

function checkSubInfo(){
	var username = document.getElementById('username').value;
	var userid = document.getElementById('userid').value;
	var telephone = document.getElementById('telephone').value;
	var province = document.getElementById('provinceID').value;
	var city = document.getElementById('cityID').value;
	var cheatcash = document.getElementById('cheatcash').value;
	var cheatdate = document.getElementById('cheatdate').value;
	var cheaturl = document.getElementById('cheaturl').value;
	
	if(username.length == 0 || userid.length == 0 || telephone.length == 0 || province == '选择省' || city == '选择城市' || cheatcash.length == 0 || cheatdate.length == 0 || cheaturl.length == 0){
		alert('请您填写所有信息！');
		return false;
	}
	if(username.length > 64){
		alert('请您输入不大于32个字的姓名！');
		return false;
	}
	var ut  = /\d/;
	if(15 > userid.length || userid.length > 18 || !ut.test(userid)){
		alert('请您输入正确的身份证号！');
		return false;
	}
	if(!ut.test(telephone)){
		alert('请您输入正确的电话号码！');
		return false;
	}
	var dt = /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})/;
	if(!dt.test(cheatdate)){
		alert('请您输入正确的日期格式YYYY-MM-DD！');
		return false;
	}
	if(!cheatdate.isDate()){
		alert('请您输入正确的日期！');
		return false;
	}
	if(cheaturl.indexOf("http://") == -1 || cheaturl.indexOf(".") == -1){
		alert('请您输入正确的骗子页面地址！');
		return false;
	}
	return true;
}
