jQuery(function($) { $('.target_blank') .attr({ 'target': '_blank' }); $('.confirm') .each(function() { var $this = $(this); var message = $this.attr('title') || 'Are you sure?'; $this .click(function(e) { if (!confirm(message)) { e .preventDefault(); } }); }) .removeAttr('title'); $('.numbersOnly').bind("keyup change", function(e) { this.value = this.value.replace(/[^0-9\.:]/g,''); }); $('.selectBox>select').change(function(){ $this = $(this); option = $this.find("option:selected").text(); $this.parent('div').find('div').text(option); }); $('.search').click(function () { $("#searchFrom").submit(); }); $('#showMenu').click(function () { $('#menu').toggle(300); }); $(document).one('focus.autoExpand', 'textarea.autoExpand', function(){ var savedValue = this.value; this.value = ''; this.baseScrollHeight = this.scrollHeight; this.value = savedValue; }).on('input.autoExpand', 'textarea.autoExpand', function(){ var minRows = this.getAttribute('data-min-rows')|0, rows; this.rows = minRows; rows = Math.ceil((this.scrollHeight - this.baseScrollHeight) / 16); this.rows = minRows + rows; }); $( document ).ready(function() { $('.autoExpand').each(function() { var savedValue = this.value; this.value = ''; this.baseScrollHeight = this.scrollHeight; this.value = savedValue; var minRows = this.getAttribute('data-min-rows')|0, rows; this.rows = minRows; rows = Math.ceil((this.scrollHeight - this.baseScrollHeight) / 16); this.rows = minRows + rows; }); }); $('.showRegister').click(function(){ $('.login').addClass('hideForm'); $('.login').removeClass('showForm'); $('.register').addClass('showForm'); $('.register').removeClass('hideForm'); }); $('.showLogin').click(function(){ $('.register').addClass('hideForm'); $('.register').removeClass('showForm'); $('.login').addClass('showForm'); $('.login').removeClass('hideForm'); }); $(document).ready(function(){ $footerHeight = $('footer').height(); $wrapperHeight = $('#wrapper').height(); $totHeight = $footerHeight + $wrapperHeight; $windowHeight = $(window).height(); if($totHeight < $windowHeight){ $raz = $windowHeight - $totHeight; $('#footerFix').css('min-height', $raz + 'px'); } }); $(window).resize(function(){ $footerHeight = $('footer').height(); $wrapperHeight = $('#wrapper').height(); $totHeight = $footerHeight + $wrapperHeight; $windowHeight = $(window).height(); if($totHeight < $windowHeight){ $raz = $windowHeight - $totHeight; $('#footerFix').css('min-height', $raz + 'px'); } }); }); function createCookie(name, value, days) { var date, expires; if (days) { date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); expires = "; expires="+date.toGMTString(); } else { expires = ""; } document.cookie = name+"="+value+expires+"; path=/"; var d = document.getElementById(name); d.className += " hidden"; }