//
// @author [Cassette]
// @copyright [2010] 
// Software on this site is copyright 2010
// Cassette Pty Ltd.
// All Rights Reserved. Copying, Editing or
// Distributing this software is strictly
// forbidden without permission from
// Cassette Pty Ltd.
// for more information please contact
// Cassette www.cassette.cc 
//

var nav = "";
var subnav = "";

 function callMe(id){
 $("#" + id).fancybox({
 'width' : '100%',
 'height' : '100%'
  });
    readyFancy(id); //call to trigger the decoy link page
 }
  function readyFancy(id){
  $("#" + id).trigger("click");
  } 



function SendEmail()
{
  $("#load").empty();
  $("#load").addClass("loading");
   var loadUrl = "ajax-mail.php";
   $("#load").load(loadUrl, {
                firstname: $("#first-name").val(),
                surname: $("#surname").val(),
                email: $("#em").val(),
                telephone: $("#telephone").val(),
                send_me_more_info:$("#send-me-more:checked").val(),
                keep_me_up_to_date: $("#keep-me-up:checked").val(),
                update_me_about_future: $("#update-me:checked").val(),
                hu: ''
             }
             , function(responseText){
                $("#load").removeClass("loading");
                $("#load").html(responseText);
             }); 
}

function Navigation(id)
{
        $("#" + id).attr("src", "images/gui/navigation/" + id + "_on.jpg");
        $("#" + id).removeClass('hover');
}



function SubNavigation(id)
{
    if (id != subnav)
    {
            $("#" + id).attr("src", "images/gui/text/" + id + "_on.jpg");
            $("#" + id).removeClass('menu-items');
            $("#" + id).unbind('mouseenter mouseleave');
            if (subnav != "")
            {
                $("#" + subnav).attr("src", "images/gui/text/" + subnav + ".jpg");
                $("#" + subnav).addClass('menu-items');
                $("#" + subnav + "-copy").hide();
            }
            $("#" + id  + "-copy").show();
            subnav = id;
        }
}


function initMenu() {
   
   $(".hover").click(
    function() {
            Navigation($(this).attr("id"));
         }
    );
    
    
    $(".menu-items").click(
    function() {
            SubNavigation($(this).attr("id"));
         }
    );
    
    $(".menu-items").hover(function(e){	
            s = $(this).attr("src").replace(/\.(.+)$/i, "_on.$1");
            $(this).attr("src", s);

	},function(){
	       s = $(this).attr("src").replace(/_on\.(.+)$/i, ".$1");
            $(this).attr("src", s);
    });
    
    
    $(".hover").hover(function(e){	
             s = $(this).attr("src").replace(/\.(.+)$/i, "_on.$1");
            $(this).attr("src", s);

	},function(){
	       s = $(this).attr("src").replace(/_on\.(.+)$/i, ".$1");
            $(this).attr("src", s);
    });
}


$(document).ready(function(){
    initMenu();
    $('#mycarousel').jcarousel({
    	wrap: 'circular',
        size:17,
        scroll:1
    });
      $(".footer-cassette-logo").hover(function() {
				$(this).addClass("footer-cassette-logo-hover");
			}, function() {
				$(this).removeClass("footer-cassette-logo-hover");
		});//#$("div.footerLogo").hover();
}); 
