function printOK(modelsNotHiddenSize, warningText){
	var objcp;
	var objcp ;
	var size = modelsNotHiddenSize;	
	for (var i = 1; i <= size; i++){
		className = "cp" + i ;
		objcp = getElementsByClass(className);
		if (objcp != null && objcp[0].className.indexOf( ' hide' ) > 0 ) { 
			modelsNotHiddenSize --  ;
		}
	}
	maxNoOfProductsForPrint  = 5;
	return (modelsNotHiddenSize <= maxNoOfProductsForPrint || (modelsNotHiddenSize > maxNoOfProductsForPrint && confirm(warningText)));
}

/*
* Use to open glossary pages when popup disabled.
* JSP should set openGlossaryPageLinkUrl variable, and function adds keyword to end of url.
*/
var openGlossaryPageLinkUrl;
function openGlossaryPage(keyword){
	//encode keyword
	window.location = openGlossaryPageLinkUrl +'&keyword='+ keyword;
}

/*
 * Use to get event key code.
*/
function getKeyCode(e)
{
     var key;     
     if(window.event)
          return window.event.keyCode; //IE
     else
          return e.which; //firefox
}
/*
 * this gets the survey parameters from the url of the iFrame hidden inside the survey.
*/
function getParam(paramNo){
	var pair = window.location.search.substring( 1 );
	var params = pair.split( '&' );
	var parts = params[paramNo].split( '=' );
	var param = parts[1];
	if(parts[0]==height)
		param = parseInt( param );
	return param;
}

/*
 * this gets the height of the survey. 
 * technically, it gets the height of the calling window.
*/
function loadHiddenIframe(path,top) {

	var height = Math.max( document.body.offsetHeight, document.body.scrollHeight );
	height=height+60;
	//this loads the hidden page into the iFrame hidden inside the survey, with height as a url parameter.
	var iframe = document.getElementById( 'HiddenIframe' );
	if(iframe!=null)
		iframe.src = path + '?height=' + height + '&top=' + top;
}