if ((screen.width<=1366) && (screen.height<=768)) {$('body').css('background-image','url(images/background_small.jpg)');} else {$('body').css('background-image','url(images/background_large.jpg)');}$.validator.addMethod("checkinput",function(value,label){return!value.match(/[^-a-zA-Z' ]/);},'letters only');var prompts={downloadWindow:function(){var html='<div class="adcinner">'+'<div class="adctitle">Download The Video and MP3...</div>'+'<div class="adctext">'+'<p>Thanks for completing our form. Now for the good stuff...</p>'+'<p style="font-size:12px;">Please select your preferred video format from the links below or simply download the mp3!</p>'+'<div style="margin:0 0 5px;" class="dl_title">Download Video</div>'+'<ul>'+'<li class="quicktime"><a href="store/alesha_dixon_cool_with_me_live_acoustic.mov.zip">Alesha Dixon - Cool With Me (Live acoustic) - MOV video (58Mb)</a></li>'+'<li class="windows"><a href="download.php?q=wmv">Alesha Dixon - Cool With Me (Live acoustic) - WMV video (38Mb)</a></li>'+'</ul>'+'<div style="margin:10px 0 5px;" class="dl_title">Download Audio</div>'+'<ul>'+'<li class="mp3"><a href="download.php?q=mp3">Alesha Dixon - Cool With Me (Live acoustic) - MP3 audio (9Mb)</a></li>'+'</ul>'+'<div style="margin:15px 0;text-align:center;"><button type="button" name="close_btn" id="close_btn" onclick="jQuery.prompt.close()">Close Window</button></div>'+'</div>'+'</div>';$.prompt(html,{prefix:'adc'});},alertWindow:function(msg){var html='<div class="adcinner">'+'<div class="adctitle">Download The Video and MP3...</div>'+'<div class="adctext" style="font-size:14px;"><p>Oops! There was an error...</p><p style="font-size:12px;">'+msg+'</p>'+'<div style="margin:15px 0;text-align:center;"><button type="button" name="close_btn" id="close_btn" onclick="jQuery.prompt.close()">Close Window</button></div>'+'</div></div>';$.prompt(html,{prefix:'adc'});}}
$('form#download_form').validate({rules:{name:{required:true,checkinput:true},email:{required:true,email:true},age:{required:true},location:{required:true,checkinput:true}},messages:{name:{required:'required'},email:{required:'required',email:'invalid email'},age:{required:'required'},location:{required:'required'}},errorElement:"div",errorPlacement:function(error,element){var container=element.parent('div');container.children('div:last-child').remove();container.append(error);},success:function(error){var container=error.parent('div');container.children('div:last-child').remove();if(container.children('div.success').length!=1){container.append('<div class="success">&nbsp;</div>');}},submitHandler:function(form){$.ajax({url:'./ajax/signup.php',dataType:'json',data:{name:$('input#name').val(),email:$('input#email').val(),age:$('select#age').val(),location:$('input#location').val()},type:'post',success:function(json){$('input#name').val('');$('input#email').val('');$('select#age').val('');$('input#location').val('');$('form#download_form div.success').remove();if(json.success){prompts.downloadWindow();}else if(json.error){prompts.alertWindow(json.error);}}});}});$().ready(function(){$('#twitter_container').jScrollPane();});
