$(document).ready(function(){

	if (location.href.indexOf('lingeriebutikken.dk') != -1){
		$('#ShopLayOut_SpaceTop_TD').css('background-image',$('#ShopLayOut_SpaceTop_TD').css('background-image').replace("background-logo.jpg","background-logo-lingerie.jpg"))
	}

	if (location.href.indexOf('lingeriebutikken.dk') != -1){$('.rightpic').css('background-image','url(../design/background-top-right-lingerie.jpg)');}







	// PNGFIX LAVEDE MØG I VORES CHECKMARKS, DERFOR DENNE
	$('#ContentContainer_TBL .box2 li').each(function(){
	
		$(document.createElement('img'))
			.css('position', 'absolute')
			.css('left', parseInt($(this).offset().left + 7) + 'px')
			.css('top', parseInt($(this).offset().top + 3) + 'px')
			.css('width', '18px')
			.css('height', '21px')
			.attr('src', '../design/ckeck.png')
			.prependTo('body');
	
	})
	

	// KØR PNGFIX
	$(function(){$(document).pngFix();});


	// REBIND ALERT BOXES
	window.alert = function(txt){

		// SPECIFIKT FOR LAGT I KURVEN ALERT
		if (txt.indexOf('Varen er nu tilføjet til kurven') != -1){
//		if (txt == 'Varen er nu tilføjet til kurven.') {
			window.scrollTo(1, 1);
			$('#basketid img').attr({src : '/design/gaa-til-kurven-animation.gif'});
		}
	
		// VIS ALERTS I FACEBOX
		$.facebox(txt);
	
	}
	

	// NO RIGHTCLICK
	$('#Canvas').noContext();
	$('#Selector').noContext();
	$('.ProductImage img').noContext();
	//$.facebox('Copyright 2009 - Lingeributikken.dk');


	// FJERN <br>'S I MENU
	$('.RootCategory_Productmenu br').css('display', 'none');
	$('#Table50 tr:first-child').css('display', 'none');


	// INDKØBSKURV
	var basket		= document.createElement('div');
		basket.id	= 'basketid';
	
	$(basket).html($('.NumberProduct_Basket span')
		.html())
		.css('margin-left', '620px')
		.css('margin-top', '-16px')
		.css('cursor', 'pointer')
		.css('height', '40px')
		.css('width', '300px')
		.appendTo('.cards');

	$('#basketid').click(function(){
		location.href = '/shop/showbasket.html';
	});
	
	
	// DESVÆRRE TJEK PÅ USERAGENT :(
	if ($.browser.name == 'chrome')
	{
		$('#ContentContainer_TBL .box2 li img').each(function(){
			$(this).css('top', parseInt($(this).offset().top + 16) + 'px')
		});
	}

	if ($.browser.name == 'safari' || $.browser.name == 'chrome')
	{
		$('#ShopLayOut_ProductMenu_TD').css('padding-top', '10px');
	}

	if ($.browser.name == 'msie' || $.browser.name == 'firefox')
	{
		$('#ShopLayOut_ProductMenu_TD').css('padding-top', '26px');
	}


	// TOPMENU
	$('#topmenu a').mouseout(function(){
		classname = $(this).attr('class');
	
		switch(classname.toLowerCase()) {
			case 'lingeri':
				if (getCookie('RootCat') != 372) $(this).css('background-image', 'none')
				break;

			case 'xxlingeri':
				if (getCookie('RootCat') != 112) $(this).css('background-image', 'none')
				break;

			case 'kostumer':
				if (getCookie('RootCat') != 320) $(this).css('background-image', 'none')
				break;	

			case 'herre':
				if (getCookie('RootCat') != 250) $(this).css('background-image', 'none')
				break;

			case 'kjoler':
				if (getCookie('RootCat') != 292) $(this).css('background-image', 'none')
				break;	

			case 'sexlegetoej':
				if (getCookie('RootCat') != 392) $(this).css('background-image', 'none')
				break;	

			case 'smykker':
				if (getCookie('RootCat') != 506) $(this).css('background-image', 'none')
				break;	

			default:
		}
	})

	$('#topmenu a').mouseover(function(){
		classname = $(this).attr('class');
	
		switch(classname.toLowerCase()) {
			case 'lingeri':
				$(this).css('background-image', 'url(../design/1/background_menu.gif)')
				break;

			case 'xxlingeri':
				$(this).css('background-image', 'url(../design/2/background_menu.gif)')
				break;

			case 'kostumer':
				$(this).css('background-image', 'url(../design/3/background_menu.gif)')
				break;	

			case 'herre':
				$(this).css('background-image', 'url(../design/4/background_menu.gif)')
				break;

			case 'kjoler':
				$(this).css('background-image', 'url(../design/6/background_menu.gif)')
				break;	

			case 'sexlegetoej':
				$(this).css('background-image', 'url(../design/5/background_menu.gif)')
				break;	

			case 'smykker':
				$(this).css('background-image', 'url(../design/7/background_menu.gif)')
				break;	

			default:
		}
	})


});