<!--

//time to implement basic show / hide
Element.implement({
	//implement show
	fancyShow: function() {
		this.fade('in');
		this.setStyle('z-index','1000');
	},
	//implement hide
	fancyHide: function() {
		this.fade('out');
	}
});

// fade in/out and destroy element
Element.implement({
	fadeAndDestroy: function(duration) {
		duration = duration || 600;
		this.set('tween', {
			duration: duration,
			onComplete: this.destroy.bind(this)
		});
		this.fade('out');
	}
});


// clear initial values from keywords search
function onFocus(){
	if($('search-field').get('value') == 'lab search'){
		$('search-field').set('value','');
	}
}
// put back initial values for keywords search if left empty
function onBlur(){
	if($('search-field').get('value') == ''){
		$('search-field').set('value','lab search');
	}
}	

var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height, menubar, scrollbars, resizable){
	if(popUpWin){
		if(!popUpWin.closed) popUpWin.close();
	}
	popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar='+menubar+',scrollbars='+scrollbars+',resizable='+resizable+',copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function printorder(orderid, type){
	w=700;
	h=500;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	//images = popUpWindow('/entry/view.php?downloadid='+downloadid+'&type='+type+'&name='+name, LeftPosition, TopPosition, w, h, 'no', 'yes');
	popUpWindow('/cart/printorder.php?orderid='+orderid+"&type="+type, LeftPosition, TopPosition, w, h, "yes", "yes", "yes");
}
function printorderhistory(orderid, type){
	w=700;
	h=500;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	//images = popUpWindow('/entry/view.php?downloadid='+downloadid+'&type='+type+'&name='+name, LeftPosition, TopPosition, w, h, 'no', 'yes');
	popUpWindow('/login/print.php?orderid='+orderid+"&type="+type, LeftPosition, TopPosition, w, h, "yes", "yes", "yes");
}
function printWishlist(){
	w=700;
	h=500;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	//images = popUpWindow('/entry/view.php?downloadid='+downloadid+'&type='+type+'&name='+name, LeftPosition, TopPosition, w, h, 'no', 'yes');
	popUpWindow('/products/print.php', LeftPosition, TopPosition, w, h, "yes", "yes", "yes");
}
//-->
