	
	var ie = document.all;
	var nn6 = document.getElementById &&! document.all;
	
	var isdrag = false;
	var x, y;
	var dobj;
	
	function findById(x){return document.getElementById(x);}
	
	function pageWidth() {return window.innerWidth != null? window.innerWidth: document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth:document.body != null? document.body.clientWidth:null;}

	function pageHeight() {return window.innerHeight != null? window.innerHeight: document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight:document.body != null? document.body.clientHeight:null;}

	function posLeft() {return typeof window.pageXOffset != 'undefined' ? window.pageXOffset:document.documentElement && document.documentElement.scrollLeft? document.documentElement.scrollLeft:document.body.scrollLeft? document.body.scrollLeft:0;}

	function posTop() {return typeof window.pageYOffset != 'undefined' ? window.pageYOffset:document.documentElement && document.documentElement.scrollTop? document.documentElement.scrollTop: document.body.scrollTop?document.body.scrollTop:0;}
	
	function scrollFix(){
		var obol=findById('detailPopup');obol.style.top=posTop()+'px';obol.style.left=posLeft()+'px'
	}

	function sizeFix(){
		var obol=findById('detailPopup');obol.style.height=pageHeight()+'px';obol.style.width=pageWidth()+'px';
	}


	function openDebugWindow(url) {
 	 	win = window.open(url, "Debug Window", "width=300,height=200,scrollbars=yes");
  		win.focus();
	}


	function movemouse( e ) {
	  if( isdrag ) {
	    dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x;
	    dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y;
	    return false;
	  }
	}
	
	function selectmouse( e ) {
	  var fobj       = nn6 ? e.target : event.srcElement;
	  
	  if(fobj == null) {
		  return false;
	  }
	  
	  while (fobj.tagName != "HTML" && fobj.tagName != "BODY" && fobj.className != "dragme") {
	    fobj = nn6 ? fobj.parentNode : fobj.parentElement;
	  }
	
	  if (fobj.className=="dragme") {
	    isdrag = true;
	    while (fobj.tagName != "DIV") {
	    fobj = nn6 ? fobj.parentNode : fobj.parentElement;
	    }
	    dobj = document.getElementById(fobj.id);
	    tx = parseInt(dobj.style.left+0);
	    ty = parseInt(dobj.style.top+0);
	    x = nn6 ? e.clientX : event.clientX;
	    y = nn6 ? e.clientY : event.clientY;
	    document.onmousemove=movemouse;
	    return false;
	  }
	}
	
	function styledPopupClose(popupID) {
	  try {
		  if(document.getElementById('detailPopup'))
		  {
		    document.getElementById('detailPopup').style.display = "none";
		  } else if( window.parent.document.getElementById('detailPopup')) {
		  	window.parent.document.getElementById('detailPopup').style.display = "none";
		  }	  
		  
		  if(document.getElementById(popupID))
		  {
		    document.getElementById(popupID).style.display = "none";
		  } else if( window.parent.document.getElementById(popupID) ) {
		  	window.parent.document.getElementById(popupID).style.display = "none";
		  }
	  } catch (e) 
	  { /*do nothing*/ }
	}
	
	document.onmousedown=selectmouse;
	document.onmouseup=new Function("isdrag=false");
	
	function startPopup(popupID)
	{
	  if(document.getElementById(popupID))
	  {
	     document.getElementById(popupID).style.display="block";
	     
	     var pageSize = _getPageSize();     
	     document.getElementById(popupID).style.height="auto";
         var gh = document.getElementById(popupID).offsetHeight;
         var gw = document.getElementById(popupID).offsetWidth;     
	     var y = (pageSize.pageWidth/2 - gw/2);
	     //var x = (document.body.scrollTop+pageSize.windowHeight/2)- gh/2; //(pageSize.pageHeight/2 - gh/2);
	     var x = (pageSize.windowHeight/2)- gh/2; //(pageSize.pageHeight/2 - gh/2);
	     
	     document.getElementById(popupID).style.top=x+"px";
	     document.getElementById(popupID).style.left=y+"px";
	  }
	}
	
	function addIFramePopupWithoutClose(popupID,title,url,width,height)
	{     
   		init();
	    styledPopupClose('detailPopup');
	    styledPopupClose(popupID);
	    var pageSize = _getPageSize();
	    //var y = (pageSize.windowWidth/2 - width/2);
	    //var x = (pageSize.windowHeight/2 - height/2);
	    var y = (pageSize.pageWidth/2 - width/2);
	    //var x = (document.body.scrollTop+pageSize.windowHeight/2)- height/2; 
	    var x = (pageSize.windowHeight/2)- height/2; 
	    
	    var s = new Array();						  
	    s[s.length] =  "<div id='" + popupID + "' name='name'"
					   +"style='width: " + width + "px; height: " + height + "px; display: none; position: absolute; top: " + x + "px; left: " + y + "px;'>"
					   +"<table width='" + width + "px' height='" + height + "px' cellpadding='0' cellspacing='0' border='1' class='dragme borderColor2 backColorWhite'>"
					   +"<tr>"
					      +"<td width='" + width + "px' height='" + height + "px'>"
							   +"<table width='100%' height='100%' cellpadding='0' cellspacing='0' border='0' class='dragme'>"
									+"<tr valign='top'>"
										+"<td colspan='2' valign='top' height='19px' align='right'></td>"
									+"</tr>"
									+"<tr valign='top'>"
									    +"<td valign='top' width='5px'>"
										+"</td>" 									
										+"<td valign='top' height='25px'>"
										+"<font class='text3 color2'>" + "Details" + "</font>"
										+"</td>" 
									+"</tr>"
									+"<tr valign='top'>"
									    +"<td valign='top' width='5px'>"
										+"</td>" 									    
										+"<td valign='top' height='20px'>"
										+"<font class='text2 color3' >" + title + "</font>"
										+"</td>" 
									+"</tr>"
									+"<tr valign='middle'>"
									    +"<td valign='top' align='center'  style='height:100%;' colspan='2'>"
											+"<iframe height=\"100%\" style='width:100%; height:100%;' src=\""
											+ url
											+"\" framespacing=\"0\" frameborder=\"0\"></iframe>"
										+"</td>"
									+"</tr>"									
								+"</table>"
							+"</td>" 
						  +"</tr>"								
						+"</div>";
	
     	document.getElementById("detailPopup").innerHTML = s.join("");
	    document.getElementById(popupID).style.display="block";
	    document.getElementById('detailPopup').style.display="block";
	    scrollFix();
	}
	
	/**
	 * deprecated, please use addPostIFramePopup
	 * This method has problems with encoding
	 */
	function addIFramePopup(popupID,title,url,width,height){
		addIFramePopupWithMainTitle(popupID,title,url,width,height,"Details");
	}
	
	/**
	 * deprecated, please use addPostIFramePopup
	 * This method has problems with encoding
	 */	
	function addIFramePopupWithMainTitle(popupID,title,url,width,height,mainTitle)
	{     
   		init();
	    styledPopupClose('detailPopup');
	    styledPopupClose(popupID);
	    var pageSize = _getPageSize();
	    //var y = (pageSize.windowWidth/2 - width/2);
	    //var x = (pageSize.windowHeight/2 - height/2);
	    var y = (pageSize.pageWidth/2 - width/2);
	    //var x = (document.body.scrollTop+pageSize.windowHeight/2)- height/2; 
	    var x = (pageSize.windowHeight/2)- height/2; 
	    
	    var s = new Array();						  
	    s[s.length] =  "<div id='" + popupID + "' name='name'"
					   +"style='width: " + width + "px; height: " + height + "px; display: none; position: absolute; top: " + x + "px; left: " + y + "px;'>"
					   +"<table width='" + width + "px' height='" + height + "px' cellpadding='0' cellspacing='0' border='1' class='dragme borderColor2 backColorWhite'>"
					   +"<tr>"
					      +"<td width='" + width + "px' height='" + height + "px'>"
							   +"<table width='100%' height='100%' cellpadding='0' cellspacing='0' border='0' class='dragme'>"
									+"<tr valign='top'>"
										+"<td colspan='2' valign='top' height='19px' align='right'><a href=\"javascript:styledPopupClose('"+popupID+"');\"><img height='19px'"
											+"width='90px' src='../../images/close2.jpg' border='0'></a></td>"
									+"</tr>"
									+"<tr valign='top'>"
									    +"<td valign='top' width='5px'>"
										+"</td>" 									
										+"<td valign='top' height='25px'>"
										+"<font class='text3 color2'>" + mainTitle + "</font>"
										+"</td>" 
									+"</tr>"
									+"<tr valign='top'>"
									    +"<td valign='top' width='5px'>"
										+"</td>" 									    
										+"<td valign='top' height='20px'>"
										+"<font class='text2 color3' >" + title + "</font>"
										+"</td>" 
									+"</tr>"
									+"<tr valign='middle'>"
									    +"<td valign='top' align='center'  style='height:100%;' colspan='2'>"
											+"<iframe height=\"100%\" style='width:100%; height:100%;' src=\""
											+ url
											+"\" framespacing=\"0\" frameborder=\"0\"></iframe>"
										+"</td>"
									+"</tr>"									
								+"</table>"
							+"</td>" 
						  +"</tr>"								
						+"</div>";
	
     	document.getElementById("detailPopup").innerHTML = s.join("");
	    document.getElementById(popupID).style.display="block";
	    document.getElementById('detailPopup').style.display="block";
	    scrollFix();
	}

	function addPostIFramePopup(popupID,title,url,params,width,height){
		addPostIFramePopupWithMainTitle(popupID,title,url,params,width,height,"Details");
	}
	
	function addPostIFramePopupWithMainTitle(popupID,title,url,params,width,height,mainTitle)
	{     
   		init();
	    styledPopupClose('detailPopup');
	    styledPopupClose(popupID);
	    var pageSize = _getPageSize();
	    //var y = (pageSize.windowWidth/2 - width/2);
	    //var x = (pageSize.windowHeight/2 - height/2);
	    var y = (pageSize.pageWidth/2 - width/2);
	    //var x = (document.body.scrollTop+pageSize.windowHeight/2)- height/2; 
	    var x = (pageSize.windowHeight/2)- height/2; 
	    
	    var s = new Array();						  
	    s[s.length] =  "<div id='" + popupID + "' name='name'"
					   +"style='width: " + width + "px; height: " + height + "px; display: none; position: absolute; top: " + x + "px; left: " + y + "px;'>"
					   +"<table width='" + width + "px' height='" + height + "px' cellpadding='0' cellspacing='0' border='1' class='dragme borderColor2 backColorWhite'>"
					   +"<tr>"
					      +"<td width='" + width + "px' height='" + height + "px'>"
							   +"<table width='100%' height='100%' cellpadding='0' cellspacing='0' border='0' class='dragme'>"
									+"<tr valign='top'>"
										+"<td colspan='2' valign='top' height='19px' align='right'><a href=\"javascript:styledPopupClose('"+popupID+"');\"><img height='19px'"
											+"width='90px' src='../../images/close2.jpg' border='0'></a></td>"
									+"</tr>"
									+"<tr valign='top'>"
									    +"<td valign='top' width='5px'>"
										+"</td>" 									
										+"<td valign='top' height='25px'>"
										+"<font class='text3 color2'>" + mainTitle + "</font>"
										+"</td>" 
									+"</tr>"
									+"<tr valign='top'>"
									    +"<td valign='top' width='5px'>"
										+"</td>" 									    
										+"<td valign='top' height='20px'>"
										+"<font class='text2 color3' >" + title + "</font>"
										+"</td>" 
									+"</tr>"
									+"<tr valign='middle'>"
									    +"<td valign='top' align='center'  style='height:100%;' colspan='2'>"
											+"<iframe height=\"100%\" style='width:100%; height:100%;' name=\"popup_iframe\" framespacing=\"0\" frameborder=\"0\"></iframe>"
										+"</td>"
									+"</tr>"									
								+"</table>"
							+"</td>" 
						  +"</tr>"
						  +"</table>"
						  
						  +"<form action=\"" + url + "\" method=\"post\" target=\"popup_iframe\" id=\"popup_iframe_form\">"
						  +"<input type=\"hidden\" value=\""+ url + "\" />"
						  + "</form>"
						+"</div>";
	
     	document.getElementById("detailPopup").innerHTML = s.join("");
	    document.getElementById(popupID).style.display="block";
	    document.getElementById('detailPopup').style.display="block";
	    scrollFix();
	    var form = document.getElementById("popup_iframe_form");
	    for(var key in params) {
	        var hiddenField = document.createElement("input");
	        hiddenField.setAttribute("type", "hidden");
	        hiddenField.setAttribute("name", key);
	        hiddenField.setAttribute("value", params[key]);

	        form.appendChild(hiddenField);
	    }
	    form.submit();
	}	
	
	function addEmptyIFramePopup(popupID,url,width,height)
	{    
   		init(); 
	    styledPopupClose('detailPopup'); 
	    styledPopupClose(popupID);
	    var pageSize = _getPageSize();
	    //var y = (pageSize.windowWidth/2 - width/2);
	    //var x = (pageSize.windowHeight/2 - height/2);
	    var y = (pageSize.pageWidth/2 - width/2);
	    //var x = (document.body.scrollTop+pageSize.windowHeight/2)- height/2; 
	    var x = (pageSize.windowHeight/2)- height/2; 
	    
	    var s = new Array();						  
	    s[s.length] =  "<div id='" + popupID + "' name='name'"
					   +"style='width: " + width + "px; height: " + height + "px; display: none; position: absolute; top: " + x + "px; left: " + y + "px;'>"
					   +"<table width='" + width + "px' height='" + height + "px' cellpadding='0' cellspacing='0' border='1' class='dragme borderColor2 backColorWhite'>"
					   +"<tr>"
					      +"<td width='" + width + "px' height='" + height + "px'>"
							   +"<table width='100%' height='100%' cellpadding='0' cellspacing='0' border='0' class='dragme'>"
									+"<tr valign='middle'>"
									    +"<td valign='middle' align='bottom' colspan='2' style='width:100%; height:100%;'>"
											+"<iframe style='width:"+ (width-2) + "px; height: "+ (height-50) + "px;' scrolling='no' src=\""
											+ url
											+"\" framespacing=\"0\" frameborder=\"0\"></iframe>"
										+"</td>"
									+"</tr>"									
								+"</table>"
							+"</td>" 
						  +"</tr>"								
						+"</div>";
	
     	document.getElementById("detailPopup").innerHTML = s.join("");
	    document.getElementById(popupID).style.display="block";
   	    document.getElementById('detailPopup').style.display="block";
   	    scrollFix();
	}
	
	function addPopup(popupID,title,body,width,height)
	{     
		init();
		styledPopupClose('detailPopup'); 
	    styledPopupClose(popupID);
	    var pageSize = _getPageSize();
	    //var y = (pageSize.windowWidth/2 - width/2);
	    //var x = (pageSize.windowHeight/2 - height/2);
	    var y = (pageSize.pageWidth/2 - width/2);
	    //var x = (document.body.scrollTop+pageSize.windowHeight/2)- height/2; 
	    var x = (pageSize.windowHeight/2)- height/2; 
	    
	    var s = new Array();						  
	    s[s.length] =  "<div id='" + popupID + "' name='name'"
					   +"style='width: " + width + "px; height: " + height + "px; display: none; position: absolute; top: " + x + "px; left: " + y + "px;'>"
					   +"<table width='" + width + "px' height='" + height + "px' cellpadding='0' cellspacing='0' border='1' class='dragme borderColor2 backColorWhite'>"
					   +"<tr>"
					      +"<td width='" + width + "px' height='" + height + "px'>"
							   +"<table width='100%' height='100%' cellpadding='0' cellspacing='0' border='0' class='dragme'>"
									+"<tr valign='top'>"
										+"<td colspan='2' valign='top' height='19px' align='right'><a href=\"javascript:styledPopupClose('"+popupID+"');\"><img height='19px'"
											+"width='90px' src='../../images/close2.jpg' border='0'></a></td>"
									+"</tr>"
									+"<tr valign='top'>"
									    +"<td valign='top' width='5px'>"
										+"</td>" 									
										+"<td valign='top' height='25px'>"
										+"<font class='text3 color2'>" + "Details" + "</font>"
										+"</td>" 
									+"</tr>"
									+"<tr valign='top'>"
									    +"<td valign='top' width='5px'>"
										+"</td>" 									    
										+"<td valign='top' height='20px'>"
										+"<font class='text2 color3' >" + title + "</font>"
										+"</td>" 
									+"</tr>"
									+"<tr valign='middle'>"
									    +"<td valign='middle' align='center' colspan='2'>"
									        +"<table width='99%' height='99%' cellpadding='0' cellspacing='0' border='1' class='dragme borderColor4'>"
									          +"<tr valign='top'>"
									             +"<td valign='top' align='left' colspan='2'>"
									             +"<font class='text1 color3'>"
									             + body
									             +"</font>"
												 +"</td>"
											  +"</tr>"									             
									        +"</table>"
										+"</td>"
									+"</tr>"									
								+"</table>"
							+"</td>" 
						  +"</tr>"								
						+"</div>";
	
     	document.getElementById("detailPopup").innerHTML = s.join("");
	    document.getElementById(popupID).style.display="block";
   	    document.getElementById('detailPopup').style.display="block";
   	    scrollFix();
	} 
	
	
	function addPopupWithSubmit(popupID,body,width,height,formName,formField)
	{     
		init();
		styledPopupClose('detailPopup'); 
	    styledPopupClose(popupID);
	    var pageSize = _getPageSize();
	    //var y = (pageSize.windowWidth/2 - width/2);
	    //var x = (pageSize.windowHeight/2 - height/2);
	    var y = (pageSize.pageWidth/2 - width/2);
	    //var x = (document.body.scrollTop+pageSize.windowHeight/2)- height/2; 
	    var x = (pageSize.windowHeight/2)- height/2; 
	    
	    var s = new Array();						  
	    s[s.length] =  "<div id='" + popupID + "' name='name'"
					   +"style='width: " + width + "px; height: " + height + "px; display: none; position: absolute; top: " + x + "px; left: " + y + "px;'>"
					   +"<table width='" + width + "px' height='" + height + "px' cellpadding='0' cellspacing='0' border='1' class='dragme borderColor2 backColorWhite'>"
					   +"<tr>"
					      +"<td width='" + width + "px' height='" + height + "px'>"
							   +"<table width='100%' height='100%' cellpadding='0' cellspacing='0' border='0' class='dragme'>"
									+"<tr valign='top'>"
										+"<td colspan='2' valign='top' height='19px' align='right'><a href=\"javascript:styledPopupClose('"+popupID+"');partialSubmitForm('"+formName+"','"+formField+"');\"><img height='19px'"
											+"width='90px' src='../../images/close2.jpg' border='0'></a></td>"
									+"</tr>"
									+"<tr valign='middle'>"
									    +"<td valign='middle' align='center' colspan='2'>"
									        +"<table width='99%' height='99%' cellpadding='0' cellspacing='0' border='1' class='dragme borderColor4'>"
									          +"<tr valign='top'>"
									             +"<td valign='top' align='left' colspan='2'>"
									             +"<font class='text1 color3'>"
									             +"<div style='height:200px;overflow:auto'>"
									             + body
									             +"</div></font>"
												 +"</td>"
											  +"</tr>"									             
									        +"</table>"
										+"</td>"
									+"</tr>"									
								+"</table>"
							+"</td>" 
						  +"</tr>"								
						+"</div>";
	
     	document.getElementById("detailPopup").innerHTML = s.join("");
	    document.getElementById(popupID).style.display="block";
   	    document.getElementById('detailPopup').style.display="block";
   	    scrollFix();
	} 
	
  	
	function addPopupWithScrollBar(popupID,body,width,height)
	{     
		init();
		styledPopupClose('detailPopup'); 
	    styledPopupClose(popupID);
	    var pageSize = _getPageSize();
	    //var y = (pageSize.windowWidth/2 - width/2);
	    //var x = (pageSize.windowHeight/2 - height/2);
	    var y = (pageSize.pageWidth/2 - width/2);
	    //var x = (document.body.scrollTop+pageSize.windowHeight/2)- height/2; 
	    var x = (pageSize.windowHeight/2)- height/2; 
	    
	    var s = new Array();						  
	    s[s.length] =  "<div id='" + popupID + "' name='name'"
					   +"style='width: " + width + "px; height: " + height + "px; display: none; position: absolute; top: " + x + "px; left: " + y + "px;'>"
					   +"<table width='" + width + "px' height='" + height + "px' cellpadding='0' cellspacing='0' border='1' class='dragme borderColor2 backColorWhite'>"
					   +"<tr>"
					      +"<td width='" + width + "px' height='" + height + "px'>"
							   +"<table width='100%' height='100%' cellpadding='0' cellspacing='0' border='0' class='dragme'>"
									+"<tr valign='top'>"
										+"<td colspan='2' valign='top' height='19px' align='right'><a href=\"javascript:styledPopupClose('"+popupID+"');\"><img height='19px'"
											+"width='90px' src='../../images/close2.jpg' border='0'></a></td>"
									+"</tr>"
									+"<tr valign='middle'>"
									    +"<td valign='middle' align='center' colspan='2'>"
									        +"<table width='99%' height='99%' cellpadding='0' cellspacing='0' border='1' class='dragme borderColor4'>"
									          +"<tr valign='top'>"
									             +"<td valign='top' align='left' colspan='2'>"
									             +"<font class='text1 color3'>"
									             +"<div style='height:200px;overflow:auto'>"
									             + body
									             +"</div></font>"
												 +"</td>"
											  +"</tr>"									             
									        +"</table>"
										+"</td>"
									+"</tr>"									
								+"</table>"
							+"</td>" 
						  +"</tr>"								
						+"</div>";
	
     	document.getElementById("detailPopup").innerHTML = s.join("");
	    document.getElementById(popupID).style.display="block";
   	    document.getElementById('detailPopup').style.display="block";
   	    scrollFix();
	} 

	function addPopupWithCloseButton(popupID,body,width,height)
	{   
		init();
		styledPopupClose('detailPopup'); 
	    styledPopupClose(popupID);
	    var pageSize = _getPageSize();
	    var y = (pageSize.pageWidth/2 - width/2);
	    //var x = (document.body.scrollTop+pageSize.windowHeight/2)- height/2; //(pageSize.pageHeight/2 - height/2);
	    var x = (pageSize.windowHeight/2)- height/2; //(pageSize.pageHeight/2 - height/2);
	    
	    var s = new Array();						  
	    s[s.length] =  "<div id='" + popupID + "' name='name'"
					   +"style='width: " + width + "px; height: " + height + "px; display: none; position: absolute; top: " + x + "px; left: " + y + "px;'>"
					   +"<table width='" + width + "px' height='" + height + "px' cellpadding='0' cellspacing='0' border='1' class='dragme borderColor2 backColorWhite'>"
					   +"<tr>"
					      +"<td width='" + width + "px' height='" + height + "px'>"
							   +"<table width='100%' height='100%' cellpadding='0' cellspacing='0' border='0' class='dragme'>"
									+"<tr valign='top'>"
										+"<td colspan='2' valign='top' height='19px' align='right'><a href=\"javascript:styledPopupClose('"+popupID+"');\"><img height='19px'"
											+"width='90px' src='../../images/close2.jpg' border='0'></a></td>"
									+"</tr>"
									+"<tr valign='middle'>"
									    +"<td valign='middle' style='height:100%;' align='center' colspan='2'>"
									        +"<table width='99%' height='99%' cellpadding='0' cellspacing='0' border='1' class='dragme borderColor4'>"
									          +"<tr valign='top'>"
									             +"<td valign='top' align='left' colspan='2' style:'vertical-align:middle;'>"
									             +"<font class='text1 color3'>"
									             + body
									             +"</font>"
												 +"</td>"
											  +"</tr>"									             
									        +"</table>"
										+"</td>"
									+"</tr>"									
								+"</table>"
							+"</td>" 
						  +"</tr>"								
						+"</div>";
	
     	document.getElementById("detailPopup").innerHTML = s.join("");
	    document.getElementById(popupID).style.display="block";
   	    document.getElementById('detailPopup').style.display="block";
   	    scrollFix();
	} 

	function addLoadingPopupWithCloseButton(popupID,message,width,height)
	{ 
		addPopupWithCloseButton(popupID,"<table style='width:100%;height:100%;'><tr><td style='text-align:center;'>"+message+"</td></tr><tr><td style='width:100%; text-align:center; height:100%; vertical-align:middle;'><img height='32px' width='32px' src='../../images/actions/lightbox-load-ani.gif'/></td></tr></table>",width, height);
	}
	
	function getScroll()
	{
		var scrOfX = 0, scrOfY = 0;
		if( typeof( window.pageYOffset ) == 'number' ) {
			scrOfY = window.pageYOffset; scrOfX = window.pageXOffset;
		} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
			scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft;
		} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
			scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft;
		}
		return { 'scrOfX':scrOfX,
		         'scrOfY':scrOfY 
		        };
	}
 
  function _getPageSize() {
    var xScroll, yScroll;
    try{
	    if (window.innerHeight && window.scrollMaxY) {
	      xScroll = document.body.scrollWidth;
	      yScroll = window.innerHeight + window.scrollMaxY;
	    } else if (document.body.scrollHeight > document.body.offsetHeight){
	      // all but Explorer Mac
	      xScroll = document.body.scrollWidth;
	      yScroll = document.body.scrollHeight;
	    } else {
	      // Explorer Mac...would also work in Explorer 6 Strict,
	      // Mozilla and Safari
	      xScroll = document.body.offsetWidth;
	      yScroll = document.body.offsetHeight;
	    }
   	  } catch (e) 
	  { /*do nothing*/ }

    var windowWidth, windowHeight;
    try{
		    if (self.innerHeight) {      // all except Explorer
		      windowWidth = self.innerWidth;
		      windowHeight = self.innerHeight;
		    } else if (document.documentElement
		    && document.documentElement.clientHeight) {
		      // Explorer 6 Strict Mode
		      windowWidth = document.documentElement.clientWidth;
		      windowHeight = document.documentElement.clientHeight;
		    } else if (document.body) { // other Explorers
		      windowWidth = document.body.clientWidth;
		      windowHeight = document.body.clientHeight;
		    }
		
		    // for small pages with total height less then height of the viewport
	    if(yScroll < windowHeight){
	      pageHeight = windowHeight;
	    } else {
	      pageHeight = yScroll;
	    }
	
	    // for small pages with total width less then width of the viewport
	    if(xScroll < windowWidth){
	      pageWidth = windowWidth;
	    } else {
	      pageWidth = xScroll;
	    }
	  } catch (e) 
	  { /*do nothing*/ }
    return {
      'pageWidth':pageWidth,
      'pageHeight':pageHeight,
      'windowWidth':windowWidth,
      'windowHeight':windowHeight,
      'yScroll':yScroll,
      'xScroll':xScroll
    };
  }	 
  
  
  
    function HideToolTip()
	{
	  document.getElementById("toolTip").innerHTML = "";
	}
	
  	function ShowToolTip(title,message)
	{  		
	    var s = new Array();						  
	    s[s.length] =  "<table width='100%' cellpadding='0' cellspacing='0' border='1' class='dragme borderColor2 backColorWhite'>"
						  +"<tr valign='top'>"									
							  +"<td valign='top'>"
								    +"<table width='100%' cellpadding='0' cellspacing='0'>"
						  				+"<tr valign='top'>"									
							  				+"<td valign='top'>"								    
												+"<font class='text1 color2'>" + title + "</font>"
											 +"</td>"
						  				+"</tr>"	
						  				+"<tr valign='top'>"									
							  				+"<td valign='top'>"							  														 												
												+"<font class='text1 color2'>" + message + "</font>"
											 +"</td>"
						  				+"</tr>"											
									+"</table>";								
							  +"</td>"
						   +"</tr>"
						+"</table>";
     	document.getElementById("toolTip").innerHTML = s.join("");
	}

  	function addLoadEvent(func) { 
  		var oldonload = window.onload; 
  		if (typeof window.onload != 'function') { 
  			window.onload = func; 
  		} else { 
  			window.onload = function() { 
  				if (oldonload) { 
  					oldonload(); 
  				} 
  				func(); 
  			} 
  		} 
  	} 

	
   	function init(){
		window.onscroll = scrollFix; window.onresize = sizeFix;
	}
    