var newwindow;
var visicert = 0;
function poptastic(url, height, width) {
	newwindow = window.open(url,'name','height='+height+',width='+width+',scrollbars=yes,resizable=false,toolbar=no,menubar=no,location=false');
	if (window.focus) {newwindow.focus()}
}

function confirmer(_msg, _yes, _no){
	question = confirm(_msg);
	if(question != "0"){
		top.location = _yes;
	} else {
		if(_no != ""){
			top.location = _no;
		}
	}
}

function showCertificateBox(_total, _upto){
	if(_total == 0 && _upto > 0){
		_upto = visicert;
		var cur = 0;
		while(++cur <= _upto){
			if(cur<10){
				_cur = String("0"+cur)
			} else {
				_cur = String(cur);
			}
			newitem = document.getElementById("gc_row_"+_cur);
			if(newitem){
				newitem.style.display = "";
			} else {
				return;
			}
		}
	} else if (_total > 0 && _upto == 0) {	
		var total = _total;
		var cur = 0;
		var breakLoop = false;
		while(++cur <= total && breakLoop == false){
			if(cur<10){
				_cur = String("0"+cur)
			} else {
				_cur = String(cur);
			}
			newitem = document.getElementById("gc_row_"+_cur);
			if(newitem.style.display == "none"){
				newitem.style.display = "";
				breakLoop = true;
				visicert = cur;
			}
		}
	}
}
