
/* Modified by Alex Spooner, 2009-02-10 08:17:39 EST */
/* Modified by Attila Pest, 2009-07-17 05:11:08 EST */

var tbt = false;

function hideTopbar()
{
  $("#topbar_newsletter").attr("class","hidden");
  $("#topbar_search").attr("class","hidden");
}

function searchContact(state)
{	
   $('#address_info').show(); 
   $('div[id^="ct"]').hide(); 
   $('div[id^="ct"]:contains("' + state + '")').slideDown("slow");
   if (state!="Europe" && state!="Asia" && state!="Africa" && state!="Australia" && state!="South America" && state!="North America" ){
     $('#af').slideDown("slow");
   }  
   if (state=="North America"){ 
     $('#address_info').hide();
     $('#world').hide();
     $('#states').show();
   }   
}


$(document).ready(function()
{
    
    $("#signup").click(function(event){
		 	event.preventDefault();
      $("#topbar_newsletter").attr("class","content");
		 	$("#topbar_search").attr("class","hidden");
		 	$("#newsletter_email").focus();
    });
    
    $("#s").click(function(event){
		 	event.preventDefault();
      $("#topbar_search").attr("class","content");
		 	$("#topbar_newsletter").attr("class","hidden");
		 	$("#search").focus();
    });
    
    $("#newsletter_email,#search").focus(function(){
      if (tbt) clearTimeout(tbt);
    });
    
    $("#newsletter_email,#search").blur(function(){
      tbt = setTimeout("hideTopbar()",1000);
    });
    
    $("#what").hover(
      function () {
        $("#what_is_this").show();
      }, 
      function () {
        $("#what_is_this").hide();
      }
    );

    $("[id^='cat']").click(function(event){
		 	event.preventDefault();
		 	if ($(this).attr("class")=="open") $(this).attr("class","");
		 	else $(this).attr("class","open");
      var id = $(this).attr("id");
		 	$("#news"+id).toggle();
    });

});



