$(function() {

  if ($(window).width() > 1010){
     $("#menuHeader").css({"width": "42%"});
	 $("#menuHeader ul").css({"padding-left": "5%"});
  }
  if ($(window).width() == 980){
     $("#menuHeader").css({"width": "58%"});
  }
   

  var $global = {}
  $global.bigMenuLi = "";


  $("#categorybox a").hover(
    function(){	  
	  $(this).css({"color":"#6E6E6E"}).animate({"margin-left":"20px"}, 300).css({"filter":""});
	 
	}, 
	function(){
	  $(this).css({"color":"#8A8A8A"}).animate({"margin-left":"10px"}, 100).css({"filter":""});
	 
	}
  );
  
  

  $("#showdown").click(function(e) {          
    e.preventDefault();
    $("#myaccount").toggle();
	$("#menu li.last").toggleClass("menu-open");
  });

  $("#myaccount").mouseup(function() {
    return false
  });

  $(document).mouseup(function(e) {
    if($(e.target).parent("#showdown").length==0) {
	  $("#menu li.last").removeClass("menu-open");
	  $("#myaccount").hide();
	}
  });
  
  $(".featuredboxmain").hover(
    function(){
	  $(this).css({"background":"#F2F5F9", "border": "1px solid #97C8DF"});
	},
    function(){
	  $(this).css({"background":"#FFFFFF", "border": "1px solid #C7C7BC"});
	}
  ); 
  
  if(typeof($().uniform)!="undefined"){
    $("#content input[type=text], #content input[type=radio], #content input[type=file], #content select").uniform();
	$("select.uniformsmall").uniform({selectClass: 'selectUniformSmall'});
	$("#contentDuration div.selector span").css({"width": "50px"});
	$("#contentDuration div.selector").css({"width": "90px"});
	
	$("#contentRelisting div.selector span").css({"width": "50px"});
	$("#contentRelisting div.selector").css({"width": "90px"});
	
	
  }

  
  $("#customLanguageSelection a").click(function(){
    $("#customLanguageSelection .hideMenu ul").slideToggle(500);
	if($("#customCurrencySelection .hideMenu ul").is(":visible")) {
	  $("#customCurrencySelection .hideMenu ul").hide();
	  return false;
	}
	if($("#customCountrySelection .hideMenu ul").is(":visible")) {
	  $("#customCountrySelection .hideMenu ul").hide();
	  return false;
	}
  });
  $("#customCurrencySelection a").click(function(){
    $("#customCurrencySelection .hideMenu ul").slideToggle(500);
	if($("#customLanguageSelection .hideMenu ul").is(":visible")) {
	  $("#customLanguageSelection .hideMenu ul").hide();
	}
	if($("#customCountrySelection .hideMenu ul").is(":visible")) {
	  $("#customCountrySelection .hideMenu ul").hide();
	}
  });
  $("#customCountrySelection a").click(function(){
    $("#customCountrySelection .hideMenu ul").slideToggle(500);
	if($("#customLanguageSelection .hideMenu ul").is(":visible")) {
	  $("#customLanguageSelection .hideMenu ul").hide();
	}
	if($("#customCurrencySelection .hideMenu ul").is(":visible")) {
	  $("#customCurrencySelection .hideMenu ul").hide();
	}
  });
  
  
  
  $("#hideMenuUl li").click(function(){
    var $id = $(this).attr("id");
    showBigMenu($id);
  });


  
  
  displayError=function(errorText, container)
{
   var $alert = $('#alert');
    
  $alert.html('<p>'+errorText+'</p>');
  
    $alert.css({'opacity': .9});
    if($alert.length)
    {
      var alerttimer = window.setTimeout(function () {
                         $alert.trigger('click');
                       }, 5000);
      $alert.slideDown('fast')
		    .click(function () {
              window.clearTimeout(alerttimer);
                $alert.slideUp('fast');
              });
    }
     
  }
  
  
  
/**
* bigMenu
**/
  
  showBigMenu = function($region) {
    $("#bigMenu").slideToggle(400);
	$("#customCountrySelection .hideMenu ul").hide();
	$(".bigMenucontinentCountries").hide(100);
    $("#div"+$region).show("slide",{direction: 'right'});
    $(".bigMenuPrev").show();	
	$(".bigMenuNext").show();	
	$global.bigMenuLi = $region;
  }

  
  $(".bigMenuNext").click(function(){
    $("div.bigMenucontinentCountriesPanel").scrollTo('+=300px', '0px', {duration:100});
  });
  
  $(".bigMenuPrev").click(function(){
    $("div.bigMenucontinentCountriesPanel").scrollTo('-=300px', '0px', {duration:100});
  });
  
  $("#closeBigMenu").click(function(){
    $("#bigMenu").slideUp(400);
  });
  
  
  
});



  




$(window).load(function() {
  if($.browser.msie){
	/*$("#categorybox, .featuredboxtitle, .featuredboxmain, .featuredbox, .contentbox, .mostActiveUsers").liquidCanvas("[shadow{color:#C0C0C0} fill{color:#fff}] => roundedRect{radius:6}");
	
	$("#categorybox, .mostActiveUsers").css({"border":"0px", "padding-left":"5px", "padding-right":"5px"});
	
    $(".featuredbox, .contentbox").css({"border":"0px"});	
	*/
  }
  
}); 






