/**
 * @author batman
 */
$(document).ready(

	function(){
		
		// cycle homepage
		$('#home_slider').cycle({
			pause: true,
			pager: '#nav',
			slideExpr: '.home_slide',
			pagerAnchorBuilder: function(idx, slide) { 
        return '<li><a href="#"></a></li>'; 
			}
		});


		$('#home_carousel').jcarousel({
      vertical: true,
      scroll: 1,
      auto: 3,
      buttonNextHTML: null,
      buttonPrevHTML: null,
      wrap: 'both'
		});
		
		// countdown
		if($('#home_counter2').length>0) {
			$(function () {
				var austDay = new Date();
				austDay = new Date( $('#cd_y').val() - 0 , $('#cd_m').val() - 1, $('#cd_d').val() - 0 );
				$('#home_counter2').countdown(
					{
						until: austDay,
						layout: '<span>{dn}gg . {hnn}h . {mnn}m . {snn}s</span>'
					}
				);
				$('#year').text(austDay.getFullYear());
			});
		}

	
	}

);

function isValidEmailAddress(emailAddress) {
	var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
	return pattern.test(emailAddress);
}
