(function($) {
	$.fn.ellipsis = function(enableUpdating){
		
		var s = document.documentElement.style;
		//if (!('textOverflow' in s || 'OTextOverflow' in s)) {
			return this.each(function(){	
								  
				var el = $(this);
				var textElement = $('A',$(this));
				
				if(el.css("overflow-y") == "hidden"){
					var originalText = textElement.html();
					var w = el.width();
					var t = $(this.cloneNode(true)).css('position', 'absolute').hide()
					.css('height', 'auto').css('overflow-y', 'visible');
					var cloneA = $('A',t);
					el.after(t);
					var text = originalText;
					while(text.length > 0 && t.height()-3 > el.height()){
						text = text.substr(0, text.length - 3);
						cloneA.html(text + "...");
					}	
					el.html(t.html());
					t.remove();
					if(enableUpdating == true){
						var oldW = el.width();
						setInterval(function(){
							if(el.width() != oldW){
								oldW = el.width();
								el.html(originalText);
								el.ellipsis();
							}
						}, 200);
					}
				}
			});
		//} else return this;
	};
})(jQuery);


function validateForm()
{	
	$('.err').css({display:'none'});
	var valid = true;
	if ($('#subemail').attr('value').match(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/)==null) 
		{$('#subemail_err').css({display:'block'}); valid=false;}
	
	return valid;
}









