$(document).ready(function(){
	if ($('input.placeholder').length) {
		$('input.placeholder').each(function(index) {
			if (!Modernizr.input.placeholder) {
				this.value = this.title;
				$(this).addClass('empty');
			}
		});
	
		$('input.placeholder').focus(function() {
			if(this.className.indexOf("empty") != -1) {
				$(this).removeClass('empty');
				this.value = '';
			}
		});
	
		$('input.placeholder').blur(function() {
			if(this.value == '') {
				$(this).addClass('empty');
				this.value = this.title;
			}
		});
	}
});


/* Write the current year on the page  */
function showCurrentYear() {
	var d = new Date()
	document.write(d.getFullYear());
}





/* unewWindow functionality */
function unewWindow(url) {
	if (arguments.length > 1) {
		var width = String(arguments[1]);
		var height = String(arguments[2]);
		if ((loc = width.indexOf("%")) != -1) {
			width = width.slice(0, loc);
			width = Number(width);
			width = screen.width * (width / 100);
		}
		if ((loc = height.indexOf("%")) != -1) {
			height = height.slice(0, loc);
			height = Number(height);
			height = screen.height * (height / 100);
		}
	} else {
		var width = 640;
		var height = 480;
	}
	var attributeString = 'height=' + height + ',width=' + width + ',menubar=yes,scrollbars=yes,resizable=yes,screenX=10,screenY=10,top=10,left=10';
	//alert(attributeString);
	var winpop=window.open(url, 'NewWin', attributeString);
	winpop.focus();
}


function unewWindow_noMenu(url) {
	if (arguments.length > 1) {
		var width = String(arguments[1]);
		var height = String(arguments[2]);
		if ((loc = width.indexOf("%")) != -1) {
			width = width.slice(0, loc);
			width = Number(width);
			width = screen.width * (width / 100);
		}
		if ((loc = height.indexOf("%")) != -1) {
			height = height.slice(0, loc);
			height = Number(height);
			height = screen.height * (height / 100);
		}
	} else {
		var width = 640;
		var height = 480;
	}
	var attributeString = 'height=' + height + ',width=' + width + ',menubar=no,scrollbars=yes,resizable=yes,screenX=10,screenY=10,top=10,left=10';
	//alert(attributeString);
	var winpop=window.open(url, 'NewWin', attributeString);
	winpop.focus();
}


function unewWindowRight_noMenu(url) {
	if (arguments.length > 1) {
		var width = String(arguments[1]);
		var height = String(arguments[2]);
		if ((loc = width.indexOf("%")) != -1) {
			width = width.slice(0, loc);
			width = Number(width);
			width = screen.width * (width / 100);
		}
		if ((loc = height.indexOf("%")) != -1) {
			height = height.slice(0, loc);
			height = Number(height);
			height = screen.height * (height / 100);
		}
	} else {
		var width = 640;
		var height = 480;
	}
	var offset = screen.width - width - 20;
	var attributeString = 'height=' + height + ',width=' + width + ',menubar=no,scrollbars=yes,resizable=yes,screenX=10,screenY=10,top=10,left=' + offset;
	//alert(attributeString);
	var winpop=window.open(url, 'NewWin', attributeString);
	winpop.focus();
}


 //Client side javascript to open new window,
	function newWindow(url) {
		var winpop=window.open(url, 'NewWin', 'height=480,width=640,menubar=yes,scrollbars=yes');
	}

