/* box header und footer werden zufällig ausgewählt */
imgpath = '/fileadmin/includes/themes/kommunikarriere/images/boxes/';
//
jQuery.shuffleboxes = function(){
	for( var i = 0; i<arguments.length; i++ ){
		myclass = arguments[i];
		// breite boxen
		jQuery('#main div.'+arguments[i]).each(			
			function(j){
				myself = $j(this);
				randhead = Math.round( Math.random() )+1; // 1 oder 2
				randfoot = Math.round( Math.random() )+1; // 1 oder 2
				imgheadname =  imgpath + 'boxheader-bg-breit-' + myclass + '-' + randhead + '.gif';
				imgfootname =  imgpath + 'boxfooter-bg-breit-' + randfoot + '.gif';
				//alert( imgname );
				myself.find('h2').css('background-image','url(' + imgheadname + ')' );
				myself.find('.cfooter').css('background-image','url(' + imgfootname + ')' );				
			}
		);
		// schmale boxen
		jQuery('#right div.'+arguments[i]).each(			
			function(j){
				myself = $j(this);
				randhead = Math.round( Math.random() )+1; // 1 oder 2
				randfoot = Math.round( Math.random()*3 )+1; // 1,2,3 oder 4
				imgheadname =  imgpath + 'boxheader-bg-breit-' + myclass + '-' + randhead + '.gif';
				imgfootname =  imgpath + 'boxfooter-bg-schmal-' + randfoot + '.gif';
				//alert( imgname );
				myself.find('h2').css('background-image','url(' + imgheadname + ')' );
				myself.find('.cfooter').css('background-image','url(' + imgfootname + ')' );				
			}
		);
	}
}
//
$j(document).ready(function(){
	$j.shuffleboxes(
		'branche',
		'arbeitsplatz',
		'karriere',
		'wissen',
		'diskussion',
		'downloads',
		'neutral'
	);
});