/*
function initMenu() {

  $('.widget_pages ul li ul').hide();
  
  $('.widget_pages ul .current_page_parent ul').show();
  
  
  $('.widget_pages li a').click(
    function() {
  /*    var checkElement = $(this).next();
      if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
		  checkElement.slideUp('normal');
        return false;
        }
      if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
        $('.wpsc_category_3 ul:visible').slideUp('normal');
        checkElement.slideDown('normal');
        return false;
        }
      }
	 */
	 	
		 /*	var checkElement = $(this).next();
			
			if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
				
				checkElement.slideUp('normal');
				checkElement.find('ul').hide();
				return false;
			 }
			
			
			if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
				checkElement.parent().parent().find('ul').slideUp('slow');	
				$('.widget_pages ul ul:visible').slideUp('normal');
				checkElement.slideDown('normal');
				
				return false;	
			}
			
			 
		}
    );
  }*/
  function initMenu(id) {
  $(id + " ul li").children('ul').hide();
  
   $(id + " ul li:has('ul')").prepend('<img class="trans" src="http://' + document.location.hostname + '/wp-content/themes/CorporateSandbox/images/bullet_toggle_plus.png">');
 //  $(id + " ul li:not(:has('>ul'))").prepend('<img class="trans" src="http://' + document.location.hostname + '/wp-content/themes/CorporateSandbox/images/tranparent.jpg">');
  $(id + " > ul > li:not(:has('ul'))").find('a').addClass("no_subcats");
  $(id + ' .current_page_ancestor>img').attr('src', 'http://' + document.location.hostname + '/wp-content/themes/CorporateSandbox/images/bullet_toggle_minus.png');
  
  $(id + ' .current_page_parent').parent('ul').show();
  $(id + ' .current_page_parent').children('ul').show();
  $(id + ' .current_page_parent>img').attr('src', 'http://' + document.location.hostname + '/wp-content/themes/CorporateSandbox/images/bullet_toggle_minus.png');
  
  $(id + ' .current_page_item').children('ul').show();
  $(id + '.current_page_item>img').attr('src', 'http://' + document.location.hostname + '/wp-content/themes/CorporateSandbox/images/bullet_toggle_minus.png');
  
  $(id + ' ul li img').click(
		function() {
		  var checkElement = $(this).next().next();
		  var subEmlement = null;
			  if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
				  checkElement.slideUp('normal');
				  checkElement.find('ul').hide();
				  $(this).attr('src', 'http://' + document.location.hostname + '/wp-content/themes/CorporateSandbox/images/bullet_toggle_plus.png');
				return false;
				}
			  if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
/*					$(this).parents('li').parents('ul:visible').slideUp('normal');*/
				checkElement.parent().parent().find('ul').slideUp('slow');
				checkElement.slideDown('slow');
				
				checkElement.parent().parent().find('img').attr('src', 'http://' + document.location.hostname + '/wp-content/themes/CorporateSandbox/images/bullet_toggle_plus.png');
				
				$(this).attr('src', 'http://' + document.location.hostname + '/wp-content/themes/CorporateSandbox/images/bullet_toggle_minus.png');
				}
		  }
    );
  }
  
