/* * clearingInput: a jQuery plugin * * clearingInput is a simple jQuery plugin that provides example/label text * inside text inputs that automatically clears when the input is focused. * Common uses are for a hint/example, or as a label when space is limited. * * For usage and examples, visit: * http://github.com/alexrabarts/jquery-clearinginput * * Licensed under the MIT: * http://www.opensource.org/licenses/mit-license.php * * Copyright (c) 2008 Stateless Systems (http://statelesssystems.com) * * @author Alex Rabarts (alexrabarts -at- gmail -dawt- com) * @requires jQuery v1.2 or later * @version 0.1.1 */ (function ($) { $.extend($.fn, { clearingInput: function (options) { var defaults = {blurClass: 'blur'}; options = $.extend(defaults, options); return this.each(function () { var input = $(this).addClass(options.blurClass); var form = input.parents('form:first'); var label, text; text = options.text || textFromLabel() || input.val(); if (text) { input.val(text); input.blur(function () { if (input.val() === '') { input.val(text).addClass(options.blurClass); } }).focus(function () { if (input.val() === text) { input.val(''); } input.removeClass(options.blurClass); }); form.submit(function() { if (input.hasClass(options.blurClass)) { input.val(''); } }); input.blur(); } function textFromLabel() { label = form.find('label[for=' + input.attr('id') + ']'); // Position label off screen and use it for the input text return label ? label.css({position: 'absolute', left: '-9999px'}).text() : ''; } }); } }); })(jQuery); jQuery(function(){ jQuery('.labelize input:text').clearingInput(); if(document.getElementById('sidebar') != null) { var sidebar = document.getElementById('sidebar'); var main = document.getElementById('mainContent'); var sHeight = sidebar.offsetHeight; var mHeight = main.offsetHeight; if(mHeight > sHeight) { sidebar.style.height='' + mHeight + 'px'; } } if(document.getElementById('home') != null) { var left = document.getElementById('homeBlog'); var leftCH = left.offsetHeight; //css('height'); var leftH = parseFloat(leftCH); var middle = document.getElementById('homeAnalisis'); var middleCH = middle.offsetHeight; //css('height'); var middleH = parseFloat(middleCH); var right = document.getElementById('homeNC'); var rightCH = right.offsetHeight; //css('height'); var rightH = parseFloat(rightCH); //which left side column is bigger? if(leftH > middleH) { var leftLargest = leftH; //console.log('leftLargest: ' + leftLargest); } else { var leftLargest = middleH; //console.log('leftLargest: ' + leftLargest); } var homeVideo = document.getElementById('homeVideo').offsetHeight; //console.log('homeVideo height: ' + homeVideo); //is the left or right taller? if(leftLargest > rightH) { //console.log('one of the left columns has a greater height'); var largest = leftLargest; var height = (leftLargest - homeVideo) - 15; left.style.height='' + largest + 'px'; middle.style.height='' + largest + 'px'; right.style.height='' + height + 'px'; } else { //console.log('the right column has a greater height'); var largest = (rightH - 74); left.style.height='' + largest + 'px'; middle.style.height='' + largest + 'px'; } } });