jQuery(document).ready(function(){

/* init lightbox */

jQuery("a[rel=lightbox]").fancybox({
	'zoomSpeedIn'	:	500,
	'zoomSpeedOut' :	500,
	'hideOnContentClick': false,
	'frameWidth': 840,
	'frameHeight': 400
});



// initialize scrollable 
jQuery("div.scrollable").scrollable(
{
 size: 4
}
).mousewheel(); 


if(jQuery('#enable_date').attr('value') == 0)jQuery('div.date > select').attr('disabled','disabled');
if(jQuery('#enable_time').attr('value') == 0)jQuery('div.time > select').attr('disabled','disabled');
if(jQuery('#enable_weight').attr('value') == 0)jQuery('input#weight').attr('disabled','disabled');
if(jQuery('#enable_height').attr('value') == 0)jQuery('input#height').attr('disabled','disabled');

jQuery('#enable_date').change(function(){
if(jQuery('div.date > select').attr('disabled'))jQuery('div.date > select').attr('disabled','');
else jQuery('div.date > select').attr('disabled','disabled');
});

jQuery('#enable_time').change(function(){
if(jQuery('div.time > select').attr('disabled'))jQuery('div.time > select').attr('disabled','');
else jQuery('div.time > select').attr('disabled','disabled');
});

jQuery('#enable_weight').change(function(){
if(jQuery('input#weight').attr('disabled'))jQuery('input#weight').attr('disabled','');
else jQuery('input#weight').attr('disabled','disabled');
});

jQuery('#enable_height').change(function(){
if(jQuery('input#height').attr('disabled'))jQuery('input#height').attr('disabled','');
else jQuery('input#height').attr('disabled','disabled');
});

// select all desired fields and attach tooltips to them 
jQuery("input[title]").tooltip({ 
    // place tooltip on the right edge 
    position: "center right",  
    // a little tweaking of the position 
    offset: [-2, 10],  
    // use the built-in fadeIn/fadeOut effect 
    effect: "fade",  
    // custom opacity setting 
    opacity: 1,  
    // use this single tooltip element 
    tip: '.tooltip'  
});
jQuery("div[title]").tooltip({ 
    // place tooltip on the right edge 
    position: "center right",  
    // a little tweaking of the position 
    offset: [-2, 10],  
    // use the built-in fadeIn/fadeOut effect 
    effect: "fade",  
    // custom opacity setting 
    opacity: 1,  
    // use this single tooltip element 
    tip: '.tooltip'  
});
jQuery("select[title]").tooltip({ 
    // place tooltip on the right edge 
    position: "center right",  
    // a little tweaking of the position 
    offset: [-2, 10],  
    // use the built-in fadeIn/fadeOut effect 
    effect: "fade",  
    // custom opacity setting 
    opacity: 1,  
    // use this single tooltip element 
    tip: '.tooltip'  
});
jQuery("textarea[title]").tooltip({ 
    // place tooltip on the right edge 
    position: "center right",  
    // a little tweaking of the position 
    offset: [-2, 10],  
    // use the built-in fadeIn/fadeOut effect 
    effect: "fade",  
    // custom opacity setting 
    opacity: 1,  
    // use this single tooltip element 
    tip: '.tooltip'  
});
})