// JavaScript Document

$(document).ready(function(){
	
  //hide toolbar and make visible the 'show' button
	$("span.downarr a").click(function() {
    $("#toolbar").slideToggle("fast");
    $("#toolbarbut").fadeIn("slow");    
  });
  
  //show toolbar and hide the 'show' button
  $("span.showbar a").click(function() {
    $("#toolbar").slideToggle("fast");
    $("#toolbarbut").fadeOut();    
  });
  
  //show tooltip when the mouse is moved over a list element 
  $("ul#social li").hover(function() {
		$(this).find("div").fadeIn("fast").show(); //add 'show()'' for IE
    $(this).mouseleave(function () { //hide tooltip when the mouse moves off of the element
        $(this).find("div").hide();
    });
    
  });
  
  //don't jump to #id link anchor 
  $(".facebook, .twitter, .delicious, .digg, .rss, .stumble, .menutit, span.downarr a, span.showbar a").click(function() {
   return false;                                         
	});
	
  //show quick menu on click 
	$("div#menu_title a").click(function() {
		if($(".quickmenu").is(':hidden')){ //if quick menu isn't visible 
			$(".quickmenu").fadeIn("fast"); //show menu on click
		}
		else if ($(".quickmenu").is(':visible')) { //if quick menu is visible 
      $(".quickmenu").fadeOut("fast"); //hide menu on click
    }
	});
	
	
	$(".qmclose").click(function() {
		if($(".quickmenu").is(':hidden')){ //if quick menu isn't visible 
			
      $(".quickmenu").fadeIn("fast"); //show menu on click
		}
		else if ($(".quickmenu").is(':visible')) { //if quick menu is visible 
     
      $(".quickmenu").fadeOut("fast"); //hide menu on click
    }
	});
	
	
	//hide menu on casual click on the page
	$(document).click(function() {
			$(".quickmenu").fadeOut("fast");
		
	});
	$('.quickmenu').click(function(event) { 
		event.stopPropagation(); //use .stopPropagation() method to avoid the closing of quick menu panel clicking on its elements 
	});

	setTimeout(function() {
  $('.quickmenu').fadeOut('slow');
}, 13000); // <-- time in milliseconds




$("a#home").click(function() {
		$(".splproducts").hide();  
    $(".splhome").show();
    $(".splport").hide();   
});



$("a#products").click(function() {
		$(".splhome").hide();
    $(".splport").hide();   
    $(".splproducts").show();   
});

$("a#portfolio").click(function() {
		$(".splhome").hide(); 
    $(".splproducts").hide();  
    $(".splport").show();
    $("#pswfdis").css('display', 'none');
    $(".portright").css('margin-top', '-10px');
    $("#portswf").css('height', '261px');
    
      
});

$("a#acct").click(function() { 
    $("#portswf").css('height', '0px');
    $(".portright").css('margin-top', '-23px');
    $("#pswfdis").css('display', 'inline');
    
});

$(".qmdetails").click(function() { 
    $("#portswf").css('height', '0px');
    $(".portright").css('margin-top', '-23px');
    $("#pswfdis").css('display', 'inline');
    
});

$("a#qlink").click(function() {  
     $("#portswf").css('height', '0px');
     $(".portright").css('margin-top', '-23px');
     $("#pswfdis").css('display', 'inline');
});

$(".qclose").click(function() {  
if ($('#portswf').css('height') === '0px') {
$(".portright").css('margin-top', '-10px');
    $("#portswf").css('height', '261px');
    $("#pswfdis").css('display', 'none');
}
});

$(".mclose").click(function() {  
if ($('#portswf').css('height') === '0px') {
$(".portright").css('margin-top', '-10px');
    $("#portswf").css('height', '261px');
    $("#pswfdis").css('display', 'none');
}
});

$(".lclose").click(function() {  
if ($('#portswf').css('height') === '0px') {
$(".portright").css('margin-top', '-10px');
    $("#portswf").css('height', '261px');
    $("#pswfdis").css('display', 'none');
}
});


	
	});
	



