function open_window(url, width, height, windowname)
{
	if(!windowname) windowname = window;
	if(!width) width = 800;
	if(!height) height = 600;
	var left = (screen.width - width)/2;
	var wnd = window.open(url , windowname,"left="+left+",top=100,width=" + width + ",height=" + height + ",directories=no,menubar=no,status=yes,resizable=yes,scrollbars=yes,toolbar=no");
	if (wnd.opener == null){ wnd.opener = self; }
	wnd.focus();
}

function relocateOpener(href) {
	if (opener && !opener.closed) {
		opener.location.href = href;
	} else {
		opener = window.open(href, "");
		opener.opener = null;
	}
	opener.focus();
}

$(function(){
	$('input[placeholder]').focusout(function(){
		if(this.value == '') this.value = this.getAttribute('placeholder');
	}).focusin(function(){
		if(this.value == this.getAttribute('placeholder')) this.value = '';
	}).trigger('focusout');
	
	$('a.fancybox').fancybox();
});


/*
$(function(){
	$(document).bind("contextmenu",function(e){
		e.preventDefault();
		return false;
	}).keydown(function(e){
		if((e.which == 85 || e.which == 67 || e.which == 45) && e.ctrlKey){ // c,u,insert
			e.preventDefault();
			return false;
		}
	});
});
*/
