
jQuery.noConflict();


jQuery(document).ready(function(){

	jQuery("#tab_nytt").click(function(){
		jQuery("#content_nytt").show();
		jQuery("#tab_nytt").removeClass("inactive");
		jQuery("#tab_nytt").addClass("active");
		jQuery("#content_topp").hide();	
		jQuery("#tab_topp").removeClass("active");
		jQuery("#tab_topp").addClass("inactive");		
	})
	
	
	jQuery("#tab_topp").click(function(){
		jQuery("#content_nytt").hide();
		jQuery("#tab_nytt").removeClass("active");
		jQuery("#tab_nytt").addClass("inactive");
		jQuery("#content_topp").show();	
		jQuery("#tab_topp").removeClass("inactive");
		jQuery("#tab_topp").addClass("active");
	})
	
	
	ShareThis();	

	jQuery("#TM_Grupper").hover(function(){
 			jQuery("#Grupper").show();
		},
		function(){
			jQuery("#Grupper").hide();
 	});
 	
 	jQuery("#TM_Brands").hover(function(){
 			jQuery("#Brands").show();
		},
		function(){
			jQuery("#Brands").hide();
 	});

});


ShareThis = function()
{
	var loc = document.location.href;
	var titles = document.getElementsByTagName("title");
	var tCount = titles.length;
	var title = "";
	if (tCount > 0)
	{
		title = titles[0].innerHTML;
	}
	
	var container = document.createElement("div");
	var ul = document.createElement("ul");
	container.id = "share_div";

	
	var fb = document.createElement("li");
	fb.innerHTML = '<a rel=\"nofollow\" target=\"_blank\" href=\"http://www.facebook.com/share.php?u=' + loc + '&amp;t='+title+'\" title=\"Facebook\"><img src=\"/bilder/facebook.png\" title=\"Facebook\" alt=\"Facebook\" /></a>';
	
	var twit = document.createElement("li");
	twit.innerHTML = '<a rel=\"nofollow\" target=\"_blank\" href=\"http://twitter.com/home?status=' + loc +'\" title=\"TwitThis\"><img src=\"/bilder/twitter.gif\" title=\"TwitThis\" alt=\"TwitThis\" /></a>';
	
	var bloggy = document.createElement("li");
	bloggy.innerHTML = '<a rel=\"nofollow\" target=\"_blank\" href=\"http://www.pusha.se/posta?url=' + loc + '&amp;title=' + title + '\" title=\"Pusha\"><img src=\"/bilder/pusha.png\" title=\"Pusha\" alt=\"Pusha\"></a>';
	var pusha = document.createElement("li");
	pusha.innerHTML = '<a rel=\"nofollow\" target=\"_blank\" href=\"http://bloggy.se/home?status=' + title + '+' + loc + '\" title=\"Bloggy\"><img src=\"/bilder/bloggy.png\" title=\"Bloggy\" alt=\"Bloggy\" ></a>';
	var mail = document.createElement("li");	
	mail.innerHTML = '<a rel=\"nofollow\" target=\"_blank\" href=\"mailto:?subject=' + title + '&amp;body=' + loc + '\" title=\"Maila sidan\"><img src=\"/bilder/email_link.png? title=\"Maila sidan!\" alt=\"Maila sidan\"></a>';
	ul.appendChild(fb);
	ul.appendChild(bloggy)
	ul.appendChild(twit)
	ul.appendChild(pusha)
	ul.appendChild(mail)	
	container.appendChild(ul);
	var br = document.createElement("br");
	br.className = "clearer";
	container.appendChild(br);
	var dela = document.getElementById("delameddig");
	if (dela){dela.appendChild(container);}
	
}
