// JavaScript Document
$(document).ready(function() {
	try{
		$('#js-news').ticker({
				speed: 0.10,
				htmlFeed: false,
				ajaxFeed: true,
				displayType: 'fade',
				feedUrl: '../news.xml',
				feedType: 'xml',
				debugMode: false,
				controls: false,
				titleText: 'Energy-Saving Tips:',	
				direction: 'ltr',	
				pauseOnItems: 3500,
				fadeInSpeed: 600,
				fadeOutSpeed: 300
		 });
	 }catch(err){}
	 
	 try{
		$("#comingSoonSignup").validator();
	 }catch(err){}
	 
	 try {
		$('.clicktocall').hover(function () {
          $('#clicktocall').animate({marginTop:'5'},400);
		});
		$('.clicktocall').mouseleave(function () {
          $('#clicktocall').animate({marginTop:'24'},300);
		});
		
		$('.feedback').hover(function () {
          $('#feedback').animate({marginTop:'5'},400);
		});
		$('.feedback').mouseleave(function () {
          $('#feedback').animate({marginTop:'24'},300);
		});
		
		$('.emergencycontacts').hover(function () {
          $('#emergencycontacts').animate({marginTop:'5'},400);
		});
		$('.emergencycontacts').mouseleave(function () {
          $('#emergencycontacts').animate({marginTop:'20'},300);
		});
		
		$('.tipoftheday').hover(function () {
          $('#tipoftheday').animate({marginTop:'5'},400);
		});
		$('.tipoftheday').mouseleave(function () {
          $('#tipoftheday').animate({marginTop:'24'},300);
		});
		
		$('.requestabrochure').hover(function () {
          $('#requestabrochure').animate({marginTop:'5'},400);
		});
		$('.requestabrochure').mouseleave(function () {
          $('#requestabrochure').animate({marginTop:'24'},300);
		});
		
		$('.referafriend').hover(function () {
          $('#referafriend').animate({marginTop:'5'},400);
		});
		$('.referafriend').mouseleave(function () {
          $('#referafriend').animate({marginTop:'24'},300);
		});
		
		$(".clicktocall a").colorbox({width:"650px", height:"480px", iframe:true, scrolling:false});
		$(".feedback a").colorbox({width:"40%", height:"600px", iframe:true, scrolling:false});
		$(".feedbackcontact a").colorbox({width:"40%", height:"600px", iframe:true, scrolling:false});
		$(".contactcontact a").colorbox({width:"40%", height:"600px", iframe:true, scrolling:false});
		$(".ctc a").colorbox({width:"650px", height:"480px", iframe:true, scrolling:false});
		$(".emergencycontacts a").colorbox({width:"750px", height:"500px", iframe:true, scrolling:true});
		$(".tipoftheday a").colorbox({width:"35%", height:"500px", iframe:true, scrolling:true});
		$(".requestabrochure a").colorbox({width:"40%", height:"450px", iframe:true, scrolling:true});
		$(".referafriend a").colorbox({width:"740px", height:"600px", iframe:true, scrolling:true});
		$("#FeedbackForm").validator();
		$("#BrochureForm").validator();
	 }catch(err){}
	 
	 try {
		 // We'll target all AREA elements with alt tags (Don't target the map element!!!)
		$('area[alt]').qtip(
		{
			content: {
				attr: 'alt' // Use the ALT attribute of the area map for the content
			},
			style: {
				classes: 'ui-tooltip-tipsy ui-tooltip-shadow'
			}
		});
	 }catch(err){}
	 
	 try{
		$("#enterZipCodeHome").validator();
	 }catch(err){}
	 
	 try{
		$("enterZipCodeInYourArea").validator();
	 }catch(err){}
	 
	 try{
		$("checkZipCodeSignUp").validator();
	 }catch(err){}
	 
	 try{
		$("zipCodeNotification").validator();
	 }catch(err){}
 });
