// JavaScript Document

function openWindowCenter(pUrl,pTitle,w,h) { 
	var findLeft = document.body.offsetWidth/2;
	var findTop = document.body.offsetHeight/2;
	
	findLeft -= w/2
	findTop -= h/2;	
	var winprops = 'height='+h+',width='+w+',top='+findTop+',left='+findLeft+'resizable=0'	

	window.open(pUrl,pTitle,"",winprops)
	
}


function showProducts(catID, paction){
	document.forms[0].categoryID.value = catID;
	document.forms[0].action = paction;
	document.forms[0].submit(); 
}

function viewDetProduct(url,title) {

	popupsc(url,title,520,415);
}

function showQA(q,total) { 
	var rpta = document.getElementById('r'+q);

	for (var i=0; i<total; i++) { 
		var rptat = document.getElementById('r'+i);
		rptat.className='detalle_rpta_invi';
	}
	
	rpta.className='detalle_rpta_vis';

}

function showVoucher() { 
	/* verificar alto y ancho de la window */
	var myWidth = 0, myHeight = 0;
	if(typeof( window.innerWidth ) == 'number' ) {
	//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} 
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	}
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	 /* ------------------------------------------------ */

	var vVoucher = document.getElementById('doc_voucher');
	
	vVoucher.style.left = (myWidth/2) - (504/2) + 'px';
	vVoucher.style.top = (myHeight-270) + 'px';
	
	vVoucher.style.visibility='visible';
}

function hideVoucher() {
	var vVoucher = document.getElementById('doc_voucher');
	vVoucher.style.visibility = 'hidden';
}