// JavaScript Document

var contact = new Array();
contact.push("required,txtContactName,Please enter your name.");
contact.push("required,txtContactEmail,Please enter your email address.");
contact.push("valid_email,txtContactEmail,Please enter a valid email address.");
contact.push("required,txtContactQuery,Please enter your message / query.");
contact.push("required,txtContactCode,Please enter captcha code.");
$(document).ready(function(){
	$("a.getStarted").fancybox({
		'hideOnContentClick': false,
		'width'				: 960,
		'height'			: 440,
		'overlayColor'		: '#000000',
		'overlayOpacity'	: 0.9,
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'speedIn'			: 600, 
		'speedOut'			: 200
	});
	$("a.package").fancybox({
		'hideOnContentClick': false,
		'width'				: 300,
		'height'			: 54,
		'overlayColor'		: '#000000',
		'overlayOpacity'	: 0.9,
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'speedIn'			: 600, 
		'speedOut'			: 200
	});
	$("a.map").fancybox({
		'hideOnContentClick': false,
		'width'				: 560,
		'height'			: 340,
		'overlayColor'		: '#000000',
		'overlayOpacity'	: 0.9,
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'speedIn'			: 600, 
		'speedOut'			: 200
	});
	$('#frmContact').submit(function(){
		if ($('#txtContactName').val()=='Name')
			$('#txtContactName').val('');
		if ($('#txtPhone').val()=='Phone')
			$('#txtPhone').val('');
		if ($('#txtContactEmail').val()=='Email')
			$('#txtContactEmail').val('');
		if ($('#txtContactQuery').val()=='Please enter your message...')
			$('#txtContactQuery').val('');
		if ($('#txtContactCode').val()=='Enter code')
			$('#txtContactCode').val('');
		if (validateFields(this, contact))
		{
			return true;
		}
		else
			return false;
	});
	$('a[href*=#]').click(function() {   
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {   
			var $target = $(this.hash);   
			$target = $target.length && $target || $('[name='+this.hash.slice(1)+']');   
			if ($target.length) {   
				var targetOffset = $target.offset().top;   
				$('html,body').animate({scrollTop: targetOffset}, 1000);   
				return false;   
			}   
		}   
	});

	$('#checkBox').click(function(){
		$(this).toggleClass("unchecked");
		if ($('#cboNewsletter').val()==0)
			$('#cboNewsletter').val(1);
		else
			$('#cboNewsletter').val(0);
	});
});
