function popWindow(url, width, height, win, scrollbars) {
	var left = (screen.width - width) / 2;
	var top = (screen.height - height) / 2;
	if (win == undefined) win = "_blank";
	if (scrollbars != 1) scrollbars = 0;
	newwindow = window.open(url, win, 'toolbar=0,location=0,status=0,menubar=0,scrollbars=1' + scrollbars + ',resizable=0,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
	if (window.focus) newwindow.focus();
}
function openWindow(url, win){
	if (win == undefined) win = "_blank";
	newwindow = window.open(url, win);
	if (window.focus) newwindow.focus();
}
function popPage(url){
	//alert("icon download: "+image);
	popWindow(url, 560, 740, "ecards", 1);
}

function getURLVar(param) {
	var q = document.location.search || document.location.hash;
	if(q) {
		var pairs = q.substring(1).split("&");
		for (var i=0; i < pairs.length; i++) {
			if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
				return pairs[i].substring((pairs[i].indexOf("=")+1));
			}
		}
	}
	return "";
}

function params(qp) { 
	try{r=unescape(location.search.match(new RegExp(qp+"=+([^&]*)"))[1]);}
	catch(e){r='';} 
	return r; 
}
