function slideSwitch() {
    var active = $('#slideshow IMG.active');
    if ( active.length == 0 ) active = jQuery('#slideshow IMG:last');
    var next =  active.next().length ? active.next()
        : jQuery('#slideshow IMG:first');
    active.addClass('last-active');
    next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            active.removeClass('active last-active');
        });
}
jQuery(function() {
    setInterval( "slideSwitch()", 5000 )
	$("#headerArea .slide-show .slide-corner").pngfix();
	$("#mainContainer .top-corner").pngfix();
	$("#mainContainer .bottom-corner").pngfix();
	$("#header ul li").hover( 
      function () { 
        $(this).addClass("active"); 
      },  
      function () { 
         $(this).removeClass("active");
      } 
    );
	$("#header ul li.active").hover( 
      function () { 
        $(this).addClass("active"); 
      },  
      function () { 
         $(this).addClass("active");
      } 
    );
});
jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        scroll: 1
    });
$(".inputArea").val('Enter your email address');
$(".inputArea").css("color", "#888");
$(".inputArea").each(function() {
    var default_value = this.value;
	$(this).focus(function() {
        if(this.value == default_value) {
            this.value = '';
			$(this).css("color", "#000");

        }
		else
		{
		this.value = $.trim(this.value);
		}
    });
    $(this).blur(function() {
        if(this.value == '') {
            this.value = default_value;
			$(this).css("color", "#888");
        }
		else{
		this.value = $.trim(this.value);
		if(this.value == ''){
		$(".inputArea").val('Enter your email address');
		$(".inputArea").css("color", "#888")
		}
		}
    });
});
$("#newsletter").submit(function() {
	    var checkMail = $("#newsletter input:first").val();
		var AtSym     = checkMail.indexOf('@')
		var period1   = checkMail.indexOf('.')
		var Period    = checkMail.lastIndexOf('.')
		var Space     = checkMail.indexOf(' ')
		var Length    = checkMail.length - 1  
      if ($("#newsletter input:first").val() == "Enter your email address") {
		 alert("Please enter your email address.");
        return false;
      }
	   else if ((AtSym < 1) ||
				(Period <= AtSym+1) ||
				(period1 < 1) ||
				(Period == Length ) ||
				(Space  != -1))
			{
				alert("Please enter E-mail in correct format.");
				return false;
			}
    });

});
