var currentSec = "";
jQuery(function(){
		
	if (currentSec == "" || currentSec == "wetsuits"){controlSec = 1;};
	if (currentSec == "lycras"){controlSec = 2;};
	if (currentSec == "accessories"){controlSec = 3;};
	
	// THICKBOX INIT
	jQuery('a.thickbox,.ngg-gallery-thumbnail a').thickbox();		
	
	// STRIPING
	jQuery(".menulist li:even,.sizechart tr:odd").addClass("alt");		
	
	// FORMS
	jQuery("input.stdinput,textarea.stdinput").focus(function() {jQuery(this).addClass("stdinput-sel");}).blur(function() {jQuery(this).removeClass("stdinput-sel");});
	
	// AUTO OVER
	jQuery(".bloglines li,.apparel-thumbs li,.vcard,.products-thumbs li").mouseover(function() {jQuery(this).addClass("over");}).mouseout(function() {jQuery(this).removeClass("over");});
	
	// EASY FORMS
	jQuery(".easy-form").EasyForms();

	// UI
	if (jQuery('#photodetail-tabs').size() > 0) {jQuery('#photodetail-tabs').tabs();}
	if (jQuery('#productlist').size() > 0) {jQuery('#productlist').accordion({ active: controlSec-1});}
	
	// TOOLTIPS 
	jQuery(".OTip").hover(function(){OT_show(this.id,this.alt)},function(){jQuery('#OT').remove()}).click(function(){return false});		
	jQuery('.jtip_desc').hide();
	
	/*jQuery("#search-marca").hide();*/	
	/*jQuery(".login-btn").click(function() {jQuery("#loginbar").slideToggle("slow");return false;});*/

});

function TB_show(caption, url){
	//jQuery.fn.thickbox.tb_manual_show(caption, url);
	//jQuery.thickbox.tb_show(caption, url);
	//console.log("HIT");
	//return false;
}


/*
 * More usable Forms 
 * Copyright (c) 2009  Oliver Astrologo
 * Dual licensed under MIT and GPL.
 * @author  Oliver Astrologo
 * @version 2.3
 */

jQuery.fn.EasyForms=function(){
this.submit( function() {
			var submitForm = this;
			jQuery(submitForm).find("label").not(".radiolabel").each(function(){
				var current=jQuery(this);
				var targetForm =  jQuery('#'+current.attr("for"));				
				if (targetForm.val() == current.html()){
				targetForm.val('');
				};																			  
			});
		return true;
	});	
	this.find("label").not(".radiolabel").each(function(){
		var current=jQuery(this);		
		var targetForm = jQuery('#'+current.attr("for"));	   
	   if (targetForm.val() == ''){
			targetForm.val(current.html());		
			}	   
	   targetForm.click(function(){		
		if (jQuery(this).val() == current.html()){
			jQuery(this).val('');			
			}
		});
		targetForm.blur(function(){		
		if (jQuery(this).val() == ''){
			jQuery(this).val(current.html());			
			}
		});
		current.hide();	
	});			
}