$(document).ready(function() {
	//external links
	$('A[rel="external"]').click( function() {
		window.open( $(this).attr('href') );
		return false;
	});

	$("#header UL.navigation LI").hover(function() {
			$(this).addClass('hover');

		}, function() {
			$(this).removeClass('hover');
	});

	$("#article UL.photos").click( function(e) {
		var path = $(e.target).attr("src");
		var current_photo_src = $("#current-photo").attr("src");
		$("#current-photo").attr("src", path.substr(0, path.length - 6)+".jpg");
		//console.log(current_photo_src);
		$(e.target).attr("src", current_photo_src.substr(0, current_photo_src.length - 4)+"-1.jpg");
		return false;
	});

	$('#content INPUT[name="chk1"]').click( function() {
		var current_id = $(this).attr('value');

		$('#content FORM.kontakt DIV').addClass('hide');
		$('#content #'+current_id).removeClass('hide');

	});

	// Disabling right click
	var hashes = window.location.href.split('/');
	if (hashes[hashes.length-2] != 'banners') {
		$(document).bind("contextmenu",function(e){
			return false;
		});
	}

	// IE6 Absolute Positioning Images
	/*if($.browser.msie && $.browser.version=="6.0") {
		var self = $('#content span.b-dark, #content span.b-light');
		if(self.length > 0) {
			$.each(self, function() {
				var e = $(this);
				var eWidth = e.width();
				var eHeight = e.height();
				self.width(eWidth).height(eHeight);
				$('#content span.b-dark span, #content span.b-light span').width(eWidth-16).height(eHeight-16);
			});
		}
	}*/

        $('form.kontakt dl dd select').change(function() {
            //console.log($(this).attr('option'));
            //console.log($(this).children('option:selected').val());
            if (parseInt($(this).children('option:selected').val()) == 3) {
                $(this).next('.other').addClass('selected');
            } else {
                $(this).next('.other').removeClass('selected');
            }
        });

});
