$(document).ready(function(){
	
	$("[id$='txtFindFast']").val("keyword");
	
	$("li ul.toggle_container").hide();
	$("li ul.open_container").hide();
	$("ul li.otherHeadings h5").addClass("show");
	var div_len=$("#hubLeft ul div").length;
	for(i=0;i<div_len-1;i++)
	{
	if($("#hubLeft ul div:eq("+ i +") li.otherHeadings h5 span").html().toLowerCase()=="diy topics" || $("#hubLeft ul div:eq("+ i +") li.otherHeadings h5 span").html().toLowerCase()=="spaces")
	{
	$("#hubLeft ul div:eq("+ i +") li.otherHeadings ul").show();
	$("#hubLeft ul div:eq("+ i +") h5").removeClass("show");
	}
	}
		

	$("a#home_Link").attr("class","homeLinkoff");

	//Switch the "Open" and "Close" state per click
	
	$("li.otherHeadings h5").toggle(function(){
	if($(this).attr("class")=="show")
		$(this).removeClass("show");
		else
		$(this).addClass("show");
		}, function () {
		if($(this).attr("class")=="show")
		$(this).removeClass("show");
		else
		$(this).addClass("show");
		
		
	});
	
	//Slide up and down on click
	$("li.otherHeadings h5").click(function(){
		$(this).next(".toggle_container").slideToggle("slow");
	});

	$("#hubLeft ul li.search_data div input").focus(function(){
		if($(this).val()=="keyword")
		$(this).val("");
	});
	$("#hubLeft ul li.search_data div input").blur(function(){
		if($(this).val()=="")
		$(this).val("keyword");
	});
	
	$("#hubLeft ul div li ul li:last-child").css("border",0);
	$("#hubRight .pagination .comment_paging a:first").addClass("paging-First");
	$("#ctl00_MainContent_pnlBottomPaging a:first").addClass("paging-First");
	$("#hubRight .pagination").css("height","28px");
	
	$("#search-main-wrapper .misspelled-redox span a").click(function(){
	$("#search-main-wrapper .misspelled-redox").hide();
	return false;
	});
	
	//$("#hubRight .pagination ul.left li a.pageSelected, #hubRight .pagination .comment_paging a.paging-First,#ctl00_MainContent_pnlBottomPaging a.paging-First").attr("href","#");
	//$("#hubRight .pagination ul.left li a.pageSelected, #hubRight .pagination .comment_paging a.paging-First,#ctl00_MainContent_pnlBottomPaging a.paging-First").click(function(){
	//return false;
	//});
	$("#hubRight a.pageSelected").attr("href","#");
	$("#hubRight a.pageSelected").click(function(){
	return false;
	});
	//if(($("a.paging-First").html()).indexOf("1")>-1)
	//$("a.paging-First").css("cursor","text");

	$('a').focus(function(){
   	  $(this).blur();
	});
	var clr;
	$(".Spot01-Ad,.spot02, .spot3").click(function(){
		location.href = $("." + $(this).attr("class") + " .imageContent a").attr("href"); 
		
		});
	$(".spot01").click(function(){
		
		location.href = $("." + $(this).attr("class") + " .imageContentAdspot0 a").attr("href");
		});
		
		$(".Spot01-Ad,.spot01,.spot02, .spot3").hover(function(){
		$("." + $(this).attr("class") + " .heading h3 a").css("text-decoration","underline");
		$("." + $(this).attr("class") + " .headingAdsopt0 h3 a").css("text-decoration","underline");
		$("." + $(this).attr("class") + " .generalText p").css("text-decoration","underline");
		$("." + $(this).attr("class") + "  p").css("text-decoration","underline");
		clr=$("." + $(this).attr("class") +" ul").css("background-color");
		//alert(clr);
		if (clr=="rgb(237, 245, 247)" || clr=="#edf5f7")
		{
		$("." + $(this).attr("class") +" ul").css("background-color","#D5E8EC");		
		}
		else if (clr=="rgb(246, 242, 230)" || clr=="#f6f2e6")
		{
		$("." + $(this).attr("class") +" ul").css("background-color","#EDE4CB");		
		}

		
		},
		function()
		{
		$("." + $(this).attr("class") + " .heading h3 a").css("text-decoration","none");
		$("." + $(this).attr("class") + " .generalText p").css("text-decoration","none");
		$("." + $(this).attr("class") + " .headingAdsopt0 h3 a").css("text-decoration","none");
		$("." + $(this).attr("class") + " p").css("text-decoration","none");
		//alert(clr);
		$("." + $(this).attr("class") + " ul").css("background-color",clr);
		}
		);

});
