/**
 * protherm.js
 *
 * @version 1.0
 * @package protherm.nl
 * @author  a.j.de vries
 *
 * Copyright (c) Malibomba
 * IT IS NOT ALLOWED TO USE OR MODIFY ANYTHING OF
 * THIS CODE, WITHOUT THE PERMISION OF THE AUTHOR.
 * Info? Mail to info@malibomba.com
 */
//<![CDATA[
/**
 * ADD REQUIRED SCRIPTS:
 ----------------------------------------------------------*/
var words = [];
var required = [
	'words.js.php',
	'clearbox.js',
	'swfobject.js',
	'jquery.easing.js',
	'jquery.dimensions.js',
	'slider.js',
	'clearbox.js',
	'jquery.autocolumn.js',
	'jquery.accordion.js'
];

if( (scripts = document.getElementsByTagName('script')) !== null ) {
	for( var i = 0, len = scripts.length; i < len; i++ ) {
		if( scripts[i] && scripts[i].src.match(/protherm\.js(\?.*)?$/) ) {
			var path = scripts[i].src.replace(/protherm\.js(\?.*)?$/, '');
			for( var x = 0, len = required.length; x < len; x++ ) {
				document.write('<script type="text/javascript" src="' + (path + required[x]) + '"></script>');
			}
		}
	}
}


/**
 * UTILITIES:
 ----------------------------------------------------------*/
function word() {
	var re;
	var args = arguments;
	var word = words[args[0]];
	if( word !== undefined ) {
		for(var x = 1; x < args.length; x++) {
			re = new RegExp('#' + x);
			word = word.replace(re, args[x]);
		}
		return word;
	}
}



 $(document).ready( function(){
		$("#accordion").accordion({
			header: 'div.prod_title',
			active: false,
			alwaysOpen: false,
			animated: false,
			autoheight: false,
			navigation: true
		}).bind("change.ui-accordion", function(event, ui) {
			 $('.toggle_more', ui.newHeader).toggle();
		} );


		$("#qs").focus(function() {
		  $(this).val("");
		});

		$('.wide').columnize({columns:2});


		$('#lofslidecontent45').lofJSidernews( {interval:4000,
											   direction:'opacity',
											   duration:1000,
											   easing:'easeInOutSine'} );

	});


/**
 * BACKGROUND SIDE BAR:
 ----------------------------------------------------------*/

	var scrollSpeed = 100;       // Speed in milliseconds
	var step = 1;               // How many pixels to move per step
	var current = 0;            // The current pixel row
	var imageHeight = 1214;     // Background image height
	var headerHeight = 250;     // How tall the header is.

	var restartPosition = -(imageHeight - headerHeight);

	function scrollBg(){
		current -= step;
		if (current == restartPosition){
			current = 0;
		}
		$('#lc-sidebar').css("background-position", +current+"px 100%");
	}
	var init = setInterval("scrollBg()", scrollSpeed);

//]]>
