
	/* FUNCTIONS TO LOAD WHEN DOCUMENT IS READY
	----------------------------------------------------------------*/
	!$(document).ready(function()
	{
		if(document.getElementById("home-flash")) {
			detect_flash();
	    	load_flash('home-flash', '/swf/home_carroussel.swf', 705, 238, 9);
	    }
		ClearInputEvents('searchfield');
		ClearInputEvents('resultsearchfield');
		ClearInputEvents('cta-email');
		ClearInputEvents('newsletter');
	/*	
		$("#nav-sub a").click(function () { 
			if($(this).siblings($("ul")).length > 0) {
				$(this).siblings($("ul")).toggle();
				return false;
			} else {
				return true;	
			}
		});
	*/
		TabSwitch();
		
		$('a[@rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
		
		if(window.alphaPNG) alphaPNG();
	});
	
	/* CLEAR INPUT ON FOCUS
	----------------------------------------------------------------*/
	function ClearInputEvents(id) {
		obj = document.getElementById(id);
		if(obj != null) {
		
			if(obj.value) { 
				obj.startvalue = obj.value;
				obj.onfocus = function() { if(this.value == this.startvalue) { this.value = '';}}
				obj.onblur =  function() { if(this.value == '') { this.value = this.startvalue; }}
			} else {  
				val = ''; 
			}
		}
	}
	
	/* TAB SWITCH ON PRODUCT-DETAILS
	----------------------------------------------------------------*/
	function TabSwitch()
	{
		$(".tab-a a").click(function() {
			$('#tab-a').show();
			$('#tab-b').hide();
			$('.tab-a').addClass('active-a');
			$('.tab-b').removeClass('active-b');
			return false;
		});
		$(".tab-b a").click(function() {
			$("#tab-a").hide();
			$("#tab-b").show();
			$('.tab-a').removeClass('active-a');
			$('.tab-b').addClass('active-b');
			return false;
		});
	}