function strtolower( str ) {
    // http://kevin.vanzonneveld.net
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Onno Marsman
    // *     example 1: strtolower('Kevin van Zonneveld');
    // *     returns 1: 'kevin van zonneveld'
 
    return (str+'').toLowerCase();
}

// Content
function loadContent(file,Extra)
	{
	createCookie('activeContent',''+file+'',1);
	$("#data").load('/loader.php?id=' + file + '&extra=' + Extra);
	}
	
// LoadSpecs
function loadSpecs(Element,Group,Model)
	{
	lastModel = readCookie('activeSpec_' + Element + '');
	if(lastModel != '')
		{
		//$("#"+lastModel).css("text-decoration","none");
		$("#"+lastModel).css("color","#ffffff");
		}
	modelElement = strtolower( Model );
	$("#"+Element).load('/specsLoader.php?group=' + Group + '&model=' + Model);
	//$("#"+modelElement).css("text-decoration","underline");
	$("#"+modelElement).css("color","#ff0000");
	createCookie('activeSpec_' + Element + '',''+modelElement+'',1);
	}

function loadProds(group)
	{
	$('#prod1').load('/prodLoader.php?id='+group+'_1');
	$('#prod2').load('/prodLoader.php?id='+group+'_2');
	$('#prod3').load('/prodLoader.php?id='+group+'_3');
	}

$(document).ready(function() {
	$("a.anchorLink").anchorAnimate()
});

jQuery.fn.anchorAnimate = function(settings) {

 	settings = jQuery.extend({
		speed : 1100
	}, settings);	
	
	return this.each(function(){
		var caller = this
		$(caller).click(function (event) {	
			event.preventDefault()
			var locationHref = window.location.href
			var elementClick = $(caller).attr("href")
			
			var destination = $(elementClick).offset().top;
			$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() {
				window.location.hash = elementClick
			});
		  	return false;
		})
	})
}

