function minipopup(triokey) {
var max_count = 1;
var count = Get_Cookie('mini_count');
if (parseInt(count) == max_count) return;
count = 1;
minipopwin(triokey);
Set_Cookie("mini_count",count);
}

function minipopwin(triokey) {
var fileName = "/pop-ups/mini_" + triokey + ".html";
myWindow = window.open("", "miniwindowRef", "width=125,height=200,screenX=100,screenY=50,top=50,left=100,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,border=0");

myWindow.location.href = fileName;
if (!myWindow.opener) myWindow.opener = self;
}

function Get_Cookie(name) {
	var start = document.cookie.indexOf(name+"=");
	var len = start+name.length+1;
	if ((!start) && (name != document.cookie.substring(0,name.length))) return
null;
	if (start == -1) return null;
	var end = document.cookie.indexOf(";",len);
	if (end == -1) end = document.cookie.length;
	return unescape(document.cookie.substring(len,end));
}

function Set_Cookie(name,value) {
	var now = new Date();
	now.setTime(now.getTime() + 43200000);
	document.cookie = name + "=" + escape(value) + "; expires=" + now.toGMTString() + "; path=/";
}

rnd.today=new Date();
rnd.seed=rnd.today.getTime();

function rnd() {
	rnd.seed = (rnd.seed*9301+49297) % 233280;
	return rnd.seed/(233280.0);
};

function rand(number) {
	return Math.ceil(rnd()*number);
};

