function popup(url, width, height) {
	
	var w = 480, h = 340;

	if (document.all) {
	   /* the following is only available after onLoad */
	   w = document.body.clientWidth;
	   h = document.body.clientHeight;
	}
	else if (document.layers) {
	   w = window.innerWidth;
	   h = window.innerHeight;
	}
	
	var leftPos = (w-width)/2, topPos = (h-height)/2;

	
	myFloater = window.open(url, getRandomName(10),'scrollbars=no,status=no,width=' + width + ',height=' + height + ',top=' + topPos + ',left=' + leftPos);
	
	
	if (!myFloater.opener) {
		myFloater.opener = self; 
	}
}


function selfClose() {
	window.close();
}

function openerRefresh() {
	opener.location.href = opener.location.href;
}

function getRandomName(chars) {
	var choice = "1234567890abcdefghiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXTZ";
	var choiceLength = choice.length;
	var result = '';
	for (var i = 0; i < chars; i++) {
		var rnd = Math.floor(Math.random() * choiceLength);
		result += choice.substring(rnd,rnd+1);
	}
	return result;
}
