Reply
Fri 31 Jan, 2014 01:25 am
$('.window .close .click').click(function test(e) {
//Cancel the link behavior
//e.preventDefault();
var year = $('#year').val();
var location = $('#location').val();
var currentTime = new Date()
var today = currentTime.getFullYear();
$('#info').hide();
$('#year').css('border','0px');
$('#month').css('border','0px');
$('#day').css('border','0px');
$('#location').css('border','0px');
if(today == year){
$('#info').html('You have not entered your age, Please enter your date of birth! ');
$('#info').css('color','red');
$('#year').css('border','#f00 solid 1px');
$('#month').css('border','#f00 solid 1px');
$('#day').css('border','#f00 solid 1px');
$('#info').show();
}
else{
if(year >(today-18)){
$('#info').html('You are only '+(today-year)+' years old. You are restricted from viewing the contents of this page! ');
$('#info').css('color','red');
$('#year').css('border','#f00 solid 1px');
$('#month').css('border','#f00 solid 1px');
$('#day').css('border','#f00 solid 1px');
$('#info').show();
}
else {
if(location == '' || location == null){
$('#info').html('Please let us know where you are, enter your location!');
$('#info').css('color','red');
$('#location').css('border','#f00 solid 1px');
$('#info').show();
}
else{
if($('#agree').is(':checked')){
setCookie("username",'username',1);
}
$('#mask').hide();
$('.window').hide();
}
}
}
});