function switchmenu(types){
	var brand=document.getElementById("Brand");
	var categorise=document.getElementById("Categorise");
	var brand_Title=document.getElementById("Brand_Title");
	var categorise_Title=document.getElementById("Categorise_Title");
	if(types==0){
		brand.style.display="block";
		brand_Title.className="select";
		categorise.style.display="none";
		categorise_Title.className="click";
	}else{
		brand.style.display="none";
		brand_Title.className="click";
		categorise.style.display="block";
		categorise_Title.className="select";
	}
}
function show_categories(id,obj){
	var target=jQuery("#categories_"+id);
	if(target.css("display")=='none'){
		target.css("display","block");
		obj.src="ui/-.gif";
	}else{
		target.css("display","none");
		obj.src="ui/+.gif";
	}
}
function show_brands(id,obj){
	var target=jQuery("#brands_"+id);
	if(target.css("display")=='none'){
		target.css("display","block");
		obj.src="ui/-.gif";
	}else{
		target.css("display","none");
		obj.src="ui/+.gif";
	}
}
function ShowBrand(){
	var point=jQuery("#seeall").position();
	var _Menu=jQuery("#ShowBrand");
	if(_Menu.css("display")=="none"){
		_Menu.css({display:"block",left:point.left,top:point.top+jQuery("#seeall").height()-1});
	}else{
		_Menu.css({display:"none"})
	}
}
function ShowCategory(){
	var point=jQuery("#seeall").position();
	var _Menu=jQuery("#ShowCategory");
	if(_Menu.css("display")=="none"){
		_Menu.css({display:"block",left:point.left,top:point.top+jQuery("#seeall").height()-1});
	}else{
		_Menu.css({display:"none"})
	}
}


jQuery(document).ready(function(){
	jQuery("#Brand_Title").hover(
	function () {
		$(this).addClass("hover");
	},
	function () {
		$(this).removeClass("hover");
	}
	);
	jQuery("#Categorise_Title").hover(
	function () {
		$(this).addClass("hover");
	},
	function () {
		$(this).removeClass("hover");
	}
	);
	jQuery("#Categorise span li").hover(
	function () {
		$(this).addClass("ddhover");
	},
	function () {
		$(this).removeClass("ddhover");
	}
	);
	
	var showcase=QueryString("show");
	if(showcase==0){
		switchmenu(0);
	}
	if(showcase==1){
		switchmenu(1);
	}
	/*

	jQuery("#seebrand").hover(
	function () {
	$(this).addClass("hover");
	ShowBrand()
	},
	function () {
	$(this).removeClass("hover");
	ShowBrand()
	}
	);
	jQuery("#seecategory").hover(
	function () {
	$(this).addClass("hover");
	ShowCategory()
	},
	function () {
	$(this).removeClass("hover");
	ShowCategory()
	}
	);

	*/

});


function QueryString(fieldName)
{
	var urlString = document.location.search;
	if(urlString != null)
	{
		var typeQu = fieldName+"=";
		var urlEnd = urlString.indexOf(typeQu);
		if(urlEnd != -1)
		{
			var paramsUrl = urlString.substring(urlEnd+typeQu.length);
			var isEnd =  paramsUrl.indexOf('&');
			if(isEnd != -1)
			{
				return paramsUrl.substring(0, isEnd);
			}
			else
			{
				return paramsUrl;
			}
		}
		else
		{
			return null;
		}
	}
	else
	{
		return null;
	}
}