
// usage: log('inside coolFunc', this, arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
  log.history = log.history || [];   // store logs to an array for reference
  log.history.push(arguments);
  if(this.console) {
    arguments.callee = arguments.callee.caller;
    var newarr = [].slice.call(arguments);
    (typeof console.log === 'object' ? log.apply.call(console.log, console, newarr) : console.log.apply(console, newarr));
  }
};

// make it safe to use console.log always
(function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,timeStamp,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();){b[a]=b[a]||c}})((function(){try
{console.log();return window.console;}catch(err){return window.console={};}})());


// place any jQuery/helper plugins in here, instead of separate, slower script files.




/*DATEPICKER*/
$(document).ready(function(){						   
function updateLinked(dates) { 
    $('#linkedMonth').val(dates.length ? dates[0].getMonth() + 1 : ''); 
    $('#linkedDay').val(dates.length ? dates[0].getDate() : ''); 
    $('#linkedYear').val(dates.length ? dates[0].getFullYear() : ''); 
} 
function updateLinked2(dates) { 
    $('#linkedMonth2').val(dates.length ? dates[0].getMonth() + 1 : ''); 
    $('#linkedDay2').val(dates.length ? dates[0].getDate() : ''); 
    $('#linkedYear2').val(dates.length ? dates[0].getFullYear() : ''); 
}  
// Update datepicker from three input controls 
$('#linkedMonth,#linkedDay,#linkedYear').change(function() { 
    $('#my_date1').datepick('setDate', new Date( 
        parseInt($('#linkedYear').val(), 10), 
        parseInt($('#linkedMonth').val(), 10) - 1, 
        parseInt($('#linkedDay').val(), 10))
							); 
});//
// Update datepicker from three input controls 
$('#linkedMonth2,#linkedDay2,#linkedYear2').change(function() { 
    $('#my_date12').datepick('setDate', new Date( 
        parseInt($('#linkedYear2').val(), 10), 
        parseInt($('#linkedMonth2').val(), 10) - 1, 
        parseInt($('#linkedDay2').val(), 10))); 	
});//
						  $('#my_date1').datepick({
													   dateFormat: 'dd/mm/yyyy',
													   showOnFocus: false,
													   showTrigger: '<img  class="pic" src="/img/haeder/date-btn.jpg" alt=""  style="margin:-5px 0 0 0 !important" />',
													   onSelect:updateLinked,
													   firstDay: 1
													   });
						  $('#my_date12').datepick({
													   dateFormat: 'dd/mm/yyyy',
													   showOnFocus: false,
													   showTrigger: '<img  class="pic" src="/img/haeder/date-btn.jpg" alt=""  style="margin:-5px 0 0 0 !important" />',
													   onSelect:updateLinked2,
													   firstDay: 1
													   });
});

/*END DATEPICKER*/






$(document).ready(function(){
	$('.top-menu ul li:first-child').addClass('first')
	$('.top-menu ul li:last-child').addClass('last')
	})	

$(document).ready(function(){
	$('.bottom-menu ul li:first-child').addClass('first')
	$('.bottom-menu ul li:last-child').addClass('last')
	})
