// JavaScript Document

 // CAROUSEL
function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });
 
    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });
 
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};
 
jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
		auto: 2,
        wrap: 'circular',
		scroll: 1,
        initCallback: mycarousel_initCallback
    });
});
 // NEWS SCROLLER
	$(function() {
	$(".newsticker-jcarousellite").jCarouselLite({
		vertical: true,
		hoverPause:true,
		visible: 2,
		auto:500,
		speed:2000
	});
});
 // GALLERY LIGHTBOX
 $(function() {
        $('#gallery a').lightBox();
    });

// CSS MENU ROLLOVER IE6 //
$(function(){
	$('.tab').hover(
		// mouseover
		function(){ $(this).addClass('tabHoverLeft'); },
		
		// mouseout
		function(){ $(this).removeClass('tabHoverLeft'); }
	);	
});
$(function(){
	$('.drop').hover(
		// mouseover
		function() { $('ul.sub', this).css('visibility', 'visible'); },
		
		// mouseout
		function() { $('ul.sub', this).css('visibility', 'hidden'); }); }
	);
$(function(){
	$('.sub', this).hover(
		// mouseover
		function() { $('.drop').addClass('tabHoverLeft'); },
		
		// mouseout
		function() { $('.drop').removeClass('tabHoverLeft'); }); }
	);
$(function(){
	$('.sub', this).hover(
		// mouseover
		function() { $('.drop a').addClass('tabHoverRight a'); },
		
		// mouseout
		function() { $('.drop a').removeClass('tabHoverRight a'); }); }
	);
 // Fix hover state in IE6
$(document).ready(function() {
       $('.hoverable').hover(
	  function() {
	     $(this).addClass('hovered');     /* On hover add the class 'hovered' and apply the hovered styles */
	  }, function() {
	     $(this).removeClass('hovered');  /* On mouseout remove the class 'hovered' and reset the styles   */
	  }
       );
    });
 // QUICK CONTACT FORM      

$(document).ready(function(){
$("#ajax-contact-form").submit(function(){

// 'this' refers to the current submitted form
var str = $(this).serialize();

   $.ajax({
   type: "POST",
   url: window.location.protocol + "//" + window.location.host + "/"  + "scripts/contact.php",
   data: str,
   success: function(msg){

$("#note").ajaxComplete(function(event, request, settings){

if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
{
result = '<div class="notification_ok">Your message has been sent. Thank you!</div>';
$("#fields").hide();
}
else
{
result = msg;
}

$(this).html(result);

});

}

 });

return false;

});

});


