	$(document).ready(function() { 	
		$("#about_now").tooltip({
		offset: [194, 10],
		delay: 100, 
		effect: 'slide'
		}).dynamic({ bottom: { direction: 'down', bounce: true } });
		
		$("#why_malta").tooltip({
			offset: [194, 10],
			delay: 100, 
			effect: 'slide'
			}).dynamic({ bottom: { direction: 'down', bounce: true } });
		
		$("#services").tooltip({
			offset: [194, 10],
			delay: 100, 
			effect: 'slide'
			}).dynamic({ bottom: { direction: 'down', bounce: true } });
		
		
		$('.tabs .tab-active').show(); // show default content
		$('.tabs .header ul a').click(function(){
			$('.tabs .header ul li').removeClass('active');
			$(this).parent().addClass('active'); // make clicked tab active
			$('.tabs .tab').hide(); // hide all content
			$('.tabs').find('#' + $(this).attr('rel')).show(); // and show content related to clicked tab
			return false;
		});
		
		$("a.lightview").fancybox({'overlayShow': true, overlayOpacity:0.9,frameWidth:600,frameHeight:280 });
		$("a.lightview2").fancybox({'overlayShow': true, overlayOpacity:0.9,frameWidth:600,frameHeight:400 });
		$("a.lightview3").fancybox({'overlayShow': true, overlayOpacity:0.9,frameWidth:960,frameHeight:600 });
		
		$("a").focus(function () {
        	$(this).blur();
		});
		$("img.rollover").hover(function () {
			newsrc=$(this).attr('src').replace('.jpg','-over.jpg').replace('.png','-over.png');
        	$(this).attr('src',newsrc);
		},function () {
			newsrc=$(this).attr('src').replace('-over.jpg','.jpg').replace('-over.png','.png');
        	$(this).attr('src',newsrc);
		});
		
		$('.wysiwyg-full').ckeditor();
		var config = {
				toolbar:
					[
						['Format','TextColor','Bold','Italic','Underline','Strike'],
						['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
						['Link','Unlink'],['Maximize'],
						['NumberedList','BulletedList','Outdent','Indent'],
						['Undo','Redo','-','RemoveFormat'],
						['Cut','Copy','Paste','PasteText','PasteFromWord'],
					    ['Table','HorizontalRule','SpecialChar']
					],
				uiColor: '#dddddd'
				};
		$('.wysiwyg').each(function(index) {
			config.width=$(this).css('width');
			config.height=$(this).css('height');
			$(this).ckeditor(config);
		});	

		
		$('.anythingSlider').anythingSlider({
			easing: "easeInOutQuad",
			autoPlay: true,
			delay: 5000,
			startStopped: false,
			animationTime: 600,
			hashTags: true,
			buildNavigation: true,
			pauseOnHover: true,
			startText: "Go",
			stopText: "Stop",
			navigationFormatter: null
		});
		
		$('.anythingSlider1').anythingSlider({
			easing: "easeInOutQuad",
			autoPlay: true,
			delay: 3000,
			startStopped: false,
			animationTime: 600,
			hashTags: true,
			buildNavigation: false,
			pauseOnHover: false,
			startText: "Go",
			stopText: "Stop",
			navigationFormatter: null
		});
		
	});
			
	function addEmployer() {
		$('.submitButton').val('');
		$('.submitButton').attr("disabled","true");
		$.post('ajax.php',{
				action: "addEmployer",
				companyname: $('#companyname').val(),
				address: $('#address').val(),
				city: $('#city').val(),
				postcode: $('#postcode').val(),
				country: $('#country').val(),
				companydescription: $('#companydescription').val(),
				contactpersonname: $('#contactpersonname').val(),
				contactpersondesignation: $('#contactpersondesignation').val(),
				contactpersonemail: $('#contactpersonemail').val(),
				contactpersontelephone: $('#contactpersontelephone').val(),
				contactpersonmobile: $('#contactpersonmobile').val(),
				companyfax: $('#companyfax').val(),
			},
			function (data) {
				$('#sendStatus').html("<br /><p>Your message has been sent, we will reply as soon as possible.<br /><br />Thank you,<br />Bizav</p>");
				$('.submitButton').val('');
				$('.submitButton').attr("disabled",false);
				$('#employer').html("");
			}
		);
		return false;
	}
	
	
	function sendEmail() {
		$('.submitButton').val('Sending...');
		$('.submitButton').attr("disabled","true");
		$.post('form-contactus.php?r='+Math.random(),{
			visitor_title: $('#visitor_title').val(),
			visitor_name: $('#visitor_name').val(),
			visitor_lastname: $('#visitor_lastname').val(),
			visitor_address: $('#visitor_address').val(),
			visitor_email: $('#visitor_email').val(),
			visitor_tel: $('#visitor_tel').val(),
			visitor_mob: $('#visitor_mob').val(),
			visitor_sub: $('#visitor_sub').val(),
			visitor_description: $('#visitor_description').val(),
			},
			function (data) {
				$('#sendStatus').html("<br /><p>Your message has been sent, we will reply as soon as possible.<br /><br />Thank you,<br />Bizav</p>");
				$('.submitButton').val('Send Message');
				$('.submitButton').attr("disabled",false);
				$('#contactUsForm').html("");
			}
		);
		return false;
	}
	
	$(function() {
		setInterval("slideSwitch()", 5000);
	});
	function slideSwitch() {
		var $active = $('.slideshow SPAN.active');

		if ($active.length == 0)
			$active = $('.slideshow SPAN:last');

		var $next = $active.next().length ? $active.next()
				: $('.slideshow SPAN:first');

		$active.addClass('last-active');

		$next.css( {
			opacity : 0.0
		}).addClass('active').animate( {
			opacity : 1.0
		}, 1000, function() {
			$active.removeClass('active last-active');
		});
	}


	
