// JavaScript Document
jQuery(document).ready(function(){
		jQuery.ajax({
				url:"loadmenu.php",
				type:"GET",
				success:function(data) {
					//alert(data);
					jQuery("#menu_nav").html(data);
				},
				async:false
		});
		
		//jQuery("ul").css("list-style-image","url(images/rightarrow.png)");
		
		jQuery(".pcparkmenuname").click(function(){
			
			if (jQuery(this).parent('li').is("li[link=true]"))
			{
				/*if(jQuery(this).children("img").attr("src") == "images/rightarrow.png")
				{
					jQuery(this).children("img").attr("src","images/downarrow.png")
				} else
				{
					jQuery(this).children("img").attr("src","images/rightarrow.png")
				}*/
				
				var menu = jQuery(this).next("ul");
				//menu.toggle("slow");
				
				if (location.pathname.indexOf("productdetails.php")>=0)
				{
					window.location = "products.php?category_id=" + jQuery(this).attr("category") + "&link=1&target="+jQuery(this).parent('li').attr("target");
				} else
				{
					jQuery.ajax(
						{type:"GET",
						 url:jQuery(this).parent('li').attr("target"),
						 data:{"category_id":jQuery(this).attr("category")},
						 success:function(data){jQuery("#product-listing-content").html(data);},
						 async:false
						}
					);
				}
			} else			
			if (jQuery(this).parent('li').is("li[role=node]"))
			{
				
				/*if(jQuery(this).children("img").attr("src") == "images/rightarrow.png")
				{
					jQuery(this).children("img").attr("src","images/downarrow.png")
				} else
				{
					jQuery(this).children("img").attr("src","images/rightarrow.png")
				}*/
				
				var menu = jQuery(this).next("ul");
				//menu.toggle("slow");
			} else
			{
				//alert(jQuery(this).attr("category"));
				/*jQuery.ajax({url:"getproducts.php",
							 data:{"category_id":jQuery(this).attr("category")},
							 success:function(data){jQuery("#content-center").html(data);},
							 async:false
				});*/
				
				window.location = "products.php?category_id=" + jQuery(this).attr("category");
				
				/*jQuery.get({url:"products.php",
							 data:{"category_id":jQuery(this).attr("category")},
							 success:function(data){jQuery("#content-center").html(data);},
							 async:false
				});*/
			}

			/*agent = jQuery.browser;
			if(agent.msie) {
				event.cancelBubble = true;
			} else {
				event.stopPropagation();
			}*/
			return false;
		});
	});
