$(document).ready(function () {

	// tweak for menu
	$('.mainMenu .bc').parents('table').prev().addClass('sel');
	$('.mainMenu span').mouseover(function () { return false; })
	$('.mainMenu span').mouseout(function () { return false; })
	$('.mainMenu table').remove();

	// Hide ContentTop box for Login
	if (/\/Login\//.test(window.location)) {
    $('#ContentTop').hide();
}
	
	// remove tilda for Article category
	$("span.dnnwerk_NewsCategories>a[href^='~']")
	   .each(function()
	   { 
	      this.href = this.href.replace(/.*~/, "");
	   }); 


	//remove this text "News Feeds (RSS)" and "NILU i media"
	var rssDiv = $('.rss_feed > div');
	if (rssDiv.length){
	var a = "News Feeds (RSS)";
	var b = "NILU i media";

	var temp = rssDiv.html().replace(a, "").replace(b, "");
	$(".rss_feed > div").html(temp);
}
	
	//Toogle functionality for RSS feed 
	var path = '.rss_feed>.normal';
	var lineNr = 4;
	var i = 0;
	jQuery.each($(path+'>div.rss'), function() {
		i++;
		if(i > lineNr)
		{
		 $(this).addClass('toogle').hide();
		}
		
	});
	if(i > lineNr) {
		$(path).append('<br/><a href="" id="toogle">Vis flere</a>');
	}

	$('#toogle').click(function() {
		$('.rss_feed .toogle').slideToggle('fast', function() {
			// animation complete.
		});
		return false;
	});

	// Inform user that IE6 and below is not supported
	if ($.browser.msie && $.browser.version.substr(0,1)<7) {
		alert('This site does not support IE6 and bellow. Please use IE7+, Firefox, Opera or Chrome');
	}
	




//	// tweak for google search
//	$("#Search td.gsc-search-button").click(function () {
//		alert("tst");
//		$('#Content').hide();
//	});

//	$("#Search td.gsc-search-button").submit(function () {
//		alert("tst");
//		$('#Content').hide();
//	});

//	$("#Search input=['submit']").hide();

});
