$.noConflict();

jQuery(window).load(function () {

if(navigator.appVersion.indexOf('MSIE')>-1){
	jQuery(".powermail_text").each(function (type) {
		
		if (!this.value.empty()) {
			this.parentNode.previousSibling.firstChild.addClassName('has-text');
		}
		jQuery(this).focus(function () {
			
			jQuery(this.parentNode.previousSibling.firstChild).addClass("focus");
		});
				
		jQuery(this).keypress(function () {
			jQuery(this.parentNode.previousSibling.firstChild).addClass("has-text").removeClass("focus");
		});
		jQuery(this).blur(function () {
			if(jQuery(this).val() == "") {
				jQuery(this.parentNode.previousSibling.firstChild).removeClass("has-text").removeClass("focus");
			}
		});
	});

	jQuery(".powermail_textarea").each(function (type) {
		if (!this.value.empty()) {
			this.parentNode.previousSibling.firstChild.addClassName('has-text');
		}
			
		jQuery(this).focus(function () {
			jQuery(this.parentNode.previousSibling.firstChild).addClass("focus");
		});

		jQuery(this).keypress(function () {
			jQuery(this.parentNode.previousSibling.firstChild).addClass("has-text").removeClass("focus");
		});

		jQuery(this).blur(function () {
			if(jQuery(this).val() == "") {
				jQuery(this.parentNode.previousSibling.firstChild).removeClass("has-text").removeClass("focus");
			}
		});
	});
	
	jQuery(".powermail_select").each(function (type) {
		if (!this.value.empty()) {
			this.parentNode.previousSibling.firstChild.addClassName('has-text');
		}
			
		jQuery(this).focus(function () {
			jQuery(this.parentNode.previousSibling.firstChild).addClass("focus");
		});

		jQuery(this).keypress(function () {
			jQuery(this.parentNode.previousSibling.firstChild).addClass("has-text").removeClass("focus");
		});
		
		jQuery(this).click(function () {
			jQuery(this.parentNode.previousSibling.firstChild).addClass("has-text").removeClass("focus");
		});

		jQuery(this).blur(function () {
			if(jQuery(this).val() == "") {
				jQuery(this.parentNode.previousSibling.firstChild).removeClass("has-text").removeClass("focus");
			}
		});
	});

}
else {
	jQuery(".powermail_text").each(function (type) {
		if (!this.value.empty()) {
			this.parentNode.previous().firstChild.addClassName('has-text');
		}
		jQuery(this).focus(function () {
			jQuery(this.parentNode.previous().firstChild).addClass("focus");
		});
				
		jQuery(this).keypress(function () {
			jQuery(this.parentNode.previous().firstChild).addClass("has-text").removeClass("focus");
		});
		jQuery(this).blur(function () {
			if(jQuery(this).val() == "") {
				jQuery(this.parentNode.previous().firstChild).removeClass("has-text").removeClass("focus");
			}
		});
	});

	jQuery(".powermail_textarea").each(function (type) {
		if (!this.value.empty()) {
			this.parentNode.previous().firstChild.addClassName('has-text');
		}
			
		jQuery(this).focus(function () {
			jQuery(this.parentNode.previous().firstChild).addClass("focus");
		});

		jQuery(this).keypress(function () {
			jQuery(this.parentNode.previous().firstChild).addClass("has-text").removeClass("focus");
		});

		jQuery(this).blur(function () {
			if(jQuery(this).val() == "") {
				jQuery(this.parentNode.previous().firstChild).removeClass("has-text").removeClass("focus");
			}
		});
	});
	
	jQuery(".powermail_select").each(function (type) {
		if (!this.value.empty()) {
			if(this.id!='uid226'){
				this.parentNode.previous().firstChild.addClassName('has-text');
			}
		}
			
		jQuery(this).focus(function () {
			jQuery(this.parentNode.previous().firstChild).addClass("focus");
		});

		jQuery(this).keypress(function () {
			jQuery(this.parentNode.previous().firstChild).addClass("has-text").removeClass("focus");
		});
		
		jQuery(this).click(function () {
			jQuery(this.parentNode.previous().firstChild).addClass("has-text").removeClass("focus");
		});

		jQuery(this).blur(function () {
			if(jQuery(this).val() == "") {
				jQuery(this.parentNode.previous().firstChild).removeClass("has-text").removeClass("focus");
			}
		});
	});
}
	
	
	
});