// JavaScript Document

// INPUT ONCLICK SCRIPT-->
function clearText(field){
	if (field.defaultValue == field.value) {
		field.value = '';
		field.className='click';
	} else if (field.value == '') {
		field.value = field.defaultValue;
		field.className='blur';
}
}

// DATEPICKER
$(function() {
	$(".datepicker").datepicker({minDate: 1, dateFormat: 'dd/mm/yy'});
});

// JSCROLLPANE
$(function(){
	if ($('.scroll-pane').length) {
	  $('.scroll-pane').jScrollPane({showArrows: true});
	}
});


$(document).ready(function(){ 
	
	var flashvars = {
		xmlfile: $('#slideshowxml').val(),
		xmlfiletype: "Default"
	}
	
	var params = {
		wmode: "transparent",
		allowfullscreen: "true"
	}        
	
	var attributes = {}
	if ($('#slider').length) {
		swfobject.embedSWF("gallery.swf", "slider", "600", "365", "9.0.45", false, flashvars, params, attributes);
		swfobject.createCSS("#slider","outline:none");
	}
	
	
	// FANCYBOX
	if ($('.zoom1').length) {
	  $(".zoom1").fancybox({
		  titlePosition			: 'inside',
		  'transitionIn'			: 'fade',
		  'transitionOut'			: 'fade',
		  centerOnScroll          : true
	  });
	}
	if ($(".page").length) {
		$('.page').fancybox({
			'width'				: '75%',
			'height'			: '75%',
			'autoScale'     	: false,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'				: 'iframe'
		});
	}
	if ($(".alert").length) {
	  $('.alert').fancybox({
		  'transitionIn' : 'fade',
		  'transitionOut' : 'fade',
		  centerOnScroll : true,
		  overlayShow :	true
	  });
	}
	
}); 
