function openWnd(url,wnd_name,width,height,scrollbars){		
	var stScrollBar = (scrollbars ? 'yes' : 'no');
	newWnd = window.open(url,wnd_name,'width='+width+',height='+height+',status=yes,menubar=no,resizable=yes,scrollbars='+stScrollBar+',left='+String((screen.width-width)/2)+',top='+String((screen.height-height)/2));
	newWnd.focus();
	return false;
}

function showThumb(saleID, imageNum){
	var i = 1;
	var oThumb;
	while(oThumb = document.getElementById('thumb' + saleID + '_' + i)){
		oSpan = document.getElementById('page' + saleID + '_' + i);
		if(i == imageNum){
			oSpan.className = 'sel';
			oThumb.style.display = '';
		} else {
			oSpan.className = '';
			oThumb.style.display = 'none';
		}
		i++;
	}
}

function showCert(_id,limit) {
	for(i = 1; i < limit + 1; i++) {
		var cert = document.getElementById('cert' + i);
		if(cert){
			var thumb = document.getElementById('cert_s' + i);
			if(i == _id){
				cert.className = '';
				if(thumb) thumb.className = 'sel';
			} else {
				cert.className = 'hid';
				if(thumb) thumb.className = '';
			}
		}
	}
}

function initQuestions(){
	var i = 1;
	while(document.getElementById('answer' + i)){
		document.getElementById('answer' + i).className = 'hid';
		document.getElementById('question' + i).className = 'question';
		i++;
	}
}

function showAnswer(num){
	var oDiv = document.getElementById('answer' + num);
	if(oDiv.className != ''){
		oDiv.className = '';
	} else {
		oDiv.className = 'hid';
	}
}