/**
 * NOTE
 * 
 */

$(document).ready(function(){

	$('input#searchButton').focusin(function() {
		if ($(this).val() == "Search")
		$(this).val("");
	}).focusout(function() {
		if ($(this).val() == "")
		$(this).val("Search");
	});


	var defaultEmailTxt = "your email";
	$('input.email').val(defaultEmailTxt);
	$('input.email').focusin(function() {
		if ($(this).val() == defaultEmailTxt)
			$(this).val("");
	}).focusout(function() {
		if ($(this).val() == "")
			$(this).val(defaultEmailTxt);
	});


	$('input#searchButton').mouseenter(function() {
		$(this).css("color", "#000");
    }).mouseleave(function(){
		$(this).css("color", "#fff");
    });


	$('.pagetoolbar li').corner("5px");
//	$('.coloredBox').corner("10px tl br");


	$('a.modal').colorbox();
	$(".colorbox").colorbox({opacity: 0.95, current:'{current} of {total}'});

});


jQuery.fn.toggleText = function(a, b) {
	return this.each(function() {
		jQuery(this).text(jQuery(this).text() == a ? b : a);
	});
};

jQuery.fn.toggleValue = function(a, b) {
	return this.each(function() {
		jQuery(this).val(jQuery(this).val() == a ? b : a);
	});
};

jQuery.fn.equalHeights = function() {
	var maxHeight=0;
	this.each(function(){
		if (this.offsetHeight>maxHeight) {maxHeight=this.offsetHeight;}
	});
	this.each(function(){
		$(this).height(maxHeight + "px");
		if (this.offsetHeight>maxHeight) {
			$(this).height((maxHeight-(this.offsetHeight-maxHeight))+"px");
		}
	});
};



