function rp_preLoad() {
	rp_preloadImgs('fileadmin/templates/img/', 'promo_map_mo.jpg');
	rp_preloadImgs('fileadmin/templates/img/', 'icons_active.gif');
	rp_preloadImgs('fileadmin/templates/img/splash/', 'home.jpg', 'standard.jpg', 'werkzeug.jpg', 'diy.jpg', 'technik.jpg', 'werbung.jpg', 'spezial.jpg');
}

function rp_preloadImgs() {
	var d=document;
	if(d.images) {
		if(!d.rp_p) d.rp_p=new Array();
		var i,j=d.rp_p.length,a=rp_preloadImgs.arguments;
		var sPath = a[0];
		for(i=1; i<a.length; i++)
		if (a[i].indexOf("#")!=0){
			d.rp_p[j]=new Image;
			d.rp_p[j++].src= sPath+a[i];
		}
	}
}

function show(name, page_name, flag)
{
	if (flag == '0')
	{
		document.getElementById('splash').style.backgroundImage = "url(fileadmin/templates/img/splash/" + name + ".jpg)";
	}
	else
	{
		document.getElementById('splash').style.backgroundImage = "url(fileadmin/templates/img/splash/" + page_name + ".jpg)";
	}
}

function intPages(flag)
{
	if (flag == '0') {
		document.getElementById('ipages').style.backgroundImage = "url(fileadmin/templates/img/promo_map.jpg)";
	}
	else {
		document.getElementById('ipages').style.backgroundImage = "url(fileadmin/templates/img/promo_map_mo.jpg)";
	}
}

var img_path = 'fileadmin/templates/img/splash/';
var page_name = 'home';

$(document).ready(function() {
                  rp_preLoad();
                  

                  $('#menutop li a').hover(
                                           function() {
                                           var name = $(this).attr('class');
                                           $(this).addClass('hover');                                          
                                           $('#splash').css('background-image', 'url('+img_path+name+'.jpg)');
                                           },
                                           function() {
                                           $(this).removeClass('hover');
                                           $('#splash').css('background-image', 'url('+img_path+page_name+'.jpg)');
                                           }
                                          );
                  });

