	function initTextboxPlaceholders(){
		__doPostBack = __doPostBack_Hijacked;
		WebForm_DoPostBackWithOptions = WebForm_DoPostBackWithOptions_Hijacked;
		
		var aInputs = document.getElementsByTagName('input');
		for(i=0;i<aInputs.length;i++){
			var oAttributeValue = aInputs[i].getAttribute('PlaceholderText');
			if(oAttributeValue != null && oAttributeValue.length > 0){
				aInputs[i].placeHolderText = oAttributeValue;
				aInputs[i].onfocus = function(){
										if(this.value == this.placeHolderText){
											this.value = '';
											this.style.color = '#455560';
										}
									 }
				aInputs[i].onblur = function(){
										if(this.value == '' || this.value == this.placeHolderText){
											this.value = this.placeHolderText;
											this.style.color = '#aaa';
										}
									 }
				aInputs[i].onblur();
			}
			
			//Check for whether the textbox is bound to a button for when hitting Return (Enter)
			oAttributeValue = aInputs[i].getAttribute('BindToButton');
			if(oAttributeValue != null && oAttributeValue.length > 0){
				aInputs[i].onkeydown = function(event){
											var iKey = (window.event?window.event.keyCode:event.which);
											if(iKey == 13) {
												var oElem = $get(this.getAttribute('BindToButton'));
												if(!oElem){return true;}
												if(oElem.onclick){
													oElem.click();
												}else{
													var sJs = oElem.href.replace('javascript:', '');
													sJs = unescape(sJs);
													eval(sJs);
												}
												return false;
											}
											return true;
										}
			}
		}
	}
	function textboxPlaceholdersHandleFormSubmit(){ 
		var aInputs = document.getElementsByTagName('input');
		for(i=0;i<aInputs.length;i++){
			if(aInputs[i].placeHolderText != null && aInputs[i].placeHolderText.length > 0){
				if(aInputs[i].value == aInputs[i].placeHolderText){
					aInputs[i].value = '';	
				}
			}
		}
		return true;
	}
	
	function __doPostBack_Hijacked(eventTarget, eventArgument) {
		textboxPlaceholdersHandleFormSubmit();
		
		theForm.__EVENTTARGET.value = eventTarget;
		theForm.__EVENTARGUMENT.value = eventArgument;
		theForm.submit();
	}
	function WebForm_DoPostBackWithOptions_Hijacked(options) {
		var validationResult = true;
		if (options.validation) {
			if (typeof Page_ClientValidate == "function") {
				validationResult = Page_ClientValidate(options.validationGroup);
			}
		}
		if (validationResult) {
			if (typeof options.actionUrl != "undefined" &&
				options.actionUrl != null && (options.actionUrl.length > 0)) {
				theForm.action = options.actionUrl;
			}
			if (options.trackFocus) {
				var lastFocus = theForm.elements.__LASTFOCUS;
				if (typeof lastFocus != "undefined" && (lastFocus != null)) {
					if (typeof document.activeElement == "undefined") {
						lastFocus.value = options.eventTarget;
					} else {
						var active = document.activeElement;
						if (typeof active != "undefined" && (active != null)) {
							if (typeof active.id != "undefined" &&
								active.id != null && (active.id.length > 0)) {
								lastFocus.value = active.id;
							} else if (typeof active.name != "undefined") {
								lastFocus.value = active.name;
							}
						}
					}
				}
			}
		}
		__doPostBack(options.eventTarget, options.eventArgument);
	}

	
	if(window.attachEvent){
		window.attachEvent('onload', initTextboxPlaceholders);
	} else {
		window.addEventListener('load', initTextboxPlaceholders, false);
	}

