$(document).ready(function(){$("img").lazyload({placeholder:"images/loading.png",threshold:200,effect:"fadeIn"});$("#messages").slideDown(2000).delay(1000).fadeOut(8000);$('.closeThis').live("click",function(){$('#firstVisitor').fadeOut(2000);});$(document).keyup(function(event){if(event.keyCode==27){$("#firstVisitor").fadeOut(2000);}});$.ajaxSetup({cache:false});$("#mailList").submit(function(){var inputFieldVal=$("#mailListInput").val();var formdata=$("#mailList").serialize();if(!inputFieldVal.match(/^([a-zA-Z0-9_\+\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)){alert("Please enter a valid email address");return false;}else{$.ajax({type:"POST",url:"../work/processAjax.php",data:"mailListInput="+ inputFieldVal,timeout:2000,success:function(data){ajaxSubmitSuccess(data);},error:function(data){alert(inputFieldVal+' already exists in our database!');}});return false;}});function ajaxSubmitSuccess(data){$("#firstVisitor").fadeOut(2000);$("#messages").slideDown(1000).html("<h1>You have successfully been added to the mailing list</h1>");alert('You have successfully been added to the mailing list. An email will arrive momentarily');}
function ajaxUploadSuccess(data){$("#messages").html("<h1>Upload Success!</h1>");}
$("#citySearch").focus().autocomplete("/../includes/cQuery.php",{minChars:0,scroll:true,scrollHeight:220});$("#venueSearch").focus().autocomplete("/../includes/vQuery.php",{minChars:0,scroll:true,scrollHeight:220});function loadTrigger(evt){var thisHover=evt.data.name;$(this).find(".triggerOver"+ thisHover).fadeIn();return false;};function hideTrigger(evt){var thisHover=evt.data.name;$(this).find(".triggerOver"+ thisHover).fadeOut();return false;};$(".triggerNoah").bind("mouseenter",{name:"Noah"},loadTrigger);$(".triggerNoah").bind("mouseleave",{name:"Noah"},hideTrigger);$(".triggerDan").bind("mouseenter",{name:"Dan"},loadTrigger);$(".triggerDan").bind("mouseleave",{name:"Dan"},hideTrigger);$(".triggerJosh").bind("mouseenter",{name:"Josh"},loadTrigger);$(".triggerJosh").bind("mouseleave",{name:"Josh"},hideTrigger);$(document).ajaxSend(function(){$("#loading").fadeIn("slow");});$(document).ajaxStop(function(){$("#loading").fadeOut("slow");});$("#welcomeLink").addClass("active");$("#contentLoaded").load("pages/welcome.php");$('div#nav ul li a #welcomeLink').addClass("active");document.title='Roman Street | home';function loadPageContent(evt){var thisPage=evt.data.name;$("#contentLoaded").load('pages/'+thisPage+'.php');$('#nav ul li a').removeClass("active");$(this).addClass("active");document.title='Roman Street | '+ $(this).text();return false;}
$("#welcomeLink").bind("click",{name:"welcome"},loadPageContent);$("#storeLink").bind("click",{name:"store"},loadPageContent);$("#storeAd").bind("click",{name:"store2"},loadPageContent);$("#musicLink").bind("click",{name:"music"},loadPageContent);$("#contactLink").bind("click",{name:"contact"},loadPageContent);$("#picturesLink").bind("click",{name:"pictures"},loadPageContent);$("#pressLink").bind("click",{name:"press"},loadPageContent);$("#lessonsLink").bind("click",{name:"lessons"},loadPageContent);$("#scheduleLink").bind("click",{name:"schedule"},loadPageContent);$("#mediaLink").bind("click",{name:"media"},loadPageContent);var pageLoadSwitch=function(){$("#contentLoaded").load("pages/"+ thisPage+".php");$('div#nav ul li a').removeClass("active");$('#'+ thisPage+'Link').addClass("active");document.title='Roman Street | '+ thisPage;attachEvents();return false;}
switch($.url.param('p')){case'welcome':var thisPage='welcome';pageLoadSwitch();break;case'music':var thisPage='music';pageLoadSwitch();break;case'store':var thisPage='store';pageLoadSwitch();break;case'contact':var thisPage='contact';pageLoadSwitch();break;case'pictures':var thisPage='pictures';pageLoadSwitch();break;case'press':var thisPage='press';pageLoadSwitch();break;case'lessons':var thisPage='lessons';pageLoadSwitch();break;case'schedule':var thisPage='schedule';pageLoadSwitch();break;case'media':var thisPage='media';pageLoadSwitch();break;case'preorder':var thisPage='preOrder';pageLoadSwitch();break;default:var thisPage='welcome';pageLoadSwitch();break;}});function attachEvents(){$("a.group").fancybox({'enableEscapeButton':true,'overlayOpacity':0.7,'hideOnOverlayClick':false,'hideOnContentClick':false,'centerOnScroll':false,'zoomSpeedIn':0,'zoomSpeedOut':0});$("a.pressGroup").fancybox({'enableEscapeButton':true,'overlayOpacity':0.7,'hideOnOverlayClick':false,'hideOnContentClick':false,'centerOnScroll':false,'width':'50%','height':'50%'});$("a.retailers").fancybox({'enableEscapeButton':true,'overlayOpacity':0.7,'hideOnOverlayClick':false,'hideOnContentClick':false,'centerOnScroll':false,'width':'400','height':'50%'});$("a.toolGroup").fancybox({'enableEscapeButton':true,'overlayOpacity':0.7,'hideOnOverlayClick':false,'hideOnContentClick':false,'centerOnScroll':true,'width':'100%','height':'100%'});$("a.newsFeed").fancybox({'enableEscapeButton':true,'overlayOpacity':0.7,'hideOnOverlayClick':false,'hideOnContentClick':false,'centerOnScroll':true,'width':600,'height':450});$('.goNext').click(function(){var m=$(this).attr('nextM');var mNum=$(this).attr('nextMNum');$('#loadCalendar').load('pages/schedule.php?date='+ m+'&m='+ mNum)
return true;});$('.goLast').click(function(){var m=$(this).attr('lastM');var mNum=$(this).attr('lastMNum');$('#loadCalendar').load('pages/schedule.php?date='+ m+'&m='+ mNum)
return true;});}
Date.firstDayOfWeek=0;Date.format='mmmm dd, yyyy';$(function()
{$('.date-pick').datePicker({clickInput:true})
$('.dp-choose-date').hide();});
