/******************************************************
** lib.js version 1.25 July 22, 2005
*******************************************************/

/* menu item constructor */


/* button constructor */
function _Button(text, img, link,width,target) {
   this.link=link;
   this.img=img;
   this.text=text;
   this.width=width;
   this.target=target;
}

/* page constructor */
function _Page() {

	this.commonServer="";
	this.buttons = new Array();

	var p=this;
		
	
			
	p.buttons[0]= new _Button("logo","morec_prtlogo.jpg","",96)

	
	
}

_Page.prototype.img = function(w,h,a,c,i) {
	if (h==null) h=1;
	if (w==null) w=1;
	if (a==null) a='';
	if (c==null) c='';
	if (i==null) i='t.gif';
	var html='<img src="'+this.commonServer+'_style/img/'+i+'"'+(c==''?'':' class="'+c+'"')+' width="'+w+'" height="'+h+'" alt="'+a+'" border="0" />';
	return html;
}



_Page.prototype.printVersion = function(cellid){
	/* Temporary check to prevent non tool pages to receive errors in printversion */
	if(_page.callcount > 0){
		/* New Common Tool Printversion */
		_page.call('PrintVersion','cellid='+cellid);
	} else {
		/* Old Regular Printversion */
		var docTitle=window.document.title;
		var docHead=document.getElementsByTagName("head")[0].innerHTML;
        
		var docContent=document.getElementById(cellid).innerHTML;
		var prWindow;	

		prWindow = window.open('','thePrWindow','width=603,height=480,menubar,resizable,toolbar,scrollbars');
  		prWindow.document.open();

	  	var html=('\
		<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">\n\
		<html>\n\
		<head>'+docHead+'\n\
		</head>\n\
		<body class="p-printversion">');	

		if (_page.ns=='1') {	
			html+=('<table width="100%" border="0" cellpadding="0" cellspacing="0">\n\
				<tr id="p-row1" class="p-bg005aff">\n\
					<td width="20"></td>\n\
					<td></td>\n\
					<td width="20"></td>\n\
				</tr>\n\
				<tr id="p-row2" class="p-bg005aff">\n\
					<td>&nbsp;</td>\n\
					<td>\n\
						<table border="0" cellspacing="0" cellpadding="0" width="100%">\n\
							<tr>\n\
								<td style="text-align: left; border-bottom: 10px solid #9CB6D6">'+this.img(481,99,'Logo',null,'Morec_prtlogo.jpg')+'</td>\n\
							</tr>\n\
						</table>\n\
					</td>\n\
					<td>&nbsp;</td>\n\
				</tr>\n\
				<tr id="p-row3" class="p-bg005aff">\n\
					<td colspan="3">&nbsp;</td>\n\
				</tr>\n\
			</table>');
		} else {	
			html+=('<table width="100%" cellpadding="0" cellspacing="0">\n\
				<tr id="p-row1" class="p-bg005aff">\n\
					<td width="20"></td>\n\
					<td></td>\n\
					<td width="20"></td>\n\
				</tr>\n\
				<tr id="p-row2" class="p-bg005aff">\n\
					<td>&nbsp;</td>\n\
					<td>\n\
						<table border="0" cellspacing="0" cellpadding="0" width="100%">\n\
							<tr>\n\
								<td style="text-align: left; border-bottom: 10px solid #9CB6D6">'+this.img(481,99,'Logo',null,'Morec_prtlogo.jpg')+'</td>\n\
							</tr>\n\
						</table>\n\
					</td>\n\
					<td>&nbsp;</td>\n\
				</tr>\n\
				<tr id="p-row3" class="p-bg005aff">\n\
					<td colspan="3">&nbsp;</td>\n\
				</tr>\n\
			</table>');
		}	

		html+=('<table width="100%" cellpadding="0" cellspacing="0">\n\
		<tr>\n\
			<td width="20"></td>\n\
			<td>&nbsp;</td>\n\
			<td width="20"></td>\n\
		</tr>\n\
		<tr>\n\
			<td>&nbsp;</td>\n\
			<td>\n'+docContent+'</td>\n\
			<td>&nbsp;</td>\n\
		</tr>\n\
		<tr id="p-carow1">\n\
			<td colspan="3">&nbsp;</td>\n\
		</tr>\n\
		</table>\n\
		</body>\n\
		</html>');

		prWindow.document.write(html);
		prWindow.document.close();
		prWindow.focus();
	}
}



/*
We need only a single instance of _Page class.
 */
var _page = new _Page();


