$(document).ready(function(){
	QuoteGall();
	clearInputs();
});
function QuoteGall(){
	$('.quote-area').each(function(){
		var _m = 0;
		var list_h = $(this).find('.quote-holder').children('ul');
		var _step = list_h.parent().width();
		var _w = list_h.children().length * _step - _step;
		if(_w > _step){
			$(this).find('.arrow-right').click(function(){
				changeEl(true);
				return false;
			});
			$(this).find('.arrow-left').click(function(){
				changeEl(false);
				return false;
			});
		}
		else{
			$(this).find('.arrow-right').click(function(){
				
				return false;
			});
			$(this).find('.arrow-left').click(function(){
				
				return false;
			});
		}
		function changeEl(_f){
			if(_f) _m += _step;
			else _m -= _step;
			if(_m < 0) _m = _w;
			if(_m > _w) _m = 0;
			list_h.animate({marginLeft: - _m}, {queue:false, duration:300});
		}
	});
}
function clearInputs(){
	$('input:text, textarea').each(function(){
		this.val = this.value;
		this.onfocus = function(){
			this.className += " active";
			if(this.value == this.val) this.value = '';
		}
		this.onblur = function(){
			if(this.value == '') this.value = this.val;
			this.className = this.className.replace("active", "");
		}
	});
	$('input:password').each(function(){
		this.val = this.value;
		this.onfocus = function(){
			this.className = "";
		}
		this.onblur = function(){
			if(this.value == '') this.className = "password";
		}
	});
}
function NewsletterSignUpPopUp(url){
    var view = window.open(url,'NewsletterSignUpWindow','width=700,height=500,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=true,toolbar=false');
    view.focus();
}