function initPage(){
	clearInputs();
	initDropGallery();
}
function clearInputs(){
	var _list = document.getElementsByTagName('input');
	for(var i = 0; i  < _list.length; i++){
		if(_list[i].type == 'text' || _list[i].type == 'password'){
			_list[i].val = _list[i].value;
			_list[i].onfocus = function(){
				if(this.value == this.val) this.value = '';
			}
			_list[i].onblur = function(){
				if(this.value == '') this.value = this.val;
			}
		}
	}
}

function initDropGallery() {
	var _drop = document.getElementById('drop-window');
		var _btn = document.getElementById('toggler');
		if(_btn) {
			_btn.onclick = function() {
				if(this.className.indexOf('closed') != -1) {
					this.className = this.className.replace('closed', 'opened');
					this.innerHTML = 'Close window';
					this.parentNode.parentNode.className = this.parentNode.parentNode.className.replace('window-closed','window-opened');
				}
				else if(this.className.indexOf('opened') != -1) {
					this.className = this.className.replace('opened', 'closed');
					this.innerHTML = 'Show window';
					this.parentNode.parentNode.className = this.parentNode.parentNode.className.replace('window-opened','window-closed');
				}
				return (false);
			}
		}
}
if (window.addEventListener) window.addEventListener("load", initPage, false);
else if (window.attachEvent && !window.opera) window.attachEvent("onload", initPage);