
//** GlobalVariables.ie5 **

var bSkipCtrlState    = false;
var bSkipAltState     = true;
var iSkipStartKey     = 66;
var iSkipEndKey       = 90;
var sapUrDomainRelaxing = {NONE:"NONE",MINIMAL:"MINIMAL",MAXIMAL:"MAXIMAL"};
try {ur_system==null;} catch(e) {ur_system = {doc : window.document , stylepath : document.location.pathname.substring(0,document.location.pathname.substring(1).indexOf("/")+1)+"/resources/style/", is508 : true, domainrelaxing:sapUrDomainRelaxing.MINIMAL, dateformat:1, firstdayofweek:0};}
try {ur_language==null;} catch(e) {ur_language="en"};
ur_txt=new Array();
ur_system.browser_abbrev = "ie5";
if(ur_system.mimepath==null) ur_system.mimepath = ur_system.stylepath+"common/";
if(ur_system.emptyhoverurl==null) ur_system.emptyhoverurl = ur_system.mimepath+"emptyhover.html";

//** GlobalFunctions.ie5 **

function sapUrMapi_checkKey(e,eType,arrKeys) {
	if (e.type==eType) {
		for (var i=0;i<arrKeys.length;i++) {
			if (e.keyCode==parseInt(arrKeys[i])) {
				e.returnValue=false;
				return true;
			}
		}
	}
	return false;
}
var ur_context={suppressFocus:false};
function sapUrMapi_suppressFocus(){
	ur_context.suppressFocus=true;
}
function sapUrMapi_triggerFocus(sId) {
  var o=ur_get(sId);
  if (o) try {o.focus();} catch (ex){ }
  ur_callDelayed("sapUrMapi_focusElement('"+sId+"',true)",0);
}
function sapUrMapi_findFirstFocus(o) {
  var oChild=o;
  if (o==null) return null;
  if (sapUrMapi_Focus_canFocus(o)) {
		return o;
  }
  if (!o.childNodes) return null;
  
  if (ur_system.direction=="rtl") {
   	for (var i=oChild.childNodes.length-1;i>=0;i--) {
      var oTmp=oChild.childNodes.item(i);
	  if (sapUrMapi_Focus_canFocus(oTmp)) {
	    return oTmp;
      }
      var oTmp=sapUrMapi_findFirstFocus(oTmp);
      if (oTmp!=null) {
        return oTmp;
      }
    }  
  } else {    
    for (var i=0;i<oChild.childNodes.length;i++) {
      var oTmp=oChild.childNodes.item(i);
	  if (sapUrMapi_Focus_canFocus(oTmp)) {
	    return oTmp;
      }
      var oTmp=sapUrMapi_findFirstFocus(oTmp);
      if (oTmp!=null) {
        return oTmp;
      }
    }  
  }
  return null;
}
function ur_focus(o) {
	try {o.focus();} 
	catch (ex){}
}
function sapUrMapi_focusElement(sId,bTriggered) {
  var bErr=false;
  if (ur_context.suppressFocus) {
    window.attachEvent("onfocus",sapUrMapi_focusElement);
    ur_context.setfocusto=sId;
    ur_context.suppressFocus = false;
    return;
  } 
  if (ur_context.setfocusto != null) {
    sId=ur_context.setfocusto;
    window.detachEvent("onfocus",sapUrMapi_focusElement);
    ur_context.setfocusto=null;
  }
	if(sId == "") return;
		var o;
	  if (typeof(sId)=="string") {
	    o=ur_get(sId);
	  } else {
	    o=sId;
	  }
	  var sType=sapUrMapi_getControlTypeFromObject(o);
	  
		if (sType=="InputField" && o.tagName=="INPUT")
		{
			var txtRange = o.createTextRange();
			if(txtRange)
			{
				txtRange.collapse();
				txtRange.moveStart("character",0);
				txtRange.select();
			}
			else
				o.select();
		}
				
		if ((sType=="Tree")&&((o.className.indexOf("urTreN")>-1)||(o.className.indexOf("urTreExp")>-1))) {
		  sapUrMapi_Tree_focusNode(sapUrMapi_getRootControl(o).id,o.id.split("-")[0],true);
		} else if ((sType=="TabStrip")&&
	            (((o.className.indexOf("urTbsTxt")>-1) || ((o.firstChild!=null)&&(o.firstChild.className.indexOf("urTbsTxt")>-1))))){
		  	sapUrMapi_TabStrip_focusItem(sapUrMapi_getRootControl(o).id,parseInt(o.id.split("-")[2]));
		} else if (sType=="InputField" || sType=="TextEdit") { 
		   
		} else if (sType=="SelectableLinkBar") {
	    if (o.id.indexOf("-itm-")>-1) {
		    sapUrMapi_SelectableLinkBar_scroll(sapUrMapi_getRootControl(o).id,o.id);
		    sapUrMapi_setTabIndex(o,0);
		  }
		  try {
		   ur_focus(o);
		  } catch (ex){bErr=true};
		} else if ((sType=="PhaseIndicator")&&(o.id.indexOf("-itm-")>-1)) {
		    sapUrMapi_PhaseIndicator_focusItem(sapUrMapi_getRootControl(o).id,"-itm-0",o.id.substring(o.id.indexOf("-")));
		} else if ((sType=="RoadMap")&&(o.id.indexOf("-itm-")>-1)) {
		    sapUrMapi_RoadMap_setFocus(sapUrMapi_getRootControl(o).id,"-itm-0",o.id.substring(o.id.indexOf("-")));
		} else if (sType=="SapTable") {
		  if ((o.firstChild!=null) && (o.firstChild.tagName=="BUTTON") && (o.firstChild.className.indexOf("Ico")>-1)) {
		    o=o.firstChild;
		  }
		  try {
		   ur_focus(o);
		  } catch (ex){bErr=true};
		} else if (sType=="ComboBox") {
		  o=ur_get(sapUrMapi_getRootControl(o).id);
			if (o.disabled==true) { o.disabled=false; ur_focus(o);o.disabled=true;}
			else ur_focus(o);
		} else if (sType=="CheckBox") {
			o=ur_get(o.id.split("-")[0]);
			if (o.disabled==true) {o=ur_get(o.id.split("-")[0]+"-img");}
			ur_focus(o);
		} else if (sType=="RadioButton") {
			o=ur_get(o.id.split("-")[0]);
		  if (!o.checked) {
				var oInputGrp  = document.getElementsByName(o.name);
				for (var i=0;i<oInputGrp.length;i++){
				  if (oInputGrp[i].checked) {
				    o=oInputGrp[i];
						break;
				  } 
				}
		  }
		  try {
			 if (o.disabled==true) {o=ur_get(o.id.split("-")[0]+"-img");}
		   ur_focus(o);
		  } catch (ex){bErr=true};
		} else if (sType=="RadioButtonGroup" && o.id.indexOf("skipend")<-1) {
		  o=sapUrMapi_findFirstFocus(o);
			if (o!=null && !o.checked) {
				var oInputGrp  = document.getElementsByName(o.name);
				for (var i=0;i<oInputGrp.length;i++){
				  if (oInputGrp[i].checked) {
				    o=oInputGrp[i];
				  } 
				}
		  }
		  o=ur_get(o.id.split("-")[0]);
		  try {
		   ur_focus(o);
		  } catch (ex){bErr=true};
		} else {
			if (typeof(sId)=="string") {
				if (ur_get(sId+"-r")!=null) {
					sapUrMapi_focusElement(sId+"-r");
				}
			}
			o=sapUrMapi_findFirstFocus(o);
			if (o==null) return;
		  try {
		   ur_focus(o);
		  } catch (ex){bErr=true};
	  }
	  if (!b508Refocus) {
	   if (bErr) {
	     sapUrMapi_Focus_hideFocusRect();
	   } else {
	     sapUrMapi_Focus_showFocusRect(o);
	   }
	  }
	  return true;
	
}
var b508Refocus=false;
function sapUrMapi_refocusElement(sId) {
	if (ur_system.is508) {
	  oSpan=ur_get("ur-accfocus");
	  if (oSpan==null) {
	    oSpan=document.createElement("span");
	    oSpan.setAttribute("id","ur-accfocus");
	    oSpan.style.position="absolute";
	    document.getElementsByTagName("BODY").item(0).appendChild(oSpan);
	    oSpan=ur_get("ur-accfocus");
	  }
	  oSpan.tabIndex="2";
	  b508Refocus=true;
	  oSpan.focus();
	  ur_get(sId).focus();
	  b508Refocus=false;
	  oSpan.tabIndex="-1";
	}
}
function sapUrMapi_setTabIndex(oElem,iVal) {
  oElem.tabIndex=iVal;
  oElem.setAttribute("ti",iVal);
}
function sapUrMapi_getAbsolutePosition (obj) {
	var position = { top: 0, left: 0, right: 0};
	var oOrg=obj;
	while (obj) {   
	  var offsetleft = obj.offsetLeft;
	  if (ur_system.direction=="rtl") {
	    var offsetright = sapUrMapi_offsetRight(obj);
	    var controlType = sapUrMapi_getControlTypeFromObject(obj);
	    if (controlType=="MenuBar") {
	      
	      
	      
	      
	      if (obj.tagName=="SPAN") {
	        var temp=offsetleft+3;
	        offsetleft=offsetright-3;
	        offsetright=temp;
	  }
	    } else if (controlType=="Tree") {
	      
	      
	      if (obj.tagName=="SPAN") {
	        if (obj.offsetParent) {
	          offsetleft+=obj.offsetParent.offsetWidth-obj.offsetWidth;
	          offsetright+=obj.offsetWidth-obj.offsetParent.offsetWidth; 
	        }
	      }
	    } else   
	    
	    
	    
	    if ((offsetleft < 0) && !(parseInt(obj.currentStyle.marginLeft) < 0)) {  
	      var parentControlType = "none";
          if (obj.offsetParent) {
            parentControlType = sapUrMapi_getControlTypeFromObject(obj.offsetParent);
          }
	      if ((controlType == "SapTable") || (controlType == "TableView")) {
			if (obj.offsetParent) {
			  
			  
			  
			  
              offsetleft = parseInt(obj.offsetParent.currentStyle.paddingLeft);
              offsetright = parseInt(obj.offsetParent.currentStyle.paddingRight);
              if (isNaN(offsetleft)) {offsetleft=0;}
              if (isNaN(offsetright)) {offsetright=0;}
            } else 
              offsetleft = 0;
              offsetright = 0;
	      } else if (controlType == "PopupMenu") {
	        offsetleft = 0;
	        offsetright = 0;
	      } 
	      if ((parentControlType == "RasterLayout") && (controlType != "RasterLayout")) {
	        offsetleft = 0;
	        offsetright = 0;
	      }
	    } else 
	    if (controlType == "RatingIndicator") {
	      
	      
	      
	      if (obj.tagName=="SPAN") {
	          offsetleft+=obj.firstChild.firstChild.offsetWidth-obj.offsetWidth;
	          offsetright+=obj.offsetWidth-obj.firstChild.firstChild.offsetWidth; 
	      }  
	    } else 
	    if (controlType == "ComboBox") {
	      
	      
	      
	      
	      var parentControlType = "none";
          if (obj.offsetParent) {
            parentControlType = sapUrMapi_getControlTypeFromObject(obj.offsetParent);
          }
	      if (parentControlType != "SapTable") {      
	        if (obj.tagName=="SPAN") {
              offsetleft+=obj.firstChild.offsetWidth-obj.offsetWidth;
	          offsetright+=obj.offsetWidth-obj.firstChild.offsetWidth; 
	        }  
	      }     
	    }
	    if (sapUrMapi_getControlTypeFromObject(obj.firstChild) == "Caption") {
	      
	      
	      
	      var objChild = obj.firstChild;
	      if (obj.tagName=="SPAN") {
	          offsetleft+=objChild.firstChild.offsetWidth-objChild.offsetWidth;
	          offsetright+=objChild.offsetWidth-objChild.firstChild.offsetWidth; 
	      }  
	    }    
	    position.right += offsetright;
	  }     
	  var offsettop=obj.offsetTop;
	  if (oOrg!=obj && obj.tagName!="TABLE") { 
			var iT=parseInt(obj.currentStyle.borderTopWidth);
			if (!isNaN(iT)) {
				offsettop+=iT;
			}
			var iW=parseInt(obj.currentStyle.borderLeftWidth);
			if (!isNaN(iW)) offsetleft+=iW;
		}
	  position.top  += offsettop;
	  position.left += offsetleft;
	  obj = obj.offsetParent;
	}
	return position;
}
function sapUrMapi_getOffsetOnScreen (object) {
	var position= { top: 0, left: 0};
	position = sapUrMapi_getAbsolutePosition(object);
	var sccontrol = object.parentNode;
	while (sccontrol) {
	  if (sccontrol.tagName=="DIV" || sccontrol.tagName=="SPAN") {
	    if (sccontrol.currentStyle.overflow!="visible") {
	      if (sccontrol.scrollTop>0)  position.top=position.top-sccontrol.scrollTop;
	      if (sccontrol.scrollLeft>0) position.left=position.left-sccontrol.scrollLeft;
	    }
	  }
    	  sccontrol = sccontrol.parentNode;
	}
	return position;
}
function sapUrMapi_getRootControl(o) {
	try {
	  if (o.id.indexOf("-")>-1) {
	    o=ur_get(o.id.split("-")[0]);
	  }
	  while (o.getAttribute("ct")==null) {
	    if (o.tagName=="BODY") return "";
	    o=o.parentNode;
	  }
	  return o;
	} catch (ex) {return ""};
}
function sapUrMapi_isChildOfControl(oObj,sControlType) {
  while (oObj.tagName!="BODY") {
    if (sapUrMapi_getControlTypeFromObject(oObj)==sControlType) return oObj;
    oObj=oObj.parentNode;
  }
  return null;
}
function sapUrMapi_getControlTypeFromObject(o) {
	try {
	  return sapUrMapi_getRootControl(o).getAttribute("ct");
	} catch (ex) {return ""};
}
function sapUrMapi_getControlType(sId) {
	try {
	  aId=sId.split("-");
	  return ur_get(aId[0]).getAttribute("ct");
	} catch (ex) {return ""};
}
function sapUrMapi_cancelEvent(e,ePrime){
	if (ePrime) 
		e = ePrime;
	e.keyCode="";
	e.cancelBubble=true;
	e.returnValue=false;
	return true;
}
function ur_cancelBubble(oEvt){
	oEvt.cancelBubble=true;
}
function sapUrMapi_skip(sId,oEvt) {
	if(!ur_system.is508) return;
	var sStart=sId;
	var sEnd=sId+"-skipend";
 	var sCt=ur_get(sId).getAttribute("ct");
	
	if(sCt=="ActiveXContainer" || sCt=="AppletContainer" || sCt=="Toolbar"){ 
		sStart+="-r";
	}
	else if(sCt=="GenericTableView" || sCt=="Group" || sCt=="Iframe" || sCt=="PatternContainerTab" || 
					sCt=="PatternContainerSequence" || sCt=="TableView" || sCt=="TabStrip" || sCt=="Tray"){ 
		sStart+="-skipstart";	
		if(ur_get(sStart)==null) sStart=sId;
	}		
		
	
	if(oEvt.altKey && oEvt.keyCode==90 && oEvt.srcElement.id!=sEnd){
 		oEvt.returnValue=false;
 		oEvt.cancelBubble=true;
		return sapUrMapi_focusElement(sEnd);
	}
	
	else if(oEvt.altKey && oEvt.keyCode==66 && oEvt.srcElement.id!=sStart){
 		oEvt.returnValue=false;
 		oEvt.cancelBubble=true;	
		return sapUrMapi_focusElement(sStart);
	}
}
function getLanguageText(sMain,arrChildTxt) {
	 var s;
	 try {
	 	 s= ur_txt[ur_language][sMain];
	 	 if (arrChildTxt) {
		 	for (var i=0;i<arrChildTxt.length;i++) {
			 	 if (ur_txt[ur_language][arrChildTxt[i]]) {
			 	   s= s.replace("{"+i+"}",ur_txt[ur_language][arrChildTxt[i]]);
		 	 	} else {
		 	   	s= s.replace("{"+i+"}",arrChildTxt[i]);
		 	 }
		 }
	 }
	} catch (e) {
   		s="";
	}
	 return s;
}
function sapUrMapi_triggerClick(e,arrKeys) {
 if(sapUrMapi_checkKey(e,"keydown",arrKeys) || sapUrMapi_checkKey(e,"keypress",arrKeys)){
  try{
      e.srcElement.click();
    }
    catch(ex){};
  }
}
function sapUrMapi_scrollRight(elem) {
  return elem.scrollWidth-elem.scrollLeft-elem.clientWidth;
}
function sapUrMapi_clientRight(elem)
{
  return elem.offsetWidth-elem.clientWidth-elem.clientLeft;
}
function sapUrMapi_scrollBarWidth(elem)
{
  clientRight=sapUrMapi_clientRight(elem);
  if (elem.clientLeft>clientRight) return elem.clientLeft-clientRight;
    else return clientRight-elem.clientLeft;
}
function sapUrMapi_offsetRight(elem)
{
  if (elem.offsetParent)
    return elem.offsetParent.clientWidth-elem.offsetLeft-elem.offsetWidth;
  else return 0;
}
function sapUrMapi_clientXtoRight(docBody, e)
{
  return docBody.offsetWidth-e.clientX;
}
function sapUrMapi_posLeftCorrectionForRTL(elem)
{
   return elem.scrollWidth - elem.clientWidth + 16;
}
function sapUr_Scroll_scrollToPosition(sId,x,y) {
	sapUrMapi_scrollToPosition(ur_get(sId),x,y);
}
function sapUrMapi_scrollToPosition(o,x,y) {
	o.scrollTop=y;
  o.scrollLeft=x;
}
function sapUrMapi_getScrollLeft(o) {
  return o.scrollLeft;
}
function sapUrMapi_getScrollTop(o) {
  return o.scrollTop;
}
function sapUr_Scroll_scrollLeft(sId) {
	return sapUrMapi_getScrollLeft(ur_get(sId));
}
function sapUr_Scroll_scrollRight(sId) {
	var o = ur_get(sId);
	return sapUrMapi_scrollRight(o);
}
function sapUr_Scroll_scrollTop(sId) {
	return sapUrMapi_getScrollTop(ur_get(sId));
}
function ur_Scrl_setScrlPosById(sId,oPos)
{
	var obj = ur_get(sId);
	if(obj != null)
	{	
		sapUrMapi_scrollToPosition(obj,oPos.x,oPos.y)
	}
}
function ur_Scrl_getScrlPosById(sId)
{
	var obj = ur_get(sId);
	var oPos = new Object();
	if(obj != null)
	{	
		oPos.x = sapUrMapi_getScrollLeft(obj);
		oPos.y = sapUrMapi_getScrollTop(obj);
		return oPos;
	}
}
function sapUrMapi_initLinkStatus() {
  var oNodes = document.getElementsByTagName("A");
  for (var n=0;n<oNodes.length;n++) {
    if (oNodes[n].href.indexOf("javascript:void")>-1) {
      oNodes[n].attachEvent("onmouseover",sapUrMapi_resetStatus);
      oNodes[n].attachEvent("onfocus",sapUrMapi_resetStatus);
    }
  }
}
function sapUrMapi_resetStatus() {
  window.status="";
  event.returnValue=true;
}
function sapUrMapi_Resize_Handler(sId, sHandler) {
	this.sId = sId;
	this.sHandler = sHandler;
}
var sapUrMapi_Resize_Registry = new Array();
var sapUrMapi_Resize_Width = null;
var sapUrMapi_Resize_Timeout = null;
var sapUrMapi_Resize_Set = false;
function sapUrMapi_Resize_Capture() {
	if (sapUrMapi_Resize_Set == false) {
		window.attachEvent("onresize", sapUrMapi_Resize_CheckSize);
		sapUrMapi_Resize_Set = true;
	}
}
function sapUrMapi_Resize_AddItem(sId, sHandler) {
	
	sapUrMapi_Resize_Capture();
	
	if (!sapUrMapi_Resize_Registry[sId] || sapUrMapi_Resize_Registry[sId]) {
		sapUrMapi_Resize_Registry[sId] = new sapUrMapi_Resize_Handler(sId, sHandler);
	}
}
function sapUrMapi_Resize_CheckSize() {
	if (sapUrMapi_Resize_Timeout == null && sapUrMapi_Resize_Width == null) {
		sapUrMapi_Resize_Width = document.body.offsetWidth;
		sapUrMapi_Resize_Timeout = window.ur_callDelayed("sapUrMapi_Resize_CheckSize()", 50);
		return;
	}
	if (sapUrMapi_Resize_Width != document.body.offsetWidth) {
		sapUrMapi_Resize_Width = document.body.offsetWidth;
		sapUrMapi_Resize_Timeout = window.ur_callDelayed("sapUrMapi_Resize_CheckSize()", 50);
	}
	else {
	    window.clearTimeout(sapUrMapi_Resize_Timeout);
		sapUrMapi_Resize_Timeout = null;
		sapUrMapi_Resize_Resize();
		sapUrMapi_Resize_Width = null;
	}
}
function sapUrMapi_Resize_Resize() {
	for (var ctl in sapUrMapi_Resize_Registry) {
		if (ctl.indexOf("_") == 0) {continue;}
		if (sapUrMapi_Resize_Registry[ctl] != null) {
		  eval(sapUrMapi_Resize_Registry[ctl].sHandler);
		}
	}
}
function sapUrMapi_Create_Handler(sId, sHandler) {
	this.sId = sId;
	this.sHandler = sHandler;
}
var sapUrMapi_Create_Registry = new Array();
var sapUrMapi_Create_Set = false;
var sapUrMapi_Create_Timeout = null;
function sapUrMapi_Create_Capture() {
	if (sapUrMapi_Create_Set == false) {
		window.document.attachEvent("onreadystatechange", sapUrMapi_Create_CreateItems);
		sapUrMapi_Create_Set = true;
	}
}
function sapUrMapi_Create_AddItem(sId, sHandler) {
	
	sapUrMapi_Create_Capture();
	
	sapUrMapi_Create_Registry[sId] = new sapUrMapi_Create_Handler(sId, sHandler);
}
function sapUrMapi_Create_CreateItems() {
	if (document.readyState != "complete") return;
	else {
		for (var ctl in sapUrMapi_Create_Registry) {
			if (ctl.indexOf("_") == 0) {continue;}
			if (sapUrMapi_Create_Registry[ctl] != null) {
				eval(sapUrMapi_Create_Registry[ctl].sHandler);
			}
		}
		sapUrMapi_Create_Registry = new Array();
	}
}
function sapUrMapi_init() {
  if (ur_system.mimepath == null)ur_system.mimepath = ur_system.stylepath.substring(0,ur_system.stylepath.indexOf("/ur"))+"/common/"; 
  if(typeof(ur_system.emptyhoverurl)=="undefined" || (typeof(ur_system.emptyhoverurl)=="string" && ur_system.emptyhoverurl.length==0))
    ur_system.emptyhoverurl = ur_system.mimepath+"emptyhover.html";      
  oPopup=null;
  oDatePicker=null;
  sapUrMapi_Focus_hideFocusRect();
  sapUrMapi_Resize_Registry=new Array();
	sapUrMapi_PcTabSeq_Registry = new Array();  
	initMenus=new Array();
   _ur_tables=new Array();
}
function ur_evtSrc(e){
	if (typeof(e)=='undefined') e=window.event.srcElement;
	return e.srcElement;
}
function ur_get(sId) {
  return document.getElementById(sId);
}
function ur_isDisabled(o){
	var sSt=o.getAttribute("st");
	if(sSt==null || sSt.indexOf("d")<0) return false;
	else return true;
}
function ur_setDisabled(o,bOn){
	var sSt=o.getAttribute("st");
	if(bOn) {if(sSt.indexOf("d")==-1) o.setAttribute("st",sSt+"d");}
	else {if(sSt.indexOf("d")!=-1) o.setAttribute("st",sSt.replace("d",""));}
}
function ur_isInvalid(o){
	var sSt=o.getAttribute("st");
	if(sSt==null || sSt.indexOf("i")<0) return false;
	else return true;
}
function ur_setInvalid(o,bOn){
	var sSt=o.getAttribute("st");
	if(bOn) {if(sSt.indexOf("i")==-1) o.setAttribute("st",sSt+"i");}
	else {if(sSt.indexOf("i")!=-1) o.setAttribute("st",sSt.replace("i",""));}
}
function ur_isReadonly(o){
	var sSt=o.getAttribute("st");
	if(sSt==null || sSt.indexOf("r")<0) return false;
	else return true;
}
function ur_setReadonly(o,bOn){
	var sSt=o.getAttribute("st");
	if(bOn) {if(sSt.indexOf("r")==-1) o.setAttribute("st",sSt+"r");}
	else {if(sSt.indexOf("r")!=-1) o.setAttribute("st",sSt.replace("r",""));}
}
function ur_isRequired(o){
	var sSt=o.getAttribute("st");
	if(sSt==null || sSt.indexOf("m")<0) return false;
	else return true;
}
function ur_setRequired(o,bOn){
	var sSt=o.getAttribute("st");
	if(bOn) {if(sSt.indexOf("m")==-1) o.setAttribute("st",sS+"m");}
	else {if(sSt.indexOf("m")!=-1) o.setAttribute("st",sSt.replace("m",""));}
}
function ur_getStatusText(o){
	var sSt=o.getAttribute("st");
	var sStTxt="";
	if(sSt==null || sSt=="") return sStTxt;
	if(sSt.indexOf("d")!=-1) sStTxt += getLanguageText("SAPUR_DISABLED")+" ";
	if(sSt.indexOf("i")!=-1) sStTxt += getLanguageText("SAPUR_INVALID")+" ";
	if(sSt.indexOf("r")!=-1) sStTxt += getLanguageText("SAPUR_READONLY")+" ";
	if(sSt.indexOf("m")!=-1) sStTxt += getLanguageText("SAPUR_REQUIRED");
	sStTxt.replace(/\s+/g," ");
	return sStTxt;
}
function ur_getTooltip(sId){
	var o=null;
	if(typeof(sId)=="string") o=ur_get(sId);
	else o=sId;	
	var sTooltip="";
	var sCt=o.getAttribute("ct");
	var sSep=" "+getLanguageText("SAPUR_SEPARATOR")+" ";
	var sCtrlMsgId="SAPUR_"+sCt.toUpperCase();
	var sTutorMsgId="";	
	var sLbl=sapUrMapi_Label_getLabelText(sId);
	var sCtrl="";
	var sVal=o.value;
	var sSt=ur_getStatusText(o);
	var sTutor="";
	var sTt=o.getAttribute("tt");
	var sTtTbl=o.getAttribute("tttbl");
	
	
	if( (sCt=="InputField" || sCt=="ToolbarInputField") && sLbl==null)
		sLbl=o.getAttribute("lbl");
		
	
	if(sCt=="ComboBox" && o.getAttribute("dd")=="true") sCtrlMsgId="SAPUR_DDLISTBOX";
	else if(sCt=="InputField" || sCt=="ToolbarInputField") 
		if(o.getAttribute("f4")=="true")
			sCtrlMsgId="SAPUR_F4FIELD";
		else
			sCtrlMsgId="SAPUR_FIELD";
	
	
	if(sCt=="ComboBox" || sCt=="ItemListBox") 
		sCtrl=getLanguageText(sCtrlMsgId, new Array(o.getAttribute("ic")));
	else 
		sCtrl=getLanguageText(sCtrlMsgId);
		
	
	if(sCt=="InputField")
		switch(o.getAttribute("tp")){
			case "DATE": 
				sCtrl+=" "+getLanguageText("SAPUR_FIELD_DATE"); break;
			case "INTEGER": 
				sCtrl+=" "+getLanguageText("SAPUR_FIELD_NUMBER"); break;
			case "PW": 
				sCtrl+=" "+getLanguageText("SAPUR_FIELD_PW"); break;				
			case "TIME": 
				sCtrl+=" "+getLanguageText("SAPUR_FIELD_TIME"); break;
				break;
		}
	
	if(sCt=="ComboBox"){
		if(sVal!="") sValue=getLanguageText(sCtrlMsgId+"_ITEM", new Array(sVal)); 
		else sVal=getLanguageText(sCtrlMsgId+"_NOITEM");
	}
	else if(sCt=="CheckBox"){
		if(o.checked){
			sCtrlMsgId+="_CHK";
			sVal=getLanguageText(sCtrlMsgId);
		}
		else{
			sCtrlMsgId+="_NCHK";
			sVal=getLanguageText(sCtrlMsgId);
		}
	}
	else if(sCt=="RadioButton"){
		if(o.checked){
			sVal=getLanguageText(sCtrlMsgId+"_CHK");
		}
		else{
			sVal=getLanguageText(sCtrlMsgId+"_NCHK");
		}
	}
	else if(sCt=="InputField" && o.type=="password") sVal="";
	else if(sCt=="TextView"){
		sVal=o.getAttribute("val");
		if(sVal=="" || sVal==null)
			sVal=o.innerText;
		if(o.getAttribute("mnu")=="true") 
			sCtrlMsgId+="MNU";
	}
	
	
	sTutorMsgId=sCtrlMsgId+"_TUTOR";	
	sTutor=getLanguageText(sTutorMsgId);
	if(sCt=="RadioButton"){
		if(ur_isDisabled(o))
			sTutor=" "+getLanguageText(sCtrlMsgId+"_DSBLNAV");
		else
			sTutor+=" "+getLanguageText(sCtrlMsgId+"_NAV");
	}
	if(sCt=="ComboBox"){
		sTutor=getLanguageText("SAPUR_COMBOBOX_TUTOR");
	}
	
	
	var oDataTip=ur_get(sId+"-dtip");
	if(oDataTip!=null) {
		var	sDtTxt=sapUrMapi_DataTip_getText(sId);
		var	sDtType=sSep+getLanguageText("SAPUR_MSG_"+sapUrMapi_DataTip_getType(sId).toUpperCase());
		if (sapUrMapi_DataTip_getType(sId) == "Ok") sDtType = sSep+getLanguageText("SAPUR_MSG_SUCCESS");
		if (sapUrMapi_DataTip_getType(sId) == "Text") sDtType = "";
	}
	
	
	if(sLbl!=null) sTooltip+=sLbl;
	if(typeof(sCtrl)!="undefined") 
		if(sTooltip!="") sTooltip+=sSep+sCtrl;
		else sTooltip+=sCtrl;
	if(sVal!="" && sVal.search(/\S/)!=-1){
		if(sCt=="RadioButton" || sCt=="CheckBox")
			sTooltip+=" "+sVal;
		else if(sCt!="ItemListBox") 
			if(sTooltip!="") sTooltip+=sSep+sVal;
			else sTooltip+=sVal;
	}
	if(sSt!=null && sSt!="") sTooltip+=sSep+sSt;
	if(sTt!=null && typeof(sTt)!="" && sTt!=sVal)
		if(sTooltip.search(/\S/)==-1)
			sTooltip+=sTt;
		else
			sTooltip+=sSep+sTt;
	if(!ur_isDisabled(o) && !ur_isReadonly(o) && sTutor!=null && typeof(sTutor)!="undefined") sTooltip+=sSep+sTutor;
	else if(sCt=="RadioButton" && ur_isDisabled(o)) sTooltip+=sSep+sTutor;
	if(oDataTip!=null) sTooltip+=sDtType+sSep+sDtTxt;
	
	
	if(sTtTbl!=null && sTtTbl!="")
		if(sTooltip.search(/\S/)==-1)
			sTooltip+=sTtTbl;
		else
			sTooltip+=sSep+sTtTbl;
	
	return sTooltip;
}
function sapUrMapi_cleanUp() {
	window.detachEvent("onresize", sapUrMapi_Resize_CheckSize);
	document.detachEvent("onreadystatechange", sapUrMapi_Create_CreateItems);
  document.detachEvent("onmouseout",ur_hideCursor);
  document.detachEvent("onmouseover",ur_showCursor);
	document.onmouseover = null;
	document.onmouseout = null;
	document.onactivate=null;
	document.ondeactivate=null;
}
function ur_getAttD(o,sAtt,def) {
  if (!o || !o.getAttribute) return def;
  var s=o.getAttribute(sAtt);
  if (s!=null && s!="") return s;
  else return def;
}
function sapUrMapi_getCurrentStyle(o,sStAt){
	var s=o.currentStyle[sStAt];
	return s;
}
function ur_callDelayed(sFunc,ms) {
  return setTimeout("try{"+sFunc+"}catch(ex){}",ms);
}
//** Event.ie5 **

function ur_EVT_fire(o,sName,oEvt,hWnd) {
  var sFunc = o.getAttribute(sName); 
	if (sFunc && sFunc!="") {
		if (typeof(hWnd)=="undefined") hWnd=window; 
		if (typeof(oEvt)=="undefined") oEvt=hWnd.event;
		o.func=new hWnd.Function("event",sFunc); 
		return o.func(oEvt); 
	}
	return null;
}
function ur_EVT_src(oEvt) {
	return ur_EVT(oEvt).srcElement;
}
function ur_EVT_cancel(oEvt,oPrimeEvt){
	if (oPrimeEvt) oEvt = oPrimeEvt;
	try{oEvt.keyCode="";}catch(ex){}; 
	oEvt.cancelBubble=true;
	oEvt.returnValue=false;
	return true;
}
function ur_EVT_cancelBubble(oEvt){
	oEvt.cancelBubble=true;
}
function ur_EVT(oEvt) {
	return oEvt;
}

//** Button.ie5 **

function sapUrMapi_Button_checkClick(sId,oEvt){
	if (oEvt.type=="click") return true;
	return sapUrMapi_checkKey(oEvt,"keypress",new Array("32"))
}
function ur_B_setEnabled(o,b){
	if ((o.getAttribute("dsbl")=="true")&&(!b)) return;
	if ((o.getAttribute("dsbl")!="true")&&(b)) return;
	var sSuf="";
	var sKey="";
	var sKey1="";
	var sTt=o.getAttribute("tt");
	if (b) {
		o.onclick=o.getAttribute("onclick_dsbl");
		o.onkeypress=o.getAttribute("onkeypress_dsbl");
		o.setAttribute("dsbl","false");
		sKey1="SAPUR_BUTTON_ENABLED";
		if (ur_system.is508) o.title=getLanguageText("SAPUR_BUTTON_WHL",new Array(o.innerText,"SAPUR_BUTTON",sTt,sKey1));
	} else {
		o.setAttribute("onclick_dsbl",o.onclick);
		o.setAttribute("onkeypress_dsbl",o.onkeypress);
		o.onkeypress=null;
		o.onclick=null;
		sSuf="Dsbl";
		sKey="SAPUR_DISABLED";
		o.setAttribute("dsbl","true");
		if (ur_system.is508) o.title=getLanguageText("SAPUR_BUTTON_WHL",new Array(o.innerText,"SAPUR_BUTTON",sKey,sTt));
	}
	var s=o.className;
	var bE=(s.indexOf("Emph")>-1);
	var bS=(s.indexOf("Sml")>-1);
	var sN="urBtnStd";
	if (bS) sN="urBtnSml";
	if (bE) sN="urBtnEmph";
	sN+=sSuf;
	if (s.indexOf("urV")>-1) sN+=" urV";
	o.className=sN;
}
function sapUrMapi_Button_setDisabled(sId){
	ur_B_setEnabled(ur_get(sId),false);
	}
function sapUrMapi_Button_setEnabled(sId) {
	ur_B_setEnabled(ur_get(sId),true);
	}

//** BreadCrumb.ie5 **

function sapUrMapi_BreadCrumb_keydown(sId,oEvt){
	var o=ur_get(sId);
	var iItmCount=o.getAttribute("ic");
	var oCur=oEvt.srcElement;
	var oNext=null;
	var _ur_K_Next=ur_system.direction=="rtl"?37:39;
	var _ur_K_Prev=ur_system.direction=="rtl"?39:37;
	
	if(oEvt.keyCode=="39" || oEvt.keyCode=="37"){
		if(oEvt.keyCode==_ur_K_Next && oCur.nextSibling!=null){
			oNext=oCur.nextSibling;
			if(oNext.className.indexOf("urBrcDiv")>=0)
				oNext=oNext.nextSibling;
			sapUrMapi_setTabIndex(oCur,-1);
			if(oCur.className.indexOf("urBrcAct")>=0||oCur.firstChild.className.indexOf("urBrcAct")>=0)
				oCur.title=getLanguageText("SAPUR_BREADCRUMB_ITM_SEL_NAV", new Array(oCur.innerText,iItmCount,iItmCount));			
		}
		else if(oEvt.keyCode==_ur_K_Prev && oCur.previousSibling!=null){
			oNext=oCur.previousSibling;	
			if(oNext.className.indexOf("urBrcDiv")>=0)
				oNext=oNext.previousSibling;	
			sapUrMapi_setTabIndex(oCur,-1);
			if(oCur.className.indexOf("urBrcAct")>=0||oCur.firstChild.className.indexOf("urBrcAct")>=0)
				oCur.title=getLanguageText("SAPUR_BREADCRUMB_ITM_SEL_NAV", new Array(oCur.innerText,iItmCount,iItmCount));
		}
		if(oNext!=null){	
			sapUrMapi_setTabIndex(oNext,0);
			sapUrMapi_focusElement(oNext);
		}
	}
	if(oEvt.keyCode=="9"&&oCur.className.indexOf("Whl")<0)
		sapUrMapi_setTabIndex(oCur,-1);
}
function sapUrMapi_BreadCrumb_activate(sId,oEvt){
	if(oEvt.srcElement.tagName!="A"||oEvt.srcElement.title.indexOf(oEvt.srcElement.innerText)>=0) return;
	oEvt.srcElement.title=oEvt.srcElement.innerText+" "+getLanguageText("SAPUR_SEPARATOR")+" "+oEvt.srcElement.title;
}
function sapUrMapi_BreadCrumb_deactivate(sId,oEvt){
	if(oEvt.toElement!=null&&oEvt.toElement.parentNode.className.indexOf("Brc")>=0) return;
	var o=ur_get(sId);
	var oSel=o.lastChild;
	var iItmCount=o.getAttribute("ic");
	
	sapUrMapi_setTabIndex(oSel,0);
	if(ur_isDisabled(o))
		oSel.title=getLanguageText("SAPUR_BREADCRUMB_DSBL_ITM_SEL", new Array(oSel.innerText,iItmCount,iItmCount,o.title));
	else
		oSel.title=getLanguageText("SAPUR_BREADCRUMB_ITM_SEL", new Array(oSel.innerText,iItmCount,iItmCount,o.title));	
}

//** CheckBox.ie5 **

function sapUrMapi_CheckBox_toggle(sId,e) {
  var oIn=ur_get(sId);
  if (oIn.disabled) return false;  
  var oImg=ur_get(sId+"-img");
	
  ur_focus(oIn);
  
	if (oImg.className.indexOf("Chk")<0){ 
		oIn.checked=true;
		oImg.className=oImg.className.replace("urImgCbgImg","urImgCbgImgChk");
	}
  
	else{
		oIn.checked=false;
		oImg.className=oImg.className.replace("urImgCbgImgChk","urImgCbgImg");   
	}
  return true;
}
function sapUrMapi_CheckBox_setDisabled(sId){
  var oIn=ur_get(sId);
	var oImg=ur_get(sId+"-img");
	if (oIn.checked){ 
		if(oImg.className.indexOf("Dsbl")<0)
			oImg.className=oImg.className.replace("urImgCbgImgChk","urImgCbgImgChkDsbl");
	}
	else{
		if(oImg.className.indexOf("Dsbl")<0)
			oImg.className=oImg.className.replace("urImgCbgImg","urImgCbgImgDsbl");
	}
	if(ur_system.is508)
		sapUrMapi_setTabIndex(oImg,"0");
  oIn.disabled=true;	
	ur_setDisabled(oIn,true);
	sapUrMapi_Label_setDisabled(sapUrMapi_Label_getInputLabel(sId));
}
function sapUrMapi_CheckBox_setEnabled(sId) {
  var oIn=ur_get(sId);
	var oImg =ur_get(sId + "-img");
	if (oIn.checked) oImg.className=oImg.className.relace("urImgCbgImgChkDsbl","urImgCbgImgChk");
	else oImg.className=oImg.className.replace("urImgCbgImgDsbl","urImgCbgImg");
	oIn.disabled=false;
	ur_setDisabled(oIn,false);
	if(ur_system.is508)
		sapUrMapi_setTabIndex(oImg,"-1");
	sapUrMapi_Label_setEnabled(sapUrMapi_Label_getInputLabel(sId));
}
function sapUrMapi_CheckBox_setReadonly(sId,bSet){
  var oIn=ur_get(sId);
	var oImg=ur_get(sId+"-img");
	if(bSet){
		if (oIn.checked){ 
			if(oImg.className.indexOf("Dsbl")<0)
				oImg.className=oImg.className.replace("urImgCbgImgChk","urImgCbgImgChkDsbl");
		}
		else{ 
			if(oImg.className.indexOf("Dsbl")<0)
				oImg.className=oImg.className.replace("urImgCbgImg","urImgCbgImgDsbl");
		}
		oIn.disabled=true;	
		ur_setReadonly(oIn,true);
		if(ur_system.is508)
			sapUrMapi_setTabIndex(oImg,"0");
	}
	else{
		if (oIn.checked) oImg.className=oImg.className.replace("urImgCbgImgChkDsbl","urImgCbgImgChk");
		else oImg.className=oImg.className.replace("urImgCbgImgDsbl","urImgCbgImg");
		oIn.disabled=false;	
		ur_setReadonly(oIn,false);
		if(ur_system.is508)
			sapUrMapi_setTabIndex(oImg,"-1");	
	}
	sapUrMapi_Label_setEnabled(sapUrMapi_Label_getInputLabel(sId));
}
function sapUrMapi_CheckBox_focus(sId,oEvt) {
	if(ur_system.is508) {
		var o=ur_get(sId);
		var oImg=ur_get(sId+"-img");
		o.title=ur_getTooltip(sId);
		oImg.title=o.title;
	}
	sapUrMapi_DataTip_show(sId,"focus");
}
function sapUrMapi_CheckBox_blur(sId,oEvt) {
	sapUrMapi_DataTip_hide(sId);
}
function sapUrMapi_CheckBox_keydown(sId,oEvt){
	
	if(oEvt.keyCode=="81" && oEvt.ctrlKey ){
		if (sapUrMapi_DataTip_isOpen(sId)) sapUrMapi_DataTip_hide(sId);
		else sapUrMapi_DataTip_show(sId,"keydown");
		return sapUrMapi_cancelEvent(oEvt);
	}
	
	if(oEvt.keyCode=="27"){
		sapUrMapi_DataTip_hide(sId);
		return sapUrMapi_cancelEvent(oEvt);
	}
}

//** ComboBox.ie5 **

function ur_ComboBox_fireBeforeListLoad(sId,sListId,oEvt){
	var o=sapUrMapi_ComboBox_getObject(sId);
  var sFunc=o.main.getAttribute("onbll");	
  if(o.txt.getAttribute("ll")) return;
  if(sFunc && sFunc.indexOf("UR_NotHandled")<0){
		o.main.fBefListLoad = new Function("event",sFunc);
		o.main.fBefListLoad(oEvt);
  }
  else return false;
  o.txt.setAttribute("ll",true);
  return true;
}
function sapUrMapi_ComboBox_getObject(sId) {
	var o=new Object();
	o.main=document.getElementById(sId+"-r");
	o.txt=document.getElementById(sId);
	o.btn=document.getElementById(sId+"-btn");
	o.isdd=o.txt.getAttribute("dd")=="true";
	o.isro=ur_isReadonly(o.txt);
	o.isdsbl=ur_isDisabled(o.txt);
	o.isinv=ur_isInvalid(o.txt);
	o.isreq=ur_isRequired(o.txt);	
	o.key=o.txt.getAttribute("k");
	o.vt=o.txt.getAttribute("vt")=="true";
	o.lid=o.txt.getAttribute("lid");
	o.open=o.txt.getAttribute("op")=="true";
	return o;
}
function sapUrMapi_ComboBox_registerCreate(sId,sListId,sWidth){
	sapUrMapi_Create_AddItem(sId, "sapUrMapi_ComboBox_setWidth('"+sId+"','"+sListId+"','"+sWidth+"')");
}
var aCoB=new Array();
aCoB["oEvt"]="focus";
var aCoBWidth=new Array();
function sapUrMapi_ComboBox_setWidth(sId,sListId,sWidth){
	if(sWidth!="") return;
	var o=ur_get(sId);
	var oL=ur_get(sListId+"-r");
	if(oL==null) return;
	sapUrMapi_ItemListBox_setDim( sListId, "10px" );
	aCoB[aCoB.length]=o;
	oL=ur_get(sListId);
	aCoBWidth[aCoBWidth.length]=oL.offsetWidth;
	sapUrMapi_Create_AddItem("CoB", "sapUrMapi_ComboBox_set()");
}
function sapUrMapi_ComboBox_set(){
	for(var i=0; i<aCoB.length; i++)
		aCoB[i].style.width=parseInt(aCoBWidth[i]);
}
function sapUrMapi_ComboBox_addClass(sId,sClass,bSetIt) {
  var o=sapUrMapi_ComboBox_getObject(sId);
	
	if (o.main.parentNode.className.indexOf("STTD")>=0){		 
	if (o.txt.className.indexOf(sClass)==-1 && bSetIt) {
		o.txt.className=o.txt.className+" "+sClass;
			o.main.className=o.main.className+" "+sClass;
		}
		else if(o.txt.className.indexOf(sClass)>=0 && !bSetIt){
		o.txt.className=o.txt.className.replace(" "+sClass,"");
		o.main.className=o.main.className.replace(" "+sClass,"");		
	}
	}
	
	else{
		if (o.txt.className.indexOf(sClass)==-1 && bSetIt)
			o.txt.className=o.txt.className+" "+sClass; 
		else if(o.txt.className.indexOf(sClass)>=0 && !bSetIt)
			o.txt.className=o.txt.className.replace(" "+sClass,"");
	}
	return o;
}
function sapUrMapi_ComboBox_mousedown(sId,e) {
	var o=sapUrMapi_ComboBox_getObject(sId);
	if(e.button!=1 && o.open) return;
  o.txt.setAttribute("noblur","true");
  aCoB["srcE"]=e.srcElement.tagName;
  aCoB["oEvt"]="click";
  aCoB["dd"]=ur_get(sId).getAttribute("dd");
}
function sapUrMapi_ComboBox_click(sId,e) {
	var o=sapUrMapi_ComboBox_getObject(sId);
	if (o.isdsbl) return;
	if (o.isdd || e.type=="keydown" || ur_evtSrc(e).className.indexOf("urCoB2Btn")>=0) {
	  if (!o.open) 
			sapUrMapi_ComboBox_showList(sId,e);
		else{
			sapUrMapi_ComboBox_hideList(sId);
			if(o.isdd) sapUrMapi_ComboBox_addClass(sId,"urCoB2Hv",true);			
		}
		if(ur_evtSrc(e).className.indexOf("urCoB2Btn")>=0) 
			ur_focus(o.txt);
	}
  o.txt.setAttribute("noblur","false");
  return sapUrMapi_cancelEvent(e);
}
function sapUrMapi_ComboBox_focusDdlb(sId,e) { 
	var o=sapUrMapi_ComboBox_getObject(sId);
	aCoB["dd"]=ur_get(sId).getAttribute("dd");
	if(aCoB["dd"]=="true"){
 	if (!o.open && aCoB["oEvt"]=="focus") sapUrMapi_DataTip_show(sId,"focus");
 	}else{
 		if (!o.open && aCoB["srcE"]!="BUTTON") sapUrMapi_DataTip_show(sId,"focus");
 	}
 	aCoB["oEvt"]="focus";
	if (ur_system.is508 && o.txt.getAttribute("nav")!="true")
		o.txt.title=ur_getTooltip(o.txt.id);
	if (o.isdsbl) return;
	o.txt.setAttribute("noblur","false");
	if(!o.isdd) return;
	if (o.open && o.txt.className.indexOf(" urCoB2Hv")) sapUrMapi_ComboBox_addClass(sId,"urCoB2Hv",false);
	else if(!o.open && o.txt.className.indexOf(" urCoB2Hv")==-1) sapUrMapi_ComboBox_addClass(sId,"urCoB2Hv",true);
  return sapUrMapi_cancelEvent(e);
}
function sapUrMapi_ComboBox_fireSelectionChange(o, oEvt){
	
  if(o.txt.getAttribute("ks")==o.txt.getAttribute("k") && o.txt.getAttribute("vs")==o.txt.value) 
		return;
  
  if(o.isdd && parseInt(o.txt.getAttribute("ic"))==0) return;
  
  if(oEvt.type=="keydown" && (((oEvt.keyCode==40 || oEvt.keyCode==38)&&o.open) || (oEvt.keyCode>64 && oEvt.keyCode<126) || (oEvt.keyCode>127 && oEvt.keyCode<192))) return;
  o.txt.setAttribute("vs",o.txt.value);
  o.txt.setAttribute("ks",o.txt.getAttribute("k"));
  var sFunc=o.main.getAttribute("onsc");
  if(sFunc){
		o.main.fSelCh = new Function("event",sFunc);
		o.main.fSelCh(oEvt);
  }
}
function sapUrMapi_ComboBox_blurDdlb(sId,e) {
	var o=sapUrMapi_ComboBox_getObject(sId);
	
	if (o.isdsbl) {sapUrMapi_DataTip_hide(sId);return;}
	if(o.txt.getAttribute("noblur")=="true" || (oPopup!=null && oPopup.frame.window.mover && o.open)){
		o.txt.setAttribute("noblur","false");
		ur_focus(o.txt);
		return sapUrMapi_cancelEvent(e);
	}
	
	if (o.isdd) sapUrMapi_ComboBox_addClass(sId,"urCoB2Hv",false);
	if (oPopup!=null && o.open) sapUrMapi_ComboBox_hideList(sId);
	if (oPopup!=null && !o.open) sapUrMapi_DataTip_hide(sId);
	sapUrMapi_ComboBox_fireSelectionChange(o,e);
	o.txt.setAttribute("ll",false); 
	if (ur_system.is508)
		o.txt.setAttribute("nav","false");
	return sapUrMapi_cancelEvent(e);
}
function sapUrMapi_ComboBox_setReadonly(sId,bReadonly) {
  var o=sapUrMapi_ComboBox_addClass(sId,"urCoB2Ro",bReadonly);
  ur_setReadonly(o.txt,bReadonly);
  o.txt.readOnly=bReadonly;
}
function sapUrMapi_ComboBox_setInvalid(sId,bInvalid) {
  var o=sapUrMapi_ComboBox_addClass(sId,"urCoB2Inv",bInvalid);
  ur_setInvalid(o.txt,bInvalid);
}
var sUrComboBox_virtualTyping="";
function sapUrMapi_ComboBox_keydown(sId,e) {
	var o=sapUrMapi_ComboBox_getObject(sId);
	
	
	if(e.keyCode==81 && e.ctrlKey && !e.altKey ){
		if (sapUrMapi_DataTip_isOpen(sId)) sapUrMapi_DataTip_hide(sId);
		else sapUrMapi_DataTip_show(sId,"keydown");
		return sapUrMapi_cancelEvent(e);
	}
	
	
	if (o.isdsbl) return;
	
	
	if (e.keyCode==9) {
		if(o.open) sapUrMapi_ItemListBox_selectHoveredItem(o.lid, oPopup.frame.window.document,e);
		if (o.isdd) sapUrMapi_ComboBox_addClass(sId,"urCoB2Hv",false);
		if (oPopup!=null && o.open) sapUrMapi_ComboBox_hideList(sId);			
		return;
	}
	
	
	if( (e.altKey && (e.keyCode==40||e.keyCode==38)) || e.keyCode==115 ){
		sapUrMapi_ComboBox_click(sId,e);
		return sapUrMapi_cancelEvent(e);
	}
	
	
	if(e.keyCode==40 || e.keyCode==38 || e.keyCode==33 || e.keyCode==34 || e.keyCode==35 || e.keyCode==36){
		if(o.open) sapUrMapi_ItemListBox_keydown(o.lid, oPopup.frame.window.document, e );
		else{
			
			if(ur_ComboBox_fireBeforeListLoad(sId,o.lid,e)) 
				return sapUrMapi_cancelEvent(e);
			sapUrMapi_ItemListBox_setParentId(o.lid, sId);
			sapUrMapi_ItemListBox_setSelectedKey(o.lid,o.key,document,false);
			sapUrMapi_ItemListBox_keydown(o.lid, document, e );
		}		
		return sapUrMapi_cancelEvent(e);
	}
	
	
  if (e.keyCode==27 && o.open) {
		o.txt.value=o.txt.getAttribute("vs");
		o.txt.setAttribute("k",o.txt.getAttribute("ks"));
  	sapUrMapi_ComboBox_hideList(sId);
  	sapUrMapi_ComboBox_focusDdlb(sId,e);
  	return sapUrMapi_cancelEvent(e);
  }
  else if (e.keyCode==27 && !o.open) 
		sapUrMapi_DataTip_hide(sId);
  
  
  if (e.keyCode==13 && o.open) { 
		sapUrMapi_ItemListBox_selectHoveredItem(o.lid, oPopup.frame.window.document,e);
  	sapUrMapi_ComboBox_hideList(sId);
  	sapUrMapi_ComboBox_fireSelectionChange(o, e);
		if(ur_system.is508) o.txt.setAttribute("noblur","true");  	
  	return sapUrMapi_cancelEvent(e);
  }
  else if (e.keyCode==13 && !o.isdd)
    	if(!sapUrMapi_ComboBox_findItem(sId,o.txt.value,true,e))
    		sapUrMapi_ComboBox_fireSelectionChange(o, e);
}
function sapUrMapi_ComboBox_keypress(sId,e) {
	var o=sapUrMapi_ComboBox_getObject(sId);
	if (o.isdd){
	  if (o.vt) sapUrMapi_ComboBox_initVirtualTyping();
	  var sSearch=String.fromCharCode(e.keyCode);
	  if (!o.vt) sUrComboBox_virtualTyping=sSearch;
		else sUrComboBox_virtualTyping+=sSearch;
	  sapUrMapi_ComboBox_findItem(sId,sUrComboBox_virtualTyping,true,e);
	  if(o.open){
	  	o=sapUrMapi_ComboBox_getObject(sId);
	  	sapUrMapi_ItemListBox_setSelectedKey(o.lid,o.key,oPopup.frame.window.document,true);
	  }	  	
	 } 
	else{
		o.txt.setAttribute("k","");
	}
}
var oVTTimer=null;
function sapUrMapi_ComboBox_initVirtualTyping() {
  if (oVTTimer!=null) clearTimeout(oVTTimer); 
 	oVTTimer=ur_callDelayed("sUrComboBox_virtualTyping='';clearTimeout(oVTTimer);oVTTimer=null;",250);
 }
function sapUrMapi_ComboBox_findItem(sId,sSearch,bSelect,oEvt) {
	var o=sapUrMapi_ComboBox_getObject(sId);
	var sList=sapUrMapi_ItemListBox_getList(o.lid,document);
	var sLIST=sList.toUpperCase();
	var sSEARCH="||"+sSearch.toUpperCase();
	var iStart=0;
	var iEnd=0;
	var sKey=o.txt.getAttribute("k")+"||";
	var sNewKey="";
	var sNewVal="";
	
	if(sKey!=null && sKey!="")
		iStart=sList.indexOf(sKey);
	iStart=sLIST.indexOf(sSEARCH,iStart);
	if(iStart<0)
		iStart=sLIST.indexOf(sSEARCH);
	if(iStart<0) return false;
	
	iStart+=2;
	iEnd=sList.indexOf("|",iStart);
	sVal=sList.slice(iStart,iEnd);
	iStart=iEnd+1;
	iEnd=sList.indexOf("||",iStart);
	sKey=sList.slice(iStart,iEnd);
	
  if (bSelect)
		sapUrMapi_ComboBox_setValue(sId,sKey,sVal,null,oEvt);	
	return true;
}
function sapUrMapi_ComboBox_showList(sId,oEvt) {
	var o=sapUrMapi_ComboBox_getObject(sId);
	var oIlb;
	var arrUrls = new Array(ur_system.stylepath+"ur_pop_"+ur_system.browser_abbrev+".css");
	
	if(ur_ComboBox_fireBeforeListLoad(sId,o.lid,oEvt))
		return sapUrMapi_cancelEvent(oEvt);
	
	o.open=o.txt.setAttribute("op","true");
  if (o.isdd) sapUrMapi_ComboBox_addClass(sId,"urCoB2Hv",false);
  	
	
	clearTimeout(_ur_DataTip_timer);
	
	
	sapUrMapi_ItemListBox_setParentId(o.lid, sId);
	oIlb=sapUrMapi_ItemListBox_getObject(o.lid,document,null);
	sapUrMapi_ItemListBox_setDim(o.lid, o.main.offsetWidth);
	sapUrMapi_ItemListBox_setReadonly(oIlb,o.isro);	
	oPopup = new sapPopup(window,arrUrls,document.getElementById(o.lid+"-r"),document.getElementById(sId),oEvt,0);
	oPopup.size.height=oIlb.box.offsetHeight;
	oPopup.size.width=oIlb.box.offsetWidth;
	oPopup.sizebehaviour=sapPopupSizeBehavior.USER
	if (ur_system.direction=="rtl") oPopup.positionbehavior = sapPopupPositionBehavior.MENURIGHT;
	else sapPopupPositionBehavior.MENULEFT;	
	oPopup.show(true);
	sapUrMapi_ItemListBox_setSelectedKey(o.lid,o.key,oPopup.frame.window.document,true);
}
function sapUrMapi_ComboBox_hideList(sId) {
  var o=sapUrMapi_ComboBox_getObject(sId);
	o.txt.setAttribute("op","false");
	o.txt.setAttribute("noblur","false");
	if (oPopup) oPopup.hide();
}
function sapUrMapi_ComboBox_toggleButton(sId,bShow) {}
function sapUrMapi_ComboBox_setValue(sId,sKey,sValue,sImgSrc,oEvt) {
  var o=sapUrMapi_ComboBox_getObject(sId);
  if(!o.isro && !o.isdsbl && sKey!=null && (o.txt.ks!=sKey || o.txt.k!=sKey)){
		
		o.txt.setAttribute("k",sKey);
		o.txt.value=sValue;
		if (sImgSrc!="" && sImgSrc!=null)
  		if (sImgSrc.indexOf("url(")!=0 && sImgSrc.length>0) o.txt.style.backgroundImage="url("+sImgSrc+")";
  		else o.txt.style.backgroundImage=sImgSrc;
		
		if (ur_system.is508){
			var sSep=" "+getLanguageText("SAPUR_SEPARATOR")+" ";
			var sTt=o.txt.getAttribute("tt");
			o.txt.title=o.txt.value+sSep+getLanguageText("SAPUR_COMBOBOX_ITEM",new Array(ur_ItemListBox_getIndex(o.lid,o.txt.k),o.txt.ic));
			if(sTt!=null && sTt!="") 
				o.txt.title+=sSep+sTt;
			o.txt.setAttribute("nav","true");
		}
		
		sapUrMapi_ComboBox_fireSelectionChange(o,oEvt);
  }
  
  
  if (oEvt!=null && oEvt.type=="click"){
		sapUrMapi_ComboBox_hideList(sId);
		ur_focus(o.txt);
	}
	
	else if (ur_system.is508){
		o.txt.setAttribute("noblur","true");
		sapUrMapi_refocusElement(o.txt.id);
	}
}
function sapUrMapi_ComboBox_getSelectedKey(sId) {
  var o=sapUrMapi_ComboBox_getObject(sId);
  return o.txt.getAttribute("k");
}
function sapUrMapi_ComboBox_getSelectedValue(sId) {
  var o=sapUrMapi_ComboBox_getObject(sId);
	return o.txt.value;
}

//** DataTip.ie5 **

var _ur_DataTip_timer;
function sapUrMapi_DataTip_getText(sId) {
	var oDTText = document.getElementById(sId+"-dtip");
	oDTText = oDTText.firstChild.lastChild;
	return oDTText.innerHTML;
}
enumUrDataTipType = {ERROR:"Error",WARNING:"Warning",OK:"Ok",TEXT:"Text"};
function sapUrMapi_DataTip_getType(sId) { 
	var oDTTyp  = document.getElementById(sId+"-dtip");
	oDTTyp = oDTTyp.firstChild.firstChild;
    if ((oDTTyp.className).indexOf(enumUrDataTipType.ERROR)>-1) return enumUrDataTipType.ERROR;
    if ((oDTTyp.className).indexOf(enumUrDataTipType.WARNING)>-1) return enumUrDataTipType.WARNING;
    if ((oDTTyp.className).indexOf(enumUrDataTipType.OK)>-1) return enumUrDataTipType.OK;
    if ((oDTTyp.className).indexOf("urDataTipTxt")>-1) return enumUrDataTipType.TEXT;
  }
function sapUrMapi_DataTip_isOpen(sId){
	var oDT = document.getElementById(sId+"-dtip");
	if(oDT!=null)
	return (oDT.getAttribute("op")=="true");
}
function sapUrMapi_DataTip_show(sId,sEvtType) {
	var bShow=false;
	oDataTip = document.getElementById(sId+"-dtip");
	if (oDataTip==null) return;
	var bAf=((oDataTip.getAttribute("af")!=null) && (oDataTip.getAttribute("af")=="a"));
	var bAff=((oDataTip.getAttribute("af")!=null) && (oDataTip.getAttribute("af")=="f"));
	var iTo=0;
	if ((oDataTip.getAttribute("to")!=null) && (oDataTip.getAttribute("to")!="")) {
	  iTo=parseInt(oDataTip.getAttribute("to"));
	}
	if (typeof(sEvtType)=="undefined" || sEvtType=="") {
	  bShow=true;
	}
	if (sEvtType=="keydown") {
	  bShow=true;
	  iTo=0;
	}
	if (sEvtType=="focus") {
	  if (bAf) bShow=true;
	  if ((bAff) && (oDataTip.getAttribute("first")==null || oDataTip.getAttribute("first")=="")) {
	    bShow=true;
		oDataTip.setAttribute("first","true");
	  } else {
	    if (!bAf) iTo=0;
	  }
	}
	if (bShow) {
		var oDT = document.getElementById(sId+"-dtip");
		oDT.open = oDT.setAttribute("op", "true");
	var arrUrls = new Array(ur_system.stylepath+"ur_pop_"+ur_system.browser_abbrev+".css");
	sTriggerId=sId;
		oTrg=document.getElementById(sId);
		if (oTrg.tagName=="INPUT" && (oTrg.type.toLowerCase()=="radio" || oTrg.type.toLowerCase()=="checkbox")) {
		  oTrg=oTrg.nextSibling;
		}
		oPopup = new sapPopup(window,arrUrls,document.getElementById(sId+'-dtip'),oTrg,e,0);
		if (ur_system.direction=="rtl") oPopup.positionbehavior = sapPopupPositionBehavior.MENURIGHT;
		else sapPopupPositionBehavior.MENULEFT;	
		oPopup.show(true);
}
	if (iTo>0) {
	 _ur_DataTip_timer = ur_callDelayed("sapUrMapi_DataTip_hide(\""+sId+"\")",iTo*1000);
}
}
function sapUrMapi_DataTip_hide(sId) {
	var oDT = document.getElementById(sId+"-dtip");
	if(oDT!=null){
	if(oDT.getAttribute("op")!="true") return; 
	oDT.setAttribute("op", "false");
	}
	clearTimeout(_ur_DataTip_timer);
	if (oPopup!=null) oPopup.hide();
}

//** DateNavigator.ie5 **

function ur_DateNavigator_getMonthHdr(o){
	return o.firstChild.firstChild.firstChild.cells[1].firstChild;
}
function ur_DateNavigator_getMonth(o){
	while(o.tagName!="TABLE")
		o=o.parentNode;
	return o.parentNode;  
}
function ur_DateNavigator_focusNextMonth(o){
	var oThis=ur_DateNavigator_getMonth(o);
	var oThisHdr=ur_DateNavigator_getMonthHdr(oThis);
	var oPrev=null;
	var oPrevHdr=null;
	if(oThisHdr.parentNode.nextSibling.className.indexOf("ArrNext")>-1) { 
		oThisHdr.parentNode.nextSibling.click();
  } 
  else{		
		oNext=oThis.nextSibling; 
		if(oNext==null&&oThis.parentNode.nextSibling!=null)	
			oNext=oThis.parentNode.nextSibling.firstChild;
		if(oNext==null) return;
		oNextHdr=ur_DateNavigator_getMonthHdr(oNext);
		if(oNextHdr!=null)
			ur_focus(oNextHdr);
	} 
}
function ur_DateNavigator_focusUpMonth(o){
	var oThis=ur_DateNavigator_getMonth(o);
	var oPrevRow=oThis.parentNode.previousSibling;
	if(oPrevRow==null) return;
	ur_focus(ur_DateNavigator_getMonthHdr(oPrevRow.childNodes[oThis.cellIndex]));
}
function ur_DateNavigator_focusDownMonth(o){
	var oThis=ur_DateNavigator_getMonth(o);
	var oNextRow=oThis.parentNode.nextSibling;
	if(oNextRow==null) return;
	ur_focus(ur_DateNavigator_getMonthHdr(oNextRow.childNodes[oThis.cellIndex]));
}
function ur_DateNavigator_focusPrevMonth(o){
	var oThis=ur_DateNavigator_getMonth(o);
	var oThisHdr=ur_DateNavigator_getMonthHdr(oThis);
	var oPrev=null;
	var oPrevHdr=null;
  if(oThisHdr.parentNode.previousSibling.className.indexOf("urCalArrPrev")>-1) {
		oThisHdr.parentNode.previousSibling.click();
  } 
  else{		
		oPrev=oThis.previousSibling;	
		if(oPrev==null&&oThis.parentNode.previousSibling!=null)	
			oPrev=oThis.parentNode.previousSibling.lastChild;
		if(oPrev==null) return;
		oPrevHdr=ur_DateNavigator_getMonthHdr(oPrev);
		if(oPrevHdr!=null)
			ur_focus(oPrevHdr);
	} 
}
function ur_DateNavigator_focusThisMonth(o){
	var oThis=ur_DateNavigator_getMonth(o);
	var oThisHdr=ur_DateNavigator_getMonthHdr(oThis);
	if(oThisHdr!=null)
		ur_focus(oThisHdr);
}
function ur_DateNavigator_focusNextDay(o){
	var oNext=o.nextSibling;
	if(oNext==null&&o.parentNode.nextSibling!=null)
		oNext=o.parentNode.nextSibling.firstChild;
	if(oNext==null) return;
	if(oNext.getAttribute("ti")=="0")
		ur_focus(oNext);
	else
		ur_DateNavigator_focusNextDay(oNext);
}
function ur_DateNavigator_focusPrevDay(o){
	var oPrev=o.previousSibling;
	if(oPrev==null&&o.parentNode.previousSibling!=null)
		oPrev=o.parentNode.previousSibling.lastChild;
	if(oPrev==null||oPrev.className.indexOf("urCalName")>=0) return;
	if(oPrev.getAttribute("ti")=="0")
		ur_focus(oPrev);
	else
		ur_DateNavigator_focusPrevDay(oPrev);
}
function ur_DateNavigator_focusNextWeek(o){
	var oNext=o.parentNode.nextSibling;
	if(oNext==null) return;
	oNext=oNext.cells[o.cellIndex];
	if(oNext.getAttribute("ti")=="0")
		ur_focus(oNext);
	else
		ur_DateNavigator_focusNextWeek(oNext);
}
function ur_DateNavigator_focusPrevWeek(o){
	var oPrev=o.parentNode.previousSibling;
	if(oPrev==null) return;
	oPrev=oPrev.cells[o.cellIndex];
	if(oPrev.className.indexOf("urCalName")>=0) return;
	if(oPrev.getAttribute("ti")=="0")
		ur_focus(oPrev);
	else
		ur_DateNavigator_focusPrevWeek(oPrev);
}
function sapUrMapi_DateNavigator_keydown(sId,oEvt) {
  var o=ur_evtSrc(oEvt);
  var iKey=oEvt.keyCode;
	
  if(iKey==37)
		iKey=ur_system.direction!="rtl"?37:39;
	else if(iKey==39)
		iKey=ur_system.direction!="rtl"?39:37;
		
	
	if(iKey==90&&oEvt.altKey==true)
		return sapUrMapi_skip(sId,oEvt);
	
	
	if(iKey==66&&oEvt.altKey==true)
		return sapUrMapi_skip(sId,oEvt);		
	
	
	if(iKey==32){
		o.click();
		return sapUrMapi_cancelEvent(oEvt);
	}
			
		
	if(iKey==39){
		if(o.className.indexOf("Whl")>=0) return;
		if (o.parentNode.className.indexOf("urCalHdr")>-1)
			ur_DateNavigator_focusNextMonth(o);
		else
			ur_DateNavigator_focusNextDay(o);
		return sapUrMapi_cancelEvent(oEvt);
	}	
	
		
	if(iKey==37){
		if(o.className.indexOf("Whl")>=0) return;
		if (o.parentNode.className.indexOf("urCalHdr")>-1)
			ur_DateNavigator_focusPrevMonth(o);
		else
			ur_DateNavigator_focusPrevDay(o);
		return sapUrMapi_cancelEvent(oEvt);
	}
	
	
	if(iKey==38){
		if(o.className.indexOf("Whl")>=0) return;
		if(o.parentNode.className.indexOf("urCalHdr")>=0)
			ur_DateNavigator_focusUpMonth(o);
		else
			ur_DateNavigator_focusPrevWeek(o);
		return sapUrMapi_cancelEvent(oEvt);
	}		
	
	if(iKey==40){
		if(o.className.indexOf("Whl")>=0) return;
		if(o.parentNode.className.indexOf("urCalHdr")>=0)
			ur_DateNavigator_focusDownMonth(o);
		else		
			ur_DateNavigator_focusNextWeek(o);
		return sapUrMapi_cancelEvent(oEvt);
	}	
	
	
	if(iKey==9&&o.id!=sId&&o.id!=sId+"-skipend"){
		if(o.className.indexOf("Whl")>=0||o.parentNode.className.indexOf("urCalHdr")>-1) return;
		if(oEvt.shiftKey)
			ur_DateNavigator_focusThisMonth(o);
		else{
			var oThis=ur_DateNavigator_getMonth(o);
			var oThisHdr=ur_DateNavigator_getMonthHdr(oThis);
			if(oThisHdr.parentNode.nextSibling.className.indexOf("ArrNext")>-1)
				ur_focus(ur_get(sId+"-skipend"));
			else 	
				ur_DateNavigator_focusNextMonth(oThisHdr);
		}	
		return sapUrMapi_cancelEvent(oEvt);
	}	
	
	if(iKey==9&&oEvt.shiftKey&&o.id==sId+"-skipend"){
		ur_focus(o.previousSibling.firstChild.firstChild.lastChild.lastChild.firstChild.firstChild.firstChild.childNodes[1].firstChild);
		return sapUrMapi_cancelEvent(oEvt);
	}	  
}
function sapUrMapi_DateNavigator_mousemove(sId,oEvt) {
  var oFrom=oEvt.fromElement;
	var oTo=oEvt.toElement;
	var o=ur_get(sId);
	var oRef=o.getAttribute("hovered");
	if ((oRef!=null)  && (oRef.className.indexOf(" urCalHov")>-1)) oRef.className=oRef.className.substring(0,oRef.className.indexOf(" urCalHov"));
  if ((oTo!=null) && (oTo.currentStyle)&&((oTo.currentStyle.cursor=="hand") || (oTo.currentStyle.cursor=="pointer"))){
    if (oTo.className=="") {
      oTo.className=" urCalHov";
    } else {
      oTo.className=oTo.className+" urCalHov";
    }
    o.setAttribute("hovered",oTo);
  } else {
    o.setAttribute("hovered",null	);
  }
}
function sapUrMapi_DateNavigator_activate(sId,oEvt){
	var o=ur_evtSrc(oEvt);
	var sDay=o.getAttribute("day");
	var sSep=" "+getLanguageText("SAPUR_SEPARATOR")+" ";	
	
	
	if(sDay!=null){
		var oRow=o.parentNode;
		var oWeekday=oRow.parentNode.rows[1].cells[o.cellIndex];
		var sDesign=o.getAttribute("ds");
		var sTt=o.getAttribute("tt");
		o.title=sDay+sSep+getLanguageText("SAPUR_CALWEEK")+" "+oRow.firstChild.innerText+sSep+oWeekday.title;
		if(sDesign!=null&&sDesign!="")
			o.title+=sSep+sDesign;
		if(sTt!=null&&sTt!="")
			o.title+=sSep+sTt;
		if(o.getAttribute("cl")=="true")
			o.title+=sSep+getLanguageText("SAPUR_CALSEL_TUTOR");
	}
	
	else if (o.parentNode!=null&&o.parentNode.className.indexOf("urCalHdr")>-1){
		o.title=o.innerText;
		var iIdx=o.getAttribute("idx");
		if(iIdx=="f"){
			o.title+=sSep+getLanguageText("SAPUR_CALFIRSTMONTH");
			if(ur_get(sId).getAttribute("nav")=="true")
				o.title+=sSep+getLanguageText("SAPUR_CALPREVMONTH_TUTOR");
			if(o.getAttribute("cl")=="true")
				o.title+=" "+getLanguageText("SAPUR_CALSEL_TUTOR");													
		}
		else if(iIdx=="l"){
			o.title+=sSep+getLanguageText("SAPUR_CALLASTMONTH");
			if(ur_get(sId).getAttribute("nav")=="true")
				o.title+=sSep+getLanguageText("SAPUR_CALNEXTMONTH_TUTOR");
			if(o.getAttribute("cl")=="true")
				o.title+=" "+getLanguageText("SAPUR_CALSEL_TUTOR");						
		}
		else if(o.getAttribute("cl")=="true")
			o.title+=sSep+getLanguageText("SAPUR_CALSEL_TUTOR");
	}
}
function sapUrMapi_DateNavigator_getDateFromId(sId){}

//** DragSource.ie5 **

var _ur_DragDrop=null;
function ur_Drag_hideCursor() {
	if (_ur_DragDrop) {
   if (_ur_DragDrop.cursor) {
     _ur_DragDrop.cursor.style.display="none";
   }
  }
}
function ur_Drag_showCursor() {
	if (_ur_DragDrop) {
   if (_ur_DragDrop.cursor) {
     _ur_DragDrop.cursor.style.display="block";
   }
  }
}
function ur_Drag_progress(e) {
  if (_ur_DragDrop && _ur_DragDrop.progress) {
    var o=ur_EVT_src(e);
    _ur_DragDrop.isddoperation=true;
    var oChildContainer=sapUrMapi_isChildOfControl(o,"DropTarget");
    if (oChildContainer) {
	    if (_ur_DragDrop.target!=oChildContainer) {
	      _ur_DragDrop.target=oChildContainer;
	      ur_Drag_enter(_ur_DragDrop.target.id,e);
	    } else {
	      ur_Drag_over(_ur_DragDrop.target.id,e);
	    }
	    if (_ur_DragDrop.cursor!=_ur_DragDrop.drag) {
	      ur_Drag_hideCursor();
	      _ur_DragDrop.cursor=_ur_DragDrop.drag;
	    };
	  } else {
	    if (_ur_DragDrop.target) ur_Drag_leave(_ur_DragDrop.target.id,e);
	    _ur_DragDrop.target=null;
	    if (_ur_DragDrop.cursor!=_ur_DragDrop.nodrag) {
	      ur_Drag_hideCursor();
	      _ur_DragDrop.cursor=_ur_DragDrop.nodrag;
	    };
	  }
	  var oBody=document.getElementsByTagName("BODY")[0];
	  if (e.x>oBody.offsetWidth-26 ||e.y>oBody.offsetHeight-26 || e.x<0 || e.y<0) {
	    ur_Drag_hideCursor();
	  } else {
	  	if (ur_system.direction=="rtl") {
				iHorCorr = oBody.scrollLeft-sapUrMapi_posLeftCorrectionForRTL(oBody);
			} else {
				iHorCorr = oBody.scrollLeft;
			}
			_ur_DragDrop.cursor.style.top=e.clientY+14;
			_ur_DragDrop.cursor.style.left=e.clientX+10;
	    ur_Drag_showCursor();
	  }
    ur_EVT_fire(ur_get(_ur_DragDrop.source.id),"odrag",e);
  }
}
function ur_Drag_start(sId,e){
  if (!_ur_DragDrop) {
    _ur_DragDrop={cursor:null,drag:null,nodrag:null,progress:false,isddoperation:false};
    var o=document.createElement("IMG");
    o.src=ur_system.mimepath+"dragdrop/nodrop.gif";
		o.style.position="absolute";
	  o.style.display="none";
	  o.style.zIndex="1000";
	  _ur_DragDrop.nodrag=o;
	  document.body.appendChild(_ur_DragDrop.nodrag);
    var o=document.createElement("IMG");
    o.src=ur_system.mimepath+"dragdrop/drop.gif";
		o.style.position="absolute";
	  o.style.display="none";
	  o.style.zIndex="1000";
	  _ur_DragDrop.drag=o;
	  document.body.appendChild(_ur_DragDrop.drag);
	} 
	_ur_DragDrop.progress=true;
	_ur_DragDrop.source=ur_get(sId);
	ur_get(sId).setCapture();
  ur_EVT_fire(ur_get(sId),"ods",e);
}
function ur_Drag_end(e){
	if (_ur_DragDrop && _ur_DragDrop.progress && _ur_DragDrop.isddoperation) {
    ur_Drag_hideCursor();
    if (_ur_DragDrop.target) ur_Drop(_ur_DragDrop.target.id,e);
	  ur_EVT_fire(_ur_DragDrop.source,"ode",e);
		_ur_DragDrop.source.releaseCapture();
		ur_Drag_hideCursor();
		_ur_DragDrop.source=null;
		_ur_DragDrop.target=null;
		_ur_DragDrop.isddoperation=false;
		_ur_DragDrop.progress=false;
  }
}
function ur_Drop(sId,e) {
	if (_ur_DragDrop && _ur_DragDrop.progress && _ur_DragDrop.isddoperation) {
		ur_EVT_fire(ur_get(sId),"odrop",e);
	}
}
function ur_Drag_enter(sId,e) {
	if (_ur_DragDrop && _ur_DragDrop.progress && _ur_DragDrop.isddoperation) {
	  ur_EVT_fire(ur_get(sId),"odenter",e);
	}
}
function ur_Drag_over(sId,e) {
	if (_ur_DragDrop && _ur_DragDrop.progress && _ur_DragDrop.isddoperation) {
	  ur_EVT_fire(ur_get(sId),"odo",e);
	}
}
function ur_Drag_leave(sId,e) {
	if (_ur_DragDrop && _ur_DragDrop.progress && _ur_DragDrop.isddoperation) {
  	ur_EVT_fire(ur_get(sId),"odl",e);
  }
}

//** DropDownListBox.ie5 **

function sapUrMapi_DropDownListBox_getSelectedKey(sId) {
	oSelect = document.getElementById(sId);
	return oSelect.options[oSelect.selectedIndex].value;
}
function sapUrMapi_DropDownListBox_setSelectedKey(sId,sKey) {
	oSelect = document.getElementById(sId);
	for (var n=0;n<oSelect.options.length;n++) {
		if (oSelect.options[n].value==sKey) {
			oSelect.selectedIndex=n; return;
		}
	}
}
function sapUrMapi_DropDownListBox_getSelectedIndex(sId) {
	return document.getElementById(sId).selectedIndex;
}
function sapUrMapi_DropDownListBox_setSelectedIndex(sId,iIndex) {
	document.getElementById(sId).selectedIndex=iIndex;
}
function sapUrMapi_DropDownListBox_focus(sId) {
   sapUrMapi_focusElement(sId);
}
function sapUrMapi_DropDownListBox_addOptions(sId,oKeyValuePairs,sSelectedKey) {
  for(var elem in oKeyValuePairs)
    sapUrMapi_DropDownListBox_addOption(sId,elem,oKeyValuePairs[elem],elem==sSelectedKey);
}
function sapUrMapi_DropDownListBox_addOption(sId,sKey,sValue,bSelected) {
  var ddlb = document.getElementById(sId);
  ddlb.options[ddlb.options.length] = new Option(sValue,sKey);
  if (bSelected) ddlb.options[ddlb.options.length-1].selected=true;
}
function sapUrMapi_DropDownListBox_keydown(sId,oEvt){
	if(oEvt.keyCode==40 || oEvt.keyCode==38) ur_cancelBubble(oEvt);
}

//** FileUpload.ie5 **

function sapUrMapi_FileUpload_change(sId,oEvt){
	if(ur_system.is508){
		var o=ur_evtSrc(oEvt);
		var sTt=o.getAttribute("tt");
		var sSep=" "+getLanguageText("SAPUR_SEPARATOR")+" ";
		if(o.value!="")
			o.title=o.value+sSep;
		o.title+=getLanguageText("SAPUR_UPLD");
		if(sTt!=null && sTt!="")
			o.title+=sSep+sTt;
		o.title+=sSep+getLanguageText("SAPUR_UPLD_TUTOR");
	}
}

//** FocusRect.ie5 **
function sapUrMapi_Focus_getFocusOffset(object) {
	var position= { top: 0, left: 0};
	position = sapUrMapi_getAbsolutePosition(object);
	var sccontrol = object.parentNode;
	var bFoundFirstScrollContainer=false;
	var oTop = ur_get("ur-topfocus");
	var oBottom = ur_get("ur-bottomfocus");
	var oLeft = ur_get("ur-leftfocus");
	var oRight = ur_get("ur-rightfocus");
  var oEdg1 = ur_get("ur-edge1focus");
  var oEdg2 = ur_get("ur-edge2focus");
  var oEdg3 = ur_get("ur-edge3focus");
  var oEdg4 = ur_get("ur-edge4focus");
	while ((sccontrol) && (!bFoundFirstScrollContainer)) {
	  if (sccontrol.tagName=="DIV" || sccontrol.tagName=="SPAN") {
	    if (sccontrol.currentStyle.overflow!="visible") {
				if (sccontrol!=oTop.parentNode) {
					oParent=oTop.parentNode;
					oParent.removeChild(oTop);
					sccontrol.appendChild(oTop);
					oParent.removeChild(oBottom);
					sccontrol.appendChild(oBottom);
					oParent.removeChild(oLeft);
					sccontrol.appendChild(oLeft);
					oParent.removeChild(oRight);
					sccontrol.appendChild(oRight);
					oParent.removeChild(oEdg1);
					sccontrol.appendChild(oEdg1);
					oParent.removeChild(oEdg2);
					sccontrol.appendChild(oEdg2);
					oParent.removeChild(oEdg3);
					sccontrol.appendChild(oEdg3);
					oParent.removeChild(oEdg4);
					sccontrol.appendChild(oEdg4);
				}
				bFoundFirstScrollContainer=true;
	      var pos=sapUrMapi_getOffsetOnScreen(sccontrol);
	      position.top-=pos.top;
	      position.left-=pos.left;
	    }
	  }
	  sccontrol = sccontrol.parentNode;
	}
	if (!bFoundFirstScrollContainer) {
			oBody=document.getElementsByTagName("BODY").item(0);
			if (oBody!=oTop.parentNode) {
				oParent=oTop.parentNode;
				oParent.removeChild(oTop);
				oBody.appendChild(oTop);
				oParent.removeChild(oBottom);
				oBody.appendChild(oBottom);
				oParent.removeChild(oLeft);
				oBody.appendChild(oLeft);
				oParent.removeChild(oRight);
				oBody.appendChild(oRight);
				oParent.removeChild(oEdg1);
				oBody.appendChild(oEdg1);
				oParent.removeChild(oEdg2);
				oBody.appendChild(oEdg2);
				oParent.removeChild(oEdg3);
				oBody.appendChild(oEdg3);
				oParent.removeChild(oEdg4);
				oBody.appendChild(oEdg4);
			}
	}
	return position;
}
function sapUrMapi_Focus_canFocus(o) {
	if (o==null) return;
	if (!o.tagName) return;
	var tag=","+o.tagName+",";
  
	if((tag==",INPUT,")&&(o.type=="hidden"||o.disabled)){ 
		return false;
	}
	var search=",A,BODY,BUTTON,FRAME,IFRAME,INPUT,ISINDEX,OBJECT,SELECT,TEXTAREA,";
	if (search.indexOf(tag)>-1) return (o.tabIndex>=0);
	if (!o.getAttribute) return;
	if (o.getAttribute("ti")!=null) return (parseInt(o.getAttribute("ti"))>=0);
}
function sapUrMapi_Focus_getNextFocusableElement(o) {
	while (o!=null) {
		if (sapUrMapi_Focus_canFocus(o)) return o;
		o=o.parentNode;
	}
	return null;
}
var oOldFocus=null;
function sapUrMapi_Focus_showFocusRect(sId) {
	try
	{
	if ((document.activeElement!=null) && (document.activeElement.id=="ur-accfocus")) return;
	}
	catch(e)
	{
		return;
	}
	var oTop = ur_get("ur-topfocus");
	if (oTop==null) return;
  var oNewActive=null;
	if (typeof(sId)!="undefined") {
		if (typeof(sId)=="string") {
    oNewActive=ur_get(sId);
	} else {
      oNewActive=sId;
		}
	} else {
    oNewActive=document.activeElement;
	}
	if (oOldFocus!=null) {
	  if (oOldFocus==oNewActive) return;
	}
	
	if (sapUrMapi_getControlTypeFromObject(oNewActive)=="TabStrip") {
	  if (oNewActive.id.indexOf("-itm-")>-1 && oNewActive.id.indexOf("-txt")==-1 && oNewActive.id.indexOf("-a")==-1) {
	    oNewActive=oNewActive.firstChild;
	  }
	}
      
	if ((oNewActive==null)||(oNewActive.tagName=="BODY")) return;
	if ((oNewActive.tagName=="INPUT") && (oNewActive.type.toUpperCase()=="CHECKBOX" || oNewActive.type.toUpperCase()=="RADIO")) {
		var oNew=sapUrMapi_Label_getInputLabel(oNewActive.id);
		if (oNew!=null) {
				oNewActive.hideFocus="true";
		 		oNewActive=oNew;
		} else {
		  oNewActive=ur_get(oNewActive.id+"-img");
		  
		  if(oNewActive==null) oNewActive = document.activeElement;
		}
	}
	if(oNewActive.getAttribute("urhf")=="true") return;
	if (!oNewActive.hideFocus) oNewActive.hideFocus="true";
   
   if (sapUrMapi_getControlTypeFromObject(oNewActive)=="SelectableLinkBar") {
	  if (oNewActive.tagName=="TABLE") {
	    oNewActive=oNewActive.parentNode.parentNode.parentNode;
	  }	else {
	    oNewActive=oNewActive.parentNode;
	  }
	}
   
   	if (sapUrMapi_getControlTypeFromObject(oNewActive)=="ComboBox") {
   	  if (oNewActive.tagName=="INPUT") {
  	    oNewActive=oNewActive.parentNode;
   	  } else {
  	    oNewActive=oNewActive.parentNode;
   	  }
   	  }
	activeoffsetonscreen = sapUrMapi_Focus_getFocusOffset(oNewActive);
	var sccontrol = oNewActive.parentNode;
	var oTop = ur_get("ur-topfocus");
  var oBottom = ur_get("ur-bottomfocus");
  var oLeft = ur_get("ur-leftfocus");
  var oRight = ur_get("ur-rightfocus");
  var oEdg1 = ur_get("ur-edge1focus");
  var oEdg2 = ur_get("ur-edge2focus");
  var oEdg3 = ur_get("ur-edge3focus");
  var oEdg4 = ur_get("ur-edge4focus");
  if (oNewActive.offsetWidth>0) {
		oFocusRect=sapUrMapi_Focus_calcFocusRect(oNewActive,activeoffsetonscreen,oLeft,oRight,oTop,oBottom);
		if (oFocusRect==null) return;
		oTop.style.top=oFocusRect.top.top;
		oTop.style.left=oFocusRect.top.left;
		oTop.style.width=oFocusRect.top.width;
		oBottom.style.top=oFocusRect.bottom.top;
		oBottom.style.left=oFocusRect.bottom.left;
		oBottom.style.width=oFocusRect.bottom.width;
		oLeft.style.top=oFocusRect.left.top;
		oLeft.style.left=oFocusRect.left.left;
		oLeft.style.height=oFocusRect.left.height;
		oRight.style.top=oFocusRect.right.top;
		oRight.style.left=oFocusRect.right.left;
		oRight.style.height=oFocusRect.right.height;
		oEdg1.style.left=oLeft.style.left;
		oEdg1.style.top=oLeft.style.top;
		oEdg2.style.left=oRight.style.left;
		oEdg2.style.top=oRight.style.top;
		oEdg3.style.left=oRight.style.left;
		oEdg3.style.top=oBottom.style.top;
		oEdg4.style.left=oLeft.style.left;
		oEdg4.style.top=oBottom.style.top;
	}
}
function sapUrMapi_Focus_calcFocusRect(oElement,oOffsets,oLeft,oRight,oTop,oBottom) {
	var o=new Array();
	o.top = {top:0,left:0,width:0};
	o.bottom = {top:0,left:0,width:0};
	o.left = {top:0,left:0,height:0};
	o.right = {top:0,left:0,height:0};
	if (oElement.className.indexOf("urVt")>-1){
		oParent=oElement.parentNode.className;
		oPParent=oElement.parentNode.parentNode.className;
		if(oParent.indexOf("urST")==-1&&oPParent.indexOf("urST")==-1&&oParent.indexOf("urVaTo")==-1){
		    o.top.top-=2;
		    o.bottom.top-=2;
		    o.left.top-=2;
		    o.right.top-=2;
		}
	}
	if (oElement.className.indexOf("urIlbItmTxt")>-1) {
	  oOffsets=sapUrMapi_Focus_getFocusOffset(oElement.parentNode);
	  oElement=oElement.parentNode;
	  o.top.top+=parseInt(oTop.currentStyle.height);
	  o.bottom.top-=(parseInt(oTop.currentStyle.height));
	  o.left.left+=parseInt(oLeft.currentStyle.width);
	  o.left.top+=parseInt(oTop.currentStyle.height);
	  o.right.left-=(parseInt(oLeft.currentStyle.width)*2);
	}
	if (oElement.parentNode.className.indexOf("urTreN")>-1) {o.bottom.top-=6;o.right.left-=1;}
	if (sapUrMapi_getControlTypeFromObject(oElement.parentNode)=="CheckBox") {
	  if (oElement.tagName=="LABEL") {
	    o.left.left-=13;
	    o.top.left-=13;
	    o.top.width+=13;
 	  }
	}
	if (sapUrMapi_getControlTypeFromObject(oElement.parentNode)=="RadioButton") {
	  if (oElement.tagName=="LABEL") {
	    o.left.left-=13;
	    o.top.left-=13;
	    o.top.width+=13;
 	  }
	}
	if (sapUrMapi_getControlTypeFromObject(oElement.parentNode)=="TriStateCheckBox") {
	  if (oElement.tagName=="LABEL") {
	    o.left.left-=13;
	    o.top.left-=13;
	    o.top.width+=13;
 	  }
	}
		
	if (sapUrMapi_getControlType(oElement.id)=="PhaseIndicator") {
	  if (oElement.id.indexOf("-itm-")>-1){
	    o.top.top+=parseInt(oTop.currentStyle.height);
	    o.bottom.top-=parseInt(oBottom.currentStyle.height);
	    o.left.left+=parseInt(oLeft.currentStyle.width);
	    o.right.left-=parseInt(oRight.currentStyle.width);
	  } else {
	    o.top.top+=parseInt(oTop.currentStyle.height);
	    o.bottom.top-=(parseInt(oBottom.currentStyle.height)+1);
	    o.left.left+=parseInt(oLeft.currentStyle.width);
	    o.right.left-=parseInt(oRight.currentStyle.width);
	  }
	}
	if (sapUrMapi_getControlTypeFromObject(oElement)=="DateNavigator") {
	  if (oElement.tagName=="TD"){
	    o.left.left+=(parseInt(oLeft.currentStyle.width)+1);
	    o.top.left+=(parseInt(oLeft.currentStyle.width));
	    o.top.width-=(parseInt(oLeft.currentStyle.width)+1);
	    o.top.top+=(parseInt(oTop.currentStyle.height)+1);
	    o.bottom.top-=parseInt(oBottom.currentStyle.height);
	    o.right.left-=parseInt(oRight.currentStyle.width);
	  }
	}
	if (sapUrMapi_getControlTypeFromObject(oElement)=="SelectableLinkBar") {
	  if (oElement.tagName=="TD"){
	    o.top.top+=parseInt(oTop.currentStyle.height);
	    o.bottom.top-=parseInt(oBottom.currentStyle.height);
	    o.left.left+=parseInt(oLeft.currentStyle.width);
	    o.right.left-=(parseInt(oRight.currentStyle.width)+1);
	  }
	}
	if (sapUrMapi_getControlTypeFromObject(oElement)=="SapTable") {
		if ((oElement.className.indexOf("SelSecIco")>-1) || (oElement.className.indexOf("SelIco")>-1)){
	    o.top.top+=1;
	    o.left.left+=1;
	    o.right.left+=1;
	    o.right.top+=1;
		}
		if (oElement.tagName=="TH" || oElement.className.indexOf("urST")>-1) {
	    o.top.top+=parseInt(oTop.currentStyle.height);
	    o.top.left+=parseInt(oLeft.currentStyle.width);
	    o.top.width-=((parseInt(oLeft.currentStyle.width)*2));
	    if (oElement.tagName=="TD") o.bottom.top-=((parseInt(oBottom.currentStyle.height)*1)+1);
	    if (oElement.tagName=="TH") o.bottom.top-=((parseInt(oBottom.currentStyle.height)*1)); 
	    o.bottom.width=o.top.width;
	    o.left.left+=(parseInt(oLeft.currentStyle.width));
		}
	}
	o.top.top+=oOffsets.top-parseInt(oLeft.currentStyle.width);
	o.top.left+=oOffsets.left;
	o.top.width+=oElement.offsetWidth;
	o.bottom.top+=(oOffsets.top+oElement.offsetHeight);
	o.bottom.left=o.top.left;
	o.bottom.width=o.top.width;
	o.left.top=o.top.top;
	o.left.left+=(-1*parseInt(oLeft.currentStyle.width))+oOffsets.left;
	o.right.top=o.top.top;
	o.right.left+=(o.left.left+o.top.width+parseInt(oLeft.currentStyle.width));
	if (oElement.offsetHeight>0) {
		o.left.height+=o.bottom.top-o.top.top+parseInt(oBottom.currentStyle.height);
		
		o.right.height+=o.left.height;
		
	}
	if (isNaN(o.top.top) || isNaN(o.top.left) || isNaN(o.top.width)) return null;
	if (isNaN(o.bottom.top) || isNaN(o.bottom.left) || isNaN(o.bottom.width)) return null;
	if (isNaN(o.left.top) || isNaN(o.left.left) || isNaN(o.left.height)) return null;
	if (isNaN(o.right.top) || isNaN(o.right.left) || isNaN(o.right.height)) return null;
	o.top.top+="px";
	o.top.left+="px";
	o.top.width+="px";
	o.bottom.top+="px";
	o.bottom.left+="px";
	o.bottom.width+="px";
	o.right.top+="px";
	o.right.left+="px";
	o.right.height+="px";
	o.left.top+="px";
	o.left.left+="px";
	o.left.height+="px";
	return o;
}
function sapUrMapi_Focus_hideFocusRect() {
  var oNewActive=null;
  try {
    oNewActive=document.activeElement;
  } catch (ex) { return; }
  oOldFocus=null;
  var oTop = ur_get("ur-topfocus");
  if (oTop==null) return;
  var oBottom = ur_get("ur-bottomfocus");
  var oLeft = ur_get("ur-leftfocus");
  var oRight = ur_get("ur-rightfocus");
	var oEdg1 = ur_get("ur-edge1focus");
	var oEdg2 = ur_get("ur-edge2focus");
	var oEdg3 = ur_get("ur-edge3focus");
	var oEdg4 = ur_get("ur-edge4focus");
  oTop.style.top="-10000px";
  oBottom.style.top="-10000px";
  oLeft.style.top="-10000px";
  oRight.style.top="-10000px";
  oEdg1.style.top="-10000px";
  oEdg2.style.top="-10000px";
  oEdg3.style.top="-10000px";
  oEdg4.style.top="-10000px";
}
function sapUrMapi_Focus_addFocusRect(sFocusElementId){
  var oBdy=document.getElementsByTagName("BODY");
  document.onactivate=sapUrMapi_Focus_showFocusRect;
  document.ondeactivate=sapUrMapi_Focus_hideFocusRect;
	sapUrMapi_Resize_AddItem("ur-focus-rect", "sapUrMapi_Focus_showFocusRect()");
	var oTop = ur_get("ur-topfocus");
	var oBottom = ur_get("ur-bottomfocus");
	var oLeft = ur_get("ur-leftfocus");
	var oRight = ur_get("ur-rightfocus");
	var oEdg1 = ur_get("ur-edge1focus");
	var oEdg2 = ur_get("ur-edge2focus");
	var oEdg3 = ur_get("ur-edge3focus");
	var oEdg4 = ur_get("ur-edge4focus");
  oTop.style.top="-10000px";
  oBottom.style.top="-10000px";
  oLeft.style.top="-10000px";
  oRight.style.top="-10000px";
  oEdg1.style.top="-10000px";
  oEdg2.style.top="-10000px";
  oEdg3.style.top="-10000px";
  oEdg4.style.top="-10000px";
  try {
    sapUrMapi_focusElement(sFocusElementId);
  } catch(ex) {
  }
}
function sapUrMapi_Focus_RegisterCreate(sId) {
	sapUrMapi_Create_AddItem("ur_focus", "sapUrMapi_Focus_addFocusRect(\""+sId+"\")");
}
function sapUrMapi_Focus_getCurrentId () {
  var o = window.document.activeElement;
  if (o!=null) {
	  if (o.tagName=="LABEL") return o.htmlFor;
	  while (o.id=="") {
			if (o.tagName=="BODY") return "";
			o=o.parentNode;
	  }
	  return o.id;
  }
  return "";
}
function sapUrMapi_Focus_reset() {
	var oTop = ur_get("ur-topfocus");
	var oBottom = ur_get("ur-bottomfocus");
	var oLeft = ur_get("ur-leftfocus");
	var oRight = ur_get("ur-rightfocus");
  var oEdg1 = ur_get("ur-edge1focus");
  var oEdg2 = ur_get("ur-edge2focus");
  var oEdg3 = ur_get("ur-edge3focus");
  var oEdg4 = ur_get("ur-edge4focus");
  var oParent=oTop.parentNode;
  var oBody=document.getElementsByTagName("BODY")[0];
  if (oParent!=oBody) {
		oParent.removeChild(oTop);
		oBody.appendChild(oTop);
		oParent.removeChild(oBottom);
		oBody.appendChild(oBottom);
		oParent.removeChild(oLeft);
		oBody.appendChild(oLeft);
		oParent.removeChild(oRight);
		oBody.appendChild(oRight);
		oParent.removeChild(oEdg1);
		oBody.appendChild(oEdg1);
		oParent.removeChild(oEdg2);
		oBody.appendChild(oEdg2);
		oParent.removeChild(oEdg3);
		oBody.appendChild(oEdg3);
		oParent.removeChild(oEdg4);
		oBody.appendChild(oEdg4);
  }
}
function sapUrMapi_Focus_remove() {
	var oTop = ur_get("ur-topfocus");
	if(oTop==null) return;
	var oBottom = ur_get("ur-bottomfocus");
	var oLeft = ur_get("ur-leftfocus");
	var oRight = ur_get("ur-rightfocus");
  var oEdg1 = ur_get("ur-edge1focus");
  var oEdg2 = ur_get("ur-edge2focus");
  var oEdg3 = ur_get("ur-edge3focus");
  var oEdg4 = ur_get("ur-edge4focus");
  var oParent=oTop.parentNode;
	oParent.removeChild(oTop);
	oParent.removeChild(oBottom);
	oParent.removeChild(oLeft);
	oParent.removeChild(oRight);
	oParent.removeChild(oEdg1);
	oParent.removeChild(oEdg2);
	oParent.removeChild(oEdg3);
	oParent.removeChild(oEdg4);
}
function sapUrMapi_Focus_getFocusRectHeight() {
	var oTop = ur_get("ur-topfocus");
	if (oTop) return oTop.offsetHeight;
	return 0;
}

//** Image.ie5 **

function sapUrMapi_Image_menuActivate(sImageId,e) {
	oImage = document.getElementById(sImageId);
	if (sapUrMapi_checkKey(e,"keydown",new Array("32","40"))) {
		if (oImage.onclick) {oImage.onclick();return false;} 
		if (oImage.oncontextmenu) {oImage.oncontextmenu();return false;} 
		if (oImage.onmouseover) {oImage.onmouseover();return false;} 
	}
  return false;
}
function sapUrMapi_Image_checkClick(sId, e) {
	if (e.type=="click") return true;
	return sapUrMapi_checkKey(e,"keydown",new Array("32"));
}

//** InputField.ie5 **

var aMonthNames=null;
var aDayNames=null;
var aDayNameAbbrevs=null;
var aDayCount=null;
var sInpSrcEl=null;
var sDtPicker=null;
function sapUrMapi_InputField_setInvalid(sId,bSet,sTooltip) {
	var oIn=ur_get(sId);
	if (oIn.disabled || oIn.readonly || (ur_isInvalid(oIn)&&bSet) || (!ur_isInvalid(oIn)&&!bSet)) return;
  var oLbl=sapUrMapi_Label_getInputLabel(sId);
	sapUrMapi_Label_setInvalid(oLbl,bSet);
	if(sTooltip!="") oIn.setAttribute("tt",sTooltip);
	ur_setInvalid(oIn,bSet);
	if(bSet)
		oIn.className=oIn.className+" urEdf2TxtInv";
	else
    oIn.className=oIn.className.replace(" urEdf2TxtInv","");
	if(ur_system.is508) oIn.title=ur_getTooltip(sId);
}
function sapUrMapi_InputField_setDisabled(sId,bSet) {
	var oIn=ur_get(sId);
  var oLbl=sapUrMapi_Label_getInputLabel(sId);
  var oBtn=ur_get(sId+"-btn");
  
	if (bSet && !ur_isDisabled(oIn)) {
		sapUrMapi_Label_setDisabled(oLbl);
	  oIn.readOnly=true;
		oIn.className+=" urEdf2TxtDsbl";
		if(oBtn!=null) 
			oBtn.className=oBtn.className+"Dsbl";
	} else if(ur_isDisabled(oIn)){
		sapUrMapi_Label_setEnabled(oLbl);
	  oIn.readOnly=false;
    oIn.className=oIn.className.replace(" urEdf2TxtDsbl","");
	}
	ur_setDisabled(oIn,bSet);
	if(ur_system.is508) oIn.title=ur_getTooltip(sId);	
}
function sapUrMapi_InputField_setReadonly(sId,bSet) {
	var oIn=ur_get(sId);
  var oLbl=sapUrMapi_Label_getInputLabel(sId);
  var oBtn=ur_get(sId+"-btn");
  
	if (bSet && !ur_isReadonly(oIn)) {
		sapUrMapi_Label_setDisabled(oLbl);
	  oIn.readOnly=true;
		oIn.className+=" urEdf2TxtRo";
	} else if(ur_isReadonly(oIn)){
		sapUrMapi_Label_setEnabled(oLbl);
	  oIn.readOnly=false;
		oIn.className=oIn.className.replace(" urEdf2TxtRo","");
		if(oBtn!=null)
			oBtn.className=oBtn.className.substring(0,oBtn.className.length-4);
	}
	ur_setReadonly(oIn,bSet);
	if(ur_system.is508) oIn.title=ur_getTooltip(sId);	
}
function sapUrMapi_InputField_keydown(sId,e){
	
	if((e.altKey && (e.keyCode==40||e.keyCode==38)) || e.keyCode==115){
	  var oBtn=ur_get(sId+"-btn");
	  if(oBtn) {
	    oBtn.click();
	  }
		return ur_EVT_cancel(e);
	}
	
	if(e.keyCode == "81" && e.ctrlKey  && !e.altKey ){
		e.keyCode = "";
		if (sapUrMapi_DataTip_isOpen(sId)) sapUrMapi_DataTip_hide(sId);
		else sapUrMapi_DataTip_show(sId,"keydown");
		return sapUrMapi_cancelEvent(e);
	}
	
	
	if(e.keyCode == "27"){
		e.keyCode = "";
		if (sapUrMapi_DataTip_isOpen(sId)) {
			sapUrMapi_DataTip_hide(sId);
			return sapUrMapi_cancelEvent(e);
		}
	}
}
function sapUrMapi_InputField_changeLabel(sId,sNewLabel){
	var o=ur_get(sId);
	o.setAttribute("lbl",sNewLabel);
	o.title=ur_getTooltip(sId);
}
function sapUrMapi_InputField_focus(sId,oEvt) {
	var o=ur_get(sId);
	
  o.onbeforedeactivate=new Function ("event","ur_get('"+sId+"').setAttribute('cp',ur_getSelection(ur_get('"+sId+"')))");
	
	if(ur_system.is508) o.title=ur_getTooltip(sId);
	if(sInpSrcEl!="BUTTON") sapUrMapi_DataTip_show(sId,"focus");
	sInpSrcEl="";
	sapUrMapi_InputField_showLength(o,oEvt);
	sapUrMapi_InputField_showButton(o,oEvt);
}
function sapUrMapi_InputField_focusWithFormat(sId,sFormat,oEvt) {
	var o=ur_get(sId);
	sapUrMapi_InputField_focus(sId,oEvt);  
	o.setAttribute("tp","DATE");	 
	if (ur_getAttD(o,"tp","")=="DATE") {
	   o.setAttribute("df",sFormat);
	}
}
function sapUrMapi_InputField_showLength(o,oEvt) {
	if ( o.getAttribute("showlength") != "true" || (parseInt(o.getAttribute("maxlength")) >= o.size) ){ return; }
	
	if (urSizeDiv==null)
		sapUrMapi_InputField_initMask();
	
	var oR=o.parentNode;
	var oB=oR.lastChild;
	
	oB.className = oB.className.split(" ")[0] + " urEdf2BtnBrd";
	
	
  oR.style.width = oR.offsetWidth + "px";
	oR.className = oR.className.split(" ")[0] + " urEdfMaskOn";
	
	urInpSizes[o.id]  = o.size;
    urInpWidths[o.id] = o.style.width;
	urInpWidths["pWdth"]=o.parentNode.offsetWidth;
	
    sapUrMapi_InputField_KeyUp(o.id);
}
function sapUrMapi_InputField_triggerOnChange(sId,sOldValue,sNewValue) {
  var oInp = ur_get(sId);
  if (sOldValue!=sNewValue) {
    if (oInp.onchange!=null) return oInp.onchange();
  }
}
function sapUrMapi_InputField_setValue(sId,sValue) {
  ur_get(sId).value=sValue;
}
function sapUrMapi_InputField_getValue(sId) {
  return ur_get(sId).value;
}
var oDatePicker;
var dActDate;
function sapUrMapi_Date_getArray(sFormat,sDate) {
  var q;
  if ( sFormat == 1 || sFormat == 4 )
    q=sDate.split(".");
  if ( sFormat == 2 || sFormat == 5 || sFormat == 7)
    q=sDate.split("/" );
  if ( sFormat == 3 || sFormat == 6 || sFormat == 8)
    q=sDate.split("-");
  for (var i=0;i<q.length;i++) {
  	var str=q[i];
		if(str.length==2 && str.charAt(0)=='0'){
		  str=str.charAt(1);
		}
		q[i]=parseInt(str);
  }
  return q;
}
function sapUrMapi_Date_normalize(sFormat,arrDate) {
  
	var Day=1;
	var Month=0;
	var Year=0;
	if(sFormat==1 || sFormat==7 || sFormat==8){
		Day=arrDate[0];
		Month=arrDate[1];
		Year=arrDate[2];
	}
	else if(sFormat==2 || sFormat==3){
		Day=arrDate[1];
		Month=arrDate[0];
		Year=arrDate[2];
	}
	else if(sFormat==4 || sFormat==5 || sFormat== 6){
		Day=arrDate[2];
		Month=arrDate[1];
		Year=arrDate[0];
	}
	var arrRet=new Array(3);
	arrRet[0]=Year;
	arrRet[1]=Month-1;
	arrRet[2]=Day;
	return arrRet;
}
function sapUrMapi_Date_make(sFormat,vYear,vMonth,vDay)
{
  var dateString;
  if ( sFormat == 1 )
    dateString=sapUrMapi_Date_setZero(parseInt(vDay)) + "." + sapUrMapi_Date_setZero(parseInt(vMonth)) + "." + vYear;
  if ( sFormat == 2 )
    dateString=sapUrMapi_Date_setZero(parseInt(vMonth)) + "/" + sapUrMapi_Date_setZero(parseInt(vDay)) + "/" + vYear;
  if ( sFormat == 3 )
    dateString=sapUrMapi_Date_setZero(parseInt(vMonth)) + "-" + sapUrMapi_Date_setZero(parseInt(vDay)) + "-" + vYear;
  if ( sFormat == 4 )
    dateString="" + vYear + "." + sapUrMapi_Date_setZero(parseInt(vMonth)) + "." + sapUrMapi_Date_setZero(parseInt(vDay));
  if ( sFormat == 5 )
    dateString="" + vYear + "/" + sapUrMapi_Date_setZero(parseInt(vMonth)) + "/" + sapUrMapi_Date_setZero(parseInt(vDay));
  if ( sFormat == 6 )
    dateString="" + vYear + "-" + sapUrMapi_Date_setZero(parseInt(vMonth)) + "-" + sapUrMapi_Date_setZero(parseInt(vDay));
  if ( sFormat == 7 )
    dateString=sapUrMapi_Date_setZero(parseInt(vDay)) + "/" + sapUrMapi_Date_setZero(parseInt(vMonth)) + "/" + vYear;
  if ( sFormat == 8 )
    dateString=sapUrMapi_Date_setZero(parseInt(vDay)) + "-" + sapUrMapi_Date_setZero(parseInt(vMonth)) + "-" + vYear;
  return dateString;
}
function sapUrMapi_InputField_showActualDatePicker(sId, oEvt) {
	  sInpSrcEl=oEvt.srcElement.tagName;
	  var dt=sapUrMapi_DateField_getDate(sId);
    sapUrMapi_InputField_showDatePicker(sId,dt.year,dt.month-1,dt.day,ur_system.firstdayofweek, oEvt);
}
function sapUrMapi_InputField_showDatePicker(sId,iYear,iMonth,iDay,iFirstDayOfWeek, oEvt,bNav) {
	oInput=ur_get(sId);
	if (ur_getAttD(oInput,"st","").indexOf("d")>-1) return;
	try {sapUrMapi_DataTip_hide(sId)} catch (ex){} 
	oEvt.cancelBubble=true;
	if (!bNav && ur_getAttD(oInput,"dp","0")=="1") {sapUrMapi_hideDatePicker();return;}
  if (typeof(iFirstDayOfWeek)=="undefined") {
  	iFirstDayOfWeek=ur_system.firstdayofweek;
  }
  if (isNaN(iYear) || isNaN(iMonth) || isNaN(iDay)) {
	  var dt=sapUrMapi_DateField_getDate(sId);
	  iYear=dt.year;
	  iMonth=dt.month;
	  iDay=dt.day;
	  if (isNaN(iYear) || isNaN(iMonth) || isNaN(iDay)) {
			var dt=new Date();
			iYear  = dt.getFullYear();
			iMonth = dt.getMonth();
			iDay   = dt.getDate();
		} 
  }
	if (oInput.getAttribute("dsbl")=="true") return;
	var arrUrls;
	arrUrls = new Array(ur_system.stylepath+"ur_pop_"+ur_system.browser_abbrev+".css");
	
	if (oDatePicker) 
	if(oDatePicker.frame.window.document.getElementsByTagName("DIV")[0].firstChild)
		if(oDatePicker.frame.window.document.getElementsByTagName("DIV")[0].firstChild.className=="urDataTipStd")
			oDatePicker=null;
  if (oDatePicker) {
    var oCal = sapUrMapi_DatePicker_make(sId,iYear,iMonth,iDay,iFirstDayOfWeek);
  	oDatePicker.frame.window.document.getElementsByTagName("DIV")[0].innerHTML=oCal.innerHTML;
		oDatePicker.frame.window.document.getElementById("dp").focus();
  } else {
		dActDate  = new Date(iYear,iMonth,iDay);
		var oCal = sapUrMapi_DatePicker_make(sId,iYear,iMonth,iDay,iFirstDayOfWeek);
		oDatePicker = new sapPopup(window,arrUrls,oCal,ur_get(sId+"-btn"),oEvt,0);
		if (ur_system.direction=="rtl")
			oDatePicker.positionbehavior = sapPopupPositionBehavior.MENULEFT;
		else
			oDatePicker.positionbehavior = sapPopupPositionBehavior.MENURIGHT;
		oDatePicker.onblur = sapUrMapi_hideDatePicker;
		if (ur_system.direction=="rtl") {
			oDatePicker.position.right=oDatePicker.position.right-1;
		} else {
			oDatePicker.position.left=oDatePicker.position.left-1;
		}
		oDatePicker.position.top=oDatePicker.position.top-1;
		oDatePicker.show();
		oDatePicker.inp=sId;
		oInput.setAttribute("dp","1");
		window.document.attachEvent("onactivate",sapUrMapi_hideDatePicker);
		oDatePicker.frame.window.document.getElementById("dp").focus();
		sDtPicker=true;
  }
	sapUrMapi_Focus_hideFocusRect();
}
function sapUrMapi_hideDatePicker() {
	var oOldFocus=null;
	if (window.event && window.event.type=="activate" && window.event.srcElement.id.indexOf(oDatePicker.inp+"-btn")>-1) {
	  return;
	}
	window.document.detachEvent("onactivate",sapUrMapi_hideDatePicker);
	if (oDatePicker) {
		oOldFocus=oDatePicker.source.object;
		var oInput=ur_get(oDatePicker.inp);
		oInput.setAttribute("dp","0");
		oDatePicker.onblur=null;
		try {
			if (document.activeElement==oInput || document.activeElement.id=="sapPopupMainId_X0" || document.activeElement.id.indexOf(oInput.id)>-1) {
				sapUrMapi_focusElement(oDatePicker.inp);
				ur_setSelection(oInput,oInput.getAttribute("cp"));
			}
		} catch (ex) {}
		oDatePicker.hide();
		oDatePicker=null;
		oPopup=null;
	}
	sDtPicker=false;
}
function sapUrMapi_DatePicker_select(sId,e) {
  var o = e.srcElement;
	var oInput=ur_get(sId);
  if(oInput.readOnly) return;
  while (o.tagName!="TD") {
  	o = o.parentNode;
  	if (o==null) return;
  }
	sDay = o.id;
	if (sDay==null || sDay=="") return;
  if (sDay) {
    var aDate = sDay.split("-");
    var arrValue=new Array();
    arrValue[0]=parseInt(aDate[2]);
    arrValue[1]=parseInt(aDate[1]);
    arrValue[2]=parseInt(aDate[0]);
    if (typeof(ur_system.dateformat)=="undefined") {
      UR_InputFieldDateSelect(sId,parseInt(aDate[2]),parseInt(aDate[1]),parseInt(aDate[0]));
    } else {
	    sapUrMapi_DateField_setDate(sId,arrValue[0],arrValue[1],arrValue[2]);
		  e.cancelBubble=true;
		  sapUrMapi_hideDatePicker();
		  ur_setSelection(oInput,{pos:oInput.value.length,length:0}); 
    }
  }
}
function sapUrMapi_DatePicker_keydown(hWnd,oEvt) {
  var i=oEvt.keyCode;
  if (i==33) { hWnd.document.getElementById("prev").click(); }
  else if (i==34) { hWnd.document.getElementById("next").click(); }
  else if (i==9) {sapUrMapi_hideDatePicker();return;}
  else if (i!=115 && (!oEvt.altKey || (oEvt.keyCode!=40 && oEvt.keyCode!=38))) {sapUrMapi_hideDatePicker();return;}
  else {sapUrMapi_hideDatePicker();}
  
  oEvt.cancelBubble=true;
  oEvt.keyCode="";
  return false;
}
function sapUrMapi_Date_setZero(iInt) {
	return iInt<10?"0"+iInt:iInt;
}
function sapUrMapi_DatePicker_make(sId,iYear,iMonth,iDay,iFirstDayOfWeek) {
  var arrTmp = ur_txt[ur_language];
  if (aMonthNames==null) aMonthNames = new Array (arrTmp["SAPUR_JANUARY"],arrTmp["SAPUR_FEBRUARY"],arrTmp["SAPUR_MARCH"],arrTmp["SAPUR_APRIL"],arrTmp["SAPUR_MAY"],arrTmp["SAPUR_JUNE"],arrTmp["SAPUR_JULY"],arrTmp["SAPUR_AUGUST"],arrTmp["SAPUR_SEPTEMBER"],arrTmp["SAPUR_OCTOBER"],arrTmp["SAPUR_NOVEMBER"],arrTmp["SAPUR_DECEMBER"]);
  if (aDayNameAbbrevs==null)   aDayNameAbbrevs   = new Array (arrTmp["SAPUR_SUNDAY_ABBREV"],arrTmp["SAPUR_MONDAY_ABBREV"],arrTmp["SAPUR_TUESDAY_ABBREV"],arrTmp["SAPUR_WEDNESDAY_ABBREV"],arrTmp["SAPUR_THURSDAY_ABBREV"],arrTmp["SAPUR_FRIDAY_ABBREV"],arrTmp["SAPUR_SATURDAY_ABBREV"]);
  if (aDayCount==null)  aDayCount = new Array (31,28,31,30,31,30,31,31,30,31,30,31);
  sapUrMapi_Date_setDayCount(iMonth,iYear);
  if (typeof(iFirstDayOfWeek)=="undefined") {
  	iFirstDayOfWeek=ur_system.firstdayofweek;
  }
  var oCal = ur_get("ur-date-picker");
  if (!oCal) {
	  var oBody = document.getElementsByTagName("BODY")[0];
	  var oCal = document.createElement("SPAN");
	  oCal.id="ur-date-picker";
	  oCal.style.position="absolute";
	  if (ur_system.direction=="rtl") {
	    oCal.style.right="25";
	  } else {
	    oCal.style.left="0";
	  }
	  oCal.style.top="-1999px";
	  oBody.appendChild(oCal);
  }
  var sCalHtml = "<table onkeydown=\"return me.sapUrMapi_DatePicker_keydown(window,event)\" tabindex=\"0\" id=\"dp\" onclick=\"me.sapUrMapi_DatePicker_select('"+sId+"',event);\" class=urCalPicWhl cellpaddding=0 cellspacing=0 border=0><tr>";
	var o=ur_get(sId);
	var bRO=o.readOnly;
  var pm = iMonth-1;
  var nm = iMonth+1;
  var dy = iDay;
  var py = iYear;
  var ny = iYear;
  if (pm==-1) {pm = 11;py--;}
  if (nm==12) {nm = 0;ny++;}
  if (dy>28) {dy=25}
  sCalHtml    += "<td id=\"prev\" class=\"urCalArrPrev\" onclick=\"me.sapUrMapi_InputField_showDatePicker('"+sId+"',"+py+","+pm+","+dy+","+iFirstDayOfWeek+",event,true);\">&nbsp;</td>";
  sCalHtml    += "<td colspan=6 class=urCalHdr nowrap align=center>"+aMonthNames[iMonth]+" "+iYear+"</td>";
  sCalHtml    += "<td id=\"next\"";
  if(iYear==9999 && iMonth==11) {
    sCalHtml  += " class=\"urCalArrNextDsbl\" onclick=\"me.sapUrMapi_InputField_showDatePicker('"+sId+"',"+9999+","+11+","+31+","+iFirstDayOfWeek+",event,true);\">";
  } else {
    sCalHtml  += " class=\"urCalArrNext\" onclick=\"me.sapUrMapi_InputField_showDatePicker('"+sId+"',"+ny+","+nm+","+dy+","+iFirstDayOfWeek+",event,true);\">";
  }
  sCalHtml    += "&nbsp;";
  sCalHtml    += "</td>";
  sCalHtml    += "</tr>";
  sCalHtml    += "<tr>";
 iLastDayOfWeek = iFirstDayOfWeek-1;
  if (iLastDayOfWeek==-1) iLastDayOfWeek=6;
  
  if (ur_system.direction=="rtl") {
    sCalHtml    += "<td class=urCalName style=\"border-left:0px none\">&nbsp;</td>";
  } else {
    sCalHtml    += "<td class=urCalName style=\"border-right:0px none\">&nbsp;</td>";
  }
  for (var i=iFirstDayOfWeek;i<aDayNameAbbrevs.length;i++) {
    if (aDayNameAbbrevs.length>3) {
      aDayNameAbbrevs[i]=aDayNameAbbrevs[i].substring(0,3);
    }
    sCalHtml    += "<td class=urCalName>"+aDayNameAbbrevs[i]+"</td>";
  }
  for (var i=0;i<iFirstDayOfWeek;i++) {
    if (i==iLastDayOfWeek) {
      if (ur_system.direction=="rtl") {
        sCalHtml    += "<td class=urCalName style=\"border-left:0px none\">"+aDayNameAbbrevs[i]+"</td>";
      } else {
        sCalHtml    += "<td class=urCalName style=\"border-right:0px none\">"+aDayNameAbbrevs[i]+"</td>";
      }
    } else {
      sCalHtml    += "<td class=urCalName>"+aDayNameAbbrevs[i]+"</td>";
    }
  }
   var dDate  = new Date(iYear,iMonth,1);
  var dStart=dDate;
  dStart = new Date(dStart.getTime()-((dStart.getDay()-iFirstDayOfWeek)*1000*60*60*24));
  if (dStart.getDate() >= 1 && dStart.getDate() <= 7) dStart = new Date(dStart.getTime()-(7*1000*60*60*24));
  var iFirstWeekCode=30;                                                   
  var iMinimalDaysInFirstWeek=ur_system.minimalDaysInFirstWeek;
  if (!iMinimalDaysInFirstWeek) iMinimalDaysInFirstWeek=3;
		
	for (var i=0;i<6;i++) {
    var oDateObj=new Date();
    var weekNum=ur_getWeek(dStart,iMinimalDaysInFirstWeek);
		sCalHtml    += "<tr class=urCalRow";
		if (!bRO)
      sCalHtml    += " style=\"cursor:hand;\"";
		sCalHtml    += "><th class=urCalName style='border-style:none" +                         
		((i<5)?" none solid none":"")+" !important;'>" +                         
		weekNum+"</th>";                                       
  	for (var n=0;n<7;n++) {
				var sClass="";
        
			var sId=dStart.getFullYear()+"-"+(dStart.getMonth()+1)+"-"+dStart.getDate();
	  		if (dStart.getMonth()!=iMonth) {
	  			sClass="urCalIna";
	  		} else {
	  			sClass="";
	  		}
	  		if ((dStart.getYear()==dActDate.getYear()) && (dStart.getMonth()==dActDate.getMonth()) && (dStart.getDate()==dActDate.getDate())) {
	  			sClass+=" urCalDaySelEmp";
	  		}
	  		sCalHtml+="<td";
				if (n==0) {
				  if (ur_system.direction=="rtl")
				    sCalHtml+=" style=\"border-right-style:solid\"";
				  else    
	  		        sCalHtml+=" style=\"border-left-style:solid\"";
	  		}
	  		if ((dStart.getYear()==new Date().getYear()) && (dStart.getMonth()==new Date().getMonth()) && (dStart.getDate()==new Date().getDate())) {
	        if (sClass!="") {
	          sCalHtml+=" class="+sClass+" id="+sId+"><div style=\"cursor:hand;background-color:transparent\" class=urCalTod>"+dStart.getDate()+"</div></td>";
	        } else {
	          sCalHtml+=" id="+sId+"><div style=\"cursor:hand;background-color:transparent\" class=urCalTod>"+dStart.getDate()+"</div></td>";
	        }
	  		} else {
	  		  if (sClass!="") {
	          sCalHtml+=" id="+sId+" class="+sClass+">"+dStart.getDate()+"</td>";
	        } else {
	          sCalHtml+=" id="+sId+">"+dStart.getDate()+"</td>";
	        }
	  		}
	  		var oldStart = dStart;
	  		dStart = new Date(dStart.getTime()+(1000*60*60*24));
	  		if (dStart.getDate()==oldStart.getDate()) {
	  		  
	  		  dStart = new Date(dStart.getTime()+(1000*60*60*1));
	  		}
	  		if (dStart.getHours()==1) {
	  		  dStart = new Date(dStart.getTime()-(1000*60*60*1));
	  		}
  	}
    sCalHtml    += "</tr>";
  }
  sCalHtml    += "</tr></table>";
  oCal.innerHTML=sCalHtml;
  return oCal;
}
function sapUrMapi_Date_setDayCount(iMonth, iYear) {
	if ((iMonth == 1) && ((iYear % 400 == 0)) || ((iYear % 4 == 0) && (iYear % 100 != 0))) aDayCount[1] = 29;
}
var urSizeDiv = null;
var urInpSizes = new Array();
var urInpWidths = new Array();
function sapUrMapi_InputField_KeyUp(id, event) {
	var spaceTxt = "";
	var spaceChar = "0";
	var o=ur_get(id);
	if (o.getAttribute("showlength")!="true") return;
	var maxChars = parseInt(o.getAttribute("maxlength"));
	if (maxChars >= o.size){ return; }
	
	if (urSizeDiv==null) sapUrMapi_InputField_initMask();
	
	spaceTxt = o.value;
	
	for (var i=spaceTxt.length; i < maxChars; i++)
		spaceTxt += spaceChar;
	urSizeDiv.innerHTML = spaceTxt;
	o.style.width = urSizeDiv.offsetWidth;
	
	var oB=ur_get(id+"-btn");
  var oR=o.parentNode;
	var iPw=urInpWidths["pWdth"];
	 if(oB){
	 
	  var iMr=iPw-urSizeDiv.offsetWidth-(oR.lastChild.offsetWidth+1);
	    if(iMr>0){
			o.style.marginRight=iMr;
                     }
             }
}
function sapUrMapi_InputField_Blur(id, event) {
	var o=ur_get(id);
	if (sDtPicker==true)sDtPicker=false;
	else sapUrMapi_DataTip_hide(id);
	sapUrMapi_InputField_hideButton(o,event);
	if (ur_getAttD(o,"tp","")=="DATE") {
	  sapUrMapi_DateField_checkDate(id);
	  
	}
	if (!urInpSizes[id]) { return; }
	if (o.getAttribute("showlength")!="true") { return; }
	o.size = urInpSizes[id];
	o.style.width = urInpWidths[id];
	var oP = o.parentNode;
  if(oP.className.split(" ")[0]!="urEdf2VWhl"){
		oP.style.width = "";
  }
  else{
     o.style.marginRight=0;
  }	
	oP.className = oP.className.replace("urEdfMaskOn","");
	oP.lastChild.className = oP.lastChild.className.replace("urEdf2BtnBrd","");
}
function sapUrMapi_InputField_initMask() {
	if (urSizeDiv == null) {
		urSizeDiv = document.createElement("DIV");
		
		urSizeDiv.id = "UKL_DIV";
		urSizeDiv.className = "urEdfTxtEnbl";
		urSizeDiv.style.position = "absolute";
		if (ur_system.direction=="rtl") {
		  urSizeDiv.style.right = "0";
		} else {
		  urSizeDiv.style.left = "0";
		}
		urSizeDiv.style.top = "0";
		urSizeDiv.style.zIndex = "9999";
		urSizeDiv.style.visibility = "hidden";
		urSizeDiv.innerHTML = "aaa";
		document.body.appendChild(urSizeDiv);
	}
}
function sapUrMapi_InputField_change(sId,oEvt) {
	var o=ur_get(sId);
	if(ur_system.is508) o.title=ur_getTooltip(sId);
}
function sapUrMapi_InputFieldHelpClick(sId,oEvt) {
	var o=ur_get(sId);	
	sInpSrcEl="BUTTON";
	if (o.getAttribute("dp")!="1") {
    o.onfocus();
	  sapUrMapi_InputField_showActualDatePicker(sId,oEvt);
	} else {
	  sapUrMapi_hideDatePicker();
	}
}
function sapUrMapi_InputField_showButton(o,oEvt){
	var oR=o.parentNode;
	var oBtn=oR.getElementsByTagName("BUTTON")[0];
	if(oBtn==null||oBtn.offsetTop>=0)return;
	var oPos=sapUrMapi_getAbsolutePosition(o);
	oBtn.style.top=oPos.top;
}
function sapUrMapi_InputField_hideButton(o,oEvt){
	var oR=o.parentNode;
	var oBtn=oR.getElementsByTagName("BUTTON")[0];
	if(oBtn==null||oBtn.style.position!="absolute")return;
	ur_callDelayed("ur_get('"+oBtn.id+"').style.top='-900px'",150);
}
function sapUrMapi_DateField_checkDate(sId) {
  var dt=sapUrMapi_DateField_getDate(sId);
  if (isNaN(dt.day) || isNaN(dt.month) || isNaN(dt.year)) return;
  
}
function sapUrMapi_DateField_getDate(sId) {
  var dToday=new Date();
  var sValue=sapUrMapi_InputField_getValue(sId);
  if (sValue=="") return {day:iDay,month:iMonth,year:iYear};
  var sPattern=ur_DateField_getDatePattern(sId);
  var sLongPattern=sPattern;
  
  var sFindNumber="0123456789";
  var sFindPattern="dMy";
  var iDay,iMonth,iYear;
  var iErrors=0;
	while(sFindNumber.indexOf(sValue.charAt(0))==-1) {
		sValue=sValue.substring(1);
		iErrors++;
	}
	while(sFindNumber.indexOf(sValue.charAt(sValue.length-1))==-1) {
	  sValue=sValue.substring(0,sValue.length-1);
		iErrors++;
	}
  
  var sRegPattern="([^0-9])";
  var reg=new RegExp(sRegPattern,"ig");
  var arr=reg.exec(sValue);
  var xValue=sValue;
	var sCh=RegExp.$1;
	var sCh1;
	var twodelimiters=false;
	
	 try{
	xValue=sValue.split(sCh);
  if (xValue.length != 3)
  {
	var reg1=new RegExp(sRegPattern,"ig");
	var stempval=xValue[1];
	if(stempval!=null)
	while(reg1.exec(stempval))
	{
		var arr1= reg1.exec(stempval);
		sCh1=RegExp.$1;
		xValue=stempval.split(sCh1);
		stempval=xValue[1];
	}
	}
 
	
	if(sCh1!=null) {
	twodelimiters=true;
	if (sValue.indexOf(sCh) > sValue.indexOf(sCh1))
	{
		var tmp=sCh1;
		sCh1=sCh;
		sCh=tmp;
		
	}
	}
	}catch(Exp){}
    reg=new RegExp(sRegPattern,"ig");
    arr=reg.exec(sValue);
	if (reg.lastIndex>0) {
    if (sValue.indexOf(sCh)==4 || sValue.indexOf(sCh)==3) {
		  xValue=sPattern.replace("yyyy",sValue.substring(0,sValue.indexOf(sCh)));
				  if(twodelimiters)
			{
			  xValue=xValue.replace("MM",sValue.substring(sValue.indexOf(sCh)+1,sValue.lastIndexOf(sCh1)));
			  xValue=xValue.replace("M",sValue.substring(sValue.indexOf(sCh)+1,sValue.lastIndexOf(sCh1)));
			  xValue=xValue.replace("dd",sValue.substring(sValue.lastIndexOf(sCh1)+1));
			  xValue=xValue.replace("d",sValue.substring(sValue.lastIndexOf(sCh1)+1));
			}
	      else
			{
		  xValue=xValue.replace("MM",sValue.substring(sValue.indexOf(sCh)+1,sValue.lastIndexOf(sCh)));
		  xValue=xValue.replace("M",sValue.substring(sValue.indexOf(sCh)+1,sValue.lastIndexOf(sCh)));
		  xValue=xValue.replace("dd",sValue.substring(sValue.lastIndexOf(sCh)+1));
		  xValue=xValue.replace("d",sValue.substring(sValue.lastIndexOf(sCh)+1));
			}
		  sValue=xValue;
    }
  }
	while(sFindPattern.indexOf(sPattern.charAt(sPattern.length-1))==-1) sPattern=sPattern.substring(0,sPattern.length-1);
  while (sPattern.indexOf(" ")>-1) sPattern=sPattern.replace(" ","");
  while (sValue.indexOf(" ")>-1) {
		
    sValue=sValue.replace(" ","");
  }
  if (iErrors>3) return {day:iDay,month:iMonth,year:iYear};
  
  
  var reg=ur_DateField_getRegExpTest(sValue,sPattern);
  if (reg.lastIndex>0) {
    
    
    var iDayPos=sPattern.indexOf("d");
    var iMonthPos=sPattern.indexOf("M");
    var iYearPos=sPattern.indexOf("y");
    var sDay,sMonth,sYear="";
		if (iDayPos<iMonthPos && iDayPos<iYearPos) sDay=RegExp.$1;
    if (iDayPos>iMonthPos && iDayPos<iYearPos) sDay=RegExp.$2;
    if (iDayPos<iMonthPos && iDayPos>iYearPos) sDay=RegExp.$2;
    if (iDayPos>iMonthPos && iDayPos>iYearPos) sDay=RegExp.$3;
		while (sDay.indexOf("0")==0 && sDay.length>1) sDay=sDay.substring(1);
		iDay=parseInt(sDay);
		if (iDay==0) iDay=1;
    if (iMonthPos<iDayPos && iMonthPos<iYearPos) sMonth=RegExp.$1;
    if (iMonthPos>iDayPos && iMonthPos<iYearPos) sMonth=RegExp.$2;
    if (iMonthPos<iDayPos && iMonthPos>iYearPos) sMonth=RegExp.$2;
    if (iMonthPos>iDayPos && iMonthPos>iYearPos) sMonth=RegExp.$3;
    while (sMonth.indexOf("0")==0 && sMonth.length>1) sMonth=sMonth.substring(1);
		iMonth=parseInt(sMonth);
    if (iYearPos<iMonthPos && iYearPos<iDayPos) sYear=RegExp.$1;
    if (iYearPos>iMonthPos && iYearPos<iDayPos) sYear=RegExp.$2;
    if (iYearPos<iMonthPos && iYearPos>iDayPos) sYear=RegExp.$2;
    if (iYearPos>iMonthPos && iYearPos>iDayPos) sYear=RegExp.$3;
    while (sYear.indexOf("0")==0 && sYear.length>1) sYear=sYear.substring(1);
		iYear=parseInt(sYear);
		var arrMonth=new Array(0,31,29,31,30,31,30,31,31,30,31,30,31);
  	if (isNaN(iYear) && isNaN(iMonth) && isNaN(iDay)) return {day:iDay,month:iMonth,year:iYear};
		if (isNaN(iYear)) iYear=dToday.getFullYear();
		if (isNaN(iMonth)) iMonth=dToday.getMonth()+1;
		if (isNaN(iDay) && iMonth==dToday.getMonth()+1) iDay=dToday.getDate();
		if (isNaN(iDay) && iMonth!=dToday.getMonth()+1) iDay=1;
		if (isNaN(iYear) || isNaN(iMonth) || isNaN(iDay)) return {day:iDay,month:iMonth,year:iYear};
		if (iMonth>12) iMonth=12;
		if (iMonth<1) iMonth=1;
		if (iDay>arrMonth[iMonth]) iDay=arrMonth[iMonth];
		if (iYear<=20) iYear+=	2000;
		else if (iYear>20 && iYear<=99) iYear+=1900;
		if (iMonth==2 && iDay==29 && (!ur_DateField_isLeapYear(iYear))) iDay=28;
    return {day:iDay,month:iMonth,year:iYear};
  } else {
  	
    return {day:iDay,month:iMonth,year:iYear};
  }
  oEvt.returnValue=false;
  
}
function ur_DateField_getRegExpTest(sValue,sPattern) {
  var sPatternNew="";
  var sEscapeChars="()*$[]\/^{}|. -";
  var sFindNumberPattern="dMy";
  var bFoundNumber=false;
  for (var j=0;j<sPattern.length;j++) {
    if (!bFoundNumber && sFindNumberPattern.indexOf(sPattern.charAt(j))>-1) bFoundNumber=true;
    if (bFoundNumber) {
			if (sEscapeChars.indexOf(sPattern.charAt(j))>-1) sPatternNew=sPatternNew+"[^0-9]{0,1}";
			else sPatternNew+=sPattern.charAt(j);
		}
  }
  sRegPattern=sPatternNew.replace("dd","([0-9]{1,2})");
  sRegPattern=sRegPattern.replace("MM","([0-9]{1,2})");
  sRegPattern=sRegPattern.replace("d","([0-9]{1,2})");
  sRegPattern=sRegPattern.replace("M","([0-9]{1,2})");
  sRegPattern=sRegPattern.replace("yyyy","([0-9]{1,4})");
  sRegPattern=sRegPattern.replace("yy","([0-9]{1,4})");
  var reg=new RegExp(sRegPattern,"ig");
  var arr=reg.exec(sValue);
	if (reg.lastIndex==0) {
		sRegPattern=sPatternNew.replace("dd","([0-9]{1,2})");
		sRegPattern=sRegPattern.replace("MM","([0-9]{1,2})");
		sRegPattern=sRegPattern.replace("d","([0-9]{1,2})");
		sRegPattern=sRegPattern.replace("M","([0-9]{1,2})");
		sRegPattern=sRegPattern.replace("yyyy","([0-9]{1,4})");
		sRegPattern=sRegPattern.replace("yy","([0-9]{1,4})");
		var reg=new RegExp(sRegPattern,"ig");
		var arr=reg.exec(sValue);
  }
  if (reg.lastIndex==0 && sValue.length>2) {
		sRegPattern=sPatternNew.replace("dd","([0-9]{2,2})");
		sRegPattern=sRegPattern.replace("MM","([0-9]{2,2})");
		sRegPattern=sRegPattern.replace("d","([0-9]{1,2})");
		sRegPattern=sRegPattern.replace("M","([0-9]{1,2})");
		sRegPattern=sRegPattern.replace("yyyy","");
		sRegPattern=sRegPattern.replace("yy","");
		if (sRegPattern.indexOf("\\(")==-1 && sRegPattern.indexOf("\\)")==-1) {
		  sRegPattern=sRegPattern.substring(sRegPattern.indexOf("("),sRegPattern.lastIndexOf(")")+1);
		}
		var reg=new RegExp(sRegPattern,"ig");
	  var arr=reg.exec(sValue);
	}
  if (reg.lastIndex==0 && sValue.length>2) {
		sRegPattern=sPatternNew.replace("dd","([0-9]{1,2})");
		sRegPattern=sRegPattern.replace("MM","([0-9]{1,2})");
		sRegPattern=sRegPattern.replace("d","([0-9]{1,2})");
		sRegPattern=sRegPattern.replace("M","([0-9]{1,2})");
		sRegPattern=sRegPattern.replace("yyyy","");
		sRegPattern=sRegPattern.replace("yy","");
		if (sRegPattern.indexOf("\\(")==-1 && sRegPattern.indexOf("\\)")==-1) {
		  sRegPattern=sRegPattern.substring(sRegPattern.indexOf("("),sRegPattern.lastIndexOf(")")+1);
		}
		var reg=new RegExp(sRegPattern,"ig");
	  var arr=reg.exec(sValue);
	}
  if (reg.lastIndex==0) {
		sRegPattern=sPatternNew.replace("dd","([0-9]{2,2})");
		sRegPattern=sRegPattern.replace("MM","");
		sRegPattern=sRegPattern.replace("d","([0-9]{1,2})");
		sRegPattern=sRegPattern.replace("M","");
		sRegPattern=sRegPattern.replace("yyyy","");
		sRegPattern=sRegPattern.replace("yy","");
		if (sRegPattern.indexOf("\\(")==-1 && sRegPattern.indexOf("\\)")==-1) {
		  sRegPattern=sRegPattern.substring(sRegPattern.indexOf("("),sRegPattern.lastIndexOf(")")+1);
		}
		var reg=new RegExp(sRegPattern,"ig");
	  var arr=reg.exec(sValue);
	}
	return reg;
}
function ur_DateField_isLeapYear(iYear) {
  return ((iYear % 400 == 0) || ((iYear % 4 == 0) && (iYear % 100 != 0)));
}
function sapUrMapi_DateField_setDate(sId,iDay,iMonth,iYear) {
  var sPattern=ur_DateField_getDatePattern(sId);
  var sFormat=sPattern;
  var s=sPattern.replace("dd",ur_DateField_addZero(iDay));
  s=s.replace("MM",ur_DateField_addZero(iMonth));
  s=s.replace("yyyy",iYear+"");
  if (iYear<1950) {
    s=s.replace("yy",iYear+"");
  } else {
    s=s.replace("yy",(iYear+"").substring(2));
  }
  s=s.replace("d",iDay+"");
  s=s.replace("M",iMonth+"");
	sapUrMapi_InputField_setInvalid(sId,false,"");
	var oldValue=sapUrMapi_InputField_getValue(sId);
	sapUrMapi_InputField_setValue(sId,s)
	sapUrMapi_InputField_triggerOnChange(sId,oldValue,s);
}
function ur_DateField_getDatePattern(sId) {
	var o=ur_get(sId);
	var sFormatString="";
	if (ur_getAttD(o,"tp","")=="DATE") {
	  sFormatString=ur_getAttD(o,"df","");
	}
	if (sFormatString=="") {
	  sFormatString=ur_system.dateformatstring;
	}
	if (sFormatString!=null && sFormatString!="") 
		{
		while(sFormatString.indexOf("'")>-1) {sFormatString=sFormatString.replace("'","");}
		return sFormatString;
		}
	var iFormat=ur_system.dateformat;
	if (iFormat==1) return "dd.MM.yyyy";
	if (iFormat==2) return "MM/dd/yyyy";
	if (iFormat==3) return "MM-dd-yyyy";
	if (iFormat==4) return "yyyy.MM.dd";
	if (iFormat==5) return "yyyy/MM/dd";
	if (iFormat==6) return "yyyy-MM-dd";
	if (iFormat==7) return "dd/MM/yyyy";
	if (iFormat==8) return "dd-MM-yyyy";
}
function ur_DateField_addZero(i) {
  return i<10&&i>0?"0"+i:""+i;
}
function ur_setSelection(htmlInputFieldRef, oSelection) {
	if(oSelection!=null && htmlInputFieldRef && htmlInputFieldRef.tagName == "INPUT" && htmlInputFieldRef.getAttribute('type') == "text") {
		var textRange = htmlInputFieldRef.createTextRange();
		textRange.moveStart("character",oSelection.pos);
		textRange.collapse(true);
		textRange.moveEnd("character",oSelection.length);
		textRange.select();
		
    htmlInputFieldRef.onbeforedeactivate=null;
		
	}
};
function ur_getSelection(htmlInputFieldRef) {
	if(htmlInputFieldRef && htmlInputFieldRef.tagName == "INPUT" && htmlInputFieldRef.getAttribute('type') == "text") {
		var textRange = htmlInputFieldRef.createTextRange();
		if(textRange) {
		  var range=window.document.selection.createRange().duplicate();
		  var l=range.text.length;
		  range.collapse(true);
		  textRange.collapse(true);
		  var i=0;
		  while (!textRange.isEqual(range)) {
		    i++;
		    range.move("character",-1)
		  }
		  
	  	return {pos:i,length:l};
		}
	}
	return null;
}
function ur_setCursorPos(htmlInputFieldRef, pos) {
if(htmlInputFieldRef && htmlInputFieldRef.tagName == "INPUT" && htmlInputFieldRef.getAttribute('type') == "text") {
		var textRange = htmlInputFieldRef.createTextRange(),
			maxLength = htmlInputFieldRef.value.length;
		if(pos < 0 || pos > maxLength) pos = maxLength;
		if(textRange) {
			textRange.collapse();
			textRange.moveStart("character",pos);
			textRange.select();
		}
	}
};
function ur_getCursorPos(htmlInputFieldRef) {
	
	if(htmlInputFieldRef && htmlInputFieldRef.tagName == "INPUT" && htmlInputFieldRef.getAttribute('type') == "text") {
		var textRange = htmlInputFieldRef.createTextRange();
		if(textRange) {
			var cTextRange = window.document.selection.createRange().duplicate(),
			maxLength = htmlInputFieldRef.value.length;
			textRange.collapse();
			for(var idx=0; idx < maxLength; idx++) {
				if(  textRange.isEqual(cTextRange) )return idx;
				textRange.moveEnd("character",1);
				textRange.moveStart("character",1);
			}
		}
	}
	return -1;
};
function ur_getWeek(oDate,minDays) { 
  var x1day = 864e5;
  var x7days = 7*x1day;
  if (oDate.getDay()==0) oDate=new Date(oDate.getFullYear(), oDate.getMonth(), oDate.getDate()+1);
  var oDateISO = (Date.UTC(oDate.getFullYear(), oDate.getMonth(), oDate.getDate())/x1day)+minDays;
  var iAbsoluteWeekNum = Math.floor(oDateISO/7) 
  var iWeekYearNum = new Date(iAbsoluteWeekNum*x7days).getUTCFullYear();
  return iAbsoluteWeekNum - Math.floor(Date.UTC(iWeekYearNum-1, 11, 31)/x7days) 
}

//** ItemListBox.ie5 **

function sapUrMapi_ItemListBox_registerCreate(sId,sWidth){
	sapUrMapi_Create_AddItem(sId, "sapUrMapi_ItemListBox_setDim('"+sId+"','"+sWidth+"')");
}
function ur_ItemListBox_getIndex(sId,sKey){
	var o=sapUrMapi_ItemListBox_getObject(sId,document);
	var i=0;
	for(i=0; i<o.itms.length; i++)
		if(o.itms[i].k==sKey)	return i+1;
	return null;
}
function sapUrMapi_ItemListBox_getObject(sId,oDoc,oEvt){
	var o = new Object();
	
	var oR=oDoc.getElementById(sId+"-r");
	if (oR && oR.hasChildNodes() && oR.firstChild.tagName=="XMP") {
	  oR.innerHTML=oR.firstChild.innerHTML; 
	}	
	o.r=oDoc.getElementById(sId);
	
	o.tbl = oDoc.getElementById(sId+'-tbl');
	o.tbd=o.tbl.firstChild;
	
	o.box=o.tbl.parentNode;
	
	o.scrl=o.box;
	
	o.itms = o.tbl.getElementsByTagName("TR");
	
	var sFocus=o.tbl.getAttribute("focusitm");
	if(sFocus)
		o.focusedItm=o.itms[parseInt(sFocus)-1];
	else
		o.focusedItm=null;
	var sOldFocus=o.tbl.getAttribute("oldfocusitm");
	if(sOldFocus)
		o.oldFocusedItm=o.itms[parseInt(sOldFocus)-1];
	if(o.focusedItm==null)
		o.focusedItm=o.itm;
	
	o.selItms=new Array();
	o.prevItm=null;
	o.nextItm=null;
	var j=0;
	for(var i=0;i<o.itms.length;i++){
		if(o.itms[i].className=="urIlbItmSel"){
			o.selItms[j]=o.itms[i];
			j++;
		}
		if(o.focusedItm!=null&&o.focusedItm==o.itms[i]){
			if(i>0)
				if(o.itms[i-1].name=="HLine") o.prevItm=o.itms[i-2];
				else o.prevItm=o.itms[i-1];
			if(i<o.itms.length-1)
				if(o.itms[i+1].name=="HLine") o.nextItm=o.itms[i+2];
				else o.nextItm=o.itms[i+1];
		}
	}
	if(o.prevItm==null && o.nextItm==null) o.nextItm=o.itms[0];
	
	o.parId=o.tbl.getAttribute("parid");
	
	if(o.parId!=null&&o.parId!="") o.ro = ur_isReadonly(document.getElementById(o.parId));
	else o.ro = ur_isReadonly(o.r);
	o.enbl = !ur_isDisabled(o.r);
	o.inv = ur_isInvalid(o.r);
	o.popup = o.tbl.getAttribute("pop") == "true";
	o.multi = o.tbl.getAttribute("multi") == "true";
	o.size = parseInt(o.tbl.getAttribute("s"));
	o.vissize = parseInt(o.tbl.getAttribute("v"));
	o.userheight = o.tbl.getAttribute("h");
	o.userwidth = o.tbl.getAttribute("w");
	o.cols = o.tbl.getAttribute("cols");
	o.valcol=o.tbl.getAttribute( "vcol" );
	o.icocol=o.tbl.getAttribute( "icol" );
	return o;
}
function sapUrMapi_ItemListBox_getItem(o,sKey){
	for(var i=0; i<o.itms.length;i++){
		if(sKey==o.itms[i].getAttribute("k"))
			return o.itms[i];
	}
	return o.itms[0];
}
function sapUrMapi_ItemListBox_setParentId(sId, sParentId)  {
	if (!ur_get(sId)) sapUrMapi_ItemListBox_getObject(sId,document,null);
	var oTbl = document.getElementById(sId+"-tbl");
	oTbl.setAttribute("parid",sParentId);
}
function sapUrMapi_ItemListBox_getSelectedKeys(sId,oDoc){
	var o=sapUrMapi_ItemListBox_getObject(sId,oDoc,null);
	var aKeys=new Array();
	var j=0;
	for(var i=0; i<o.itms.length;i++){
		if( o.itms[i].className == "urIlbItmSel" ){
			aKeys[j]=o.itms[i].getAttribute("k");
			j++;
		}
	}
	return aKeys;
}
function sapUrMapi_ItemListBox_setSelectedKeys(sId,aKeys,oDoc){
	var o=sapUrMapi_ItemListBox_getObject(sId,oDoc,null);
	var sKey=aKeys.toString();
	for(var i=0; i<o.itms.length;i++)
		if( sKey.indexOf(o.itms[i].getAttribute("k")) == 0 )
			sapUrMapi_ItemListBox_selectItem(o,o.itms[i],true,null);
}
function sapUrMapi_ItemListBox_setSelectedKey(sId,sKey,oDoc,bScroll){
	var o=sapUrMapi_ItemListBox_getObject(sId,oDoc,null);
	if(sKey=="") return;
	for(var i=0; i<o.itms.length;i++){
		if( sKey==o.itms[i].getAttribute("k") ){
			sapUrMapi_ItemListBox_turnHighlightOff(o);
			sapUrMapi_ItemListBox_itemSetHighlight(o.itms[i], true);
			sapUrMapi_ItemListBox_focusItem(o,o.itms[i]);
			if(bScroll) sapUrMapi_ItemListBox_scrollIntoView(o,o.itms[i],true);			
			return;
		}
	}
}
function sapUrMapi_ItemListBox_selectHoveredItem(sId,oDoc,oEvt){
	var o=sapUrMapi_ItemListBox_getObject(sId,oDoc,null);
	for(var i=0; i<o.selItms.length;i++)
		sapUrMapi_ItemListBox_selectItem(o,o.selItms[i],true,oEvt);
}
function sapUrMapi_ItemListBox_getList(sId,doc){
	var o=sapUrMapi_ItemListBox_getObject(sId,doc,null);
	var oCols = new Array();
	var sItmKey = "";
	var sList = "";
	for( var i=0; i<o.itms.length; i++ ){
		sItmKey = o.itms[i].getAttribute("k");
		oCols =  o.itms[i].getElementsByTagName("TD");
		sList += "||";
		sList += oCols[parseInt(o.valcol)-1].innerText;
		sList += "|";
		sList += sItmKey;
	}
	if(sList!="") sList+="||";
	return sList;
}
function sapUrMapi_ItemListBox_setDim( sId, sWidth ){
	var o = sapUrMapi_ItemListBox_getObject(sId,document,null);
	
	if( parseInt(o.vissize) > 0 && !isNaN(parseInt(o.vissize)) )
		sapUrMapi_ItemListBox_setSize(o, parseInt(o.vissize));
	else if( parseInt(o.userheight) > 0 && !isNaN(parseInt(o.userheight)) )
		sapUrMapi_ItemListBox_setHeight(o, parseInt(o.userheight));
	
	if( parseInt(sWidth) >= 0 && !isNaN(parseInt(sWidth)) )
		sapUrMapi_ItemListBox_setWidth(o, parseInt(sWidth));
}
function sapUrMapi_ItemListBox_setSize(o,sSize){
	var iHeight = 0;
	var iBorder = 0;
	if( o.tbl.offsetHeight > o.box.offsetHeight ) iBorder = 2*o.box.clientTop;
	else iBorder = o.box.offsetHeight - o.tbl.offsetHeight;
	if(parseInt(sSize) <= 0) return;
	if(parseInt(sSize) >= o.itms.length) return;
	if(o.itms.length > 1)
		iHeight = parseInt(sSize) * parseInt(o.itms[1].offsetHeight) + iBorder + 2*(o.itms[1].offsetHeight-o.itms[0].offsetHeight);
	else
		iHeight = parseInt(sSize) * parseInt(o.itms[0].offsetHeight) + iBorder;
	sapUrMapi_ItemListBox_setHeight(o,iHeight);
}
function sapUrMapi_ItemListBox_setHeight(o,sHeight){
	var iHeight = 0;
	var iNewHeight = 0;
	var iBorder = 0;
	
	if( o.tbl.offsetHeight > o.box.offsetHeight ) iBorder = 2*o.box.clientTop;
	else iBorder = o.box.offsetHeight - o.tbl.offsetHeight;
	
	if( isNaN(parseInt(sHeight)) || parseInt(sHeight) <= 0 ) return;
	
	iHeight=o.scrl.offsetHeight;
	o.scrl.style.overflowY = "scroll";
	o.scrl.style.height = sHeight;
	iNewHeight = o.scrl.offsetHeight;
	
	if(iHeight <= iNewHeight){
		o.scrl.style.height=iHeight;
		return;
	}
	
		iNewHeight = 0;
		for( var i=0; i<o.itms.length; i++ ){
		if( (iNewHeight + parseInt(o.itms[i].offsetHeight)) > o.scrl.offsetHeight )
				break;
			iNewHeight += parseInt(o.itms[i].offsetHeight);
		}
	iNewHeight = iNewHeight + iBorder;
	
	if( o.box.offsetHeight < o.tbl.offsetHeight || o.popup){
		if( o.box.className.search(/Scrl$/) == -1 )
			o.box.className += "Scrl";
		o.box.setAttribute("style","overflow-y:scroll;");
	}
	else{
			if( parseInt(o.box.className.search(/Scrl$/)) < 0 )
				o.box.className = o.box.className.substr( 0,o.box.className.search(/Scrl$/) );
			o.box.style.overflowY = "visible";
		o.box.setAttribute("style","overflow-y:visible;");
	}
	o.scrl.style.height = iNewHeight;
	o.scrl.setAttribute("style","height:"+iNewHeight+";");
	o.tbl.setAttribute("s",i);
}
function sapUrMapi_ItemListBox_setWidth(o,sWidth){
	var iWidth = 0;
	var iNewWidth=parseInt(sWidth);
	if (isNaN(iNewWidth) || iNewWidth<=0) return;
	o.box.style.width = "10px";	
		iWidth = o.r.offsetWidth;
	if (iNewWidth<iWidth) return;
	o.box.style.width = iNewWidth;
	o.box.setAttribute("style","width:"+iNewWidth+";");
}
function sapUrMapi_ItemListBox_setReadonly(o,bRo){
  if(bRo && o.tbl.className.indexOf("Ro")==-1)
		o.tbl.className += "Ro";
	else if(!bRo && o.tbl.className.indexOf("Ro")!=-1)
		o.tbl.className=o.tbl.className.replace("Ro","");
	ur_setReadonly(o.r,bRo);
}
function sapUrMapi_ItemListBox_itemSelected(oItm){
	if( oItm.className == "urIlbItmSel" ) return true;
	return false;
}
function sapUrMapi_ItemListBox_itemSetHighlight(oItm,bOn){
	if( oItm == null || oItm.tagName != "TR" ) return;
	if( bOn && oItm.className != "urIlbItmSel") oItm.className = "urIlbItmSel";
	else if( oItm.className == "urIlbItmSel" ) oItm.className = "urIlbItm";
	else return;
	if (ur_system.is508) {
	  var sSel= getLanguageText("SAPUR_SELECTED");
	  var sNotSel= getLanguageText("SAPUR_NOTSELECTED");
	  var oCols = oItm.getElementsByTagName("TD");
	  for( var i=0; i<oCols.length; i++)
			if(bOn)
				oCols[i].title = oCols[i].title.replace(sNotSel,sSel);
			else
				oCols[i].title = oCols[i].title.replace(sSel,sNotSel);
	}
}
function sapUrMapi_ItemListBox_turnHighlightOff(o){
	if(o.selItms==null) return;
	for(var i=0; i<o.selItms.length; i++)
		sapUrMapi_ItemListBox_itemSetHighlight(o.selItms[i],false);
}
function sapUrMapi_ItemListBox_getVal(o,oItm){
	if(o.valcol==null) return null;
	var oCols=oItm.getElementsByTagName("TD");
	return oCols[parseInt(o.valcol)-1].innerText;
}
function sapUrMapi_ItemListBox_getIconSrc(o,oItm){
	if(o.icocol==null || o.icocol=="") return null;
	var oCols=oItm.getElementsByTagName("TD");
	var oIco;
	oIco = oCols[parseInt(o.icocol)-1].firstChild;
	return oIco.style.backgroundImage;
}
function sapUrMapi_ItemListBox_hoverItem(o,oItm){
	if(o.ro) return;
	sapUrMapi_ItemListBox_turnHighlightOff(o);
	sapUrMapi_ItemListBox_itemSetHighlight(oItm, true);
	sapUrMapi_ItemListBox_focusItem(o,oItm);
}
function sapUrMapi_ItemListBox_scrollIntoView(o,oItm,bTop){
	if( (o.box.scrollTop > oItm.rowIndex*oItm.offsetHeight) || (o.box.scrollTop+o.box.offsetHeight-2*o.box.clientTop <= oItm.rowIndex*oItm.offsetHeight) )
		if(!bTop) o.box.scrollTop=(oItm.rowIndex-o.size+1)*oItm.offsetHeight;
		else o.box.scrollTop=oItm.rowIndex*oItm.offsetHeight;
}
function sapUrMapi_ItemListBox_selectItem(o,oItm,bTop,oEvt){
	if(!o.ro && o.enbl){
		if(!(o.multi&&(oEvt.shiftKey||oEvt.ctrlKey))) sapUrMapi_ItemListBox_deselectAllItems(o);
		sapUrMapi_ItemListBox_itemSetHighlight(oItm,true);
		if(o.popup){
			sapUrMapi_ComboBox_setValue(o.parId, oItm.getAttribute("k"), sapUrMapi_ItemListBox_getVal(o,oItm), sapUrMapi_ItemListBox_getIconSrc(o,oItm),oEvt);
		}
	}
	else if(o.popup)
			sapUrMapi_ComboBox_setValue(o.parId, null,null, null,oEvt);	
	sapUrMapi_ItemListBox_focusItem(o,oItm);
	if(o.popup) sapUrMapi_ItemListBox_scrollIntoView(o,oItm,bTop);
}
function sapUrMapi_ItemListBox_deselectItem(oItm){
	sapUrMapi_ItemListBox_itemSetHighlight(oItm,false);
}
function sapUrMapi_ItemListBox_deselectAllItems(o){
	sapUrMapi_ItemListBox_turnHighlightOff(o);
}
function sapUrMapi_ItemListBox_focusItem(o,oItm){
	
	if(!o.popup&&o.focusedItm!=null)
		sapUrMapi_setTabIndex(o.focusedItm.getElementsByTagName("TD")[parseInt(o.valcol)-1],-1);
	
	o.tbl.setAttribute("focusitm",oItm.rowIndex+1);
	if (!o.popup){
		var oCols=oItm.getElementsByTagName("TD");
		sapUrMapi_setTabIndex(oCols[parseInt(o.valcol)-1],0);
		ur_focus(oCols[parseInt(o.valcol)-1]);
	}
}
function sapUrMapi_ItemListBox_mouseover( sId,oDoc,oEvt) {
	var oFrom=oEvt.fromElement;
	var oTo=oEvt.toElement;
	var o=sapUrMapi_ItemListBox_getObject(sId,oDoc,oEvt);
	
	if( oTo.tagName=="DIV" || oTo.tagName=="SPAN" || o.ro || !o.enbl || o.size==0) return;
	while( oFrom != null && oFrom.tagName != "TR" )
		oFrom = oFrom.parentNode;
	while( oTo != null && oTo.tagName != "TR" )
		oTo = oTo.parentNode;
	if( oTo==null || oTo.name=="HLine" || oFrom==oTo ) return;
	sapUrMapi_ItemListBox_hoverItem(o,oTo);
}
function sapUrMapi_ItemListBox_focus(sId,oDoc,oEvt){
	var o=sapUrMapi_ItemListBox_getObject(sId,oDoc,oEvt);
	
	if(!o.enbl && !ur_system.is508) return;
	sapUrMapi_DataTip_show(sId,"focus");
	
	if(ur_evtSrc(oEvt).id!=sId) return;
	
	if(o.popup){
		ur_focus(document.getElementById(o.parId));
		return;
	}
	
	if(o.tbl.getAttribute("tabback")=="true"){
		o.tbl.setAttribute("tabback","false");
		var oNewEvt=oDoc.createEventObject();
		oNewEvt.keyCode="9";
		oNewEvt.shiftKey=true;
		o.r.fireEvent("onkeydown",oNewEvt);
		return;
	}
	
	if(o.selItms.length==0) oItm = o.itms[0];
	else oItm = o.selItms[0];
	
	if(ur_system.is508) o.r.title=ur_getTooltip(sId);
        var iTop = o.r.scrollTop;
	sapUrMapi_ItemListBox_focusItem(o,oItm);
        o.r.scrollTop = iTop;
}
function sapUrMapi_ItemListBox_blur(sId,oEvt) {
	sapUrMapi_DataTip_hide(sId);
}
function sapUrMapi_ItemListBox_click(sId,oDoc,oEvt) {
	
	var oItm=ur_evtSrc(oEvt);
	if(oItm.tagName!="TD") return;
	while(oItm.tagName!="TR"){
		if(oItm.getAttribute("ct")=="ItemListBox") return;
		oItm=oItm.parentNode;
	}
	var o=sapUrMapi_ItemListBox_getObject(sId,oDoc,oEvt);
	var bSel = false;
	
	
	if( o.multi == true && oEvt.ctrlKey == false )
		sapUrMapi_ItemListBox_deselectAllItems(o);
	
	if(oEvt.shiftKey == true && o.multi == true  && (o.focusedItm != oItm) && o.oldFocusedItm != null){
		var oStart=o.oldFocusedItm;
		if(oStart.rowIndex < oItm.rowIndex)
			for(var i=oStart.rowIndex;i<=oItm.rowIndex;i++)
				sapUrMapi_ItemListBox_selectItem(o,o.itms[i], true, oEvt);
		else
			for(var i=oStart.rowIndex;i>=oItm.rowIndex;i--)
				sapUrMapi_ItemListBox_selectItem(o,o.itms[i], true, oEvt);
	}
	
	else{
		sapUrMapi_ItemListBox_selectItem(o, oItm, true,oEvt);
		o.tbl.setAttribute( "oldfocusitm", oItm.rowIndex+1 );
	}
	return sapUrMapi_cancelEvent(oEvt);
}
function sapUrMapi_ItemListBox_keydown( sId, doc, e ){
	var o=sapUrMapi_ItemListBox_getObject(sId, doc, e);
	var iItmIdx = 0;
	
	if(e.keyCode == "81" && e.ctrlKey && !e.altKey ){
		if (sapUrMapi_DataTip_isOpen(sId)) sapUrMapi_DataTip_hide(sId);
		else sapUrMapi_DataTip_show(sId,"keydown");
		return sapUrMapi_cancelEvent(e);
	}
		
	
	if(e.keyCode == "27"){
		sapUrMapi_DataTip_hide(sId);
		return sapUrMapi_cancelEvent(e);
	}
		
	
	if(e.keyCode=="9"  && e.shiftKey==true ){
		if(ur_evtSrc(e).tagName!="SPAN"){
			o.tbl.setAttribute("tabback","true");
			ur_focus(o.r);
		}
		return true;
	}
	
	
	if( e.keyCode =="38" && o.prevItm != null ){
		if( e.ctrlKey && o.multi )
			sapUrMapi_ItemListBox_focusItem(o,o.prevItm);
		else if( sapUrMapi_ItemListBox_itemSelected(o.prevItm) && o.multi ){
			sapUrMapi_ItemListBox_deselectItem(o.focusedItm);
			sapUrMapi_ItemListBox_focusItem(o,o.prevItm);
		}
		else
			sapUrMapi_ItemListBox_selectItem(o, o.prevItm, true, e );
		return sapUrMapi_cancelEvent(e);
	}
	
	
	if( e.keyCode=="40" && o.nextItm!=null ){
		if( e.ctrlKey && o.multi )
			sapUrMapi_ItemListBox_focusItem(o,o.nextItm);
		else if( sapUrMapi_ItemListBox_itemSelected(o.nextItm) && o.multi == true ){
			sapUrMapi_ItemListBox_deselectItem(o.focusedItm);
			sapUrMapi_ItemListBox_focusItem(o,o.nextItm);
		}
		else
			sapUrMapi_ItemListBox_selectItem(o, o.nextItm, false, e );
		return sapUrMapi_cancelEvent(e);
	}
	
	
	if( e.ctrlKey && e.keyCode == "32"  && o.multi ){
		if( sapUrMapi_ItemListBox_itemSelected(o.focusedItm) )
			sapUrMapi_ItemListBox_deselectItem(o.focusedItm);
		else
			sapUrMapi_ItemListBox_selectItem(o, o.focusedItm, true, e);
		return sapUrMapi_cancelEvent(e);
	}
	
	
	if( e.keyCode=="36" ){
		sapUrMapi_ItemListBox_selectItem(o, o.itms[0], true, e );
		return sapUrMapi_cancelEvent(e);
	}
		
	
	if( e.keyCode=="35" ){
		sapUrMapi_ItemListBox_selectItem(o, o.itms[o.itms.length-1], false, e );
		return sapUrMapi_cancelEvent(e);
	}
		
	
	if( e.keyCode=="33" && o.size!=null ){
		iItmIdx = o.focusedItm.rowIndex - o.size + 1;
		if( iItmIdx < 0 ) iItmIdx = 0;
		sapUrMapi_ItemListBox_selectItem(o, o.itms[iItmIdx], true, e );
		return sapUrMapi_cancelEvent(e);
	}
	
	
	if( e.keyCode == "34" && o.size!=null ){
		iItmIdx = o.focusedItm.rowIndex + o.size - 1;
		if( iItmIdx > o.tbd.lastChild.rowIndex ) iItmIdx = o.tbd.lastChild.rowIndex;
		sapUrMapi_ItemListBox_selectItem(o, o.itms[iItmIdx], false, e);
		return sapUrMapi_cancelEvent(e);
	}
}

//** Label.ie5 **

function sapUrMapi_Label_setDisabled(oLbl) {
	if(oLbl==null || oLbl.className.indexOf("Dsbl")>-1) return;
	if(oLbl.className.indexOf("Std")>-1)
		oLbl.className=oLbl.className.replace("LblStd","LblDsbl");
	else
		oLbl.className=oLbl.className.replace("Lbl","LblDsbl");
}
function sapUrMapi_Label_setEnabled(oLbl) {
	if (oLbl==null) return;
	oLbl.className=oLbl.className.replace("Dsbl","Std");
}
function sapUrMapi_Label_setInvalid(oLbl,bSet) {
	if (oLbl==null) return;
	
	if(!bSet){
		oLbl.className=oLbl.className.replace("Inv","");
		return;
	}
	
	if(oLbl.className.indexOf("Inv")>-1) return;
	if (oLbl.className.indexOf("Bar")>-1) 
		oLbl.className=oLbl.className.replace("Bar","InvBar");
	else
		oLbl.className+="Inv";
}
function sapUrMapi_Label_getInputLabel(sId) {
	var ur_arrLabels = document.getElementsByTagName("LABEL");
	for (var i=0;i<ur_arrLabels.length;i++) {
		if (ur_arrLabels.item(i).getAttribute("f")==sId) {
			return ur_arrLabels.item(i);
		}
	}
	for (var i=0;i<ur_arrLabels.length;i++) {
		if (ur_arrLabels.item(i).getAttribute("htmlFor")==sId) {
			return ur_arrLabels.item(i);
		}
	}
	return null;
}
function sapUrMapi_Label_getLabel(sId) {
	return sapUrMapi_Label_getInputLabel(sId);
}
function sapUrMapi_Label_FocusLabeledElement(sForId) {
  sapUrMapi_focusElement(sForId);
}
function sapUrMapi_Label_getLabelText(sId) {
	var oLbl=sapUrMapi_Label_getLabel(sId);
	if(oLbl==null) return null;
	return oLbl.innerText;
}
function sapUrMapi_Label_clickLabeledElement(sId,sForId,oEvt) {
	var o=ur_get(sForId);
	try{
		if(o.getAttribute("ct")=="CheckBox" || o.getAttribute("ct")=="RadioButton") o.click();
		else ur_focus(o);
	} catch(e){}
}
function sapUrMapi_Label_focus(sId,sForId,oEvt) {
	var o=ur_evtSrc(oEvt);
	if(ur_system.is508 && sForId!="") o.title=ur_getTooltip(sForId,sForId,false);
}

//** Link.ie5 **

function sapUrMapi_Link_activate(sLinkId,e) {
	oLink = document.getElementById(sLinkId);
	if (oLink.getAttribute("hasmenu")=="true") {
		if (sapUrMapi_checkKey(e,"keydown",new Array("32","40"))) {
			if (oLink.onclick) {oLink.onclick();return false;} 
			if (oLink.oncontextmenu) {oLink.oncontextmenu();return false;} 
			if (oLink.onmouseover) {oLink.onmouseover();return false;} 
		}
  } else {
		if (sapUrMapi_checkKey(e,"keydown",new Array("32"))) { 
  	  return true;
  	}
  }
  return false;
}

//** ListBox.ie5 **

function sapUrMapi_ListBox_focus(sId,e) {
    
	sapUrMapi_DataTip_show(sId,"focus");
}
function sapUrMapi_ListBox_blur(sId,event) {
	sapUrMapi_DataTip_hide(sId);
}
function sapUrMapi_ListBox_keydown(sId,oEvt) {
	if(oEvt.keyCode == "81" && oEvt.ctrlKey && !oEvt.altKey ){
		oEvt.keyCode = "";
		oEvt.cancelBubble = true;
		oEvt.returnValue = false;
		if (sapUrMapi_DataTip_isOpen(sId)) sapUrMapi_DataTip_hide(sId);
		else sapUrMapi_DataTip_show(sId,"keydown");
	}
	if(oEvt.keyCode == "27"){
		oEvt.keyCode = "";
		oEvt.cancelBubble = true;
		oEvt.returnValue = false;
		sapUrMapi_DataTip_hide(sId);
	}
}

//** LoadingAnimation.ie5 **

var _ur_LoadingAni_delay = 2000;
var _ur_LoadingAni_timerId = null;
var _ur_LoadingPopup = null;
function sapUrMapi_LoadingAnimation_getObject() {
	return document.getElementById("ur-loading");
}
function sapUrMapi_LoadingAnimation_getText() {
	var oLAText = document.getElementById("ur-loading");
	oLAText = oLAText.firstChild.lastChild;
	return oLAText.innerHTML;
}
function sapUrMapi_LoadingAnimation_trigger() {
	_ur_LoadingAni_timerId = ur_callDelayed("sapUrMapi_LoadingAnimation_show('ur-loading')", _ur_LoadingAni_delay);
}
function sapUrMapi_LoadingAnimation_show(sId) {
	if (_ur_LoadingAni_timerId) {
		var arrUrls = new Array(ur_system.stylepath+"ur_pop_"+ur_system.browser_abbrev+".css");
		_ur_LoadingPopup = new sapPopup(window,arrUrls,document.getElementById("ur-loading"),null,e,0);
		_ur_LoadingPopup.positionbehavior=sapPopupPositionBehavior.BROWSERCENTER;
		_ur_LoadingPopup.show(true);
		_ur_LoadingAni_timerId = null;
	}
}
function sapUrMapi_LoadingAnimation_cancel() {
	if (_ur_LoadingAni_timerId) {
		clearTimeout(_ur_LoadingAni_timerId);
	_ur_LoadingAni_timerId = null;
	} else {
		sapUrMapi_LoadingAnimation_hide();
}
}
function sapUrMapi_LoadingAnimation_hide() {
	if (_ur_LoadingPopup!=null) {
	   _ur_LoadingPopup.hide();
	   _ur_LoadingPopup=null;
	}
}

//** MenuBar.ie5 **

function sapUrMapi_MenuBar_hover(sId,e){
	var oTxt=document.getElementById(sId+"-txt");
	var oBtn=document.getElementById(sId+"-btn");
	if (oTxt.className == "urMenuItemTxtStdHover") {
	   oTxt.className = "urMenuItemTxtStd";
	   oBtn.className = "urMenuItemBtnStd";
	   return;
	  }
	else
	  if (oTxt.className == "urMenuItemTxtStdDsbl"){
	     oTxt.className = "urMenuItemTxtStdDsbl";
		 oBtn.className = "urMenuItemBtnStdDsbl";
		 return;
		}
	   else
	     if(oTxt.className == "urMenuItemTxtTrnDsbl") {
	        oTxt.className = "urMenuItemTxtTrnDsbl";
			oBtn.className = "urMenuItemBtnTrnDsbl";
			return;
		}
	      else
		  	if(oTxt.className == "urMenuItemTxtTrn") {
				oTxt.className = "urMenuItemTxtTrnHover";
				oBtn.className = "urMenuItemBtnTrnHover";
				return;
			}
			else
			  if(oTxt.className == "urMenuItemTxtTrnHover")	{
			  	  oTxt.className = "urMenuItemTxtTrn";
				  oBtn.className = "urMenuItemBtnTrn";
				  return;
				}
				else
  	        oTxt.className ="urMenuItemTxtStdHover";
			oBtn.className ="urMenuItemBtnStdHover";
			return;
}
function sapUrMapi_MenuBar_keyDown(sMenuId,e) {
 	if (sapUrMapi_checkKey(event,"keydown",new Array("37","39"))) {
 		 var oMenu = document.getElementById(sMenuId);
 		 if (e.keyCode==37) {
 		   if (ur_system.direction=="rtl") {
 		     sapUrMapi_MenuBarItem_keyDown(oMenu.lastChild.id,0,e);
 		   } else {
	 	     sapUrMapi_MenuBarItem_keyDown(oMenu.firstChild.id,0,e);
	 	   }
 		 }
 		 if (e.keyCode==39) {
 		   if (ur_system.direction=="rtl") {
 		     sapUrMapi_MenuBarItem_keyDown(oMenu.firstChild.id,0,e);
 		   } else {
	 	     sapUrMapi_MenuBarItem_keyDown(oMenu.lastChild.id,0,e);
	 	   }
 		 }
 		 return true;
  }
  return false;
}
function sapUrMapi_MenuBarItem_keyDown(sItemId,iCurrentIndex,e) {
 	if (sapUrMapi_checkKey(event,"keydown",new Array("37","39","9","40"))) {
 		 var oMenuItem = document.getElementById(sItemId);
 		 sapUrMapi_setTabIndex(oMenuItem,-1);
 		 var oNewItem = oMenuItem;
 		 if (e.keyCode==37) {
 		   if (ur_system.direction=="rtl") {
 		     if (oMenuItem.nextSibling) {
 		 	 	 oNewItem = oMenuItem.nextSibling;
 		 	 } else {
 		 	 	 oNewItem = oMenuItem.parentElement.firstChild
 		 	 }
 		   } else {
 		 	 if (oMenuItem.previousSibling) {
 		 	   oNewItem = oMenuItem.previousSibling;
 		 	 } else {
 		 	   oNewItem = oMenuItem.parentElement.lastChild;
 		 	 }
 		   }
 		 }
 		 if (e.keyCode==39) {
 		   if (ur_system.direction=="rtl") {
 		     if (oMenuItem.previousSibling) {
 		 	   oNewItem = oMenuItem.previousSibling;
 		 	 } else {
 		 	   oNewItem = oMenuItem.parentElement.lastChild;
 		 	 }
 		   } else {
 		 	 if (oMenuItem.nextSibling) {
 		 	 	 oNewItem = oMenuItem.nextSibling;
 		 	 } else {
 		 	 	 oNewItem = oMenuItem.parentElement.firstChild
 		 	 }
 		   }
 		 }
 		 if ((e.keyCode==39) || (e.keyCode==37)) {
	 	 	 sapUrMapi_setTabIndex(oNewItem,0);
	 	   ur_focus(oNewItem);
	 	 	 if (!ur_system.is508) {
	 	 	 	 if (oNewItem.getAttribute("dsbl")=="true") {
	 	 	 	 	 sapUrMapi_MenuBarItem_keyDown(oNewItem.id,0,e);
	 	 	 	 }
	 	   }
	 	 }
 		 e.cancelBubble=true;
 		 e.returnValue=false;
 		 if (e.keyCode==9) { 
 		 	 for (var n=0;n<oMenuItem.parentElement.childNodes.length;n++) {
 		 	   sapUrMapi_setTabIndex(oMenuItem.parentElement.childNodes.item(n),-1);
 		 	 }
 		 	 ur_focus(oMenuItem.parentElement);
	 		 e.cancelBubble=false;
	 		 e.returnValue=true;
		 }
 		 if (e.keyCode==40) { 
 		 	 if (oMenuItem.getAttribute("dsbl")!="true") {
	 		 	 if (oMenuItem.onclick) {
	 		 	 	 oMenuItem.click();
					 return ur_EVT_cancel(e);
	 		 	 } else {
		 		 	 if (oMenuItem.oncontextmenu) {
		 		 	 	 oMenuItem.oncontextmenu();
		 		 	 }
	 		 	 }
		 		 e.cancelBubble=false;
		 		 e.returnValue=true;
		 	 }
		 }
 		 return true;
  }
  return false;
}

//** MessageBar.ie5 **
enumUrMessageBarType = {ERROR:"Error",WARNING:"Warning",OK:"Ok",STOP:"Stop",LOADING:"Loading",NONE:"None",TEXT:"Text"};
function sapUrMapi_MessageBar_setAccText(sId,vMessageBarType) {
	var oMBar = document.getElementById(sId);
	var oMTxt = document.getElementById(sId+"-txt");
	var sMTxt = oMTxt.innerText;
	if (oMTxt.getAttribute("tt")!=null && oMTxt.getAttribute("tt")!="") sMTxt=oMTxt.getAttribute("tt");
	var sType = vMessageBarType.toUpperCase(); 
	var bHasConId = oMBar.onclick!=null;
	var sTxt = "";
	if (bHasConId) sTxt="SAPUR_MSG_JUMPKEY"; 
	if (vMessageBarType!=enumUrMessageBarType.TEXT) {
		if (ur_system.is508) {
			oMBar.title=getLanguageText("SAPUR_MSG",new Array("SAPUR_MSG_"+sType,sMTxt,sTxt));
		} else {
		  oMBar.title=sMTxt;
		}
	} else {
		if (ur_system.is508) {
			oMBar.title=getLanguageText("SAPUR_MSG",new Array("",sMTxt,sTxt));
		} else {
		  oMBar.title=sMTxt;
		}
	}
}
function sapUrMapi_MessageBar_setType(sId,vMessageBarType) {
	var oMBar = document.getElementById(sId);
	sapUrMapi_MessageBar_setAccText(sId,vMessageBarType);
	if (vMessageBarType==enumUrMessageBarType.NONE) {
		oMBar.style.display = 'none';
		return;
	} else {
		if (vMessageBarType==enumUrMessageBarType.ERROR || vMessageBarType==enumUrMessageBarType.STOP) oMBar.className="urMsgBarErr";
		else oMBar.className="urMsgBarStd";
		oMBar.style.display = 'block';
    var oMBarImg  = document.getElementById(sId+"-img");
    if (vMessageBarType!=enumUrMessageBarType.TEXT) {
    	oMBarImg.style.display="inline";
      oMBarImg.className = "urMsgBarImg"+vMessageBarType;
    } else {
    	oMBarImg.style.display="none";
    }
	}
}
function sapUrMapi_MessageBar_getType(sId) {
	var oMBar = document.getElementById(sId);
  if (oMBar.style.display == 'none') {
  	return enumUrMessageBarType.NONE;
  } else {
    var oMBarImg  = document.getElementById(sId+"-img");
    if ((oMBarImg.className).indexOf(enumUrMessageBarType.ERROR)>-1) return enumUrMessageBarType.ERROR;
    if ((oMBarImg.className).indexOf(enumUrMessageBarType.WARNING)>-1) return enumUrMessageBarType.WARNING;
    if ((oMBarImg.className).indexOf(enumUrMessageBarType.LOADING)>-1) return enumUrMessageBarType.LOADING;
    if ((oMBarImg.className).indexOf(enumUrMessageBarType.STOP)>-1) return enumUrMessageBarType.STOP;
    if ((oMBarImg.className).indexOf(enumUrMessageBarType.OK)>-1) return enumUrMessageBarType.OK;
    if ((oMBarImg.style.display).indexOf("none")>-1) return enumUrMessageBarType.TEXT;
  }
}
function sapUrMapi_MessageBar_setText(sId,sText) {
	var oMBarText = document.getElementById(sId+"-txt");
	oMBarText.innerHTML = sText;
	sapUrMapi_MessageBar_setAccText(sId,sapUrMapi_MessageBar_getType(sId));
}
function sapUrMapi_MessageBar_getText(sId) {
	var oMBarText = document.getElementById(sId+"-txt");
	return oMBarText.innerHTML;
}
function sapUrMapi_MessageBar_navigateToField(sId,sConId,oEvt) {
  
  if ((oEvt.type=="click") || (sapUrMapi_checkKey(oEvt,"keydown",new Array("32")))) {
    
    sapUrMapi_cancelEvent(oEvt);
    sapUrMapi_triggerFocus(sConId);
  }
}

//** Paginator.ie5 **

UR_PAGINATOR_BUTTON = {BEGIN:0, PREVIOUS_PAGE:1, PREVIOUS_ITEM:2,NEXT_ITEM:3,NEXT_PAGE:4,END:5};
function sapUrMapi_Paginator_setStates(sId, arrBtns, arrStates) {
	var oPaginator  = document.getElementById(sId);
	var oButton;
	var bHorizontal = oPaginator.getAttribute("ur_direction")=="horizontal";
	for (var n=0;n<arrBtns.length;n++) {
		try {
		  oButton= document.getElementById(sId+"-btn-"+arrBtns[n]);
		  if (oButton==null) continue;
		} catch (e) {
		  continue;
		}
		var sBtnTxt="";
    if (arrBtns[n]==UR_PAGINATOR_BUTTON.BEGIN) sBtnTxt="SAPUR_PAG_IBEGIN";
    if (arrBtns[n]==UR_PAGINATOR_BUTTON.PREVIOUS_PAGE) sBtnTxt="SAPUR_PAG_PPREV";
    if (arrBtns[n]==UR_PAGINATOR_BUTTON.PREVIOUS_ITEM) sBtnTxt="SAPUR_PAG_IPREV";
    if (arrBtns[n]==UR_PAGINATOR_BUTTON.NEXT_ITEM) sBtnTxt="SAPUR_PAG_INEXT";
    if (arrBtns[n]==UR_PAGINATOR_BUTTON.NEXT_PAGE) sBtnTxt="SAPUR_PAG_PNEXT";
    if (arrBtns[n]==UR_PAGINATOR_BUTTON.END) sBtnTxt="SAPUR_PAG_IEND";
		if (arrStates[n]) {
		  if (oButton.getAttribute("dsbl")=="true") {
		  	var arrClass=oButton.className.split(" ");
		  	oButton.className=arrClass[0].substring(0,arrClass[0].length-4)+" "+arrClass[1].substring(0,arrClass[1].length-4);
		  	oButton.setAttribute("dsbl","false");
				oButton.setAttribute("onclick",oButton.oc);
		  	if (ur_system.is508) {
  		    oButton.title = getLanguageText("SAPUR_WHL3",new Array(sBtnTxt,"SAPUR_PAG_BTN","SAPUR_PAG_BTN_TUTOR"));
		  	}
		  }
		} else {
		  if (oButton.getAttribute("dsbl")=="false") {
		  	var arrClass=oButton.className.split(" ");
		  	oButton.className=arrClass[0]+"Dsbl "+arrClass[1]+"Dsbl";
		  	oButton.setAttribute("dsbl","true");
				oButton.setAttribute("oc",oButton.onclick);
				oButton.onclick=null;	
		  	if (ur_system.is508) {
  		    oButton.title = getLanguageText("SAPUR_WHL3",new Array(sBtnTxt,"SAPUR_PAG_BTN","SAPUR_DISABLED"));
		  	}
		  }
		}
	}
  sapUrMapi_Focus_showFocusRect();
}
function sapUrMapi_Paginator_buttonDisabled(o) {
  if (o.ct=="Paginator") return true;
  if (o.onclick!=null) {
    return o.getAttribute("dsbl")=="true";
  } else {
    return sapUrMapi_Paginator_buttonDisabled(o.parentNode);
  }
}
function sapUrMapi_Paginator_getInputValue(sId) {
  var oInp=document.getElementById(sId+"-inp");
  if (oInp!=null) return parseInt(oInp.value);
}
function sapUrMapi_Paginator_setInputValue(sId,iNewValue) {
  var oInp=document.getElementById(sId+"-inp");
  if (oInp!=null) oInp.value=iNewValue;
}
function sapUrMapi_Paginator_keydown(sId,sConId,oEvt) {
  o=ur_evtSrc(oEvt);
  if (o.tagName=="INPUT") return;
  if (o.className.indexOf("urBtnIco")>-1) { 
	  if (!sapUrMapi_Paginator_buttonDisabled(o)) {
      sapUrMapi_triggerClick(oEvt,new Array("32"));
    }
  }
  if ((o.id.indexOf("-menu")>-1) && ((oEvt.keyCode==40) || (oEvt.keyCode==13)|| (oEvt.keyCode==32))) {
    return sapUrMapi_cancelEvent(oEvt);
  }
  if (oEvt.keyCode>36 && oEvt.keyCode<41) {
	  return sapUrMapi_cancelEvent(oEvt);
  }
  if (oEvt.keyCode==32) {
	  return sapUrMapi_cancelEvent(oEvt);
  }
  if (oEvt.keyCode>=33 && oEvt.keyCode<=36) {
    var oBtn=null;
		if (oEvt.keyCode==33) { 
			oBtn=document.getElementById(sId+"-btn-1");
		}
		if (oEvt.keyCode==34) { 
			oBtn=document.getElementById(sId+"-btn-4");
		}
		if (oEvt.keyCode==36) { 
			oBtn=document.getElementById(sId+"-btn-0");
		}
		if (oEvt.keyCode==35) { 
			oBtn=document.getElementById(sId+"-btn-5");
		}
    if (oBtn!=null) { 
      sapUrMapi_focusElement(oBtn.id);
      if (!sapUrMapi_Paginator_buttonDisabled(oBtn)) {
        oBtn.click();
      }
    }
	}
}
function sapUrMapi_Paginator_navBegin(sId,sConId,oEvt) {
  o=ur_evtSrc(oEvt);
	if (!sapUrMapi_Paginator_buttonDisabled(o)) {
		var arrButtonArray = new Array();
		arrButtonArray[0]=UR_PAGINATOR_BUTTON.PREVIOUS_PAGE;
		arrButtonArray[1]=UR_PAGINATOR_BUTTON.PREVIOUS_ITEM;
		arrButtonArray[2]=UR_PAGINATOR_BUTTON.BEGIN;
		arrButtonArray[3]=UR_PAGINATOR_BUTTON.NEXT_PAGE;
		arrButtonArray[4]=UR_PAGINATOR_BUTTON.NEXT_ITEM;
		arrButtonArray[5]=UR_PAGINATOR_BUTTON.END;
		var arrStateArray = new Array();
		arrStateArray[0]=false;
		arrStateArray[1]=false;
		arrStateArray[2]=false;
		arrStateArray[3]=true;
		arrStateArray[4]=true;
		arrStateArray[5]=true;
		sapUrMapi_Paginator_setStates(sId,arrButtonArray,arrStateArray);
		try {
	    if (sapUrMapi_getControlType(sConId)=="PatternContainerSequence") 
	      sapUrMapi_bounceItem(sConId,-1,"PATTERNCONTAINERSEQUENCE");
			if (sapUrMapi_getControlType(sConId)=="PatternContainerTab") 
				sapUrMapi_bounceItem(sConId,-1,"PATTERNCONTAINERTAB");
	  } catch (ex) {}  
		return true;
  }
  return false
}
function sapUrMapi_Paginator_navEnd(sId,sConId,oEvt) {
  o=ur_evtSrc(oEvt);
	if (!sapUrMapi_Paginator_buttonDisabled(o)) {
		var arrButtonArray = new Array();
		arrButtonArray[0]=UR_PAGINATOR_BUTTON.NEXT_PAGE;
		arrButtonArray[1]=UR_PAGINATOR_BUTTON.NEXT_ITEM;
		arrButtonArray[2]=UR_PAGINATOR_BUTTON.END;
		arrButtonArray[3]=UR_PAGINATOR_BUTTON.PREVIOUS_PAGE;
		arrButtonArray[4]=UR_PAGINATOR_BUTTON.PREVIOUS_ITEM;
		arrButtonArray[5]=UR_PAGINATOR_BUTTON.BEGIN;
		var arrStateArray = new Array();
		arrStateArray[0]=false;
		arrStateArray[1]=false;
		arrStateArray[2]=false;
		arrStateArray[3]=true;
		arrStateArray[4]=true;
		arrStateArray[5]=true;
		sapUrMapi_Paginator_setStates(sId,arrButtonArray,arrStateArray);
		try {
	    if (sapUrMapi_getControlType(sConId)=="PatternContainerSequence") 
	      sapUrMapi_bounceItem(sConId,1,"PATTERNCONTAINERSEQUENCE");
			if (sapUrMapi_getControlType(sConId)=="PatternContainerTab") 
				sapUrMapi_bounceItem(sConId,1,"PATTERNCONTAINERTAB");
	  } catch (ex) {}  
		return true;
  }
  return false;
}
function sapUrMapi_Paginator_navPrevPage(sId,sConId,oEvt) {
  o=ur_evtSrc(oEvt);
	if (!sapUrMapi_Paginator_buttonDisabled(o)) {
		try {
	    if (sapUrMapi_getControlType(sConId)=="PatternContainerSequence") 
	      sapUrMapi_pageItem(sConId,-1,"PATTERNCONTAINERSEQUENCE");
			if (sapUrMapi_getControlType(sConId)=="PatternContainerTab") 
				sapUrMapi_pageItem(sConId,-1,"PATTERNCONTAINERTAB");
	  } catch (ex) {}  
		return true;
  }
  return false;
}
function sapUrMapi_Paginator_navNextPage(sId,sConId,oEvt) {
  o=ur_evtSrc(oEvt);
	if (!sapUrMapi_Paginator_buttonDisabled(o)) {
		try {
	    if (sapUrMapi_getControlType(sConId)=="PatternContainerSequence") 
	      sapUrMapi_pageItem(sConId,1,"PATTERNCONTAINERSEQUENCE");
			if (sapUrMapi_getControlType(sConId)=="PatternContainerTab") 
				sapUrMapi_pageItem(sConId,1,"PATTERNCONTAINERTAB");
	  } catch (ex) {}  
		return true;
  }
  return false;
}
function sapUrMapi_Paginator_navPrev(sId,sConId,oEvt) {
  o=ur_evtSrc(oEvt);
	if (!sapUrMapi_Paginator_buttonDisabled(o)) {
		try {
	      if (sapUrMapi_getControlType(sConId)=="PhaseIndicator") 
	        sapUrMapi_PhaseIndicator_paging(sConId,"BACK");
	    if (sapUrMapi_getControlType(sConId)=="PatternContainerSequence") 
	      sapUrMapi_scrollItem(sConId,-1,"PATTERNCONTAINERSEQUENCE");
			if (sapUrMapi_getControlType(sConId)=="PatternContainerTab") 
				sapUrMapi_scrollItem(sConId,-1,"PATTERNCONTAINERTAB");
	    } catch (ex) {}  
		return true;
  }
  return false;
}
function sapUrMapi_Paginator_navNext(sId,sConId,oEvt) {
  o=ur_evtSrc(oEvt);
	if (!sapUrMapi_Paginator_buttonDisabled(o)) {
    try {
	    if (sapUrMapi_getControlType(sConId)=="PhaseIndicator") 
	      sapUrMapi_PhaseIndicator_paging(sConId,"FURTHER");
	    if (sapUrMapi_getControlType(sConId)=="PatternContainerSequence") 
	      sapUrMapi_scrollItem(sConId,1,"PATTERNCONTAINERSEQUENCE");
	    if (sapUrMapi_getControlType(sConId)=="PatternContainerTab") 
	      sapUrMapi_scrollItem(sConId,1,"PATTERNCONTAINERTAB");
	  } catch (ex) {}  
		return true;
  }
  return false;
}
function sapUrMapi_Paginator_showMenu(sId,sMenuId,sConId,oEvt) {
  if (oEvt.type=="click") sapUrMapi_PopupMenu_showMenu(sId+"-menu",sMenuId,sapPopupPositionBehavior.MENURIGHT,oEvt);
  if ((oEvt.keyCode==40) || (oEvt.keyCode==13)|| (oEvt.keyCode==32))sapUrMapi_PopupMenu_showMenu(sId+"-menu",sMenuId,sapPopupPositionBehavior.MENURIGHT,oEvt);
}
function ur_Paginator_triggerClick(sId,enumButton) {
  var oBtn=null;
	oBtn=document.getElementById(sId+"-btn-"+enumButton);
  if (oBtn!=null) { 
    if (!sapUrMapi_Paginator_buttonDisabled(oBtn)) {
      oBtn.click();
      return true;
    }
  }
}
function sapUrMapi_Paginator_enrichParameters(sConId) {
	try {
		if (sapUrMapi_getControlType(sConId)=="PhaseIndicator") {
	  	return sapUrMapi_PhaseIndicator_getFirstVisible(ur_get(sConId));
	   }
	} catch (ex) {}  
	return "";
}

//** PatternContainerContentItem.ie5 **

function sapUrMapi_Pc_Resize(sId) {
	sapUrMapi_Resize_AddItem(sId, "sapUrMapi_PcTabSeq_Draw('" + sId + "')");
}
function sapUrMapi_Pc_RegisterCreate(sId) {
	sapUrMapi_PcTabSeq_Create(sId);
	sapUrMapi_Create_AddItem(sId, "sapUrMapi_PcTabSeq_Draw('" + sId + "')");
}
function sapUrMapi_Pc_toggle(sId, sCtlType, e) {
	if ((e.type!="click") && (!sapUrMapi_checkKey(e,"keydown",new Array("32","30")))) return false;
	e.cancelBubble=true;
	var tbdy = document.getElementById(sId+"-tbd");
	var tbl = tbdy.parentElement;
	var tbar = document.getElementById(sId+"-tbar");
	var thead = document.getElementById(sId+"-hd");
	var ico = document.getElementById(sId+"-exp");
	if ( tbdy != null && ico != null ) {
		if ( tbdy.style.display == "none" ) {
			if (tbar) tbar.style.setAttribute("display", "block");
			tbdy.style.setAttribute("display", "block");
			
			if (tbl.getAttribute("sized") != "true"){
				sapUrMapi_Pc_Create(sId, tbl.getAttribute("scrolltype"), false );
			}
			if (ico.className.indexOf("urPcExpClosedIco") != -1){ ico.className = ico.className.replace("urPcExpClosedIco", "urPcExpOpenIco");}
			if (thead != null && thead.className == "urPcHdBgClosedIco" ){ thead.className = "urPcHdBgOpenIco";}
			if (ur_system.is508) {
				ico.title=getLanguageText(sCtlType + "_COLLAPSE",new Array(thead.innerText,sCtlType + "_COLLAPSE_KEY"));
			}
		} else {
			if (tbar){ tbar.style.setAttribute("display", "none");}
			var helper = tbdy.parentNode.offsetWidth;
			tbdy.style.setAttribute("display", "none");
			tbdy.parentNode.style.width=helper+"px";
			if (ico.className.indexOf("urPcExpOpenIco") != -1 ){ ico.className = ico.className.replace("urPcExpOpenIco", "urPcExpClosedIco");}
			if (thead != null && thead.className == "urPcHdBgOpenIco" ){ thead.className = "urPcHdBgClosedIco";}
			if (ur_system.is508) {
				ico.title=getLanguageText(sCtlType + "_EXPAND",new Array(thead.innerText, sCtlType + "_EXPAND_KEY"));
			}
	}
		ur_focus(ico);
}
  sapUrMapi_Focus_showFocusRect();
	return true;
}
function sapUrMapi_Pc_showOptionMenu(sId,e) {
  var sTrayId=sId;
  var sTriggerId=sId+"-menu";
  var sMenuContentId=ur_get(sTriggerId).getAttribute("mid");
 	if (ur_system.direction=="rtl")
	  var enumPositionBehavior=sapPopupPositionBehavior.MENULEFT;
	else
	  var enumPositionBehavior=sapPopupPositionBehavior.MENURIGHT;
  var sControlType=sapUrMapi_getControlTypeFromObject(ur_get(sId)).toUpperCase();
	switch (sControlType) {
		case "PATTERNCONTAINERTAB" :
			if (e.type!="click") {
				if (sapUrMapi_checkKey(e,"keydown",new Array("32","40","13"))){
					sapUrMapi_PopupMenu_showMenu(sTriggerId,sMenuContentId,enumPositionBehavior,e);
				}
				else if (sapUrMapi_checkKey(e,"keydown",new Array("39","37"))) {
					var intTabCount = parseInt(document.getElementById(sTrayId + "-tbl").getAttribute("tabcount"));
					if (ur_system.direction=="rtl") {
					  sapUrMapi_PcTabs_focusItem(sTrayId,null,null,e.keyCode==37,e.keyCode==39);
					} else {
					  sapUrMapi_PcTabs_focusItem(sTrayId,null,null,e.keyCode==39,e.keyCode==37);
					}
					return;
				}
				else {
					return false;
				}
			}
			else {
				sapUrMapi_PopupMenu_showMenu(sTriggerId,sMenuContentId,enumPositionBehavior,e);
			}
			break;
		case "PATTERNCONTAINERSEQUENCE" :
			if (e.type!="click") {
				if (sapUrMapi_checkKey(e,"keydown",new Array("32","40","13"))){
					sapUrMapi_PopupMenu_showMenu(sTriggerId,sMenuContentId,enumPositionBehavior,e);
				}
				else if (sapUrMapi_checkKey(e,"keydown",new Array("39","37"))) {
					var intTabCount = parseInt(document.getElementById(sTrayId + "-tbl").getAttribute("tabcount"));
					if (ur_system.direction=="rtl") {
					  sapUrMapi_PcSeq_focusItem(sTrayId,null,null,e.keyCode==37,e.keyCode==39);
					} else {
					  sapUrMapi_PcSeq_focusItem(sTrayId,null,null,e.keyCode==39,e.keyCode==37);
					}
					return;
				}
				else {
					return false;
				}
			}
			else {
				sapUrMapi_PopupMenu_showMenu(sTriggerId,sMenuContentId,enumPositionBehavior,e);
			}
			break;
		case "PATTERNCONTAINERTITLE" :
			if (e.type!="click") {
				if (sapUrMapi_checkKey(e,"keydown",new Array("32","40","13"))){
					sapUrMapi_PopupMenu_showMenu(sTriggerId,sMenuContentId,enumPositionBehavior,e);
				}
			}
			else {
			  sapUrMapi_PopupMenu_showMenu(sTriggerId,sMenuContentId,enumPositionBehavior,e);
			}
			break;
		default :
			return;
	}
}
function sapUrMapi_PcTab_Resize(sId) {
	sapUrMapi_Resize_AddItem(sId, "sapUrMapi_PcTabSeq_Draw('" + sId + "')");
}
function sapUrMapi_PcTabSeq_RegisterCreate(sId) {
	sapUrMapi_PcTabSeq_Create(sId);
	sapUrMapi_Create_AddItem(sId, "sapUrMapi_PcTabSeq_Draw('" + sId + "')");
}
var sapUrMapi_PcTabSeq_Registry = new Array();
function sapUrMapi_PcTabSeq_Create(sId) {
	sapUrMapi_PcTabSeq_Registry[sId] = false;
	
	var bCollapsed = document.getElementById(sId).getAttribute("collapsed");
	var tbl = document.getElementById(sId + "-tbd").parentElement;
	if (bCollapsed == "true"){
		tbl.setAttribute("sized", "false");
	}
	else{
		tbl.setAttribute("sized", "true");
	}
	
	sapUrMapi_Resize_AddItem(sId, "sapUrMapi_PcTabSeq_Draw('" + sId + "')");
	sapUrMapi_PcTabSeq_Registry[sId] = true;
}
function sapUrMapi_PcTabSeq_Draw() {
	var divlist = new Array();
	var tbdylist = new Array();
	var iIdx = "null";
	for (var ctls in sapUrMapi_PcTabSeq_Registry) {
		if (ctls.indexOf("_") == 0) {continue;}
		var tbdy = document.getElementById(ctls + "-tbd");
		if(tbdy==null) continue;
		tbdylist[ctls] = tbdy;
		divlist[ctls] = null;
		if (tbdy.style.display == "none") {
			continue;
		}
		iIdx = document.getElementById(ctls + "-tbl").getAttribute("selectedtab");
		if (iIdx == -9999) {
			iIdx = "Title";
		}
		var div = document.getElementById(ctls + "-cnt-" + iIdx);
		if (div==null) return;
		divlist[ctls] = div;
		
}
	for (var ctls in sapUrMapi_PcTabSeq_Registry) {
		if ((ctls.indexOf("_") == 0) || (tbdylist[ctls].style.display == "none")) {
			continue;
		}
		var div = divlist[ctls];
		var maxWidth = parseInt(div.clientWidth);
		
	}
	for (var ctls in sapUrMapi_PcTabSeq_Registry) {
		if ((ctls.indexOf("_") == 0) || (tbdylist[ctls].style.display == "none")) {
			continue;
		}
		var div = divlist[ctls];
		for (var i = 0; i < div.childNodes.length; i++) {
			if (div.childNodes[i].nodeType == 1) {
				if (div.childNodes[i].style.display == "none") {
					div.childNodes[i].style.display = "";
				}
			}
		}
	}
}
function sapUrMapi_PcTabs_getSelectedItemId(sTabStripId) {
  var oTabTable 	= document.getElementById(sTabStripId+"-tbl");
	var iSelTab			=	parseInt(oTabTable.getAttribute("selectedtab"));
	return sTabStripId+"-itm-"+iSelTab;
}
function sapUrMapi_PcTabs_focusItem(sTabStripId,iFocusIdx,iTabCount,bNext,bPrev) {
	var oTabTable = document.getElementById(sTabStripId+"-tbl");
	if (isNaN(iFocusIdx)) {iFocusIdx = parseInt(oTabTable.getAttribute("selectedtab"));}
	if (isNaN(iTabCount)) {iTabCount = parseInt(oTabTable.getAttribute("tabcount"));}
	var ico = document.getElementById(sTabStripId + "-menu");
	var iNewIndex=iFocusIdx;
	if (ico != null && ico.getAttribute("hasfocus") == "true") {
		if (bNext) {
			iNewIndex = parseInt(oTabTable.getAttribute("starttab"));
		}
		if (bPrev) {
			iNewIndex = parseInt(oTabTable.getAttribute("starttab")) - 1 + parseInt(oTabTable.getAttribute("vistabs"));
		}
	}
	else {
		if (bNext) {
			if (iFocusIdx<iTabCount-1) iNewIndex=iFocusIdx+1;
			else iNewIndex=0;
		}
		if (bPrev) {
			if (iFocusIdx>0) iNewIndex=iFocusIdx-1;
			else iNewIndex=iTabCount-1;
		}
	}
	oFocusedTab = document.getElementById(sTabStripId+"-itm-"+iNewIndex);
	if (oFocusedTab.style.display != "none") {
		var iOldFoc     = parseInt(oTabTable.getAttribute("focusedtab"));
		if (!isNaN(iOldFoc)) {
			sapUrMapi_setTabIndex(document.getElementById(sTabStripId+"-itm-"+iOldFoc+"-txt"),-1);
		}
		var oFoc = document.getElementById(sTabStripId+"-itm-"+iNewIndex+"-txt");
		sapUrMapi_setTabIndex(oFoc,0);
		ur_focus(oFoc);
		oTabTable.setAttribute("focusedtab",iNewIndex);
		if (ico != null) {
			ico.setAttribute("hasfocus", "false");
		}
		if ((oFocusedTab.getAttribute("dsbl")=="true")&&(!ur_system.is508)) {
			sapUrMapi_PcTabs_focusItem(sTabStripId,iNewIndex,iTabCount,bNext,bPrev);
			return;
		}
	}
	else {
	    if (ico != null) {
			sapUrMapi_setTabIndex(ico,0);
			ico.setAttribute("hasfocus", "true");
			ur_focus(ico);
	    }
	}
}
function sapUrMapi_PcTabs_enter (sId,e) {
	if (e.srcElement.id==sId+"-skipstart") {
		if (sapUrMapi_skip(sId+'-skipstart',sId+'-skipend',e)) return;
    if (!e.shiftKey) { 
		  if (sapUrMapi_checkKey(e,"keydown",new Array("9","39","37"))){
	      sapUrMapi_PcTabs_focusItem(sId);
				sapUrMapi_cancelEvent(e);
		  }
	  }
	}
}
function sapUrMapi_PcTabs_setActiveItem(sId,iIdx) {
	with (document) {
		var oTabTable 	= getElementById(sId+"-tbl");
		var tbdy = getElementById(sId+"-tbd");
		var iSelTab			=	parseInt(oTabTable.getAttribute("selectedtab"));
		var iTabLength	=	parseInt(oTabTable.getAttribute("tabcount"));
		var iCurIdx = parseInt(oTabTable.getAttribute("starttab"));
		var iVisTabs = parseInt(oTabTable.getAttribute("vistabs"));
		if (isNaN(iIdx)) return;
		if (getElementById(sId+"-itm-"+iIdx).getAttribute("dsbl")=="true") return false; 
		if ((iTabLength==1) || (iSelTab==iIdx)) return true; 
		var oCurrentTxt  = getElementById(sId+"-itm-"+iSelTab+"-txt");
		var oCurrentCell = getElementById(sId+"-itm-"+iSelTab);
		var oCurrentCon = getElementById(sId+"-itm-"+iSelTab+"-c");
		var oClickedTxt  = getElementById(sId+"-itm-"+iIdx+"-txt");
		var oClickedCell = getElementById(sId+"-itm-"+iIdx);
		var oClickedCon = getElementById(sId+"-itm-"+iIdx+"-c");
		var oFirstImage  = getElementById(sId+"-p");
		var oLastImage   = getElementById(sId+"-n");
		if (oCurrentCell != null){
			oCurrentCell.className="urPcTbsLabelOff"; 
			oCurrentTxt.className = "urPcTbsTxtOff";  
			if (oCurrentCon != null){
				oCurrentCon.className = "urPcConOff";	
			}
		}
		oClickedTxt.className = "urPcTbsTxtOn";   
		oClickedCell.className="urPcTbsLabelOn";  
		if (oClickedCon != null){
			oClickedCon.className = "urPcConOn";	
		}
		
		if (iCurIdx != 0){
			if (iIdx!=iCurIdx){oFirstImage.className="urPcTbsFirstAngOffPrevOn"; }
			else{oFirstImage.className="urPcTbsFirstAngOnPrevOn"; }
		}
		else{
			if (iIdx!=iCurIdx){oFirstImage.className="urPcTbsFirstAngOffPrevOff"; }
			else{oFirstImage.className="urPcTbsFirstAngOnPrevOff"; }
		}
		
		if (iCurIdx + iVisTabs >= iTabLength){
			if (iIdx == iTabLength - 1){
				oLastImage.className="urPcTbsLastOnNextOff"; 
			}
			else{
				if (iIdx != (iCurIdx + iVisTabs - 1)){oLastImage.className="urPcTbsLastOffNextOff"; }
				else{oLastImage.className="urPcTbsLastOnNextOff"; }
			}
		}
		else{  
			if (iIdx != (iCurIdx + iVisTabs - 1))oLastImage.className="urPcTbsLastOffNextOn"; 
			else{oLastImage.className="urPcTbsLastOnNextOn"; }
		}
		
		if (iSelTab == iCurIdx){
			getElementById(sId+"-itm-"+(iSelTab)+"-a").className="urPcTbsAngOffOff";
			getElementById(sId+"-itm-"+(iSelTab+1)+"-a").className="urPcTbsAngOffOff";
		} else  {
			getElementById(sId+"-itm-"+(iSelTab)+"-a").className="urPcTbsAngOffOff";
			if (iSelTab != iTabLength - 1){
				getElementById(sId+"-itm-"+(iSelTab+1)+"-a").className="urPcTbsAngOffOff";
			}
		}
		
		if (iIdx==iCurIdx){
			getElementById(sId+"-itm-"+(iIdx)+"-a").className="urPcTbsAngOffOn";
			if (iIdx != iTabLength - 1) {
			  getElementById(sId+"-itm-"+(iIdx+1)+"-a").className="urPcTbsAngOnOff";
			}
		} else {
			getElementById(sId+"-itm-"+(iIdx)+"-a").className="urPcTbsAngOffOn";
			if (iIdx != iTabLength - 1) {
				getElementById(sId+"-itm-"+(iIdx+1)+"-a").className="urPcTbsAngOnOff";
			}
		}
		oTabTable.setAttribute("selectedtab",iIdx); 
		sapUrMapi_PcTabs_focusItem(sId,iIdx); 
		
		var oCurrentContent  = getElementById(sId+"-cnt-"+iSelTab);
		var oClickedContent  = getElementById(sId+"-cnt-"+iIdx);
		
		if (tbdy.style.display != "none") {
			var maxwidth = parseInt(oCurrentContent.clientWidth);
			for (var i = 0; i < oClickedContent.childNodes.length; i++){
				oClickedContent.childNodes[i].style.width = (maxwidth - 1) + "px";
				}
			}
		
		oClickedContent.className = "urPcTbsDspSel";
		oCurrentContent.className = "urPcTbsDsp";
	}
	if (ur_system.is508) {
		oClickedTxt.title = getLanguageText("SAPUR_PCTABS_ITEM",new Array(oClickedTxt.innerText,"SAPUR_PCTABS_ITEM_SELECTED"));
		oCurrentTxt.title = getLanguageText("SAPUR_PCTABS_ITEM",new Array(oCurrentTxt.innerText,"SAPUR_PCTABS_ITEM_ENABLED"));
	}
	return true
}
function sapUrMapi_PcTabs_keySelect(sId, iSelectedIdx, iTabCount,e) {
	if (sapUrMapi_checkKey(e,"keydown",new Array("39","37"))){
	  if (ur_system.direction=="rtl") {
	    sapUrMapi_PcTabs_focusItem(sId,iSelectedIdx,iTabCount,e.keyCode==37,e.keyCode==39);
	  } else {
		sapUrMapi_PcTabs_focusItem(sId,iSelectedIdx,iTabCount,e.keyCode==39,e.keyCode==37);
	  }
	  sapUrMapi_cancelEvent(e);
	  return;
	}
	if (sapUrMapi_checkKey(e,"keydown",new Array("32"))){
		sapUrMapi_PcTabs_setActiveItem(sId,iSelectedIdx,0,false);
		sapUrMapi_cancelEvent(e);
		return;
	}
}
function sapUrMapi_PcSeq_setActiveItem(sId, iIdx, iOldIdx, bIsTitle) {
	with(document) {
		var maxwidth = 0;
		var oTbl = getElementById(sId+"-tbl");
		var tbdy = getElementById(sId+"-tbd");
		var iOldIdx = parseInt(oTbl.getAttribute("selectedtab"));
		var iTabLength = parseInt(oTbl.getAttribute("tabcount"));
		var iNewIdx = parseInt(oTbl.getAttribute("starttab"));
		var iVisTabs = parseInt(oTbl.getAttribute("vistabs"));
		
		
		if (isNaN(iIdx)){return;}
		if ((iTabLength==1) || (iOldIdx==iIdx)){ return true; }
		
		
		if (iIdx != -9999){
			
			var oClkCell = getElementById(sId + "-itm-" + iIdx);
			if (oClkCell.getAttribute("dsbl")=="true" || oClkCell.className.indexOf("Term") != -1){ return false; }
		}
		
		if (iOldIdx == -9999){
			
			
			var oCurTxt = getElementById(sId + "-tit-txt");
			var oCurCon = getElementById(sId + "-itm-tit-cn");
			var oCurContent  = getElementById(sId+"-cnt-tit");
			maxwidth = parseInt(oCurContent.clientWidth);
			
			if (oCurTxt != null){
				oCurTxt.className = "urPcTitTxt";
				}
			
				if (oCurCon != null){
				oCurCon.className = "urPcConOff";
				}
			
			oCurContent.className = "urPcSeqDsp";
		}
		else if (iOldIdx >=0 && iOldIdx < iTabLength){
			
			
			var oCurTxt = getElementById(sId + "-itm-" + iOldIdx + "-txt");
			var oCurCell = getElementById(sId + "-itm-" + iOldIdx);
			var oCurCon = getElementById(sId + "-itm-" + iOldIdx + "-c");
			var oCurStpCell = getElementById(sId + "-itm-" + iOldIdx + "-n");
			var oCurStpTxt = getElementById(sId + "-itm-" + iOldIdx + "-na");
			var oCurContent  = getElementById(sId+"-cnt-"+iOldIdx);
			maxwidth = parseInt(oCurContent.clientWidth);
			if (oCurCell != null){
				
				oCurCell.className="urPcSeqLabelOff";
				oCurTxt.className = "urPcSeqTxtOff";
				if (oCurStpCell != null){
					var re = /On/gi;
					var clsNm = oCurStpCell.className;
					
					oCurStpCell.className = clsNm.replace(re, "Off");
					oCurStpTxt.className = "urPcSeqStpTxtOff";
				}
				
				if (oCurCon != null){
					oCurCon.className = "urPcConOff";
				}
			}
			
			oCurContent.className = "urPcSeqDsp";
		}
		
		
		var newHt = 0;
		if (iIdx == -9999){
			
			
			var oClkTxt  = getElementById(sId + "-tit-a");
			var oClkCon = getElementById(sId + "-itm-tit-cn");
			var oClkContent  = getElementById(sId+"-cnt-tit");
			
			if (oClkCon != null){
				oClkCon.className = "urPcConOn";
			}
			
			if (tbdy.style.display != "none") {
				for (var i = 0; i < oClkContent.childNodes.length; i++){
					oClkContent.childNodes[i].style.width = (maxwidth - 1) + "px";
					}
				}
			oClkContent.className = "urPcSeqDspSel";
		}
		else{
			
			
			var oClkCell = getElementById(sId + "-itm-" + iIdx);
			var oClkTxt  = getElementById(sId + "-itm-" + iIdx + "-txt");
			var oClkCon = getElementById(sId + "-itm-" + iIdx + "-c");
			var oClkStpCell = getElementById(sId + "-itm-" + iIdx + "-n");
			var oClkStpTxt = getElementById(sId + "-itm-" + iIdx + "-na");
			var oClkContent  = getElementById(sId+"-cnt-"+iIdx);
			if (oClkCell != null){
				
				oClkCell.className="urPcSeqLabelOn";
				oClkTxt.className = "urPcSeqTxtOn";
				if (oClkStpCell != null){
					var re = /Off/gi;
					var clsNm = oClkStpCell.className;
					
					oClkStpCell.className = clsNm.replace(re, "On");
					oClkStpTxt.className = "urPcSeqStpTxtOn";
				}
			}
			
			if (oClkCon != null){
				oClkCon.className = "urPcConOn";
			}
			
			if (tbdy.style.display != "none") {
				for (var i = 0; i < oClkContent.childNodes.length; i++){
					oClkContent.childNodes[i].style.width = (maxwidth - 1) + "px";
					}
				}
			oClkContent.className = "urPcSeqDspSel";
		}
		
		if (iOldIdx != -9999){
			if (iOldIdx == iNewIdx){
				if (getElementById(sId+"-itm-"+(iOldIdx)+"-a") != null) {
				  getElementById(sId+"-itm-"+(iOldIdx)+"-a").className="urPcSeqAngOffOff";
				}
				var td = getElementById(sId+"-itm-"+(iOldIdx+1)+"-a");
				if (td.className.indexOf("Term") == -1){
					td.className="urPcSeqAngOffOff";
				}
				else{
					 td.className="urPcSeqAngOffTerm";
				}
			}
			else if (iOldIdx >=0 && iOldIdx < iTabLength){
				getElementById(sId+"-itm-"+(iOldIdx)+"-a").className="urPcSeqAngOffOff";
				if (iOldIdx < iTabLength){
					var td = getElementById(sId+"-itm-"+(iOldIdx+1)+"-a");
					if (td != null) {
					        if (td.className.indexOf("Term") == -1){
						        td.className="urPcSeqAngOffOff";
					        }
					        else{
						        td.className="urPcSeqAngOffTerm";
						}
					}
				}
			}
		}
		
		if (iIdx==iNewIdx){
				var td = getElementById(sId+"-itm-"+(iIdx+1)+"-a");
				if (getElementById(sId+"-itm-"+(iIdx)+"-a") != null) {
				  getElementById(sId+"-itm-"+(iIdx)+"-a").className="urPcSeqAngOffOn";
				}
				if (td.className.indexOf("Term") == -1){
					td.className="urPcSeqAngOnOff";
				}
				else{
					td.className="urPcSeqAngOnTerm";
				}
		}
		else{
			if (iIdx != -9999){
				getElementById(sId+"-itm-"+(iIdx)+"-a").className="urPcSeqAngOffOn";
			}
			if (iIdx != -9999 && iIdx != iTabLength - 1) {
				var td = getElementById(sId+"-itm-"+(iIdx+1)+"-a");
				if (td.className.indexOf("Term") == -1){
					td.className="urPcSeqAngOnOff";
				}
				else{
					td.className="urPcSeqAngOnTerm";
				}
			}
		}
		
		var oFirstImage  = getElementById(sId+"-p");
		var oLastImage   = getElementById(sId+"-n");
		
		if (iNewIdx != 0){
			
			if (iIdx!=iNewIdx){oFirstImage.className="urPcSeqFirstAngOffPrevon";}
			
			else{oFirstImage.className="urPcSeqFirstAngOnPrevon";}
		}
		else{
			
			if (iIdx!=iNewIdx){oFirstImage.className="urPcSeqFirstAngOffPrevoff";}
			
			else{oFirstImage.className="urPcSeqFirstAngOnPrevoff";}
		}
		
		
		var oLastItm=null;
		if (iTabLength-1<iNewIdx+iVisTabs-1) {
		 oLastItm=document.getElementById(sId+"-itm-"+(iTabLength-1));
		} else {
		  oLastItm=document.getElementById(sId+"-itm-"+(iNewIdx+iVisTabs-1));
		}
		if (oLastItm.getAttribute("design")=="TERM") oLastImage.style.display="none";
		else oLastImage.style.display="block";
		
		if (iNewIdx + iVisTabs >= iTabLength){
			
			if (iIdx != (iNewIdx + iVisTabs - 1) && iIdx != iTabLength - 1){
				if (oLastImage.className.indexOf("Branch") != -1){
					oLastImage.className="urPcSeqLastOffBranchOn";
				}
				else if (oLastImage.className.indexOf("Term") != -1){
					
					oLastImage.className="urPcSeqAngOffTerm";
				} 
				else if ((iIdx + iVisTabs) < iOldIdx) {
					oLastImage.className="urPcSeqLastOffNextOff";
				} else {
					oLastImage.className="urPcSeqAngOffTerm";
				}
			}
			else{ 
				if (oLastImage.className.indexOf("Branch") != -1){
					oLastImage.className="urPcSeqLastOnBranchOn";
				}
				else if (oLastImage.className.indexOf("Term") != -1){
					oLastImage.className="urPcSeqAngOnTerm";
					
				}
				else if (iIdx<iTabLength - 1){
					oLastImage.className="urPcSeqLastOffNextOn";
				}
			}
		}
		else{
			
			if (iIdx != (iNewIdx + iVisTabs - 1) && iIdx != iTabLength - 1){
				if (oLastImage.className.indexOf("Branch") != -1){
					oLastImage.className="urPcSeqLastOffBranchOn";
				}
				else if (oLastImage.className.indexOf("Term") != -1){
					oLastImage.className="urPcSeqAngOnTerm";
				}
				else{
					oLastImage.className="urPcSeqLastOffNextOn";
				}
			}
			else{
				if (oLastImage.className.indexOf("Branch") != -1){
					oLastImage.className="urPcSeqLastOnBranchOn";
				}
				else if (oLastImage.className.indexOf("Term") != -1){
					oLastImage.className="urPcSeqAngOnTerm";
				}
				else if (iIdx<iVisTabs - 1){
					oLastImage.className="urPcSeqLastOffNextOn";
				} else {
					oLastImage.className="urPcSeqLastOnNextOn";
				}
			}
		}
		
		oTbl.setAttribute("selectedtab",iIdx);
		
		if (iIdx != -1){
			sapUrMapi_PcSeq_focusItem(sId,iIdx);
		}
		if (ur_system.is508) {
			oClkTxt.title = getLanguageText("SAPUR_PCSEQ_ITEM",new Array(oClkTxt.innerText,"SAPUR_PCSEQ_ITEM_SELECTED"));
			if (oClkStpTxt != null) {
				oClkStpTxt.title = getLanguageText("SAPUR_PCSEQ_ITEM_STEPNUMBER",new Array(oClkStpTxt.innerText,"SAPUR_PCSEQ_ITEM_STEPNR_SELECTED"));
			}
			if (oCurTxt != null) {
				oCurTxt.title = getLanguageText("SAPUR_PCSEQ_ITEM",new Array(oCurTxt.innerText,"SAPUR_PCSEQ_ITEM_ENABLED"));
				if (oCurStpTxt != null) {
					oCurStpTxt.title = getLanguageText("SAPUR_PCSEQ_ITEM_STEPNUMBER",new Array(oCurStpTxt.innerText,"SAPUR_PCSEQ_ITEM_STEPNR_ENABLED"));
				}
			}
		}
	}
}
function sapUrMapi_PcSeq_focusItem(sSeqId, iIdx, iTabCount, bNext, bPrev) {
	var oTabTable 	= document.getElementById(sSeqId+"-tbl");
	if (isNaN(iIdx)) {iIdx = parseInt(oTabTable.getAttribute("selectedtab"));}
	if (isNaN(iTabCount)) {iTabCount = parseInt(oTabTable.getAttribute("tabcount"));}
	var ico = document.getElementById(sSeqId + "-menu");
	
	if (iIdx == -9999) {return false;}
	var iNewIndex=iIdx;
	if (ico != null && ico.getAttribute("hasfocus") == "true") {
		if (bNext) {
			iNewIndex = parseInt(oTabTable.getAttribute("starttab"));
		}
		if (bPrev) {
			iNewIndex = parseInt(oTabTable.getAttribute("starttab")) - 1 + parseInt(oTabTable.getAttribute("vistabs"));
			if (document.getElementById(sSeqId+"-itm-"+iNewIndex+"-txt").getAttribute("design") == "term") {
				iNewIndex--;
			}
		}
	}
	else {
		if (bNext) {
			
			if (iIdx<iTabCount-1){ iNewIndex=iIdx+1;}
			else {iNewIndex=0;}
		}
		if (bPrev) {
			if (iIdx>0) {iNewIndex=iIdx-1;}
			else {iNewIndex=iTabCount-1;}
		}
	}
	oFocusedTab = document.getElementById(sSeqId+"-itm-"+iNewIndex);
	if (oFocusedTab.style.display != "none") {
		var iOldFoc = parseInt(oTabTable.getAttribute("focusedtab"));
		if (!isNaN(iOldFoc)) {
			if (iOldFoc == -9999) {
			  sapUrMapi_setTabIndex(document.getElementById(sSeqId+"-tit-txt"),-1);
			}
			else {
			  sapUrMapi_setTabIndex(document.getElementById(sSeqId+"-itm-"+iOldFoc+"-txt"),-1);
			}
		}
		var oFoc = document.getElementById(sSeqId+"-itm-"+iNewIndex+"-txt");
		if (oFoc.getAttribute("design") != "term") {
			sapUrMapi_setTabIndex(oFoc,0);
			ur_focus(oFoc);
			oTabTable.setAttribute("focusedtab",iNewIndex);
			if (ico != null) {
				ico.setAttribute("hasfocus", "false");
			}
			if ((oFocusedTab.getAttribute("dsbl")=="true")&&(!ur_system.is508)) {
				sapUrMapi_PcSeq_focusItem(sSeqId,iNewIndex,iTabCount,bNext,bPrev);
				return;
			}
		}
		else {
			if (ico != null && ico.getAttribute("hasfocus") != "true") {
				sapUrMapi_setTabIndex(ico,0);
				ico.setAttribute("hasfocus", "true");
				ur_focus(ico);
			}
			else {
				sapUrMapi_PcSeq_focusItem(sSeqId,iNewIndex,iTabCount,bNext,bPrev);
				return;
			}
		}
	}
	else {
	    if (ico != null) {
			sapUrMapi_setTabIndex(ico,0);
			ico.setAttribute("hasfocus", "true");
			ur_focus(ico);
	    }
	}
}
function sapUrMapi_PcSeq_keySelect(sId, iSelectedIdx, iTabCount,e) {
	if (sapUrMapi_checkKey(e,"keydown",new Array("39","37"))){
		if (ur_system.direction=="rtl") {
	    sapUrMapi_PcSeq_focusItem(sId,iSelectedIdx,iTabCount,e.keyCode==37,e.keyCode==39);
	  } else {
		  sapUrMapi_PcSeq_focusItem(sId,iSelectedIdx,iTabCount,e.keyCode==39,e.keyCode==37);
	  }
		sapUrMapi_cancelEvent(e);
	  return;
	}
	if (sapUrMapi_checkKey(e,"keydown",new Array("32"))){
		sapUrMapi_PcSeq_setActiveItem(sId,iSelectedIdx,0,false);
		sapUrMapi_cancelEvent(e);
		return;
	}
}
function sapUrMapi_scrollItem( sId, iDir, sCtlType ){
	sCtlType=sCtlType.toUpperCase();
	if (iDir != -1 && iDir != 1){
		return false;
	}
	var oTabs = document.getElementById(sId + "-tbl");
	var tabcount = parseInt(oTabs.getAttribute("tabcount"));
	var firsttab = parseInt(oTabs.getAttribute("starttab"));
	var tabpage = parseInt(oTabs.getAttribute("tabpage"));
	var vistabs = parseInt(oTabs.getAttribute("vistabs"));
	var lasttab = parseInt(oTabs.getAttribute("lasttab"));
	var diff = vistabs;
	if (isNaN(lasttab)){
		if (firsttab + vistabs >= tabcount){lasttab = tabcount - 1;}
		else{lasttab = firsttab + vistabs - 1;}
	}
	if (lasttab != firsttab + vistabs - 1){
		diff = lasttab - firsttab;
	}
	if (iDir == 1){
		
		if (lasttab == tabcount - 1){return false;}
		
		SCROLL_FUNCTIONS[sCtlType](sId, firsttab, false, true, false);
		
		firsttab += 1;
		SCROLL_FUNCTIONS[sCtlType](sId, firsttab, true, true, false);
		if (diff > 2) {
			
			SCROLL_FUNCTIONS[sCtlType](sId, lasttab, true, false, false);
		}
		if (diff != 1) {
		
		lasttab += 1;
		SCROLL_FUNCTIONS[sCtlType](sId, lasttab, true, false, true);
	}
	else{
		
		lasttab = firsttab;
		SCROLL_FUNCTIONS[sCtlType](sId, lasttab, true, true, true);
		}
	}
	else{
		
		if (firsttab == 0){return false;}
		
		
		if (diff >= vistabs - 1){
			
			SCROLL_FUNCTIONS[sCtlType](sId, lasttab, false, false, true);
			
			lasttab -= 1;
			SCROLL_FUNCTIONS[sCtlType](sId, lasttab, true, false, true);
		}
		if (diff >= 1) {
			if (vistabs > 1) {
				
		SCROLL_FUNCTIONS[sCtlType](sId, firsttab, true, false, false);
		
		firsttab -= 1;
		SCROLL_FUNCTIONS[sCtlType](sId, firsttab, true, true, false);
	}
		else {
			  
				SCROLL_FUNCTIONS[sCtlType](sId, firsttab, false, false, false);
		
		firsttab -= 1;
				SCROLL_FUNCTIONS[sCtlType](sId, firsttab, true, true, false);
			}
		}
		else {
		
    SCROLL_FUNCTIONS[sCtlType](sId, firsttab, true, false, true);
		firsttab -= 1;
		SCROLL_FUNCTIONS[sCtlType](sId, firsttab, true, true, true);
		}
	}
	
	ICON_FUNCTIONS[sCtlType]( sId, firsttab, lasttab, tabcount );
	
	var newtabpage = Math.floor(firsttab / vistabs);
	oTabs.setAttribute("starttab", firsttab);
	oTabs.setAttribute("lasttab", lasttab);
	oTabs.setAttribute("tabpage", newtabpage);
	sapUrMapi_Pc_togglePager(sId,e)
}
function sapUrMapi_pageItem( sId, iDir, sCtlType ){
	sCtlType=sCtlType.toUpperCase();
	if (iDir != 1 && iDir != -1){
		return false;
	}
	var oTabs = document.getElementById(sId + "-tbl");
	var tabcount = parseInt(oTabs.getAttribute("tabcount"));
	var firsttab = parseInt(oTabs.getAttribute("starttab"));
	var tabpage = parseInt(oTabs.getAttribute("tabpage"));
	var vistabs = parseInt(oTabs.getAttribute("vistabs"));
	var lasttab = parseInt(oTabs.getAttribute("lasttab"));
	if (isNaN(lasttab)){
		if (firsttab + vistabs >= tabcount){lasttab = tabcount - 1;}
		else{lasttab = firsttab + vistabs-1;}
	}
	
	if ((iDir == -1 && firsttab == 0) || ( iDir == 1 && lasttab == tabcount -1)){
		return false;
	}
	
	if (((iDir == 1) && ((tabpage + iDir) * vistabs) < (tabcount)) ||
		((iDir == -1) && (tabpage + iDir >= 0) )){
		tabpage = tabpage + iDir;
	}
	
	var lbound = Math.floor(tabpage * vistabs);
	var ubound = lbound + vistabs - 1;
	
	if (ubound > tabcount - 1){
		ubound = tabcount -1;
	}
	
	for (var i = 0; i < tabcount; i++){
		
		if (i < lbound || i > ubound){
			if (i == firsttab){
				SCROLL_FUNCTIONS[sCtlType](sId, i, false, true, false);
			}
			else if (i == lasttab){
				SCROLL_FUNCTIONS[sCtlType](sId, i, false, false, true);
			}
			else{
			   SCROLL_FUNCTIONS[sCtlType](sId, i, false, false, false);
			}
		}
		else{
		   if (i == lbound){
				SCROLL_FUNCTIONS[sCtlType](sId, i, true, true, false);
		   }
		   else if (i == tabcount -1 || i == ubound){
				SCROLL_FUNCTIONS[sCtlType](sId, i, true, false, true);
		   }
		   else{
				SCROLL_FUNCTIONS[sCtlType](sId, i, true, false, false);
		   }
		}
	}
	
	ICON_FUNCTIONS[sCtlType]( sId, lbound, ubound, tabcount );
	
	oTabs.setAttribute("starttab", lbound);
	oTabs.setAttribute("lasttab", ubound);
	oTabs.setAttribute("tabpage", tabpage);
	sapUrMapi_Pc_togglePager(sId,e)
}
function sapUrMapi_boundsItem( sId, iDir, sCtlType ){
	sCtlType=sCtlType.toUpperCase();
	if (iDir != 1 && iDir != -1){
		return false;
	}
	var oTabs = document.getElementById(sId + "-tbl");
	var tabcount = parseInt(oTabs.getAttribute("tabcount"));
	var firsttab = parseInt(oTabs.getAttribute("starttab"));
	var tabpage = parseInt(oTabs.getAttribute("tabpage"));
	var vistabs = parseInt(oTabs.getAttribute("vistabs"));
	var lasttab = parseInt(oTabs.getAttribute("lasttab"));
	if (isNaN(lasttab)){
		if (firsttab + vistabs >= tabcount){lasttab = tabcount - 1;}
		else{lasttab = firsttab + vistabs-1;}
	}
	
	if ((iDir == -1 && firsttab == 0) || ( iDir == 1 && lasttab == tabcount)){
		return false;
	}
	
	if (iDir == 1){
		tabpage = Math.ceil(tabcount / vistabs) - 1;
	}
	else{
		tabpage = 0;
	}
	
	var lbound = Math.floor(tabpage * vistabs);
	var ubound = lbound + vistabs - 1;
	
	if (ubound > tabcount - 1){
		ubound = tabcount -1;
	}
	
	for (var i = 0; i < tabcount; i++){
		
		if (i < lbound || i > ubound){
			if (i == firsttab){
				SCROLL_FUNCTIONS[sCtlType](sId, i, false, true, false);
			}
			else if (i == lasttab){
				SCROLL_FUNCTIONS[sCtlType](sId, i, false, false, true);
			}
			else{
			   SCROLL_FUNCTIONS[sCtlType](sId, i, false, false, false);
			}
		}
		else{
		   if (i == lbound){
				SCROLL_FUNCTIONS[sCtlType](sId, i, true, true, false);
		   }
		   else if (i == tabcount -1 || i == ubound){
				SCROLL_FUNCTIONS[sCtlType](sId, i, true, false, true);
		   }
		   else{
				SCROLL_FUNCTIONS[sCtlType](sId, i, true, false, false);
		   }
		}
	}
	
	ICON_FUNCTIONS[sCtlType]( sId, lbound, ubound, tabcount );
	
	oTabs.setAttribute("starttab", lbound);
	oTabs.setAttribute("lasttab", ubound);
	oTabs.setAttribute("tabpage", tabpage);
	sapUrMapi_Pc_togglePager(sId,e)
}
function sapUrMapi_jumpItem( sId, iTab, sCtlType ){
	sCtlType=sCtlType.toUpperCase();
  sapUrMapi_PopupMenu_hideAll();
	var oTabs = document.getElementById(sId + "-tbl");
	var tabcount = parseInt(oTabs.getAttribute("tabcount"));
	var firsttab = parseInt(oTabs.getAttribute("starttab"));
	var vistabs = parseInt(oTabs.getAttribute("vistabs"));
	var lasttab = parseInt(oTabs.getAttribute("lasttab"));
	var seltab = parseInt(oTabs.getAttribute("selectedtab"));
	if (isNaN(lasttab)){
		if (firsttab + vistabs >= tabcount){lasttab = tabcount - 1;}
		else{lasttab = firsttab + vistabs-1;}
	}
	
	if (iTab >= tabcount || iTab < 0){
		return false;
	}
	
	var tabpage = Math.floor(iTab / vistabs);
	
	var lbound = Math.floor(tabpage * vistabs);
	var ubound = lbound + vistabs - 1;
	
	if (ubound > tabcount - 1){
		ubound = tabcount -1;
	}
	
	for (var i = 0; i < tabcount; i++){
		
		if (i < lbound || i > ubound){
			if (i == firsttab){
				SCROLL_FUNCTIONS[sCtlType](sId, i, false, true, false);
			}
			else if (i == lasttab){
				SCROLL_FUNCTIONS[sCtlType](sId, i, false, false, true);
			}
			else{
			   SCROLL_FUNCTIONS[sCtlType](sId, i, false, false, false);
			}
		}
		else{
		   if (i == lbound){
				SCROLL_FUNCTIONS[sCtlType](sId, i, true, true, false);
		   }
		   else if (i == tabcount -1 || i == ubound){
				SCROLL_FUNCTIONS[sCtlType](sId, i, true, false, true);
		   }
		   else{
				SCROLL_FUNCTIONS[sCtlType](sId, i, true, false, false);
		   }
		}
	}
	
	oTabs.setAttribute("starttab", lbound);
	oTabs.setAttribute("lasttab", ubound);
	oTabs.setAttribute("tabpage", tabpage);
	sapUrMapi_Pc_togglePager(sId,e)
	
	
	SELECT_FUNCTIONS[sCtlType](sId, iTab, seltab, false);
	
	ICON_FUNCTIONS[sCtlType]( sId, lbound, ubound, tabcount );
}
function showTab(sId, iIdx, bShow, bIsFirst, bIsLast ){
	
	var oTabs = document.getElementById(sId + "-tbl");
	var tabcount = parseInt(oTabs.getAttribute("tabcount"));
	var tabimg = document.getElementById(sId + "-itm-" + iIdx + "-a");
	var tabcell = document.getElementById(sId + "-itm-" + iIdx);
	
	var conimg = document.getElementById(sId + "-itm-" + iIdx + "-ca");
	var concell = document.getElementById(sId + "-itm-" + iIdx + "-c");
	if (bShow){
		
		if (!bIsFirst && !bIsLast){
			tabimg.style.display = "";
			tabcell.style.display = "";
			if (concell != null){
				concell.style.display = "";
				conimg.style.display = "";
			}
		}
		else if (bIsFirst){
			tabimg.style.display = "none";
			tabcell.style.display = "";
			if (concell != null){
				concell.style.display = "";
				conimg.style.display = "none";
			}
		}
		else if (bIsLast && !bIsFirst){
			tabimg.style.display = "";
			tabcell.style.display = "";
			if (concell != null){
				concell.style.display = "";
				conimg.style.display = "";
			}
		}
	}
	else{
		
		tabimg.style.display = "none";
		tabcell.style.display = "none";
		if (concell != null){
			concell.style.display = "none";
			conimg.style.display = "none";
		}
	}
}
function setTabIcons( sId, firsttab, lasttab, tabcount ){
	var prev = document.getElementById(sId + "-p");
	var next = document.getElementById(sId + "-n");
	var first = document.getElementById(sId + "-itm-" + firsttab);
	var last = document.getElementById(sId + "-itm-" + lasttab);
	var prevtmp = prev.className;
	var nexttmp = next.className
	
	if (firsttab == 0){
		if (first.className.indexOf("LabelOn") != -1){
			prev.className = "urPcTbsFirstAngOnPrevOff";
		}
		else{
			prev.className = "urPcTbsFirstAngOffPrevOff";
		}
	}
	else{
		if (first.className.indexOf("LabelOn") != -1){
			prev.className = "urPcTbsFirstAngOnPrevOn";
		}
		else{
			prev.className = "urPcTbsFirstAngOffPrevOn";
		}
	}
	
	if (lasttab == tabcount - 1){
		if (last.className.indexOf("LabelOn") != -1){
			next.className = "urPcTbsLastOnNextOff";
		}
		else{
			next.className = "urPcTbsLastOffNextOff";
		}
	}
	else{
		if (last.className.indexOf("LabelOn") != -1){
			next.className = "urPcTbsLastOnNextOn";
		}
		else{
			next.className = "urPcTbsLastOffNextOn";
		}
	}
	prev.childNodes(0).className = "urPcTbsPreFirstAng";
	next.childNodes(0).className = "urPcTbsAfterLastAng";
}
function showItem( sId, iIdx, bShow, bIsFirst, bIsLast ){
	
	var oTabs = document.getElementById(sId + "-tbl");
	var tabcount = parseInt(oTabs.getAttribute("tabcount"));
	var seltab = parseInt(oTabs.getAttribute("selectedtab"));
	var tabimg = document.getElementById(sId + "-itm-" + iIdx + "-a");
	var tabstat = document.getElementById(sId + "-itm-" + iIdx + "-n");
	var tabcell = document.getElementById(sId + "-itm-" + iIdx);
	
	var conimg = document.getElementById(sId + "-itm-" + iIdx + "-ca");
	var constat = document.getElementById(sId + "-itm-" + iIdx + "-cn");
	var concell = document.getElementById(sId + "-itm-" + iIdx + "-c");
	if (bShow){
		
		var statdisp = "";
		if (tabcell.getAttribute("design") == "INT" || tabcell.getAttribute("design") == "TERM"){
			statdisp = "none";
		}
		if (!bIsFirst && !bIsLast){
			tabimg.style.display = "";
			tabcell.style.display = "";
			tabstat.style.display = statdisp;
			if (concell != null){
				concell.style.display = "";
				conimg.style.display = "";
				constat.style.display = statdisp;
			}
		}
		else if (bIsFirst){
			tabimg.style.display = "none";
			tabcell.style.display = "";
			tabstat.style.display = statdisp;
			if (concell != null){
				concell.style.display = "";
				conimg.style.display = "none";
				constat.style.display = statdisp;
			}
		}
		else if (bIsLast){
			tabimg.style.display = "";
			tabcell.style.display = "";
			tabstat.style.display = statdisp;
			if (concell != null){
				concell.style.display = "";
				conimg.style.display = "";
				constat.style.display = statdisp;
			}
		}
	}
	else{
		
		tabimg.style.display = "none";
		tabcell.style.display = "none";
		tabstat.style.display = "none";
		if (concell != null){
			concell.style.display = "none";
			conimg.style.display = "none";
			constat.style.display = "none";
		}
	}
}
function setSeqIcons( sId, firsttab, lasttab, tabcount ){
	var prev = document.getElementById(sId + "-p");
	var next = document.getElementById(sId + "-n");
	var c_prev = document.getElementById(sId + "-p-c");
	var c_next = document.getElementById(sId + "-n-c");
	var first = document.getElementById(sId + "-itm-" + firsttab);
	var last = document.getElementById(sId + "-itm-" + lasttab);
	var prevtmp = prev.className;
	var nexttmp = next.className
	
	if (firsttab == 0){
		if (first.className == "urPcSeqLabelOn"){
			prev.className = "urPcSeqFirstAngOnPrevOff";
		}
		else{
			prev.className = "urPcSeqFirstAngOffPrevOff";
		}
		if (c_prev != null) {
		  c_prev.style.display = "none";
		}
	}
	else{
		if (first.className == "urPcSeqLabelOn"){
			prev.className = "urPcSeqFirstAngOnPrevOn";
		}
		else{
			prev.className = "urPcSeqFirstAngOffPrevOn";
		}
		if (c_prev != null) {
		  c_prev.style.display = "";
		}
	}
	
	if (lasttab == tabcount - 1){
		var lastdesign = last.getAttribute("design").toUpperCase();
		
		
		if (lastdesign == "TERM") {
			next.className = "urPcSeqLastTerm";
			if (c_next != null) {
			  c_next.style.display = "none";
			}
		}
		
		else if (lastdesign == "BRANCH") {
			if (last.className == "urPcSeqLabelOn"){
				next.className = "urPcSeqLastOnBranchOn";
			}
			else{
				next.className = "urPcSeqLastOffBranchOn";
			}
			if (c_next != null) {
			  c_next.style.display = "none";
			}
		}
		else {
		    if (last.className == "urPcSeqLabelOn") {
				next.className = "urPcSeqLastOnNextOff";
			}
			else {
			    next.className = "urPcSeqLastOffNextOff";
			}
			if (c_next != null) {
			  c_next.style.display = "none";
			}
		}
	}
	else{
		next.style.display="block";
		if (last.className == "urPcSeqLabelOn"){
			next.className = "urPcSeqLastOnNextOn";
		}
		else{
			next.className = "urPcSeqLastOffNextOn";
		}
		if (c_next != null) {
		  c_next.style.display = "";
		}
	}
	
	prev.childNodes(0).className = "urPcSeqPreFirstAng";
	
	if (next.className.indexOf("Term") != -1){
		next.childNodes(0).className = "urPcSeqAfterLastAng";
	}
	else if (next.className.indexOf("Branch") != -1){
		next.childNodes(0).className = "urPcSeqBranchAng";
	}
	else{
		next.childNodes(0).className = "urPcSeqAfterLastAng";
	}
}
SCROLL_FUNCTIONS = {PATTERNCONTAINERTAB:showTab,PATTERNCONTAINERSEQUENCE:showItem};
ICON_FUNCTIONS = {PATTERNCONTAINERTAB:setTabIcons,PATTERNCONTAINERSEQUENCE:setSeqIcons}
SELECT_FUNCTIONS = {PATTERNCONTAINERTAB:sapUrMapi_PcTabs_setActiveItem,PATTERNCONTAINERSEQUENCE:sapUrMapi_PcSeq_setActiveItem}
function debug_jumpItem(elm){
	for (var i = 0; i < elm.options.length; i++){
		if (elm.options[i].selected == true){
			sapUrMapi_jumpItem( elm.getAttribute("control"), i, elm.getAttribute('controltype'));
	}
    }
}
function sapUrMapi_Pc_togglePager(sId,e) {
  if (document.getElementById(sId+"-pag")!=null) {
    var sPagerId=document.getElementById(sId+"-pag").firstChild.id;
  } else {
    return;
  }
	var oTabs = document.getElementById(sId + "-tbl");
	var tabcount = parseInt(oTabs.getAttribute("tabcount"));
	var firsttab = parseInt(oTabs.getAttribute("starttab"));
	var tabpage = parseInt(oTabs.getAttribute("tabpage"));
	var vistabs = parseInt(oTabs.getAttribute("vistabs"));
	var lasttab = parseInt(oTabs.getAttribute("lasttab"));
  var arrButtonArray = new Array();
	var arrStateArray = new Array();
  arrButtonArray[arrButtonArray.length]=UR_PAGINATOR_BUTTON.BEGIN;
  arrButtonArray[arrButtonArray.length]=UR_PAGINATOR_BUTTON.PREVIOUS_PAGE;
  arrButtonArray[arrButtonArray.length]=UR_PAGINATOR_BUTTON.PREVIOUS_ITEM;
	if (firsttab!=0) {
	  arrStateArray[arrStateArray.length]=true;
	  arrStateArray[arrStateArray.length]=true;
	  arrStateArray[arrStateArray.length]=true;
	} else {
	  arrStateArray[arrStateArray.length]=false;
	  arrStateArray[arrStateArray.length]=false;
	  arrStateArray[arrStateArray.length]=false;
	}
  arrButtonArray[arrButtonArray.length]=UR_PAGINATOR_BUTTON.END;
  arrButtonArray[arrButtonArray.length]=UR_PAGINATOR_BUTTON.NEXT_PAGE;
  arrButtonArray[arrButtonArray.length]=UR_PAGINATOR_BUTTON.NEXT_ITEM;
	if (lasttab!=tabcount-1) {
	  arrStateArray[arrStateArray.length]=true;
	  arrStateArray[arrStateArray.length]=true;
	  arrStateArray[arrStateArray.length]=true;
	} else {
	  arrStateArray[arrStateArray.length]=false;
	  arrStateArray[arrStateArray.length]=false;
	  arrStateArray[arrStateArray.length]=false;
	}
  sapUrMapi_Paginator_setStates(sPagerId,arrButtonArray,arrStateArray);
}

//** PhaseIndicator.ie5 **
function sapUrMapi_PhInPhaseSelect(sId,sPhaseId,bSelected,e){}
var arrValuesOfPhases = new Array();
function sapUrMapi_PhaseIndicator_create(sId){
	sapUrMapi_Create_AddItem(sId, "sapUrMapi_PhaseIndicator_init('"+sId+"')");
}
function sapUrMapi_PhaseIndicator_init(sId){
	var oVisblPhases = ur_get(sId);
	var iWidth = oVisblPhases.offsetWidth;
	if (iWidth>0) {
	  sapUrMapi_PhaseIndicator_setAllValues(sId);
	} else {
	 	return;
  }
  sapUrMapi_PhaseIndicator_draw(sId);
	
	sapUrMapi_Resize_AddItem(sId, "sapUrMapi_PhaseIndicator_draw('" + sId + "')");
}
function sapUrMapi_PhaseIndicator_setAllValues(sId){
	var done = false;
	if(done == false){
		arrValuesOfPhases[sId] = new Array();
		var iItemCount = parseInt(ur_get(sId).getAttribute('allitems'));
		for(var i = 0; i <= iItemCount; i++){
			arrValuesOfPhases[sId][i] = new Array();
			arrValuesOfPhases[sId][i][0] = sId + '-itm-' + i;
			arrValuesOfPhases[sId][i][1] = ur_get(sId + '-itm-' + i).offsetWidth;
		}
		arrValuesOfPhases[sId][iItemCount + 1] = new Array();
		done = true;
	}
}
function sapUrMapi_PhaseIndicator_draw(sId) {
  var o=ur_get(sId);
	var iItemCount = parseInt(o.getAttribute('allitems'));
	var iFirstIdxOld = parseInt(o.getAttribute('firstvisible'));
	ur_get(sId + '-cnt-scrl').style.width = '1px';
	sapUrMapi_PhaseIndicator_setSelectedItem(sId);
	sapUrMapi_PhaseIndicator_make(sId,iFirstIdxOld,iItemCount);
}
function sapUrMapi_PhaseIndicator_make(sId,iStart,iEnd,sDir){
  var o=ur_get(sId);
	var iLastIdxOld = parseInt(o.getAttribute('lastvisible'));
	var iFirstIdxOld = parseInt(o.getAttribute('firstvisible'));
	var iAvailWdth = ur_get(sId + '-cnt').offsetWidth;
	var iItemCount = parseInt(o.getAttribute('allitems'));
	var iVisblWdth = 0;
	var iFirstIdx = 0;
	var iLastIdx = 0;
	var ii=0;
	for(var i=0;i<=iItemCount;i++) {
	  arrValuesOfPhases[sId][i][2]=false;
	}
  
  
	if(sDir == 'FURTHER' || typeof(sDir)=="undefined"){
    for (i=iStart;i<=iEnd;i++) {
			if(iAvailWdth > 0 && iAvailWdth >= arrValuesOfPhases[sId][i][1]){
				arrValuesOfPhases[sId][i][2]=true;
				iAvailWdth = iAvailWdth - arrValuesOfPhases[sId][i][1];
				iVisblWdth = iVisblWdth + arrValuesOfPhases[sId][i][1];
			}else{
				break;
			}
		ii=i;
    }
	}
	if(sDir == 'BACK'){
    for (i=iStart;i>=iEnd;i--) {
			if(iAvailWdth > 0 && iAvailWdth >= arrValuesOfPhases[sId][i][1]){
				arrValuesOfPhases[sId][i][2]=true;
				iAvailWdth = iAvailWdth - arrValuesOfPhases[sId][i][1];
				iVisblWdth = iVisblWdth + arrValuesOfPhases[sId][i][1];
			}else{
				break;
			}
		  ii=i;
    }
  }
	if(ii == 0 && iAvailWdth > iVisblWdth && iAvailWdth >= arrValuesOfPhases[sId][iStart + 1][1]){
		iAvailWdth = ur_get(sId + '-cnt').offsetWidth;
		for(i = (iStart + 1); i<= iItemCount; i++){
				iVisblWdth = iVisblWdth + arrValuesOfPhases[sId][i][1];
			if(iAvailWdth >= iVisblWdth && iAvailWdth >= arrValuesOfPhases[sId][i][1]){
				arrValuesOfPhases[sId][i][2]=true;
				iStart = i;
			}else{
				break;
			}
		}
	}
	for(var i=0;i<=iItemCount;i++) {
	  if (arrValuesOfPhases[sId][i][2]==false) {
		  ur_get(arrValuesOfPhases[sId][i][0]).childNodes[0].style.display = "none";
	  } else {
		  ur_get(arrValuesOfPhases[sId][i][0]).childNodes[0].style.display = "block";
	  }
	}
	if(sDir == 'BACK'){
		ur_get(sId).setAttribute('firstvisible',ii);
		ur_get(sId).setAttribute('lastvisible',iStart);
		iFirstIdx = ii;
		iLastIdx = iStart;
	} else {
		ur_get(sId).setAttribute('firstvisible',iStart);
		ur_get(sId).setAttribute('lastvisible',ii);
		iFirstIdx = iStart;
		iLastIdx = ii;
	}
	var oLastIdx = ur_get(sId + '-itm-img-' + iLastIdx);
	if(iFirstIdx == 0 && iLastIdx != iItemCount && oLastIdx != null){
		ur_get(sId + '-cnt-scrl').style.width = iVisblWdth;
		if(!isNaN(iLastIdxOld) && iLastIdxOld != iItemCount){
			ur_get(sId + '-itm-img-' + iLastIdxOld).className = 'urPhInFurtherArrow';
			}
		ur_get(sId + '-p').style.display = 'none';
		ur_get(sId + '-itm-img-' + iLastIdx).className = 'urPhInMoreAfter';
	}
	if(iFirstIdx != 0 && iLastIdx != iItemCount){
		ur_get(sId + '-p').style.display = 'block';
		ur_get(sId + '-cnt-scrl').style.width = iVisblWdth;
		if(iLastIdxOld != iItemCount){
			if(!isNaN(iLastIdxOld)){
				ur_get(sId + '-itm-img-' + iLastIdxOld).className = 'urPhInFurtherArrow';
			}
		}
		if(iLastIdx!=null){
			ur_get(sId + '-itm-img-' + iLastIdx).className = 'urPhInMoreAfter';
		}
	}
	if(iFirstIdx != 0 && iLastIdx == iItemCount){
		ur_get(sId + '-p').style.display = 'block';
		ur_get(sId + '-cnt-scrl').style.width = iVisblWdth;
		if(!isNaN(iLastIdxOld) && iLastIdxOld != iItemCount){
			ur_get(sId + '-itm-img-' + iLastIdxOld).className = 'urPhInFurtherArrow';
		}
	}
	if(iFirstIdx == 0 && iLastIdx == iItemCount){
		ur_get(sId + '-cnt-scrl').style.width = iVisblWdth;
		ur_get(sId + '-p').style.display = 'none';
		if(!isNaN(iLastIdxOld) && iLastIdxOld != iItemCount){
			ur_get(sId + '-itm-img-' + iLastIdxOld).className = 'urPhInFurtherArrow';
		}
	}
	sapUrMapi_PhaseIndicator_setPagingButtons(sId);
}
function sapUrMapi_PhaseIndicator_paging(sId,sDir){
	var iItemCount = parseInt(ur_get(sId).getAttribute('allitems'));
	var iFirstIdxOld = parseInt(ur_get(sId).getAttribute('firstvisible'));
	var iLastIdxOld = parseInt(ur_get(sId).getAttribute('lastvisible'));
		if(sDir == 'FURTHER'){
				iFirstIdxOld = iLastIdxOld + 1;
				sapUrMapi_PhaseIndicator_make(sId,iFirstIdxOld,iItemCount,sDir);
		} else if(sDir== 'BACK'){
			iLastIdxOld = iFirstIdxOld - 1;
			if(iLastIdxOld != 0){
				sapUrMapi_PhaseIndicator_make(sId,iLastIdxOld,0,sDir);
				}else{
					ur_get(sId).setAttribute('firstvisible',0);
					sapUrMapi_PhaseIndicator_draw(sId);
				}
		} else {
		  	iLastIdxOld = parseInt(sDir.substring(sDir.lastIndexOf("-")+1));
				ur_get(sId).setAttribute('focuseditem',iLastIdxOld);
				ur_get(sId).setAttribute('firstvisible',iLastIdxOld);
				sapUrMapi_PhaseIndicator_draw(sId);
			}
	}
function sapUrMapi_PhaseIndicator_setPagingButtons(sId){
	var iItemCount = parseInt(ur_get(sId).getAttribute('allitems'));
	if(ur_get(sId+"-pag").hasChildNodes()){
		sPagerId = ur_get(sId+"-pag").childNodes.item(0).id;
		var arrButtonArray = new Array();
		arrButtonArray[0]=UR_PAGINATOR_BUTTON.PREVIOUS_ITEM;
		arrButtonArray[1]=UR_PAGINATOR_BUTTON.NEXT_ITEM;
		var arrStateArray = new Array();
		arrStateArray[0]=true; 
		arrStateArray[1]=true; 
		var iFirstIdxOld = parseInt(ur_get(sId).getAttribute('firstvisible'));
		var iLastIdxOld = parseInt(ur_get(sId).getAttribute('lastvisible'));
		if(iFirstIdxOld == 0){
				arrStateArray[0]=false; 
		}
		if(iLastIdxOld == iItemCount || isNaN(iLastIdxOld)){
				arrStateArray[1]=false; 
		}
		sapUrMapi_Paginator_setStates(sPagerId,arrButtonArray,arrStateArray);
	} else {
	  return;
	}
}
function sapUrMapi_PhaseIndicator_setSelectedItem(sId) {
	var iItemCount = parseInt(ur_get(sId).getAttribute('allitems'));
	var iItemSel = parseInt(ur_get(sId).getAttribute('selecteditem'));
	var bNoSel = false;
	var iFirstIdx = parseInt(ur_get(sId).getAttribute('firstvisible'));
	
	
	if (!isNaN(iItemSel)) {
		for (i = 0; i <= iItemCount; i++) {
			if (ur_get(sId + '-itm-' + i).getAttribute('sel') == 'true') {
				ur_get(sId).setAttribute('selecteditem',i);
				ur_get(sId).setAttribute('focuseditem',i);
					bNoSel = true;
				break;
			}
		}
	}
	if(bNoSel == false){
		ur_get(sId).setAttribute('selecteditem',iFirstIdx);		
	}
}
function sapUrMapi_PhaseIndicator_keydown(sId,e){
  var iSelected = parseInt(ur_get(sId).getAttribute('selecteditem'));
  if(e.keyCode == 39 || e.keyCode == 37){
		if (isNaN(iSelected)) {
			if (ur_get(sId).getAttribute('stepamount')!="0") {
				sapUrMapi_setTabIndex(ur_get(sId + '-itm-0'),0);
				ur_focus(ur_get(sId + '-itm-0'));
			} 
		} else {
		sapUrMapi_setTabIndex(ur_get(sId + '-itm-'+iSelected),0);
			ur_focus(ur_get(sId + '-itm-' + iSelected));
  }
}
	if(e.keyCode==9){
		if (isNaN(iSelected)) {
			if (ur_get(sId).getAttribute('stepamount')!="0") {
				sapUrMapi_setTabIndex(ur_get(sId + '-itm-0'),-1);
			} 
		} else {
			sapUrMapi_setTabIndex(ur_get(sId + '-itm-' + iSelected),-1);
		}
	}
}
function sapUrMapi_PhaseIndicator_keydownStep(sId,sItemIdx,bSel,e){
	var iItemCount = parseInt(ur_get(sId).getAttribute('allitems'));
	var iFocusedItemOld = ur_get(sId).getAttribute('focuseditem');
	var iLastVsbl = ur_get(sId).getAttribute('lastvisible');
	var iFirstVsbl = ur_get(sId).getAttribute('firstvisible');
	var iSelected = ur_get(sId).getAttribute('selecteditem');
	var iItemIdx = parseInt(sItemIdx);
	var sItem = '-itm-';
	var sFocusedItemNew = sItem + iItemIdx;          
	var sNextItem = sItem + (iItemIdx + 1);  
	var sPrevItem = sItem + (iItemIdx - 1); 
	
	
	if(e.keyCode == 39) {
	  if (ur_system.direction == "rtl") {
	    
	    if (iItemIdx > 0){
	       sapUrMapi_PhaseIndicator_focusItem(sId,sFocusedItemNew,sPrevItem);
	    }
	    
	    if(iItemIdx == 0){
	    }
		if (iItemIdx == iFirstVsbl && !isNaN(iFirstVsbl) && iFirstVsbl != 0){
			sapUrMapi_PhaseIndicator_paging(sId,"BACK");
	    }
	  } else {
	    
	    if (iItemIdx < iItemCount){
	       sapUrMapi_PhaseIndicator_focusItem(sId,sFocusedItemNew,sNextItem);
	    }
	    
			if (iItemIdx == iItemCount){
		    }
			if (iItemIdx == iLastVsbl && !isNaN(iLastVsbl) && iLastVsbl != iItemCount){
			sapUrMapi_PhaseIndicator_paging(sId,"FURTHER");
	    }
	  }
	}
	
	
	if(e.keyCode == 37) {
	  if (ur_system.direction == "rtl") {
	    
	    if (iItemIdx < iItemCount){
	       sapUrMapi_PhaseIndicator_focusItem(sId,sFocusedItemNew,sNextItem);
	    }
	    
			if (iItemIdx == iItemCount){
		    }
			if (iItemIdx == iLastVsbl && !isNaN(iLastVsbl) && iLastVsbl != iItemCount){
			sapUrMapi_PhaseIndicator_paging(sId,"FURTHER");
	    }
	  } else {
	    
	    if (iItemIdx > 0){
	       sapUrMapi_PhaseIndicator_focusItem(sId,sFocusedItemNew,sPrevItem);
	    }
	    
		    if(iItemIdx == 0){
		    }
			if (iItemIdx == iFirstVsbl && !isNaN(iFirstVsbl) && iFirstVsbl != 0){
			  sapUrMapi_PhaseIndicator_paging(sId,"BACK");
	    }
	  }
	}
	if(e.keyCode==32){
		sapUrMapi_triggerClick(e,new Array('32'));
	}
	
	if(!isNaN(iFocusedItemOld)){
		if(e.keyCode == 9 && iSelected != iFocusedItemOld){
		   sapUrMapi_PhaseIndicator_focusItem(sId,(sItem + iFocusedItemOld),(sItem + iSelected));
		   }
		 }
	   e.cancelBubble=true;
}
function sapUrMapi_PhaseIndicator_focusItem(sId,sFocusedOld,sFocusedNew){
	sapUrMapi_setTabIndex(ur_get(sId + sFocusedOld),-1);
	sapUrMapi_setTabIndex(ur_get(sId + sFocusedNew),0);
	ur_focus(ur_get(sId + sFocusedNew));
	
}
function sapUrMapi_PhaseIndicator_setFocusAttribute(sId,sItemIdx){
	ur_get(sId).setAttribute('focuseditem',sItemIdx);
	sapUrMapi_Focus_showFocusRect();
	e.cancelBubble=true;
}
function sapUrMapi_PhaseIndicator_getFirstVisible(o){
	return o.getAttribute("firstvisible");
}

//** PopupMenu.ie5 **

var mnu = new Object();
mnu.intv = null;
mnu.active = false;
mnu.delay = 250;
mnu.cancel = false;
mnu.mnuWin = null;
mnu.mnuE = null;
var sapPopupMenuLevel = 0;
var menuFontSize;
var subMenus = new Array(null,null,null,null,null,null);
var subMenuItems = new Array(null,null,null,null,null,null);
var initMenus = new Array();
var me = window;
function sapUrMapi_PopupMenu_init(id,e) {
	if (me.menuObject) {
	  sapUrMapi_PopupMenu_exit(id,e);
	}
	if (!me.menuObject) {
	  var items =window.document.getElementById(id).childNodes.item(0).childNodes.item(0).childNodes.item(1).childNodes;
	  var menu = new sapUrMapi_PopupMenu(items);
	  me.menuObject = menu;
    me.menuObject.standalone=true;
  }
}
function sapUrMapi_PopupMenu_exit(id,e) {
	if (e.srcElement.id==id) {
		if (me.menuObject) {
			if (!me.menuObject.standalone) {
			  sapUrMapi_PopupMenu_hideAll();
			  sapUrMapi_PopupMenu_setItemActive(me,-1, id);
		    me.menuObject = null;
		  }
		}
	} else {
		if (me.menuObject) {
			if (me.menuObject.out) {
		    sapUrMapi_PopupMenu_setItemActive(me,-1, id);
		  }
		}
	}
}
function sapUrMapi_PopupMenu_hoverItem(mywindow,id,e) {
	
	var o=mywindow.event.srcElement;
  if(o.parentNode.className=="urMnuDvdr"){
      iIdx = "dvdr"
      sapUrMapi_PopupMenu_setItemActive(mywindow,iIdx, id);
      if (mywindow.mylevel<=sapPopupMenuLevel) {
                  for (var n=mywindow.mylevel+1;n<=sapPopupMenuLevel;n++) {
                       subMenus[n].hide();
                  }
      }
      return;
  }
  if (o.tagName=="IMG" || o.tagName=="NOBR")o=o.parentNode;
	if (o.tagName=="TD") {
	  iIdx = parseInt(o.parentNode.getAttribute("Idx"));
	  if (mywindow.menuObject==null) {
	    sapUrMapi_PopupMenu_init(id,e);
	  }
	  if (mywindow.menuObject.activeItem==iIdx) return;
if(o.getAttribute("isscroll")=="true") {
    mywindow.event.cancelBubble=true;
				iIdx=-1;
    return false;
}
	  sapUrMapi_PopupMenu_setItemActive(mywindow,iIdx, id);
	  if (mywindow.mylevel<=sapPopupMenuLevel) {
	  	for (var n=mywindow.mylevel+1;n<=sapPopupMenuLevel;n++) {
	      subMenus[n].hide();
      }
	  }
	  ur_focus(mywindow.document.body);
	  try {
	  if (mywindow.menuObject.items[mywindow.menuObject.activeItem].getAttribute("dsbl")!="true") {
	    sapUrMapi_PopupMenu_setItemActive(mywindow,"opensub", id);
	  }
		} catch (e) {
		}
	}
	mywindow.event.cancelBubble=true;
}
var oPopup;
function 	sapUrMapi_PopupMenu_hideAll() {
  for (var n=0;n<sapPopupMenuLevel+1;n++) {
	 if (subMenus[n]!=null) {
    subMenus[n].hide();
    }
  }
  if (oPopup) {
    oPopup.hide();
	  if(oPopup.source.object!=null) ur_focus(oPopup.source.object);
	}
  oPopup=null;
  window.document.onmousedown=null;
  sapPopupMenuLevel=0;
}
function 	sapUrMapi_PopupMenu_showMenu(idTrigger,idContent,enumAlignment,e) {
	var styles = document.getElementsByTagName("LINK");
	var arrUrls;
	arrUrls = new Array(ur_system.stylepath+"ur_pop_"+ur_system.browser_abbrev+".css");
  
  for (var i=0;i<subMenus.length;i++) {
  	if (subMenus[i]!=null) {
  		subMenus[i].hide();
  	}
  }
		var menuDiv = ur_get(idContent);
	if (!menuDiv) return;
	if (menuDiv.hasChildNodes() && menuDiv.childNodes[0].tagName=="XMP") {
	  menuDiv.innerHTML=menuDiv.firstChild.innerHTML; 
	}
	sapUrMapi_PopupMenu_drawInit(idContent); 
  oPopup = new sapPopup(window,arrUrls,ur_get(idContent),ur_get(idTrigger),e,0);
  oPopup.onblur=oPopup.hide;
  if (ur_system.direction=="rtl") {
    if (!enumAlignment) enumAlignment= sapPopupPositionBehavior.MENURIGHT
  } else {
    if (!enumAlignment) enumAlignment= sapPopupPositionBehavior.MENULEFT
  }
  oPopup.positionbehavior = enumAlignment;
  oPopup.show();
  document.attachEvent("onmousedown",sapUrMapi_PopupMenu_hideAll);
   
  var items = oPopup.frame.window.document.body.childNodes.item(0).childNodes.item(0).childNodes.item(0).childNodes.item(1).childNodes;
  var menu = new sapUrMapi_PopupMenu(items);
  oPopup.frame.window.menuObject = menu;
  oPopup.frame.window.document.body.onkeydown = menuDiv.childNodes.item(0).onkeydown;
  try {
  if (e.type=="keydown") {
  	sapUrMapi_PopupMenu_setItemActive(oPopup.frame.window,"first", idContent);
  }
  } catch (exc) {}
  sapUrMapi_setTabIndex(oPopup.frame.window.document.body.childNodes.item(0).childNodes.item(0),0);
  ur_focus(oPopup.frame.window.document.body.childNodes.item(0));
try {
  oPopup.frame.window.document.body.childNodes.item(0).childNodes.item(0).fireEvent("onkeypress");
} catch(e) {
}
}
function sapUrMapi_PopupMenu_setItemActive(win,newActive, sId) {
	var remActive = newActive;
	var menuObj=win.menuObject;
	menuObj.out=false;
	if ((newActive=="opensubkey")||(newActive=="opensub")) {
		if (!menuObj.items[menuObj.activeItem]) return;
		var sSubMenuId = menuObj.items[menuObj.activeItem].getAttribute("submenu");
		if ((sSubMenuId!="") && (sSubMenuId!=null)) {
		  if (!oPopup) {
		  	var iStartLevel=-1;
		  } else {
		  	var iStartLevel=win.mylevel;
		  }
		  if (iStartLevel<sapPopupMenuLevel) {
				for (var n=iStartLevel+1;n<sapPopupMenuLevel+1;n++) {
				  if (subMenus[n]!=null) {
  				  subMenus[n].hide();
  		      subMenuItems[n].className = 'urMnuRowOff';
  				}
				}
			  sapPopupMenuLevel=iStartLevel;
			}
			var arrUrls;
			arrUrls = new Array(ur_system.stylepath+"ur_pop_"+ur_system.browser_abbrev+".css");
			if (top.sapPopupStore) {
			  oStore = top.sapPopupStore
			} else {
			  oStore = window.sapPopupStore;
			}
			if (!oPopup) {
			   subwindow = window;
  			 sapPopupMenuLevel = 0;
			} else {
			  subwindow = win;
			  sapPopupMenuLevel = win.mylevel+1;
			}
			var src = menuObj.items[menuObj.activeItem];
			var o = ur_get(sSubMenuId);
			if (o.hasChildNodes() && o.firstChild.tagName=="XMP") {
				o.innerHTML=o.firstChild.innerHTML; 
			}
			sapUrMapi_PopupMenu_drawInit(sSubMenuId, window); 
		  sapUrMapi_PopupMenu_drawInit(sSubMenuId);
			subMenu = new sapPopup(window,arrUrls,o,src,subwindow.event,sapPopupMenuLevel);
	  subMenu.onblur=subMenu.hide;
		  subMenu.positionbehavior = sapPopupPositionBehavior.SUBMENU;
		  subMenu.show();
		  subMenus[sapPopupMenuLevel] = subMenu;
			subMenuItems[sapPopupMenuLevel] = menuObj.items[menuObj.activeItem];
			var items = subMenus[sapPopupMenuLevel].frame.window.document.body.childNodes.item(0).childNodes.item(0).childNodes.item(0).childNodes.item(1).childNodes;
			var menu = new sapUrMapi_PopupMenu(items);
		  subMenus[sapPopupMenuLevel].frame.window.menuObject = menu;
		  subMenus[sapPopupMenuLevel].frame.window.document.body.onkeydown = o.childNodes.item(0).onkeydown;
			
			if (!oPopup) {
				oPopup= subMenus[sapPopupMenuLevel];
			}
			if (win.mylevel>1) {
				sapUrMapi_PopupMenu_setItemActive(subMenus[win.mylevel-1].frame.window,subMenus[win.mylevel-1].frame.window.menuObject.activeItem, sId)
			} else {
				if (!oPopup) {
					sapUrMapi_PopupMenu_setItemActive(subMenus[sapPopupMenuLevel].frame.window,subMenus[sapPopupMenuLevel].frame.window.menuObject.activeItem, sId)
				} else {
					sapUrMapi_PopupMenu_setItemActive(oPopup.frame.window,oPopup.frame.window.menuObject.activeItem, sId)
				}
			}
			if (newActive=="opensubkey") {
				sapUrMapi_PopupMenu_setItemActive(subMenus[sapPopupMenuLevel].frame.window,"first", sId);
		  }
		  sapUrMapi_setTabIndex(subMenus[sapPopupMenuLevel].frame.window.document.body.childNodes.item(0),0);
		  ur_focus(subMenus[sapPopupMenuLevel].frame.window.document.body.childNodes.item(0));
try {
		  subMenus[sapPopupMenuLevel].frame.window.document.body.childNodes.item(0).fireEvent("onkeypress");
} catch(e) {
}
		}
	  return;
	}
	if (newActive=="closesub") {
		if (win.mylevel) {
			subMenus[win.mylevel].hide();
			if (win.mylevel>1) {
				ur_focus(subMenus[win.mylevel-1].frame.window.document.body);
				sapUrMapi_PopupMenu_setItemActive(subMenus[win.mylevel-1].frame.window,subMenus[win.mylevel-1].frame.window.menuObject.activeItem, sId)
			} else {
				ur_focus(oPopup.frame.window.document.body);
				sapUrMapi_PopupMenu_setItemActive(oPopup.frame.window,oPopup.frame.window.menuObject.activeItem, sId)
			}
		}
	  return;
	}
	if (newActive=="first") {
	  newActive=menuObj.activeItem+1;
	  if (newActive>menuObj.items.length-1) newActive=0;
	}
	var bDown = "true";
	if (newActive=="next") {
	  newActive=menuObj.activeItem+1;
		if (newActive>menuObj.items.length-1){
			if (menuObj.items[0].style.display != "none"){
				newActive=0;
			}
			else{
			   newActive = menuObj.items.length-1;
			   return;
			}
		}
	}
	if (newActive=="prev") {
		newActive=menuObj.activeItem-1;
		if (newActive<0){
			if (menuObj.items[menuObj.items.length-1].style.display != "none"){
				newActive=menuObj.items.length-1;
			}
			else{
			   newActive = 0;
			   return;
			}
		}
		bDown = "false";
	}
  if (newActive=="dvdr") {
             if (menuObj.activeItem>-1) {
                  if (menuObj.items[menuObj.activeItem].getAttribute("dsbl")!=null) {
                  menuObj.items[menuObj.activeItem].className="urMnuRowDsbl";
                  } else {
                          menuObj.items[menuObj.activeItem].className="urMnuRowOff";
                  }
             }
             menuObj.activeItem=newActive;
  }
	if ((newActive>-1) || isNaN(newActive)) {
		if (menuObj.activeItem>-1) {
			if (menuObj.items[menuObj.activeItem].getAttribute("dsbl")!=null) {
			  menuObj.items[menuObj.activeItem].className="urMnuRowDsbl";
		  } else {
			  menuObj.items[menuObj.activeItem].className="urMnuRowOff";
		  }
		  if (ur_system.is508) {
		  	with(menuObj.items[menuObj.activeItem]) {
		  	  for (var i=0;i<childNodes.length;i++) {
		  	    if (childNodes.item(i).className=="urMnuTxt") {
		  	    	sapUrMapi_setTabIndex(childNodes.item(i),-1);
		  	    	break;
		  	    }
		  	  }
		  	}
		  }
		}
		menuObj.activeItem =  newActive;
		if (menuObj.activeItem>-1) {
		  while (menuObj.items[menuObj.activeItem].style.display == "none"){
		    sapUrMapi_PopupMenu_manualScroll(win, sId, bDown, true);
		   }
		  	with(menuObj.items[menuObj.activeItem]) {
		  	  for (var i=0;i<childNodes.length;i++) {
		  	    if (childNodes.item(i).className=="urMnuTxt") {
		  	    	sapUrMapi_setTabIndex(childNodes.item(i),0);
		  	    	ur_focus(childNodes.item(i));
		  	    	break;
		  	    }
		  	  }
		  	}
			if (menuObj.items[menuObj.activeItem].getAttribute("dsbl")!=null) {
			  menuObj.items[menuObj.activeItem].className="urMnuRowDsblOn";
		  } else {
			  menuObj.items[menuObj.activeItem].className="urMnuRowOn";
		  }
		}
	} else {
		if (newActive==-1) {
			if (ur_system.is508) {
				if (menuObj) {
					if (menuObj.items) {
				  	for (var j=0;j<menuObj.items.length;j++) {
				 			if (menuObj.items[j]) {
					  		with(menuObj.items[j]) {
						  	  for (var i=0;i<childNodes.length;i++) {
						  	    if (childNodes.item(i).className=="urMnuTxt") {
						  	    	sapUrMapi_setTabIndex(childNodes.item(i),-1);
						  	    	break;
						  	    }
						  	  }
						  	}
					  	}
					  }
					}
				}
		  }
		  if (menuObj) {
			  if (menuObj.items.length>0) {
			  	if (menuObj.items[menuObj.activeItem]) {
						if (menuObj.items[menuObj.activeItem].getAttribute("dsbl")!=null) {
						  menuObj.items[menuObj.activeItem].className="urMnuRowDsbl";
					  } else {
						  menuObj.items[menuObj.activeItem].className="urMnuRow";
					  }
					}
				}
			}
		}
	}
}
function sapUrMapi_PopupMenu(items) {
	this.activeItem = -1;
	this.items = new Array();
	for (var i=0;i<items.length;i++) {
		if (items.item(i).childNodes.item(0).className!="urMnuDvdr") {
			this.items[this.items.length]=items.item(i);
			this.items[this.items.length-1].setAttribute("Idx",this.items.length-1);
		}
	}
	return this;
}
function sapUrMapi_PopupMenu_keyDown(mywindow,id,e) {
	if (e.keyCode==27) {
		if (mywindow.menuObject) {
			if (me.menuObject) {
				if (me.menuObject.standalone) {
					sapUrMapi_PopupMenu_exit(id,e);
			    ur_focus(me.menuObject.items[me.menuObject.activeItem].parentNode.parentNode.parentNode);
				  hidePopupMenu();
			  } else {
				  ur_focus(oPopup.source.object);
				  hidePopupMenu();
			  }
			} else {
			  ur_focus(oPopup.source.object);
			  hidePopupMenu();
			}
		}
		return;
	}
	if (e.keyCode==40) { 
	  sapUrMapi_PopupMenu_setItemActive(mywindow,"next", id);
	}
	if (e.keyCode==38) { 
	  sapUrMapi_PopupMenu_setItemActive(mywindow,"prev", id);
	}
	if (e.keyCode==39) { 
	  if (ur_system.direction == "rtl") {
	    sapUrMapi_PopupMenu_setItemActive(mywindow,"closesub", id);
	  } else {
	    sapUrMapi_PopupMenu_setItemActive(mywindow,"opensubkey", id);
	  }
    }
	if (e.keyCode==37) { 
	  if (ur_system.direction == "rtl") {
	    sapUrMapi_PopupMenu_setItemActive(mywindow,"opensubkey", id);
	  } else {
	    sapUrMapi_PopupMenu_setItemActive(mywindow,"closesub", id);
	  }
	}
	if (e.keyCode==13) { 
		var item=mywindow.menuObject.items[mywindow.menuObject.activeItem];
		if (item.onclick) {
			item.onclick();
		}
	}
	if (e.keyCode!=9) {
	  e.cancelBubble=true;
	  e.returnValue=false;
	} else {
		if (mywindow.menuObject) {
			mywindow.menuObject.out=true;
		}
		if(oPopup.source.object!=null) ur_focus(oPopup.source.object);
		hidePopupMenu();
	  e.cancelBubble=false;
	  e.returnValue=true;
	}
	return false;
}
function sapUrMapi_PopupMenu_ExecuteLink(id) {
  oItem = window.document.getElementById(id);
  sTarget = oItem.target;
  sHref   = oItem.href;
  oTarget = top.frames[sTarget];
  if (oTarget) {
  	oTarget.location.href=sHref;
  } else {
    window.open(sHref,sTarget,"");
  }
}
function sapUrMapi_PopupMenu_RegisterCreate(sId) {
	sapUrMapi_Create_AddItem(sId, "sapUrMapi_PopupMenu_drawInit('" + sId + "')");
}
function sapUrMapi_PopupMenu_drawInit( sId, oSubWindow ){
	if (typeof(initMenus[sId])!="undefined" && initMenus[sId].windowHeight==window.document.body.clientHeight) {
	  return;
	}
	var tbl = null;
	if (!oSubWindow) {
	  tbl = window.document.getElementById(sId+"-r");
	}
	else {
	  tbl = oSubWindow.document.getElementById(sId+"-r");
	}
	if (typeof(tbl)=="undefined" || tbl==null)  {
 		tbl=oSubWindow.document.getElementById(sId).childNodes.item(0).childNodes.item(0);
 		if (tbl.tagName=="TABLE") {
 		  	tbl.setAttribute("id",sId+"-r");
 		} else {
 			tbl=null;
 		}
 	}
	
	if (typeof(tbl)=="undefined" || tbl==null)  {
	return;
	}
	
	if (tbl.offsetWidth == 0){
	return;
	}
	var rows = tbl.childNodes.item(1).rows;
	var visIdx = tbl.getAttribute("visidx") - 0;
    var visCnt = tbl.getAttribute("viscnt") - 0;
    var actVisCnt = visCnt;
    var oldActVisCnt = tbl.getAttribute("actviscnt") - 0;
	var maxVisCnt = rows.length - visIdx;
	if (visCnt == 0){
		
		return false;
	}
	if (visCnt > maxVisCnt) {
	    
		visCnt = maxVisCnt;
		tbl.setAttribute("viscnt", visCnt);
	}
	tbl.width = tbl.offsetWidth;
    tbl.style.width = tbl.offsetWidth + "px";
	
	var maxHt = window.document.body.clientHeight;
	var mnuHt = tbl.offsetHeight;
	var btnHt = tbl.childNodes.item(0).rows(0).offsetHeight + tbl.childNodes.item(2).rows(0).offsetHeight;
	var visBtns = true;
	var menuProps = new Array();
	var firsttime = false;
	if (typeof(initMenus[sId])=="undefined") {
	  for (var i = 0; i < rows.length; i++){
        for (var z = 0; z < rows(i).cells.length; z++){
			rows(i).cells(z).width = rows(i).cells(z).offsetWidth;
            rows(i).cells(z).style.width = rows(i).cells(z).offsetWidth +"px";
        }
      }
	  menuProps["windowHeight"] = maxHt;
	  menuProps["menuHeight"]= mnuHt;
	  menuProps["buttonHeight"] = btnHt;
	  menuProps["itemHeight"] = rows(0).offsetHeight;
	  initMenus[sId]=menuProps;
	  oldActVisCnt = visCnt;
	  firsttime=true;
	} else {
	  initMenus[sId].windowHeight=maxHt;
	}
	if (typeof(menuFontSize)=="undefined") {
	  menuFontSize = rows(0).cells(0).currentStyle.fontSize;
	}
	
	if ((visIdx == 0) && (visCnt >= rows.length)) {
	  if (firsttime) {
	    if (maxHt > mnuHt){
	      tbl.setAttribute("actviscnt", actVisCnt);
		  
		  for (var i = 0; i < rows.length; i++){
			if (rows(i).cells(0).className == "urMnuDvdr"){
				rows(i).cells(0).style.fontSize="5px";
			}
		  visBtns = false;
		  }
	    } else {
	      tbl.childNodes.item(0).style.display = "";
		  tbl.childNodes.item(2).style.display = "";
		}
	  } else {
		if (oldActVisCnt >= rows.length) {   
											 
		  if (maxHt > initMenus[sId].menuHeight){ return; }
		  else {
		    tbl.childNodes.item(0).style.display = "";
		    tbl.childNodes.item(2).style.display = "";
		    
		    for (var i = 0; i < rows.length; i++){
			  if (rows(i).cells(0).className == "urMnuDvdr"){
				rows(i).cells(0).style.fontSize = menuFontSize;
			  }
		    }
		  }
		} else {							
											
		  if (maxHt > initMenus[sId].menuHeight) {
		    tbl.childNodes.item(0).style.display = "none";
		    tbl.childNodes.item(2).style.display = "none";
		    tbl.setAttribute("actviscnt", actVisCnt);
		    
		    for (var i = 0; i < rows.length; i++){
			  if (rows(i).cells(0).className == "urMnuDvdr"){
			 	rows(i).cells(0).style.fontSize="5px";
			  }
			visBtns=false;
		    }
		  }
		}
      }
	}
	mnuHt = 0 + tbl.childNodes.item(0).rows(0).offsetHeight + tbl.childNodes.item(2).rows(0).offsetHeight;
	var n;
	actVisCnt = Math.floor((maxHt-mnuHt)/initMenus[sId].itemHeight);
	if (actVisCnt <= 0) actVisCnt=1;
	if (actVisCnt > visCnt) actVisCnt=visCnt;
	var upOn = false;
	var dnOn = false;
	if (firsttime) {
	  
	  for (n=0; n<visIdx; n++) rows(n).style.display = "none";
	  
	  for (n=visIdx+actVisCnt; n<rows.length; n++) rows(n).style.display = "none";
	}
	if (visIdx>0) upOn = true;
	
	
    if (actVisCnt < oldActVisCnt) {
      for (n= visIdx+actVisCnt; n<visIdx+oldActVisCnt; n++)
           rows(n).style.display = "none";
	} else {
	  for (n= visIdx+oldActVisCnt; n<visIdx+actVisCnt; n++)
           rows(n).style.display = "";
    }
    if (visIdx+actVisCnt < rows.length) dnOn = true;
    if ((actVisCnt!=oldActVisCnt) || (firsttime))
      tbl.setAttribute("actviscnt", actVisCnt);
	
	if (visBtns) {
	  if (!oSubWindow) {
	    sapUrMapi_PopupMenu_setButtons( sId, false, upOn );
	    sapUrMapi_PopupMenu_setButtons( sId, true, dnOn );
	  } else {
		sapUrMapi_PopupMenu_setButtons( sId, false, upOn, oSubWindow );
		sapUrMapi_PopupMenu_setButtons( sId, true, dnOn, oSubWindow );
	  }
    }
}
function sapUrMapi_PopupMenu_timeScroll(oWindow, sId, bDown, bCancel, e) {
    
    mnu.mnuWin = oWindow;
    mnu.mnuWin.event.cancelBubble = true;
    if (bCancel & mnu.intv == null){
        mnu.active = false;
        return false;
    }
    else if (bCancel){
        mnu.cancel = true;
        mnu.mnuWin.parent.clearInterval(mnu.intv);
        mnu.intv = null;
        
        if (mnu.active == false){
            sapUrMapi_PopupMenu_scrollItem(sId, bDown);
        }
        mnu.active = false;
    }
    else{
        mnu.cancel = false;
		mnu.intv = mnu.mnuWin.parent.setInterval("sapUrMapi_PopupMenu_scrollItem('" + sId + "', '" + bDown + "')", mnu.delay);
    }
}
function sapUrMapi_PopupMenu_manualScroll(oWindow, sId, bDown, bCancel, e ){
    
    mnu.mnuWin = oWindow;
    mnu.mnuWin.event.cancelBubble = true;
	if (bCancel){
        mnu.cancel = true;
        mnu.mnuWin.parent.clearInterval(mnu.intv);
        mnu.intv = null;
        
        if (mnu.active == false){
            sapUrMapi_PopupMenu_scrollItem(sId, bDown);
        }
        mnu.active = false;
	}
	else{
	   return false;
	}
}
function sapUrMapi_PopupMenu_scrollItem(sId, bDown) {
    mnu.active = true;
    
	var tbl = mnu.mnuWin.document.getElementById(sId+"-r");
    var tbody = tbl.childNodes.item(1);
    
    var rIdx = tbl.getAttribute("visidx") - 0;
    var visCnt = tbl.getAttribute("actviscnt") - 0;
    
    if (bDown == "true"){
        if ((rIdx + visCnt) >= tbody.rows.length){
            mnu.cancel = true;
        }
        else{
            tbody.rows(rIdx).style.display = "none";
			tbody.rows(rIdx + visCnt).style.display = "";
            ++rIdx;
            tbl.setAttribute("visidx", rIdx);
            mnu.cancel = false;
        }
    }
    else{
       if (rIdx <= 0){
           mnu.cancel = true;
       }
       else{
           tbody.rows(rIdx + visCnt - 1).style.display = "none";
           --rIdx;
		   tbody.rows(rIdx).style.display = "";
           tbl.setAttribute("visidx", rIdx);
           mnu.cancel = false;
       }
    }
    
    if(mnu.cancel){
        mnu.mnuWin.parent.clearInterval(mnu.intv);
        mnu.intv = null;
        return;
    }
    else{
       
       if ((rIdx + visCnt - 0) >= tbody.rows.length){
           sapUrMapi_PopupMenu_setButtons(sId, true, false);
       }
       else{
           sapUrMapi_PopupMenu_setButtons(sId, true, true);
       }
       if (rIdx - 0 <= 0){
          sapUrMapi_PopupMenu_setButtons(sId, false, false);
       }
       else{
          sapUrMapi_PopupMenu_setButtons(sId, false, true);
       }
    }
}
function sapUrMapi_PopupMenu_setButtons( sId, bUp, bOn, oMenuWin ){
    var x;
    var node;
    (bUp)? x = 2 : x = 0;
		try {
			if (oMenuWin) {
				node = oMenuWin.document.getElementById(sId+"-r").childNodes.item(x).childNodes.item(0).childNodes.item(0);
			} else {
	        if (mnu.mnuWin != null){
	         node = mnu.mnuWin.document.getElementById(sId+"-r").childNodes.item(x).childNodes.item(0).childNodes.item(0);
	        } else {
						node = window.document.getElementById(sId+"-r").childNodes.item(x).childNodes.item(0).childNodes.item(0);
	        }
			}
			if (!bOn){
			  node.className = node.className.split("Dsbl")[0] + "Dsbl";
			} else {
				node.className = node.className.split("Dsbl")[0];
			}
		}
		catch(e){
		}
}
function sapUrMapi_PopupMenuItem_setDisabled( sPopupMenuId, iIdx){
  var tbl = window.document.getElementById(sPopupMenuId+"-r");
	if (isNaN(iIdx)) { return; }
	var rows = tbl.childNodes.item(1).rows;
	rows(iIdx).className="urMnuRowDsbl";
	rows(iIdx).setAttribute("dsbl","true");
	rows(iIdx).cells(1).oldTitle=rows(iIdx).cells(1).title;
  rows(iIdx).cells(1).title=getLanguageText("SAPUR_POPUP_ITEM_WHL_DISABLED",new Array(rows(iIdx).cells(1).innerText,"SAPUR_POPUP_ITEM_DISABLED"))
}
function sapUrMapi_PopupMenuItem_setEnabled( sPopupMenuId, iIdx){
  var tbl = window.document.getElementById(sPopupMenuId+"-r");
	if (isNaN(iIdx)) { return; }
	var rows = tbl.childNodes.item(1).rows;
	rows(iIdx).className="urMnuRowOff";
	rows(iIdx).setAttribute("dsbl","false");
	rows(iIdx).cells(1).title=rows(iIdx).cells(1).oldTitle;
}
var ur_replace_function=false;
var ur_replace_function_button_id="";
function sapUrMapi_ToolbarButton_openMenu( sButtonId, e){
	var sPopupId=document.getElementById(sButtonId+"-r").getAttribute("popup");
	if (document.getElementById(sPopupId)==null) return;
	if (document.getElementById(sButtonId+"-r").getAttribute("replaceable")=="true") {
	  ur_replace_function=true;
	  ur_replace_function_button_id=sButtonId;
	}
	if ((e.type!="click")&&(e.type!="contextmenu")) {
		if (!sapUrMapi_checkKey(e,"keypress",new Array("32","40"))) {
	    e.cancelBubble=true;
	    e.returnValue=true;
		  return false;
		}
	}
	if (ur_system.direction=="rtl")
 	  sapUrMapi_PopupMenu_showMenu(sButtonId+"-r",sPopupId,sapPopupPositionBehavior.MENULEFT,e);
 	else
 	  sapUrMapi_PopupMenu_showMenu(sButtonId+"-r",sPopupId,sapPopupPositionBehavior.MENURIGHT,e);
  e.cancelBubble=false;
	if ((e.type=="contextmenu")) {
    e.returnValue=false;
  } else {
    e.returnValue=true;
  }
}
function sapUrMapi_PopupMenu_selectItem(oWnd,sItemId,bChecked,oEvt) {
   oWnd.me.sapUrMapi_ToolbarButton_setFunctionFromMenuItem(sItemId);  
   oWnd.me.sapUrMapi_PopupMenu_hideAll();
   sapUrMapi_cancelEvent(oEvt);
}

//** PopupTrigger.ie5 **

function sapUrMapi_PopupTrigger_hover(sId,bIn,e) {
	if (bIn || e.type=="mouseover"){
		document.getElementById(sId).className = "urPopUpTrgWhl urPopUpTrgInd";
		if (e.type=="focus") {
	      document.getElementById(sId).setAttribute("opened","false");
	      document.getElementById(sId).setAttribute("focused","true");
	    }
	} 
if(bIn==false || e.type=="mouseout"){
   	if (document.getElementById(sId).getAttribute("opened")!="true"){
		  if (document.getElementById(sId).getAttribute("focused")=="true"){
		  } else {
		    document.getElementById(sId).className = "urPopUpTrgWhl";
		  }
		  if (e.type=="blur") {
		    document.getElementById(sId).setAttribute("focused","false");
		    document.getElementById(sId).className = "urPopUpTrgWhl";
		  }
		}
  }
  e.cancelBubble=true;
  e.returnValue=true;
}
function sapUrMapi_PopupTrigger_openMenu(sId,sMenuId,e) {
	var o=ur_get(sId);
	var bOpen=false;
	var eConMenu=false;
	var eClick=false;
	
	if(ur_system.is508 ) var oChild=sapUrMapi_findFirstFocus(o);
	if(oChild) var sChildId=oChild.getAttribute("id");
	else var sChildId=sId;
	
	var oBtn=ur_get(sId+"-btn");
	if((o && o.oncontextmenu) || (oBtn && oBtn.oncontextmenu)) {
	  eConMenu=true;
	  eClick=true;
	}
	if (sapUrMapi_checkKey(e,"keydown",new Array("121")) && eConMenu==true){
		bOpen=true;
	} else if (e.altKey && sapUrMapi_checkKey(e,"keydown",new Array("40")) && eClick==true){
		bOpen=true;
	} else if(e.type=="contextmenu" ||e.type=="click") {
		bOpen=true;
	}else if(sapUrMapi_checkKey(e,"keydown",new Array("115"))) {
		bOpen=true;
	}else if(e.keyCode==32 && e.srcElement.getAttribute("id").indexOf("_selmenu")>-1){
		bOpen=true;
		e.cancelBubble=true;
	}
	
	if (bOpen) {
		if (ur_system.direction=="rtl")
		  sapUrMapi_PopupMenu_showMenu(sChildId,sMenuId,sapPopupPositionBehavior.MENULEFT,e);
		else
	 	  sapUrMapi_PopupMenu_showMenu(sChildId,sMenuId,sapPopupPositionBehavior.MENURIGHT,e);
		  if (sapUrMapi_checkKey(e,"keydown",new Array("115","121")))return ur_EVT_cancel(e);
		  if (e.type=="contextmenu") {
		      e.returnValue=false;
		    } else {
			  ur_EVT_cancelBubble(e);
		      e.returnValue=true;
		    }  
	}    
}
function sapUrMapi_PopupTrigger_RegisterCreate(sId) {
	sapUrMapi_Create_AddItem(sId, "sapUrMapi_PopupTrigger_init('" + sId + "')");
}
function sapUrMapi_PopupTrigger_init(sId){
	   var value = document.getElementById(sId).firstChild.style.width;
	   var percent = value.lastIndexOf('%');
	   if(percent < 3 && percent > -1)
	   {
	     document.getElementById(sId).style.width = value;
	     document.getElementById(sId).firstChild.style.width = '100%';
	   }
}

//** RadioButton.ie5 **

function sapUrMapi_RadioButton_registerCreate(sId) {
	sapUrMapi_Create_AddItem(sId, "sapUrMapi_RadioButton_create('"+sId+"')");
}
function sapUrMapi_RadioButton_create(sId) {
	var o=ur_get(sId);
	if(o==null || !o.checked ) return;
	o.checked=false;
	o.checked=true;
}
function sapUrMapi_RadioButton_toggle(sId,e) {
	if(e.type=="keydown" && (e.ctrlLeft || e.ctrlRight)) return;
  var oIn=ur_get(sId);
  if (oIn.disabled) return false;
  var oInGrp=new Array();
  if(oIn.name!="") 
		oInGrp=document.getElementsByName(oIn.name);
	else
		oInGrp[0]=oIn;
  oIn.checked = true;
  ur_focus(oIn);
  for(var i=0;i<oInGrp.length;i++){
	  var oImg = ur_get(oInGrp[i].id+"-img");
	  if(oImg==null) continue;
	  if(oInGrp[i].checked ){ 
			if(oImg.className.indexOf("Chk")<0)
				oImg.className=oImg.className.replace("urImgRbgImg","urImgRbgImgChk");
    }
	  else {
	  	if (!oInGrp[i].disabled) {
	  	  oImg.className=oImg.className.replace("urImgRbgImgChk","urImgRbgImg");
	  	} else {
	  		if(oImg.className.indexOf("Dsbl")<0)
	  			oImg.className=oImg.className.replace("urImgRbgImg","urImgRbgImgDsbl");
	  	}
	  }
  }
  sapUrMapi_Focus_showFocusRect(sId);
  return true;
}
function sapUrMapi_RadioButton_setDisabled(sId) {
  var oIn=ur_get(sId);
  var oImg=ur_get(sId+"-img");
  oIn.disabled=true;
	if(oImg.className.indexOf("Chk")>=0){ 
		if(oImg.className.indexOf("Dsbl")<0)
			oImg.className=oImg.className.replace("urImgRbgImgChk","urImgRbgImgChkDsbl");
	}
	else{ 
		if(oImg.className.indexOf("Dsbl")<0)
			oImg.className=oImg.className.replace("urImgRbgImg","urImgRbgImgDsbl");
	}
	ur_setDisabled(oIn,true);
	sapUrMapi_Label_setDisabled(sapUrMapi_Label_getInputLabel(sId));
	if(ur_system.is508)
		sapUrMapi_setTabIndex(oImg,"0");
	
}
function sapUrMapi_RadioButton_setEnabled(sId) {
  var oIn=ur_get(sId);
  oIn.disabled=false;
	var oImg=ur_get(sId+"-img");
	if (oImg.className.indexOf("Chk")>=0) 
		oImg.className=oImg.className.replace("urImgRbgImgChkDsbl","urImgRbgImgChk");
	else
		oImg.className=oImg.className.replace("urImgRbgImgDsbl","urImgRbgImg");
	ur_setDisabled(oIn,false);
	sapUrMapi_Label_setEnabled(sapUrMapi_Label_getInputLabel(sId));
	if(ur_system.is508)
		sapUrMapi_setTabIndex(oImg,"-1");	
}
function sapUrMapi_RadioButton_setReadonly(sId,bSet){
  var oIn=ur_get(sId);
	var oImg=ur_get(sId+"-img");
	if(bSet){
		if (oImg.className.indexOf("Chk")>=0){ 
			if(oImg.className.indexOf("Dsbl")<0)
				oImg.className=oImg.className.replace("urImgRbgImgChk","urImgCbgImgChkDsbl");
		}
		else{ 
			if(oImg.className.indexOf("Dsbl")<0)
				oImg.className=oImg.className.replace("urImgRbgImg","urImgRbgImgDsbl");
		}
		oIn.disabled=true;	
		ur_setReadonly(oIn,true);
		if(ur_system.is508)
			sapUrMapi_setTabIndex(oImg,"0");
		
	}
	else{
		if (oImg.className.indexOf("Chk")>=0) 
			oImg.className=oImg.className.replace("urImgRbgImgChkDsbl","urImgRbgImgChk");
		else 
			oImg.className=oImg.className.replace("urImgRbgImgDsbl","urImgRbgImg");
		oIn.disabled=false;	
		ur_setReadonly(oIn,false);
		if(ur_system.is508)
			sapUrMapi_setTabIndex(oImg,"-1");			
	}
	sapUrMapi_Label_setEnabled(sapUrMapi_Label_getInputLabel(sId));
}
function sapUrMapi_RadioButton_focus(sId,oEvt) {
	if(ur_system.is508) {
		var o=ur_get(sId);
		var oImg=ur_get(sId+"-img");
		o.title=ur_getTooltip(sId);
		oImg.title=o.title;
	}
	sapUrMapi_DataTip_show(sId,"focus");
}
function sapUrMapi_RadioButton_blur(sId,oEvt) {
	sapUrMapi_DataTip_hide(sId);
}
function sapUrMapi_RadioButton_keydown(sId,oEvt) {
  var iKey=oEvt.keyCode;	
  if(iKey==37)
		iKey==ur_system.direction!="rtl"?37:39;
	else if(iKey==39)
		iKey==ur_system.direction!="rtl"?39:37;
	
	if(oEvt.keyCode == "81" && oEvt.ctrlKey ){
		if (sapUrMapi_DataTip_isOpen(sId)) sapUrMapi_DataTip_hide(sId);
		else sapUrMapi_DataTip_show(sId,"keydown");
		return sapUrMapi_cancelEvent(oEvt);
	}
	
	
	if(oEvt.keyCode == "27"){
		sapUrMapi_DataTip_hide(sId);
		return sapUrMapi_cancelEvent(oEvt);		
	}
	
	
	if(iKey==37 || iKey==38){		 
		var oIn=ur_get(sId);
		if (oIn.parentNode.parentNode.className.indexOf("urST")>-1) return;
  	if(!(oIn.disabled || oEvt.ctrlKey)) return;
		var oInGrp=document.getElementsByName(oIn.name);
		for(var i=0; i<oInGrp.length;i++)
			if(oInGrp[i]==oIn) break;
		if(i>0) i-=1;
		if(oInGrp[i].disabled) oIn=ur_get(oInGrp[i].id+"-img");
		else oIn=oInGrp[i];
		ur_focus(oIn);
		sapUrMapi_Focus_showFocusRect(oIn.id);
		return sapUrMapi_cancelEvent(oEvt);
	}
	
	if(iKey==39 || iKey==40){
		var oIn=ur_get(sId);
		if (oIn.parentNode.parentNode.className.indexOf("urST")>-1) return;
		if(!(oIn.disabled || oEvt.ctrlKey)) return;
		var oInGrp=document.getElementsByName(oIn.name);
		for(var i=0; i<oInGrp.length;i++)
			if(oInGrp[i]==oIn) break;
		if(i<oInGrp.length-1) i+=1;
		if(oInGrp[i].disabled) oIn=ur_get(oInGrp[i].id+"-img");
		else oIn=oInGrp[i];
		ur_focus(oIn);
		sapUrMapi_Focus_showFocusRect(oIn.id);
		return sapUrMapi_cancelEvent(oEvt);
	}		
}

//** RoadMap.ie5 **

function sapUrMapi_RoadMap_hoverEdges(sId,sEdgeName,sBool,e){
	var oMore=document.getElementById(sId + '-itm-' + sEdgeName).childNodes.item(0);
	if(sBool=='true' && sEdgeName=='end'){
		oMore.className='urRMMoreAfterHover';
	}
	if(sBool=='false' && sEdgeName=='end'){
		oMore.className='urRMMoreAfter';
	}
	if(sBool=='true' && sEdgeName=='start'){
			oMore.className='urRMMoreBeforeHover';
	}
	if(sBool=='false' && sEdgeName=='start'){
		oMore.className='urRMMoreBefore';
	}
}
function sapUrMapi_RoadMap_hoverStep(sId,sStepNr,sBool,sStepDesign){
		var oStep=document.getElementById(sId + '-itm-' + sStepNr).childNodes.item(0).childNodes.item(0).childNodes.item(0).childNodes.item(1);
		var oStepName=document.getElementById(sId + '-itm-' + sStepNr).childNodes.item(1);
	if(oStepName.className != "urRMNoItem"){
		if(sBool=="true"){
			oStepName.className='urRMStepItem urRMItemHover';
			}else{
				oStepName.className='urRMStepItem';
			}
	}
	if(sStepDesign=='default'){
			if(sBool=='true'){
				oStep.className='urRMStep urRMStepStd urRMStepHover';
			}else{
				oStep.className='urRMStep urRMStepStd';
			}
		}
	if(sStepDesign=='rtstart'){
			if(sBool=='true'){
				oStep.className='urRMStep urRMRoundTripStart urRMRoundTripStartHover';
			}else{
				oStep.className='urRMStep urRMRoundTripStart';
			}
		}
	if(sStepDesign=='rtend'){
			if(sBool=='true'){
				oStep.className='urRMStep urRMRoundTripEnd urRMRoundTripEndHover';
			}else{
				oStep.className='urRMStep urRMRoundTripEnd';
			}
		}
	if(sStepDesign=='rt'){
			if(sBool=='true'){
				oStep.className='urRMStep urRMRoundTrip urRMRoundTripHover';
			}else{
				oStep.className='urRMStep urRMRoundTrip';
			}
		}
	if(sStepDesign=='sub'){
			if(sBool=='true'){
				oStep.className='urRMSubStep urRMSubStepHover';
			}else{
				oStep.className='urRMSubStep';
			}
		}
}
function sapUrMapi_RoadMap_getSelected(sId)
{
	var iItemCount=parseInt(document.getElementById(sId).getAttribute('stepamount'));
	var iItemSel=parseInt(document.getElementById(sId).getAttribute('selectedstep'));
	var bHasSelItem=false;
	
	if(isNaN(iItemSel)){
		for(i=0; i <= iItemCount; i++)
		{
			if(document.getElementById(sId + '-itm-' + i).getAttribute('sel')=='true')
			  {
				document.getElementById(sId).setAttribute('selectedstep',i);
				document.getElementById(sId).setAttribute('focusedstep',i);
				bHasSelItem=true;
				break;
			  }
		 }
		 if(bHasSelItem==false){
		 	for(i=0; i <= iItemCount; i++){
			 	if(document.getElementById(sId+"-itm-"+i)){
					document.getElementById(sId).setAttribute('selectedstep',i);
					sapUrMapi_setTabIndex(document.getElementById(sId + '-itm-'+i),0);
					break;
				}
		 	}
		 }
	}
}
function sapUrMapi_RoadMap_focusSelected(sId,e){
  var iSelected=parseInt(document.getElementById(sId).getAttribute('selectedstep'));
	if(e.keyCode==39 || e.keyCode==37){
			if (isNaN(iSelected)) {
				if (document.getElementById(sId).getAttribute('stepamount')!="0") {
					sapUrMapi_setTabIndex(document.getElementById(sId + '-itm-0'),0);
					ur_focus(document.getElementById(sId + '-itm-0'));
				} 
			} else {
				sapUrMapi_setTabIndex(document.getElementById(sId + '-itm-' + iSelected),0);
				ur_focus(document.getElementById(sId + '-itm-' + iSelected));
		}
	}
	if(e.keyCode==9){
		if (isNaN(iSelected)) {
			if (document.getElementById(sId).getAttribute('stepamount')!="0") {
				sapUrMapi_setTabIndex(document.getElementById(sId + '-itm-0'),-1);
			} 
		} else {
			sapUrMapi_setTabIndex(document.getElementById(sId + '-itm-' + iSelected),-1);
			}
		}
	}
function sapUrMapi_RoadMap_keydownStep(sId,sStepName,e){
	sapUrMapi_RoadMap_keydown(sId,sStepName,e);
}
function sapUrMapi_RoadMap_keydownEdge(sId,sStepName,e){
	sapUrMapi_RoadMap_keydown(sId,sStepName,e);
}
function sapUrMapi_RoadMap_keydown(sId,sStepName,e){
	var iItemCount=parseInt(document.getElementById(sId).getAttribute('stepamount'));
	var iItemFocus=parseInt(document.getElementById(sId).getAttribute('focusedstep'));
	var iSelected=parseInt(document.getElementById(sId).getAttribute('selectedstep'));
	var oStart=document.getElementById(sId + '-itm-start').childNodes.item(0);
	var oEnd=document.getElementById(sId + '-itm-end').childNodes.item(0);
	if(sStepName != 'start' && sStepName != 'end'){
		var iStepIdx=parseInt(sStepName);
	   }
		if(oStart.className=='urRMMoreBefore' || oStart.className=='urRMMoreBeforeDsbl'){
		var bMoreBefore=true;
		}else{
		var bMoreBefore=false;
		}
		if(oEnd.className=='urRMMoreAfter' || oEnd.className=='urRMMoreAfterDsbl'){
		var bMoreAfter=true;
		}else{
		var bMoreAfter=false;
		}
	var sStep='-itm-';
	var sStep0=sStep + '0'
	var sLastStep=sStep + iItemCount	
	var sFocusStep=sStep + iStepIdx;        
	var sNextStep=sStep + (iStepIdx + 1);  
	var sPrevStep=sStep + (iStepIdx - 1); 
	var sStart='start';
	var sEnd='end';
	
	
	if(e.keyCode==39) {
	  if (ur_system.direction=="rtl") {
	    
	    if (iStepIdx > 0){
	       sapUrMapi_RoadMap_setFocus(sId,sFocusStep,sPrevStep);
	    }
	    
	    if (sStepName==sEnd){
	       sapUrMapi_RoadMap_setFocus(sId,(sStep + sEnd),sLastStep);
	    }
	    
	    if(sStepName==0 && bMoreBefore==true){
	      sapUrMapi_RoadMap_setFocus(sId,sStep0,(sStep + sStart));
	    }
	  } else {
	    
	    if (sStepName < iItemCount){
	       sapUrMapi_RoadMap_setFocus(sId,sFocusStep,sNextStep);
	    }
	    
		if (iStepIdx==iItemCount && bMoreAfter==true){
		   sapUrMapi_RoadMap_setFocus(sId,sLastStep,(sStep + sEnd));
	    }
	    
	    if (sStepName==sStart){
	       sapUrMapi_RoadMap_setFocus(sId,(sStep + sStart),sStep0);
	    }
	  }
	}
	
	
	if(e.keyCode==37) {
	  if (ur_system.direction=="rtl") {
	    
	    if (iStepIdx < iItemCount){
	       sapUrMapi_RoadMap_setFocus(sId,sFocusStep,sNextStep);
	    }
	    
		if (iStepIdx==iItemCount && bMoreAfter==true){
		   sapUrMapi_RoadMap_setFocus(sId,sLastStep,(sStep + sEnd));
	    }
	    
	    if (sStepName==sStart){
	       sapUrMapi_RoadMap_setFocus(sId,(sStep + sStart),sStep0);
	    }
	  } else {
	    
	    if (iStepIdx > 0){
	       sapUrMapi_RoadMap_setFocus(sId,sFocusStep,sPrevStep);
	    }
	    
	    if (sStepName==sEnd){
	       sapUrMapi_RoadMap_setFocus(sId,(sStep + sEnd),sLastStep);
	    }
	    
	    if(iStepIdx==0 && bMoreBefore==true){
	      sapUrMapi_RoadMap_setFocus(sId,sStep0,(sStep + sStart));
	    }
	  }
	}
	
	if(e.keyCode==9 && iSelected != iItemFocus){
		if(sStepName != sStart && sStepName != sEnd){
	   		sapUrMapi_RoadMap_setFocus(sId,(sStep + iItemFocus),(sStep + iSelected));
		}
		if(sStepName == sStart){
			sapUrMapi_RoadMap_setFocus(sId,(sStep + sStart),(sStep + iSelected));
		}
		if(sStepName == sEnd){
	   		sapUrMapi_RoadMap_setFocus(sId,(sStep + sEnd),(sStep + iSelected));
		}
	 }
	 
	 if(e.keyCode==32){
	 sapUrMapi_triggerClick(e,new Array('32'));
	 }
	   e.cancelBubble=true;
	 if (e.keyCode==39 || e.keyCode==37) e.returnValue=false;
}
function sapUrMapi_RoadMap_setFocus(sId,sOldStep,sNewStep){
	sapUrMapi_setTabIndex(document.getElementById(sId + sOldStep),-1);
	sapUrMapi_setTabIndex(document.getElementById(sId + sNewStep),0);
	ur_focus(document.getElementById(sId + sNewStep));
}
function sapUrMapi_RoadMap_setFocusStep(sId,iStepIdx,e){
	sapUrMapi_RoadMap_setFocusIdx(sId,iStepIdx,e);
}
function sapUrMapi_RoadMap_setFocusEdge(sId,iStepIdx,e){
	sapUrMapi_RoadMap_setFocusIdx(sId,iStepIdx,e);
}
function sapUrMapi_RoadMap_setFocusIdx(sId,iStepIdx,e){
	document.getElementById(sId).focusedstep=iStepIdx;
	e.cancelBubble=true;
}

//** SapTable.ie5 **

function sapUrMapi_SapTable_getClickedRowIndex(e)
{
   var o=ur_evtSrc(e);
   while (o!=null && o.getAttribute("rr")==null) o=o.parentElement;
   if(o==null) return;
   try {
     var iRIdx=parseInt(o.rr); 
     if (isNaN(iRIdx)) return null;
     else return iRIdx;
   } catch (e) {
     return null;
   }
}
function sapUrMapi_SapTable_getClickedColIndex(e)
{
   var o=ur_evtSrc(e);
   while (o!=null && o.getAttribute("cc")==null) o=o.parentElement;
   if(o==null) return;
   try {
     var iCIdx=parseInt(o.cc);
     if (isNaN(iCIdx)) return null;
     else return iCIdx;
   } catch (e) {
     return null;
   }
}
function sapUrMapi_SapTable_getClickedCellId(e)
{
   var o=ur_evtSrc(e);
   while ( o!=null && o.getAttribute("cc")==null ) o=o.parentElement;
   if(o==null) return;
   try {
     var sId=o.id;
     return sId;
   } catch (e) {
     return null;
   }
}
function sapUrMapi_SapTable_getClickedRow(sTableId,e) {
   var idx=sapUrMapi_SapTable_getClickedRowIndex(e);
   if(idx==null) return;
   return sapUrMapi_SapTable_getRow(sTableId,idx);
}
function sapUrMapi_SapTable_getRow(sTableId, iRowIdx) {
	var oTable=ur_Table_create(sTableId);
	for (var i=0;i<oTable.rows.length;i++) {
	  var s=oTable.rows[i].ref.getAttribute("rr");
	  if(!s || s=="") continue;
	  if (!isNaN(parseInt(s))) {
	    if (parseInt(s)==iRowIdx) return oTable.rows[i].ref;
		}
	}
	return null
}
function sapUrMapi_SapTable_correctSelectionBorder(oRow)
{
  sapUrMapi_SapTable_correctSelectionBorder4Table(oRow.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id);
}
function sapUrMapi_SapTable_correctSelectionBorder4Table(id)
{
  oTable=ur_Table_create(id)
  collRows = oTable.rows;
  var oTestRow1;
  var oTestRow2;
  for (var y=0;y<collRows.length;y++) {
    if(y>0){
      oTestRow1 = collRows[y-1];
      oTestRow2 = collRows[y];
    }
    else{
      continue;
    }
    for (x=0;x<collRows[y].cells.length;x++) {
      if(oTestRow2.cells[x].ref.className.indexOf("urSTSel")<0 && oTestRow1.cells[x].ref.className.indexOf("urSTSel")<0){
        oTestRow1.cells[x].ref.style.borderBottomColor=oTestRow1.cells[x].ref.currentStyle.borderLeftColor;
        oTestRow2.cells[x].ref.style.borderBottomColor=oTestRow2.cells[x].ref.currentStyle.borderLeftColor;
      }
      else if(oTestRow1.cells[x].ref.className.indexOf("urSTSel")<0){
        oTestRow1.cells[x].ref.style.borderBottomColor=oTestRow2.cells[x].ref.currentStyle.borderLeftColor;
        oTestRow2.cells[x].ref.style.borderTopWidth="0px";
        oTestRow2.cells[x].ref.style.borderBottomColor=oTestRow2.cells[x].ref.currentStyle.borderLeftColor;
      }
      else if(oTestRow2.cells[x].ref.className.indexOf("urSTSel")<0){
        oTestRow2.cells[x].ref.style.borderBottomColor=oTestRow2.cells[x].ref.currentStyle.borderLeftColor;
      }
      else if(oTestRow2.cells[x].ref.className.indexOf("urSTSel")>=0){
        oTestRow2.cells[x].ref.style.borderBottomColor=oTestRow2.cells[x].ref.currentStyle.borderLeftColor;
        oTestRow2.cells[x].ref.style.borderTopWidth="0px";
        if(oTestRow2.cells[x].ref.className.indexOf("urSTSel2")<0){
          oTestRow1.cells[x].ref.style.borderBottomColor=oTestRow2.cells[x].ref.currentStyle.borderLeftColor;
        }
      }
    }
  }
}
function sapUrMapi_SapTable_selectRowByObject(oRow,bSelect,bSecondary)
{
  var oButton = oRow.getElementsByTagName("BUTTON").item(0);
  if(!oButton.getAttribute("rr")||oButton.getAttribute("rr")=="") return;
  var bEdit = false;
  if(!bSelect)
    oButton.className="urSTRowUnSelIcon";
  else if(bSecondary)
    oButton.className="urSTRowSelSecIcon";
  else
    oButton.className="urSTRowSelIcon";
  for (var n=0;n<oRow.childNodes.length;n++) {
    oItem=oRow.childNodes.item(n);
    if (oItem==oButton.parentNode) {
      bEdit=oItem.nextSibling.edit=="true";
    } else {
      bEdit=oItem.edit=="true";
    }
    sapUrMapi_SapTableSelectCell(oItem,bEdit,bSelect,bSecondary);
  }
  if(bEdit==true)
    sapUrMapi_SapTable_correctSelectionBorder(oRow);
}
function sapUrMapi_SapTable_selectRow(sTableId,sRowIdx,iCol,iGroup,e,bSecondary)
{
  if (typeof(bSecondary)=="undefined") bSecondary=false;
  var oRow = e.srcElement.parentNode.parentNode;
  var oButton = oRow.getElementsByTagName("BUTTON").item(0);
  var bSelect = oButton.className=="urSTRowSelIcon"||oButton.className=="urSTRowSelSecIcon"?false:true;
  sapUrMapi_SapTable_selectRowByObject(oRow,bSelect,bSecondary);
  return oRow;
}
function sapUrMapi_SapTableSelectCell(oCell,bEdit,bSelect,bSecondary)
{
  if (typeof(bSelect)=="undefined") bSelect=true;
  if (typeof(bSecondary)=="undefined") bSecondary=false;
  if (bSelect) {
    oCell.className=oCell.className+" urSTSel";
    if(bSecondary){
      oCell.className=oCell.className+"2";
    }
    if(!bEdit){
      oCell.className=oCell.className+"Ro";
    }
  } else {
  	arrClasses = oCell.className.split(" ");
	  var s="";
		for (var i=0;i<arrClasses.length;i++) {
			if (arrClasses[i].indexOf("urSTSel")==-1) {
				s=s+" "+arrClasses[i];
		  }
		}
		oCell.className=s;
	}
}
function sapUrMapi_SapTable_isSelectable(oRow){
	var sButtons = oRow.getElementsByTagName("BUTTON");
	for(var i=0;i<sButtons.length;i++)
		if(sButtons[i].className=="urSTRowUnSelIcon" || sButtons[i].className=="urSTRowSelIcon")
			return true;
	return false;
}
function sapUrMapi_SapTable_clickSelButton(oRow,oEvt){
	while(oRow.tagName!="TR") oRow = oRow.parentNode;
	if(oRow.tagName!="TR")return;
	var sButtons = oRow.getElementsByTagName("BUTTON");
	for(var i=0;i<sButtons.length;i++){
		if(sButtons[i].className=="urSTRowUnSelIcon" || sButtons[i].className=="urSTRowSelIcon"){
			sButtons[i].fireEvent("onclick",oEvt);
			return;
		}
	}
}
function sapUrMapi_SapTable_getModelCellOfCnt(sId,o) {
  var oTbl=ur_Table_create(sId);
	var oCell=o;
	
	while((oCell.tagName != "TD" && oCell.tagName != "TH") || oCell.className.indexOf("urSTT")==-1) {
		if(oCell.id==sId) break;
		oCell = oCell.parentNode;
	}
	 
	oCell=oTbl.lookup[oCell.id];
	return oCell;
}
function sapUrMapi_SapTable_focusUp(sId,o){
  var oTable=ur_Table_create(sId);
  var oCell = oTable.focusedCell;
	if(oCell==null) oCell=sapUrMapi_SapTable_getModelCellOfCnt(sId,o);
	if (oCell==null) return "UNDEFINED";
  var oCol=oCell.parentCol;
  if (oCell.rowIdx==0) return "END"; 
  while (oCol.cells[oCell.rowIdx-1].ref==oCell.ref) { 
    oCell=oCol.cells[oCell.rowIdx-1]
    if (oCell.rowIdx==0) return "END"; 
  }
  oCell=oCol.cells[oCell.rowIdx-1];
  oTable.focusedCell=oCell;
	if(oCell.ref!=null) ur_focus(oCell.ref.firstChild);
	return ""
}
function sapUrMapi_SapTable_focusDown(sId,o){
  var oTable=ur_Table_create(sId);
  var oCell = oTable.focusedCell;
	if(oCell==null) oCell=sapUrMapi_SapTable_getModelCellOfCnt(sId,o);
	if (oCell==null) return "UNDEFINED";
  var oCol=oCell.parentCol;
  if (oCol.cells.length-1==oCell.rowIdx) return "END"; 
  while (oCol.cells[oCell.rowIdx+1].ref==oCell.ref) { 
    oCell=oCol.cells[oCell.rowIdx+1];
    if (oCol.cells.length-1==oCell.rowIdx) return "END"; 
  }
  oCell=oCol.cells[oCell.rowIdx+1];
  oTable.focusedCell=oCell;
	if(oCell.ref!=null) ur_focus(oCell.ref.firstChild);
	return ""
}
function sapUrMapi_SapTable_focusPrevious(sId,o){
  var oTable=ur_Table_create(sId);
  var oCell = oTable.focusedCell;
	if(oCell==null) oCell=sapUrMapi_SapTable_getModelCellOfCnt(sId,o);
	if (oCell==null) return "UNDEFINED";
  var oRow=oCell.parentRow;
  if (oCell.colIdx==0) return "END"; 
  while (oRow.cells[oCell.colIdx-1].ref==oCell.ref) { 
    oCell=oRow.cells[oCell.colIdx-1]
    if (oCell.colIdx==0) return "END"; 
  }
  oCell=oRow.cells[oCell.colIdx-1];
  oTable.focusedCell=oCell;
	if(oCell.ref!=null) ur_focus(oCell.ref.firstChild);
	return ""
}
function sapUrMapi_SapTable_focusNext(sId,o){
  var oTable=ur_Table_create(sId);
  var oCell = oTable.focusedCell;
	if(oCell==null) oCell=sapUrMapi_SapTable_getModelCellOfCnt(sId,o);
	if (oCell==null) return "UNDEFINED";
  var oRow=oCell.parentRow;
  if (oRow.cells.length-1==oCell.colIdx) return "END"; 
  while (oRow.cells[oCell.colIdx+1].ref==oCell.ref) { 
    oCell=oRow.cells[oCell.colIdx+1]
    if (oRow.cells.length-1==oCell.colIdx) return "END"; 
  }
  oCell=oRow.cells[oCell.colIdx+1];
  oTable.focusedCell=oCell;
	if(oCell.ref!=null) ur_focus(oCell.ref.firstChild);
	return ""
}
function sapUrMapi_SapTable_tabBack(sId,o){
  var oTable=ur_Table_create(sId);
  var oCell = oTable.focusedCell;
	if(oCell==null) oCell=sapUrMapi_SapTable_getModelCellOfCnt(sId,o);
	if (oCell==null) return false;
  var oRow=oCell.parentRow;
	if(oCell.colIdx>0) {
		if(oRow.cells[oCell.colIdx-1].ref!=oCell.ref)
			oCell=oRow.cells[oCell.colIdx-1];
		else
			while (oCell.colIdx>0 && oRow.cells[oCell.colIdx-1].ref==oCell.ref)
				oCell=oRow.cells[oCell.colIdx-1];
  }
  if (oCell.colIdx==0) { 
		if (oCell.rowIdx==0) {
		  if (oTable.hasToolbar)ur_focus(oTable.toolbar); 
		  else ur_focus(oTable.ref);
		  return false;
		}
    oRow=oTable.rows[oCell.rowIdx-1];
    oCell=oRow.cells[oRow.cells.length-1]; 
  }
  if (oCell!=null) {
    oTable.focusedCell=oCell;
    ur_focus(oCell.ref.firstChild);
    return true;
  }
	return false;
}
function sapUrMapi_SapTable_keydown(sId,e) {
  var o=e.srcElement;
  var sTag=o.tagName;
	var iKey=e.keyCode;
	var bS=e.shiftKey;
	var bA=e.altKey;
	var bC=e.ctrlKey;
	var sCt=sapUrMapi_getControlTypeFromObject(o);
	
	var oT=ur_get(sId); 
	
	var sPhId=oT.getAttribute("ph");
	var oPh=ur_get(sPhId);
	
	var sPvId=oT.getAttribute("pv");
	var oPv=ur_get(sPvId);
	
	
	if(iKey==32 && sCt!="InputField" && sCt!="TextEdit" && sCt!="ComboBox"){
		try{
			o.fireEvent("onclick",e);
		} catch(ex){ }
		ur_EVT_cancel(e);
		return true;
	}
	
	if((bC || bS) && (iKey==40 || iKey==38)){
		if(sapUrMapiSapTable_sort(o))
			return sapUrMapi_cancelEvent(e);
	}
	
	if(iKey==40){
		sResult=sapUrMapi_SapTable_focusDown(sId,o);
		if (sResult=="END" && oPv!=null) {
		  if (ur_Paginator_triggerClick(sPvId,UR_PAGINATOR_BUTTON.NEXT_ITEM)) {sapUrMapi_cancelEvent(e);return true;}
		  else if (ur_Paginator_triggerClick(sPvId,UR_PAGINATOR_BUTTON.NEXT_PAGE)) {sapUrMapi_cancelEvent(e);return true;}
		  else if (ur_Paginator_triggerClick(sPvId,UR_PAGINATOR_BUTTON.END)) {sapUrMapi_cancelEvent(e);return true;}
		  else sapUrMapi_cancelEvent(e);
		} else {
			sapUrMapi_cancelEvent(e);
		}
		return true;
	}
	
	if(iKey==38){
		sResult=sapUrMapi_SapTable_focusUp(sId,o);
		if (sResult=="END" && oPv!=null) {
		  if (ur_Paginator_triggerClick(sPvId,UR_PAGINATOR_BUTTON.PREVIOUS_ITEM)) {sapUrMapi_cancelEvent(e);return true;}
		  else if (ur_Paginator_triggerClick(sPvId,UR_PAGINATOR_BUTTON.PREVIOUS_PAGE)) {sapUrMapi_cancelEvent(e);return true;}
		  else if (ur_Paginator_triggerClick(sPvId,UR_PAGINATOR_BUTTON.BEGIN)) {sapUrMapi_cancelEvent(e);return true;}
		  else sapUrMapi_cancelEvent(e);
		} else {
			sapUrMapi_cancelEvent(e);
		}
		return true;
	}
	
	if(iKey==39 && (sCt!="InputField" && sCt!="TextEdit")){
		var sResult="";
		if (ur_system.direction=="rtl")
			sResult=sapUrMapi_SapTable_focusPrevious(sId,o);
		else
			sResult=sapUrMapi_SapTable_focusNext(sId,o);
		if (sResult=="END" && oPh!=null) {
			if (ur_system.direction=="rtl") {
				if (ur_Paginator_triggerClick(sPhId,UR_PAGINATOR_BUTTON.PREVIOUS_ITEM)) {sapUrMapi_cancelEvent(e);return true;}
				else if (ur_Paginator_triggerClick(sPhId,UR_PAGINATOR_BUTTON.PREVIOUS_PAGE)) {sapUrMapi_cancelEvent(e);return true;}
				else if (ur_Paginator_triggerClick(sPhId,UR_PAGINATOR_BUTTON.BEGIN)) {sapUrMapi_cancelEvent(e);return true;}
				else sapUrMapi_cancelEvent(e);
			} else {
				if (ur_Paginator_triggerClick(sPhId,UR_PAGINATOR_BUTTON.NEXT_ITEM)) {sapUrMapi_cancelEvent(e);return true;}
				else if (ur_Paginator_triggerClick(sPhId,UR_PAGINATOR_BUTTON.NEXT_PAGE)) {sapUrMapi_cancelEvent(e);return true;}
				else if (ur_Paginator_triggerClick(sPhId,UR_PAGINATOR_BUTTON.END)) {sapUrMapi_cancelEvent(e);return true;}
				else sapUrMapi_cancelEvent(e);
			}
		} else {
			sapUrMapi_cancelEvent(e);
		}
		return true;
	}
	
	if(iKey==37 && (sCt!="InputField" && sCt!="TextEdit")){
		var sResult="";
		if (ur_system.direction=="rtl")
			sResult=sapUrMapi_SapTable_focusNext(sId,o);
		else
			sResult=sapUrMapi_SapTable_focusPrevious(sId,o);
		if (sResult=="END" && oPh!=null) {
			if (ur_system.direction=="rtl") {
				if (ur_Paginator_triggerClick(sPhId,UR_PAGINATOR_BUTTON.NEXT_ITEM)) {sapUrMapi_cancelEvent(e);return true;}
				else if (ur_Paginator_triggerClick(sPhId,UR_PAGINATOR_BUTTON.NEXT_PAGE)) {sapUrMapi_cancelEvent(e);return true;}
				else if (ur_Paginator_triggerClick(sPhId,UR_PAGINATOR_BUTTON.END)) {sapUrMapi_cancelEvent(e);return true;}
				else sapUrMapi_cancelEvent(e);
			} else {
				if (ur_Paginator_triggerClick(sPhId,UR_PAGINATOR_BUTTON.PREVIOUS_ITEM)) {sapUrMapi_cancelEvent(e);return true;}
				else if (ur_Paginator_triggerClick(sPhId,UR_PAGINATOR_BUTTON.PREVIOUS_PAGE)) {sapUrMapi_cancelEvent(e);return true;}
				else if (ur_Paginator_triggerClick(sPhId,UR_PAGINATOR_BUTTON.BEGIN)) {sapUrMapi_cancelEvent(e);return true;}
				else sapUrMapi_cancelEvent(e);
			}
		} else {
			sapUrMapi_cancelEvent(e);
		}
		return true;
	}
	
	if(iKey==9 && bS==true ){
		if( sapUrMapi_SapTable_tabBack(sId,o) ){
			e.returnValue = false;
			e.cancelBubble = true;
			return true;
		}
	}
	
	else if(iKey==9){
		  var oTable=ur_Table_create(sId);
			oTable.focusedCell=null;
	}
	
	
  
	
  
	if (oPh!=null) {
		if (oPh.getAttribute("ct")=="Paginator") {
			
			if(iKey==33 && bA && !bS && !bC && sTag!="TEXTAREA" ){
				if (ur_Paginator_triggerClick(sPhId,UR_PAGINATOR_BUTTON.PREVIOUS_PAGE)) sapUrMapi_cancelEvent(e);
				return;
			}
			
			if(iKey==34 && bA && !bS && !bC && sTag!="TEXTAREA" ){
				if (ur_Paginator_triggerClick(sPhId,UR_PAGINATOR_BUTTON.NEXT_PAGE)) sapUrMapi_cancelEvent(e);
				return;
			}
		}
	}
  
	if (oPv!=null) {
		if (oPv.getAttribute("ct")=="Paginator") {
			
			if(iKey==36 && !bA && !bS && bC && sTag!="INPUT" && sTag!="TEXTAREA"){
				if (ur_Paginator_triggerClick(sPvId,UR_PAGINATOR_BUTTON.BEGIN)) sapUrMapi_cancelEvent(e);
				return;
			}
			
			if(iKey==35 && !bA && !bS && bC && sTag!="INPUT" && sTag!="TEXTAREA"){
				if (ur_Paginator_triggerClick(sPvId,UR_PAGINATOR_BUTTON.END)) sapUrMapi_cancelEvent(e);
				return;
			}
			
			if(iKey==33 && !bA && !bS &&!bC && sTag!="INPUT" && sTag!="TEXTAREA"){
				if (ur_Paginator_triggerClick(sPvId,UR_PAGINATOR_BUTTON.PREVIOUS_PAGE)) sapUrMapi_cancelEvent(e);
				return;
			}
			
			if(iKey==34 && !bA && !bS &&!bC && sTag!="INPUT" && sTag!="TEXTAREA"){
				if (ur_Paginator_triggerClick(sPvId,UR_PAGINATOR_BUTTON.NEXT_PAGE)) sapUrMapi_cancelEvent(e);
				return;
			}
		}
	}
	
	return sapUrMapi_skip(sId,e);
}
function sapUrMapi_SapTable_HiCell_he(o,oEvt) {
  oSrc=oEvt.srcElement;
  var sTag=oSrc.tagName;
  var sCt="|"+sapUrMapi_getControlTypeFromObject(oSrc)+"|";
  if (sCt=="|Caption|") if (sapUrMapi_getControlTypeFromObject(sapUrMapi_getRootControl(oSrc).parentNode)=="Link") sCt="|Link|"; 
  var sClick="|TextView|SapTable|ProgressIndicator|Caption|Image|";
  var sNClick="|InputField|TextEdit|ComboBox|";
  if ((sClick.indexOf(sCt)>-1 || oEvt.keyCode==9 || oEvt.keyCode==107 || oEvt.keyCode==109) && (sNClick.indexOf(sCt)==-1)) {
		var sExp=o.getAttribute("oex");	
		var sCol=o.getAttribute("oco");	
		var sCl=o.getAttribute("oc");
		var oFunc=null;
		var oExp=null;
		var oCol=null;
		var sClass=o.firstChild.className;
		var bNoMod = (oEvt.shiftKey==false && oEvt.ctrlKey==false && oEvt.altKey==false);  
		if (sCl!=null && sCl!="")
			oFunc=new Function("event",sCl);  
		if (sClass.indexOf("urSTExpClo")>-1 && sExp!=null && sExp!="")
			oExp=new Function("event",sExp);  
		if (sClass.indexOf("urSTExpOp")>-1 && sCol!=null && sCol!="")
			oCol=new Function("event",sCol);  
																																											
		if (oCol!=null &&(oEvt.type=="click" || (oEvt.type=="keydown" && oEvt.keyCode==109 && bNoMod))) {
			oCol(o.id);
			sapUrMapi_cancelEvent(oEvt);
		}
		if (oExp!=null && (oEvt.type=="click" || (oEvt.type=="keydown" && oEvt.keyCode==107 && bNoMod))) {
			oExp(o.id);
			sapUrMapi_cancelEvent(oEvt);
		}
		if (oFunc!=null && (oEvt.type=="click" || (oEvt.type=="keydown" && oEvt.keyCode==32 && bNoMod))) {
			oFunc(o.getAttribute("tableid"),o.id);
			sapUrMapi_cancelEvent(oEvt);
		}
	} else {
    return;
  }
}
function sapUrMapiSapTable_sort(oCell,bAsc){
	var aBtn;
	var oBtn=null;
	var sTp=oCell.getAttribute("tp");
	
	if(sTp==null || sTp.indexOf("HDR")<0) return false;
	aBtn=oCell.getElementsByTagName("button");
	for(var i=0;i<aBtn.length;i++)
		if(aBtn[i].className.indexOf("urSTIconSor")>=0 || aBtn[i].className=="urSTIconUnsorted")oBtn=aBtn[i];
	if(oBtn!=null) oBtn.click();
	return true;
}
function sapUrMapi_SapTable_activate(sId,e){
	var o=e.srcElement;      
	var oTab=ur_Table_create(sId);
	var oCell=sapUrMapi_SapTable_getModelCellOfCnt(sId,o);
	var oFocus=null;
	if(oCell==null || o!=oCell.ref.firstChild )return;
	if( oCell.ref.firstChild.firstChild!=null)
	oFocus=sapUrMapi_findFirstFocus(oCell.ref.firstChild.firstChild);
	if(oFocus==null) oFocus=oCell.ref.firstChild;
	
	if(oFocus!=null){
		if (ur_system.is508) sapUrMapi_SapTable_getTooltip(oFocus,oCell.ref,oTab);
		ur_focus(oFocus);
	}
}
function sapUrMapi_SapTable_getTooltip(o,oCell,oTab){
	var sTooltip="";
	var sSep=" "+getLanguageText("SAPUR_SEPARATOR")+" ";
	var sTypeMsgId="";
	var sTt=oCell.getAttribute("tt");
	var sSt=ur_getStatusText(oCell);
	var sTutor="";
	var aHeaders;
	var sHeaders="";
	var oHeader;
	var sSort="";
	var oRow=oCell.parentNode;
	
	if(oCell.className.indexOf("urSTTHL")>=0){
		if(oCell.tagName=="TD") oCell=oCell.parentNode.parentNode.parentNode.parentNode;
		if(o && o.className=="urSTColHdrSelPopupIcon") return;
		
		if( (oCell.innerText=="" || oCell.innerText==" ") && oCell.cellIndex==0 ){
			o.title=getLanguageText("SAPUR_ST_HDR1_E");
			return;
		}
		sSort=oCell.getAttribute("sort");
		if(oCell.className.indexOf("urSTTHL1")!=-1) sTypeMsgId="SAPUR_SAPTABLE_HEADER1";
		else if(oCell.className.indexOf("urSTTHL2")!=-1) sTypeMsgId="SAPUR_SAPTABLE_HEADER2";
		else if(oCell.className.indexOf("urSTTHL3")!=-1) sTypeMsgId="SAPUR_SAPTABLE_HEADER3";
		sTooltip=oCell.innerText+sSep+getLanguageText(sTypeMsgId);
		if(sSt && sSt!="") sTooltip+=sSep+sSt;
		if(sSort=="A"){
			sTooltip+=sSep+getLanguageText("SAPUR_SAPTABLE_SORTED_ASC");
			sTutor=getLanguageText("SAPUR_SAPTABLE_SORTD");
		}
		else if(sSort=="D"){
			sTooltip+=sSep+getLanguageText("SAPUR_SAPTABLE_SORTED_DESC");
			sTutor=getLanguageText("SAPUR_SAPTABLE_SORTA");
		}
		else if(sSort=="U"){
			sTutor=getLanguageText("SAPUR_SAPTABLE_SORTA");
		}
		
		if(sTt!=null && sTt!="") sTooltip+=sSep+sTt;
		if(oCell.getAttribute("cl")=="true")
			sTutor=getLanguageText("SAPUR_SAPTABLE_CLICK");
		if(sTutor!="")
			sTooltip+=sSep+sTutor;		
		oCell.title=sTooltip;		
	}
	
	else if(oCell!=null && oCell.className.indexOf("urSTFlt")>=0){
		o.title=getLanguageText("SAPUR_SAPTABLE_FLTICO");
	}
	
	else if(oCell!=null && oCell.getAttribute("flt")=="true"){
		aHeaders=oCell.getAttribute("headers").split(" ");
		for(var i=0;i<aHeaders.length;i++){
			oHeader=ur_get(aHeaders[i]);
			if(oHeader!=null)sHeaders+=oHeader.innerText;
			if(i<aHeaders.length) sHeaders+=" ";
		}
		sTooltip=getLanguageText("SAPUR_SAPTABLE_FLT",[sHeaders]);	
		o.setAttribute("lbl",sTooltip);
		o.setAttribute("tttbl",getLanguageText("SAPUR_SAPTABLE_FLTTUT"));
	}
	
	else if(o!=null && o.className.indexOf("urSTRowSel")>=0){
		o.title=getLanguageText("SAPUR_SAPTABLE_ROWDSEL",[oCell.getAttribute("rr")]);
	}
	else if(o!=null && o.className.indexOf("urSTRowUnSel")>=0){
		o.title=getLanguageText("SAPUR_SAPTABLE_ROWSEL",[oCell.getAttribute("rr")]);
	}	
	
	else{
    if(parseInt(oTab.ref.r)!=0){
			var sRow=oCell.getAttribute("rr");
			if(sRow==null || sRow=="" || parseInt(sRow)==0)
				sRow=oRow.getAttribute("rr");
		  sTooltip=getLanguageText("SAPUR_SAPTABLE_ROW",new Array(sRow));
		  if (oCell.getAttribute("headers")==null || oCell.getAttribute("headers")=="") {
		    sHeaders=(oTab.lookup[oCell.id].colIdx+1);
	  	} else {
		  	aHeaders=oCell.getAttribute("headers").split(" ");
		  	for(var i=0;i<aHeaders.length;i++){
			  	oHeader=ur_get(aHeaders[i]);
			  	if(oHeader!=null)sHeaders+=oHeader.innerText;
			  	if(i<aHeaders.length) sHeaders+=" ";
		  	}
		  }
		  sTooltip+=" "+getLanguageText("SAPUR_SAPTABLE_COL",[sHeaders]);
		}
		
		sTutor="";
		if (oCell.firstChild!=null) {
			var sClass=oCell.firstChild.className;
		  
			if (sClass.indexOf("urSTExpOp")>-1) {
				sTooltip+=sSep+getLanguageText("SAPUR_EXPANDED");
				sTutor=sSep+getLanguageText("SAPUR_SAPTABLE_COLLAPSE_TUT");
			}
			
			if (sClass.indexOf("urSTExpClo")>-1) {
				sTooltip+=sSep+getLanguageText("SAPUR_COLLAPSED");
				sTutor=sSep+getLanguageText("SAPUR_SAPTABLE_EXPAND_TUT");
			}
		}
    
		
		if (oCell.getAttribute("lv")!=null && oCell.getAttribute("lv")!="") {
		  var sLvl=parseInt(oCell.getAttribute("lv"))+1;
		  sTooltip+=sSep+getLanguageText("SAPUR_SAPTABLE_CELL_LVL",[sLvl]);
		}
		if(oCell.className.indexOf("urSTSNeg")>0) sTooltip+=sSep+getLanguageText("SAPUR_NEGATIVE");
		else if(oCell.className.indexOf("urSTSTot")>=0) sTooltip+=sSep+getLanguageText("SAPUR_TOTAL");
		else if(oCell.className.indexOf("urSTSSubtot")>=0) sTooltip+=sSep+getLanguageText("SAPUR_SUBTOTAL");
		else if(oCell.className.indexOf("urSTSBad")>=0) sTooltip+=sSep+getLanguageText("SAPUR_BADVALUE");
		else if(oCell.className.indexOf("urSTSCrit")>=0) sTooltip+=sSep+getLanguageText("SAPUR_CRITICALVALUE");
		else if(oCell.className.indexOf("urSTSPos")>=0) sTooltip+=sSep+getLanguageText("SAPUR_POSITIVE");
		if(oCell.className.indexOf("urSTSel")>=0) sTooltip+=sSep+getLanguageText("SAPUR_SELECTED");
		sTooltip+=sTutor;
		o.setAttribute("tttbl",sTooltip);		
	
		if(o.getAttribute("ott"))
			o.title=o.getAttribute("ott")+sSep+sTooltip;		
		else{
			o.setAttribute("ott",o.title);	
			o.title+=sSep+sTooltip;
		}	
	}	
}
var _ur_tables=new Array();
function ur_Table_create(sId) {
	if (_ur_tables[sId]==null) { 
		
		var oRows = new Array();
		var oRefCells = new Array();
		var oBdy = null;
		var iR=0;
		var oTab=ur_get(sId);
		var bHasTb=false;
		var oTb=null;
		while(oBdy==null){
		  if (oTab.rows[iR].cells[0]==null){iR++;continue;}
		  var oTmp=oTab.rows[iR].cells[0].firstChild;
		  if (oTmp==null) {iR++;continue;}
		  if (oTmp.tagName=="TABLE") {
		    if (oTmp.getAttribute("bd")=="1") {
					oBdy=oTmp;
					break;
		    }	  
		    if (oTmp.firstChild.firstChild.firstChild.getAttribute("ct")=="Toolbar") {
					oTb=oTmp.firstChild.firstChild.firstChild;
					bHasTb=true;
		    }	  
		  }
		  iR++;
		}
		if (oBdy==null) return null;
		var oTRows = oBdy.rows;
		var oDCells = null;
		var oRowSpanedCells = new Array();
		
		var iMax=0;
		for (var iRowCount=0;iRowCount<oTRows.length;iRowCount++)  {
			var oCells = new Array();
			var iColCount=0;
			oDCells=oTRows[iRowCount].cells;
			var iLength=iMax;
			if (oDCells.length>iMax) iLength=oDCells.length; 
			for (var iCol=0;iCol<iLength;iCol++) {
				if (oRowSpanedCells!=null) { 
					for (var k=0;k<oRowSpanedCells.length;k++) {
						if (oRowSpanedCells[k].pos==iCol && oRowSpanedCells[k].rspan>1) { 
							iColCount++;
							oCells.push({ref:oRowSpanedCells[k].o,rspan:true}); 
							for (t=1;t<oRowSpanedCells[k].cspan;t++) { 
								iColCount++;
								oCells.push({ref:oRowSpanedCells[k].o,cspan:true,rspan:true}); 
							}
							oRowSpanedCells[k].rspan--; 
							
							if (k<oRowSpanedCells.length-1 && oRowSpanedCells[k+1].pos==iCol+1 && oRowSpanedCells[k+1].rspan>1) { 
								oCells.push({ref:oRowSpanedCells[k+1].o,rspan:true}); 
								for (t=1;t<oRowSpanedCells[k+1].cspan;t++) { 
									iColCount++;
									oCells.push({ref:oRowSpanedCells[k+1].o,cspan:true,rspan:true}); 
								}
								oRowSpanedCells[k+1].rspan--; 
							}
						}
					}
				}
				if (iCol<oDCells.length) {
					iColCount++;
					oCells.push({ref:oDCells[iCol]});	 
					var iColSpan=parseInt(oDCells[iCol].colSpan); 
					if (isNaN(iColSpan)) iColSpan=1;
					var iRowSpan=parseInt(oDCells[iCol].rowSpan); 
					if (isNaN(iRowSpan)) iRowSpan=1;
					if (iColSpan>1) {
						for (var x=1;x<iColSpan;x++) {
							
							oCells.push({ref:oDCells[iCol],cspan:true});
							iColCount++;
						}
					}
					if (iRowSpan>1) oRowSpanedCells.push({rspan:iRowSpan,cspan:iColSpan,o:oDCells[iCol],pos:iCol}); 
				}	
			}
			oRows.push({irowidx:oRows.length,ref:oTRows[iRowCount],cells:oCells}); 
			iMax=iColCount>iMax?iColCount:iMax; 
		}
		
		
		
		
		
		var oCols=new Array();
		for (var i=0;i<oRows.length;i++){
			for (var j=0;j<iMax;j++) {
				if (oRows[i].cells[j]==null) {
					oRows[i].cells[j]={ref:oRows[i].cells[j-1].ref,empty:true};
					oRows[i].cells[j-1].last=true; 
				} else {
					oRows[i].cells[j].empty=false;
					oRows[i].cells[j].last=j==iMax-1?true:false; 
				}
				if (i>0) oRows[i].previousRow=oRows[i-1];
				if (i<oRows.length-1) oRows[i].nextRow=oRows[i+1];
				oRows[i].irowidx=i;
				var oCell=oRows[i].cells[j]; 
				
				oRows[i].sel=-1;
				
				oCell.foc=false;
				oCell.sel=-1; 
				oCell.type="te"; 
				oCell.parentRow=oRows[i]; 
				oCell.headers=ur_table_getCellHeaders(oCell.ref.getAttribute("headers"));
				oCell.first=j==0?true:false; 
				oCell.isTH=oCell.ref.tagName=="TH"; 
				oCell.rowIdx=i;
				oCell.colIdx=j;
				
				
				if (i==0) {
					oCols.push({icolidx:j,cells:new Array()}); 
				}
				oCell.parentCol=oCols[j];	
				oCols[j].cells.push(oCell); 
				
				oCols[j].sel=-1;
				if (oRefCells[oCell.ref.id]!=null) {
					oCell.ref.setAttribute("id",oCell.ref.id+"dupl-"+sId+"-cell-"+i+"-"+j);
				}
				if (oCell.ref.id==null || oCell.ref.id=="") {
					oCell.ref.setAttribute("id",sId+"-cell-"+i+"-"+j);
				}
			  oRefCells[oCell.ref.id]=oCell;
			}
		}
		
		_ur_tables[sId]={rows:oRows,cols:oCols,lookup:oRefCells,ref:oTab,hasToolbar:bHasTb,toolbar:oTb};
	}
  
	return _ur_tables[sId];
}
function ur_table_getCellHeaders(s) {
	var result=null;
	if (s!=null && s!="") {
		result=new Array();
		var arrHdr=s.split(",");
		for (var iH=0;iH<arrHdr.length;iH++) {
			var oHdr=ur_get(arrHdr[iH]);
			result.push({ref:oHdr,text:""});
			
		}
	}
	return result;
}

//** SelectableLinkBar.ie5 **

function sapUrMapi_SelectableLinkBar_RegisterCreate(sId) {
	sapUrMapi_Create_AddItem(sId, "sapUrMapi_SelectableLinkBar_create('" + sId + "')");
}
function sapUrMapi_SelectableLinkBar_create(sId) {
	sapUrMapi_Resize_AddItem(sId, "sapUrMapi_SelectableLinkBar_draw('" + sId + "')");
	sapUrMapi_SelectableLinkBar_draw(sId);
}
function sapUrMapi_SelectableLinkBar_draw(sId) {
  var oLinkBar = document.getElementById(sId);
  var iWidth = oLinkBar.offsetWidth;
  var iOrgWidth=iWidth;
  var oLinkBarContent = document.getElementById(sId+"-cnt");
  var oLinkBarScrollPrev = document.getElementById(sId+"-p");
  var oLinkBarScrollNext = document.getElementById(sId+"-n");
  iWidth-=oLinkBarScrollPrev.offsetWidth;
  iWidth-=oLinkBarScrollNext.offsetWidth;
  var nWidth=0;
  var xWidth=0;
  var xHeight=oLinkBarScrollNext.offsetHeight;
  var collItems = oLinkBarContent.childNodes;
  var iFirstVisible=sapUrMapi_SelectableLinkBar_getFirstVisibleItem(sId);
  var iLastVisible=parseInt(ur_get(sId).getAttribute("lastitemidx"));
  for (var n=0;n<collItems.length;n++) {
		  collItems.item(n).style.width="50px";
  }
  var ix=0;
  if (iWidth==0) {
  	oLinkBar.style.width="100%";
  	return;
  }
  if (iFirstVisible==-1) {
	  for (var n=0;n<iLastVisible+1;n++) {
		  collItems.item(n).style.height=xHeight;
	   	collItems.item(n).style.display="block";
	    nWidth+=collItems.item(n).offsetWidth;
	    if (nWidth<iWidth) {
	      xWidth=nWidth;
	    }
 	    if (nWidth>iWidth) {
	      collItems.item(ix).style.display="none";
	      ix++;
	      iFirstVisible=ix;
	    }
    }
    if (nWidth<iWidth) {
		  for (var n=iLastVisible+1;n<collItems.length;n++) {
		   	collItems.item(n).style.display="block";
  	    iLastVisible=n-1;
		    if (nWidth<iWidth) {
		      xWidth=nWidth;
		    }
 	      nWidth+=collItems.item(n).offsetWidth;
	 	    if (nWidth>iWidth) {
	 	    	break;
		    }
	    }
    }
  } else {
    var iLastVisible=-1;
	  for (var n=0;n<collItems.length;n++) {
		   collItems.item(n).style.height=xHeight;
		   if (n<iFirstVisible) {
		   	collItems.item(n).style.display="none";
		    continue;
		   } else {
		   	collItems.item(n).style.display="block";
		   }
		   nWidth+=collItems.item(n).offsetWidth;
		   if (nWidth<iWidth) {
		     xWidth=nWidth;
		   }
		   if (nWidth>iWidth) {
		     collItems.item(n).style.display="none";
		     if (iLastVisible==-1) {
		     	 iLastVisible=n-1;
		     }
		   }
		   if (nWidth<iWidth) {
		     xWidth=nWidth;
		   }
	  }
  }
  if (iLastVisible==-1) {
  	 iLastVisible=collItems.length-1;
  }
  if (iFirstVisible==-1) {
  	 iFirstVisible=0;
  }
  oLinkBar.setAttribute("lastitemidx",iLastVisible);
  oLinkBar.setAttribute("firstitemidx",iFirstVisible);
  
  
	if (oLinkBarScrollNext.onclick!=null) {
    oLinkBarScrollNext.setAttribute("oldonclick",oLinkBarScrollNext.onclick);
	}
  if (iLastVisible>=collItems.length-1) {
    oLinkBarScrollNext.className="urLnkBarScrlRight urLnkBarScrlRightDsbl";
    oLinkBarScrollNext.onclick=null;
  } else {
    oLinkBarScrollNext.className="urLnkBarScrlRight";
    oLinkBarScrollNext.onclick=oLinkBarScrollNext.getAttribute("oldonclick");
  }
	if (oLinkBarScrollPrev.onclick!=null) {
    oLinkBarScrollPrev.setAttribute("oldonclick",oLinkBarScrollPrev.onclick);
	}
  if (iFirstVisible==0) {
    oLinkBarScrollPrev.className="urLnkBarScrlLeft urLnkBarScrlLeftDsbl";
    oLinkBarScrollPrev.onclick=null;
  } else {
    oLinkBarScrollPrev.className="urLnkBarScrlLeft";
    oLinkBarScrollPrev.onclick=oLinkBarScrollPrev.getAttribute("oldonclick");
  }
  var oLinkBarDiv = document.getElementById(sId+"-div");
  oLinkBarDiv.style.height=xHeight;
  oLinkBarDiv.style.width=xWidth;
}
function sapUrMapi_SelectableLinkBar_getFirstVisibleItem(sLinkBarId) {
	return parseInt(ur_get(sLinkBarId).getAttribute("firstitemidx"));
}
function sapUrMapi_SelectableLinkBar_resize(sLinkBarId,e) {
  sapUrMapi_SelectableLinkBar_create(sLinkBarId);
}
function sapUrMapi_SelectableLinkBar_scroll(sLinkBarId,sDirection) {
  var iFirstVisible=sapUrMapi_SelectableLinkBar_getFirstVisibleItem(sLinkBarId);
  var iLastVisible=ur_get(sLinkBarId).getAttribute("lastitemidx");
  var iPageSize=iLastVisible-iFirstVisible;
  if (sDirection=="PREV") {
		iLastVisible=iFirstVisible-1;
		iFirstVisible=-1;
  } else if (sDirection=="NEXT") {
		iFirstVisible=iLastVisible+1;
		iLastVisible=-1;
	}	else {
	  iFirstVisible=-1;
	  iLastVisible=parseInt(sDirection.split("-")[2]);
	}
	ur_get(sLinkBarId).setAttribute("firstitemidx",iFirstVisible)
	ur_get(sLinkBarId).setAttribute("lastitemidx",iLastVisible)
  sapUrMapi_SelectableLinkBar_draw(sLinkBarId);
}
function sapUrMapi_SelectableLinkBar_goprevious(sId,o,e) {
	if(o.tagName == "TABLE"){
			o=o.firstChild.firstChild.firstChild;
		} else {
			while(o.tagName != "TD") o=o.parentNode;
			sapUrMapi_setTabIndex(o.firstChild,-1);
			o=o.previousSibling;
			if(o==null) return;
		}
		if(o.firstChild.className == "urLnkBarLnkDsbl" && ur_system.is508 == false ) o=o.previousSibling;
		if(o==null) return;
		if(o.style.display=="none")
		  sapUrMapi_SelectableLinkBar_scroll(sId,"PREV");
		sapUrMapi_setTabIndex(o.firstChild,0);
		sapUrMapi_focusElement(o.firstChild);
		e.cancelBubble=true;
	    e.returnValue=false;
		return true;
}
function sapUrMapi_SelectableLinkBar_gonext(sId,o,e) {
	if(o.tagName == "TABLE"){
			o=o.firstChild.firstChild.firstChild;
		}
		else{
			while(o.tagName != "TD") o=o.parentNode;
			sapUrMapi_setTabIndex(o.firstChild,-1);
			o=o.nextSibling;
			if(o==null) return;
		}
		if(o.firstChild.className == "urLnkBarLnkDsbl" && ur_system.is508 == false ) o=o.nextSibling;
		if(o==null) return;
		if(o.style.display=="none")
			sapUrMapi_SelectableLinkBar_scroll(sId,"NEXT");
		sapUrMapi_setTabIndex(o.firstChild,0);
		sapUrMapi_focusElement(o.firstChild);
		e.cancelBubble=true;
	    e.returnValue=false;
		return true;
}
function sapUrMapi_SelectableLinkBar_keydown(sId,e) {
	var o=e.srcElement;
	
	if(e.keyCode=="32"){
		if(o.tagName=="A")o.click();
		e.cancelBubble=true;
	  e.returnValue=false;
	}
	
	if(e.keyCode=="39"){
		if (ur_system.direction=="rtl")
			return sapUrMapi_SelectableLinkBar_goprevious(sId,o,e)
		else
			return sapUrMapi_SelectableLinkBar_gonext(sId,o,e)
	}
	
	if(e.keyCode=="37"){
		if (ur_system.direction=="rtl")
			return sapUrMapi_SelectableLinkBar_gonext(sId,o,e);
		else
			return sapUrMapi_SelectableLinkBar_goprevious(sId,o,e);
	}
	
	if(e.keyCode=="9"){
		if(o.tagName == "TABLE"){
			o=o.firstChild.firstChild.firstChild;
		} else {
			while(o.tagName != "TD") o=o.parentNode;
			sapUrMapi_setTabIndex(o.firstChild,-1);
			o=o.previousSibling;
			if(o==null) return;
		}
	}
}

//** TableView.ie5 **

function sapUrMapi_Table_selectRow(sTableId,iRow,e)
{
  var oInput = document.getElementById(sTableId+'-itm-'+iRow);
  var oInputGrp = document.getElementsByName(oInput.name);
  if ((oInputGrp.length==1)&&(oInput.type!="radio"))
  {
        var sSt=oInput.getAttribute("st");
 	    if (e.srcElement.tagName=="IMG") oInput.checked = (!oInput.checked);
		var oImg = document.getElementById(oInput.id + "-img");
		oImg.className = "urImgCbgImg";
		if (oInput.checked) oImg.className = "urImgCbgImgChk";
		
		var oRow = oInput.parentElement;
		while(!oRow.rr)
		{
			oRow=oRow.parentElement;
		}
		for (var n=0;n<oRow.cells.length;n++)
		{
			var oCell = oRow.cells[n];
			if (oInput.checked)
			{
			  oCell.setAttribute("unselectedclass",oCell.className);
			  
			}
			else
			{
	  		  
			}
		}
		if(ur_system.is508)
		{
			if(oInput.checked)
			{
				if(sSt.indexOf("n")==-1) 
					oInput.setAttribute("st",sSt+"s");
				else 
				{
					if(sSt.indexOf("n")!=-1) oInput.setAttribute("st",sSt.replace("n","s"));
				}
			}
			else
			{
				if(sSt.indexOf("s")==-1) 
					oInput.setAttribute("st",sSt+"n");
				else 
				{
					if(sSt.indexOf("s")!=-1) oInput.setAttribute("st",sSt.replace("s","n"));
				}
			}
		}
  } 
  else
  {
	  for (var i = 0; i < oInputGrp.length; i++)
	  {
	    var oImg = document.getElementById(oInputGrp[i].id + "-img");
	    if (oInputGrp[i]==oInput)
		{
			  var sSt=oInput.getAttribute("st");
			  if (e.srcElement.tagName=="IMG") oInput.checked=true;
			  if (e.srcElement.tagName=="IMG") ur_focus(oInputGrp[i]);
		      oImg.className = "urImgRbgImgChk";
			  if(ur_system.is508)
			  {
				  if(sSt.indexOf("n")==-1) 
					oInput.setAttribute("st",sSt+"s");
				  else 
				  {
					if(sSt.indexOf("n")!=-1) oInput.setAttribute("st",sSt.replace("n","s"));
				  }
			  }
	    } 
		else
		{
			 if (oImg.onclick)
			 {
				var sSt=oInputGrp[i].getAttribute("st");
				oInputGrp[i].checked=false;
				oImg.className = "urImgRbgImg";
				if(ur_system.is508)
				{
					if(sSt.indexOf("s")==-1) 
					   oInputGrp[i].setAttribute("st",sSt+"n");
					else 
					{
					   if(sSt.indexOf("s")!=-1) oInputGrp[i].setAttribute("st",sSt.replace("s","n"));
					}
				}
			 }
		}
	}
  }
  e.cancelBubble=true;
  e.returnValue=true;
}
function sapUrMapi_Table_getClickedRowIndex(sId) {
 	 oSrc = window.event.srcElement;
   var obj = event.srcElement;
   while ( (obj!=null) && (obj.tagName!='TD') )
      obj = obj.parentElement;
   if(obj==null) return;
   var parent = obj.parentElement;
   var rowIndex = parent.rr;
   return parseInt(parent.rr);
}
function sapUrMapi_Table_getClickedColIndex(sId) {
 	 oSrc = window.event.srcElement;
   var obj = event.srcElement;
   while ( (obj!=null) && (obj.tagName!='TD') )
      obj = obj.parentElement;
   oCell = obj;
   while ( (obj!=null) && (obj.tagName!='TABLE') )
      obj = obj.parentElement;
   if ( obj==null ) return;
   var colidx =  oCell.cellIndex - parseInt( obj.nmi );
   return colidx;
}
function sapUrMapi_Table_getClickedCellId(sId) {
 	 oSrc = window.event.srcElement;
   var obj = event.srcElement;
   while ( (obj!=null) && (obj.tagName!='TD') )
      obj = obj.parentElement;
   oCell = obj;
   var cellid =  oCell.id;
   return cellid;
}
function sapUrMapi_Table_clickSelButton(o){
	var oRow = o;
	while(oRow.tagName!="TR") oRow = oRow.parentNode;
	if(oRow.tagName!="TR")return;
	var sButtons = oRow.getElementsByTagName("BUTTON");
	for(var i=0;i<sButtons.length;i++)
		if(sButtons[i].className=="urSTRowUnSelIcon" || sButtons[i].className=="urSTRowSelIcon")
			if(o.id != sButtons[i].id)
				sButtons[i].click();
}
function sapUrMapi_Table_getCellIndex(oCell){
	var i=0;
	var o=oCell;
	var oRow=oCell.parentNode;
	var oTab=oRow.parentNode.parentNode;
	
	while(o.previousSibling!=null){
		for(var j=oRow.rowIndex-1;j>=0;j--){
			if(oTab.rows[j].cells.length<=o.cellIndex) continue;
			if(oTab.rows[j].cells[o.cellIndex].rowSpan>1 && oTab.rows[j].rowIndex+oTab.rows[j].cells[o.cellIndex].rowSpan-1>=oRow.rowIndex){
				i+=oTab.rows[j].cells[o.cellIndex].rowSpan-1;
				break;
			}
		}
		if(o.previousSibling!=null) o=o.previousSibling;
		i+=o.colSpan;
	}
	return i;
}
function sapUrMapi_Table_getCell(oRow,iIdx){
	var o=oRow.firstChild;
	var oTab=oRow.parentNode.parentNode;
	var i=0;
	
	while(i<iIdx){
		for(var j=oRow.rowIndex-1;j>=0;j--){
			if(oTab.rows[j].cells.length<=o.cellIndex) continue;
			if(oTab.rows[j].cells[o.cellIndex].rowSpan>1 && oTab.rows[j].rowIndex+oTab.rows[j].cells[o.cellIndex].rowSpan-1>=oRow.rowIndex){
				iIdx-=oTab.rows[j].cells[o.cellIndex].rowSpan-1;
				break;
			}
		}
		if(o.nextSibling!=null && i<iIdx) o=o.nextSibling;
		else break;
		i+=o.colSpan;
	}
	return o;
}
function sapUrMapi_Table_focusUp(sId,o){
	var oCell = o;
	var iCellIdx=0;
	
	while(oCell.tagName != "TD" && oCell.tagName != "TH") oCell = oCell.parentNode;
	iCellIdx=sapUrMapi_Table_getCellIndex(oCell);
	
	var oCurrRow = oCell.parentNode;
	var oRow=oCurrRow.parentNode.firstChild;
	while(oRow.nextSibling!=oCurrRow){
		oCell=sapUrMapi_Table_getCell(oRow,iCellIdx);
		if(oRow.rowIndex+oCell.rowSpan >= oCurrRow.rowIndex)
			break;
		oRow=oRow.nextSibling;
	}
	
	
	if(oCurrRow.previousSibling==null && oRow.parentNode.previousSibling!=null)
		oRow=oRow.parentNode.previousSibling.firstChild;
	
	oCell=sapUrMapi_Table_getCell(oRow,iCellIdx);
	if(oCell!=null) ur_focus(oCell);
}
function sapUrMapi_Table_focusDown(sId,o){
	var oCell=o;
	var bLastRow=false;
	
	while(oCell.tagName != "TD" && oCell.tagName != "TH") oCell = oCell.parentNode;
	
	var oRow=oCell.parentNode;
	for(var i=0; i<oCell.rowSpan;i++){
		if(oRow.nextSibling)
			oRow=oRow.nextSibling;
		else{
			bLastRow=true;
			break;
		}
	}
	
	if(bLastRow && oRow.parentNode.nextSibling!=null && oRow.parentNode.nextSibling.tagName!="TFOOT")
	 oRow=oRow.parentNode.nextSibling.firstChild;
	else if(bLastRow) return;
	
	oCell=sapUrMapi_Table_getCell(oRow,sapUrMapi_Table_getCellIndex(oCell));
	if(oCell!=null && oCell.firstChild && oCell.firstChild.innerTest!="" ) ur_focus(oCell);
}
function sapUrMapi_Table_focusPrevious(sId,o){
	var oCell = o;
	var oPCell = null;
	var oTab = null;
	while(!(oCell.className.substr(0,4)=="urST"&& (oCell.tagName=="TD"||oCell.tagName=="TH"))){
		oCell=oCell.parentNode;
		if(oCell==null||oCell.id==sId) return false;
	}
	oTab = oCell;
	while(oTab.tagName!="TABLE") oTab = oTab.parentNode;
	for(var i=0; i<oCell.parentNode.rowIndex; i++){
		for(var j=0; j<=oCell.cellIndex; j++){
			if(oTab.rows[i].cells.length > j)
			if( oTab.rows[i].rowIndex+parseInt(oTab.rows[i].cells[j].rowSpan)-1>=oCell.parentNode.rowIndex && oCell.cellIndex==oTab.rows[i].cells[j].cellIndex)
				oPCell=oTab.rows[i].cells[j];
		}
	}
	if(oPCell==null && oCell.previousSibling!=null) oPCell=oCell.previousSibling;
	if(oPCell!=null) ur_focus(oPCell);
}
function sapUrMapi_Table_focusNext(sId,o){
	var oCell = o;
	var oTab;
	while((oCell.tagName!="TD" || oCell.tagName!="TH") && oCell.className.indexOf("urST")==-1){
		oCell=oCell.parentNode;
	}
  if (oCell.nextSibling && (oCell.nextSibling.tagName=="TD" || oCell.nextSibling.tagName=="TH")) ur_focus(oCell.nextSibling);
}
function sapUrMapi_Table_tabBack(sId,o){
	var oCell = o;
	var oTab;
	if( o.tagName == "TABLE" || o.tagName == "TBODY" ) return false;
	while(oCell.tagName != "TD" && oCell.tagName != "TH"){
		oCell = oCell.parentNode;
		sControl = oCell.getAttribute("ct");
		if(sControl=="Toolbar" || sControl=="Paginator") {
		  return false;
		}
		if (oCell.firstChild&&oCell.firstChild.className.indexOf("PagInd")>-1) return false;
	}
	
	if(oCell.tagName != "TD" && oCell.tagName != "TH") return false;
	oTab = oCell;
	while(oTab.tagName!="TABLE") oTab = oTab.parentNode;
	if(oTab.parentNode.parentNode.parentNode.parentNode.id.indexOf(sId)==-1) return false;
	if( oCell.previousSibling){
	  if (oCell.parentNode.firstChild==oCell.previousSibling && oCell.parentNode.parentNode.firstChild==oCell.parentNode && oCell.parentNode.parentNode.tagName=="THEAD") {
	    return false;
	  }
		ur_focus(oCell.previousSibling);
		return true;
	} else {
		var oRow = oCell.parentNode;
		if (oRow.previousSibling==null && oRow.parentNode.previousSibling && oRow.parentNode.previousSibling.tagName=="THEAD") {
		  ur_focus(oRow.parentNode.previousSibling.lastChild.lastChild);
		  return true;
		} else {
			oRow=oRow.previousSibling;
			if( oRow != null){
				ur_focus(oRow.lastChild);
				return true;
			}	
		}
	}
	return false;
}
function sapUrMapi_Table_keydown(sId,e){
  var o=e.srcElement;
	var iKey=e.keyCode;
	var sCt=sapUrMapi_getControlTypeFromObject(o);
	
	
	if(iKey==32 && sCt!="InputField" && sCt!="TextEdit" && sCt!="ComboBox"){
		try{
			o.click();
		} catch(ex){ }
		sapUrMapi_cancelEvent(e);
		return true;
	}
	
	if(e.keyCode == "40" && e.srcElement.tagName != "SELECT"){
		sapUrMapi_Table_focusDown(sId,e.srcElement);
		e.returnValue=false;
		e.cancelBubble=true;
		return true;
	}
	
	if(e.keyCode == "38" && e.srcElement.tagName != "SELECT"){
		sapUrMapi_Table_focusUp(sId,e.srcElement);
		e.returnValue=false;
		e.cancelBubble=true;
		return true;
	}
	
	if(e.keyCode == "39" && (e.srcElement.tagName != "INPUT" || e.srcElement.type.toUpperCase()=="CHECKBOX" || e.srcElement.type.toUpperCase()=="RADIO")){
		if (ur_system.direction=="rtl")
			sapUrMapi_Table_focusPrevious(sId,e.srcElement);
		else
			sapUrMapi_Table_focusNext(sId,e.srcElement);
		e.returnValue=false;
		e.cancelBubble=true;
		return true;
	}
	
	if(e.keyCode == "37" && (e.srcElement.tagName != "INPUT" || e.srcElement.type.toUpperCase()=="CHECKBOX" || e.srcElement.type.toUpperCase()=="RADIO")){
		if (ur_system.direction=="rtl")
			sapUrMapi_Table_focusNext(sId,e.srcElement);
		else
			sapUrMapi_Table_focusPrevious(sId,e.srcElement);
		e.returnValue=false;
		e.cancelBubble=true;
		return true;
	}
	
	if(e.keyCode == "9" && e.shiftKey == true ){
		if( sapUrMapi_Table_tabBack(sId,e.srcElement) ){
			e.returnValue = false;
			e.cancelBubble = true;
			return true;
		}
	}
  
  if(ur_get(sId).getElementsByTagName("TFOOT")[0]!=null){
		var o=e.srcElement;
		var sTag=o.tagName;
		var iKey=e.keyCode;
		var bS=e.shiftKey;
		var bA=e.altKey;
		var bC=e.ctrlKey;
		var sTag=e.srcElement.tagName;
		var aBtns=ur_get(sId).getElementsByTagName("TFOOT")[0].getElementsByTagName("IMG");
		if (aBtns.length!=null) {
				
				if(iKey==36 && !bA && !bS && bC && sTag!="INPUT" && sTag!="TEXTAREA"){
					for (var i=0;i<aBtns.length;i++) {
						if (aBtns[i].className.indexOf("Top")>-1 && aBtns[i].className.indexOf("Dsbl")==-1) {
							aBtns[i].click();
							sapUrMapi_cancelEvent(e);
							break;
						}
					}
					return;
				}
				
				if(iKey==35 && !bA && !bS && bC && sTag!="INPUT" && sTag!="TEXTAREA"){
					for (var i=0;i<aBtns.length;i++) {
						if (aBtns[i].className.indexOf("Bottom")>-1 && aBtns[i].className.indexOf("Dsbl")==-1) {
							aBtns[i].click();
							sapUrMapi_cancelEvent(e);
							break;
						}
					}
					return;
				}
				
				if(iKey==33 && !bA && !bS &&!bC && sTag!="INPUT" && sTag!="TEXTAREA"){
					for (var i=0;i<aBtns.length;i++) {
						if (aBtns[i].className.indexOf("PgUp")>-1 && aBtns[i].className.indexOf("Dsbl")==-1) {
							aBtns[i].click();
							sapUrMapi_cancelEvent(e);
							break;
						}
					}
					return;
				}
				
				if(iKey==34 && !bA && !bS &&!bC && sTag!="INPUT" && sTag!="TEXTAREA"){
					for (var i=0;i<aBtns.length;i++) {
						if (aBtns[i].className.indexOf("PgDown")>-1 && aBtns[i].className.indexOf("Dsbl")==-1) {
							aBtns[i].click();
							sapUrMapi_cancelEvent(e);
							break;
						}
					}
					return;
				}
		}
	}
	
	return sapUrMapi_skip(sId,e);
}
function sapUrMapi_Table_activate(sId,e){
	
	if( e.srcElement.tagName != "TD" && e.srcElement.tagName != "TH") return;
	var o = e.srcElement.firstChild;
	
	if(o==null) 
	{
		if (ur_system.is508) sapUrMapi_Table_getTooltip(e.srcElement);
		return;
	}
	var oChild = o;
	var oFocus = null;
	
	while(oFocus==null){
		while(oFocus==null){
			if(o==null) break;
			if(o.nodeType!=3 && (sapUrMapi_Focus_canFocus(o)==true||o.type=="radio")){
				oFocus=o;
				break;
			}
			o = o.firstChild;
		}
		if(oChild==null) break;
		oChild=oChild.nextSibling;
		o=oChild;
	}
	
	if(oFocus!=null) {
		if (ur_system.is508) sapUrMapi_Table_getTooltip(oFocus);
	  ur_focus(oFocus);
	}
}
function sapUrMapi_Table_getTooltip(oF){
		var sTooltip="";
		var sSep=" "+getLanguageText("SAPUR_SEPARATOR")+" ";
		if(oF.getAttribute("tp")=="ROWSEL")
		{
			var rowDesc = oF.getAttribute("rowDesc");
			if(rowDesc!=null)
			{
				sTooltip = getLanguageText("SAPUR_TBV_ROW",new Array(rowDesc));
				if(oF.checked)
				{
					if(oF.getAttribute("isSingleSel")=="true")
					{
						oF.parentNode.lastChild.firstChild.title=sTooltip;
						return;
					}
					else
					sTooltip+= sSep+getLanguageText("SAPUR_TBV_ROW_SEL_TUT");
				}
				else
				{
					sTooltip+= sSep+getLanguageText("SAPUR_TBV_ROW_NSEL_TUT");
				}
			}
			else
			{
				var rowIdx = oF.getAttribute("rowIdx");
				sTooltip = getLanguageText("SAPUR_TBV_ROW",new Array(rowIdx));
				if(oF.checked)
				{
					if(oF.getAttribute("isSingleSel")=="true") 
					{
						oF.parentNode.lastChild.firstChild.title=sTooltip;
						return;
					}
					else
					sTooltip+= sSep+getLanguageText("SAPUR_TBV_ROW_SEL_TUT");
				}
				else
				{
					sTooltip+= sSep+getLanguageText("SAPUR_TBV_ROW_NSEL_TUT");
				}
			}
			oF.parentNode.lastChild.firstChild.title=sTooltip;
			return;
		}	
		if(oF.className.indexOf("urSTbvCell")>-1 )
	    {
			var row = parseInt(oF.getAttribute("rowIndex"))+1;
			var col = parseInt(oF.getAttribute("colIndex"))+1;
			var aHeaders;
			var sHeaders=oF.getAttribute("headers");
			var oHeader;
			if (sHeaders==null || sHeaders=="") 
			sTooltip = getLanguageText("SAPUR_TBV_CELL",new Array(row,col));
			else
			{
				aHeaders=sHeaders.split(" ");
				sHeaders="";
				for(var i=0;i<aHeaders.length;i++)
				{
					oHeader=ur_get(aHeaders[i]);
					if(oHeader!=null)sHeaders+=oHeader.innerText;
					if(i<aHeaders.length) sHeaders+=" ";
				}
				sTooltip = getLanguageText("SAPUR_TBV_CELL",new Array(row,sHeaders));
			}
			if(oF.title!=null)
			{
				if(oF.title.indexOf(sTooltip)>-1) return;
				oF.title+=sSep;
				oF.title+=sTooltip;				
			}
			else
			{
				oF.title=sTooltip;
			}
		}
		else
		{
	    
			var o = oF.parentElement;
			while(o.tagName!="TD") o=o.parentNode;
			var row = parseInt(o.getAttribute("rowIndex"))+1;
			var col = parseInt(o.getAttribute("colIndex"))+1;
			
			var aHeaders;
			var sHeaders=o.getAttribute("headers");
			var oHeader;
			if (sHeaders==null || sHeaders=="") 
			sTooltip = getLanguageText("SAPUR_TBV_CELL",new Array(row,col));
			else
			{
				aHeaders=sHeaders.split(" ");
				sHeaders="";
				for(var i=0;i<aHeaders.length;i++)
				{
					oHeader=ur_get(aHeaders[i]);
					if(oHeader!=null)sHeaders+=oHeader.innerText;
					if(i<aHeaders.length) sHeaders+=" ";
				}
				sTooltip = getLanguageText("SAPUR_TBV_CELL",new Array(row,sHeaders));
			}
					
			oF.setAttribute("tttbl",sTooltip);
	 	}
}

//** TabStrip.ie5 **

function sapUrMapi_TabStrip_RegisterCreate(sId,iCount,iActive) {
  sapUrMapi_Create_AddItem(sId, "sapUrMapi_TabStrip_create('" + sId + "','" + iCount + "','" + iActive + "')");
  
  sapUrMapi_Resize_AddItem(sId, "sapUrMapi_TabStrip_resize('"+sId+"',"+iCount+")");	
}
function 	sapUrMapi_TabStrip_create(sId,iCount,iActive) {
	if(iCount==0) return;
	var oTabTable=ur_get(sId);
	var arrTabs=new Array();
	var activeTab = ur_get(sId + "-cnt-" + iActive);
	var iHeight_atr=activeTab.style.height;
	var iHeight=0;
	if (sapUrMapi_getCurrentStyle(activeTab.childNodes[0],"overflow")!="visible") {
	    var oContent=ur_TS_drawScrollContent(sId);
	    iHeight=iHeight_atr;
	    var iWidth=oContent.width;
	}else{
	  var iWidth=0;
	}
	if(oTabTable.getAttribute("exact")=="1"){
	for(i=0;i<iCount;i++){
		curTab = ur_get(sId + "-cnt-" + i);
		if (sapUrMapi_getCurrentStyle(curTab.childNodes[0],"overflow")=="visible") {
		if(curTab.scrollHeight>iHeight) iHeight=curTab.scrollHeight;
		if(curTab.scrollWidth>iWidth) iWidth=curTab.scrollWidth;
		} else {
		   arrTabs.push(curTab);
		}
	}
		for (var i=0;i<arrTabs.length;i++) {
			arrTabs[i].childNodes[0].style.height=iHeight;
			arrTabs[i].childNodes[0].style.width=iWidth;
		}
		if (activeTab.offsetHeight<=iHeight) {
		activeTab.style.height=iHeight;
		}
		if (activeTab.offsetWidth<iWidth) { 
		if(! (oTabTable.style.width =="100%") )
		activeTab.style.width=iWidth;
		}
	}
}
	
function ur_TS_drawScrollContent(sId) {
	var curTab = ur_get(sId + "-cnt-" + ur_get(sId+"-tbl").getAttribute("selectedtab"));
	if (sapUrMapi_getCurrentStyle(curTab.childNodes[0],"overflow")!="visible") {
	  var oBorders=curTab.parentNode;
		var iBl=parseInt(sapUrMapi_getCurrentStyle(oBorders,"borderBottomWidth"));
		var iBr=parseInt(sapUrMapi_getCurrentStyle(oBorders,"borderRightWidth"));
		var iBt=parseInt(sapUrMapi_getCurrentStyle(oBorders,"borderTopWidth"));
		var iBb=parseInt(sapUrMapi_getCurrentStyle(oBorders,"borderBottomWidth"));
	  curTab.childNodes[0].style.height=curTab.parentNode.offsetHeight-iBt-iBb;
	  curTab.childNodes[0].style.width=curTab.parentNode.offsetWidth-iBl-iBr;
	  curTab.style.overflow="visible";
	  return {height:curTab.parentNode.offsetHeight-iBt-iBb,width:curTab.parentNode.offsetWidth-iBl-iBr};
	} else {
	  return {height:curTab.offsetHeight,width:curTab.offsetWidth};
	}
}
function sapUrMapi_TabStrip_resize(sId,iCount)
{
 	
 	try{
 	
 	if(!ur_get(sId)) return;
 	
 	var iSel=ur_get(sId+"-tbl").getAttribute("selectedtab");
	var activeTab = ur_get(sId + "-cnt-" + iSel);
	
	
	
	
	sapUrMapi_TabStrip_create(sId,iCount,iSel);
	}catch(ex) {};
}
function sapUrMapi_TabStrip_getSelectedItemId(sTabStripId) {
  var oTabTable 	= document.getElementById(sTabStripId+"-tbl");
	var iSelTab			=	parseInt(oTabTable.getAttribute("selectedtab"));
	return sTabStripId+"-itm-"+iSelTab;
}
function sapUrMapi_TabStrip_keySelect(strId, intSelectedIdx, intTabCount,e) {
	if (sapUrMapi_checkKey(e,"keydown",new Array("39","37"))){
	  e.cancelBubble=true;
	  e.returnValue=false;
		if (ur_system.direction == "rtl") {
			sapUrMapi_TabStrip_focusItem(strId,intSelectedIdx,intTabCount,e.keyCode==37,e.keyCode==39);
			return;
		} else {
			sapUrMapi_TabStrip_focusItem(strId,intSelectedIdx,intTabCount,e.keyCode==39,e.keyCode==37);
			return;
		}
  }
  if (sapUrMapi_checkKey(e,"keydown",new Array("32"))){
	  if(e.srcElement.parentNode.className != "urTbsLabelOffDsbl")
  		e.srcElement.click();
	
	ur_EVT_cancel(e);
  	return;
  }
}
function sapUrMapi_TabStrip_focusItem(sTabStripId,iFocusIdx,iTabCount,bNext,bPrev) {
  var oTabTable 	= document.getElementById(sTabStripId+"-tbl");
	if (isNaN(iFocusIdx)) iFocusIdx = parseInt(oTabTable.getAttribute("selectedtab"));
	var iNewIndex=iFocusIdx;
	if (bNext) { 
		if (iFocusIdx<iTabCount-1) iNewIndex=iFocusIdx+1;
		else iNewIndex=0;
	}
	if (bPrev) {
		if (iFocusIdx>0) iNewIndex=iFocusIdx-1;
		else iNewIndex=iTabCount-1;
	}
	oFocusedTab = document.getElementById(sTabStripId+"-itm-"+iNewIndex)
  var oTabTable 	= document.getElementById(sTabStripId+"-tbl");
	var iOldFoc     = parseInt(oTabTable.getAttribute("focusedtab"));
	if (!isNaN(iOldFoc)) {
		sapUrMapi_setTabIndex(document.getElementById(sTabStripId+"-itm-"+iOldFoc+"-txt"),-1);
	}
	var oFoc = document.getElementById(sTabStripId+"-itm-"+iNewIndex+"-txt");
  sapUrMapi_setTabIndex(oFoc,0);
  ur_focus(oFoc);
 	oTabTable.setAttribute("focusedtab",iNewIndex);
	if ((oFocusedTab.getAttribute("dsbl")=="true")&&(!ur_system.is508)) {
 		sapUrMapi_TabStrip_focusItem(sTabStripId,iNewIndex,iTabCount,bNext,bPrev);
		return;
	}
}
function sapUrMapi_TabStrip_enter (sId,e) {
	if (e.srcElement.id==sId+"-skipstart") {
		if (sapUrMapi_skip(sId+'-skipstart',sId+'-skipend',e)) return;
    if (!e.shiftKey) { 
		  if (sapUrMapi_checkKey(e,"keydown",new Array("9","39","37"))){
	      sapUrMapi_TabStrip_focusItem(sId);
			  e.cancelBubble=false;
		  }
	  }
	}
}
function sapUrMapi_TabStrip_setActiveItem(sId,iIdx) {
	with (document) {
		var oTabTable 	= getElementById(sId+"-tbl");
		var iSelTab			=	parseInt(oTabTable.getAttribute("selectedtab"));
		var iTabLength	=	parseInt(oTabTable.getAttribute("tabcount"));
		if (isNaN(iIdx)) return;
		if (getElementById(sId+"-itm-"+iIdx).getAttribute("dsbl")=="true") return false; 
		if ((iTabLength==1) || (iSelTab==iIdx)) return true; 
		var oCurrentTxt  = getElementById(sId+"-itm-"+iSelTab+"-txt");
		var oCurrentCell = getElementById(sId+"-itm-"+iSelTab);
		var oClickedTxt  = getElementById(sId+"-itm-"+iIdx+"-txt");
		var oClickedCell = getElementById(sId+"-itm-"+iIdx);
		var oFirstImage  = getElementById(sId+"-p");
		var oLastImage   = getElementById(sId+"-n");
		oCurrentCell.className="urTbsLabelOff"; 
		oCurrentTxt.className = "urTbsTxtOff";  
		oClickedTxt.className = "urTbsTxtOn";   
	  oClickedCell.className="urTbsLabelOn";  
		
		var oCurrentContent  = getElementById(sId+"-cnt-"+iSelTab);
	  	var oClickedContent  = getElementById(sId+"-cnt-"+iIdx);
		var o=ur_TS_drawScrollContent(sId);
		
		if (iIdx!=0) oFirstImage.className="urTbsFirstAngOffPrevoff"; 
		else oFirstImage.className="urTbsFirstAngOnPrevoff"; 
		if (iIdx!=iTabLength-1)oLastImage.className="urTbsLastOffNextoff"; 
		else oLastImage.className="urTbsLastOnNextoff"; 
	  
		if (iSelTab==0) getElementById(sId+"-itm-"+(iSelTab+1)+"-a").className="urTbsAngOffOff";
		else  {
	  	getElementById(sId+"-itm-"+(iSelTab)+"-a").className="urTbsAngOffOff";
		  if (iSelTab!=iTabLength-1) getElementById(sId+"-itm-"+(iSelTab+1)+"-a").className="urTbsAngOffOff";
		}
	  
		if (iIdx==0) getElementById(sId+"-itm-"+(iIdx+1)+"-a").className="urTbsAngOnOff";
		else {
			getElementById(sId+"-itm-"+(iIdx)+"-a").className="urTbsAngOffOn";
			if (iIdx!=iTabLength-1) getElementById(sId+"-itm-"+(iIdx+1)+"-a").className="urTbsAngOnOff";
		}
	  oTabTable.setAttribute("selectedtab",iIdx); 
	  sapUrMapi_TabStrip_focusItem(sId,iIdx); 
	  
		if (sapUrMapi_getCurrentStyle(oClickedContent.childNodes[0],"overflow")!="visible") {
			oClickedContent.childNodes[0].style.height=o.height;
			oClickedContent.childNodes[0].style.width=o.width;
		} else {
	      if (ur_get(sId).getAttribute("exact")=="1") {
				oClickedContent.style.height=o.height;
				if(! (ur_get(sId).style.width =="100%") )
				oClickedContent.style.width=o.width;
		  }
		}
		oCurrentContent.style.position="absolute";
		oCurrentContent.style.visibility="hidden";
		oClickedContent.style.overflow="visible";
		oClickedContent.style.position="static";
		oClickedContent.style.visibility="inherit";
		}
	if (ur_system.is508) {
		var sTt=oClickedTxt.title;
	  oClickedTxt.title=oClickedTxt.getAttribute("tt");
	  oClickedTxt.setAttribute("tt",sTt);
		sTt=oCurrentTxt.title;
	  oCurrentTxt.title=oCurrentTxt.getAttribute("tt");	  
	  oCurrentTxt.setAttribute("tt",sTt); 
	}
	sapUrMapi_Focus_showFocusRect();
	return true;
}

//** TextEdit.ie5 **

function sapUrMapi_TextEdit_focus(sId,oEvt){
	if(ur_system.is508) {
		var o=ur_get(sId);
		o.title=ur_getTooltip(sId);
	}
	sapUrMapi_DataTip_show(sId,"focus");
}
function sapUrMapi_TextEdit_blur(sId,oEvt) {
	sapUrMapi_DataTip_hide(sId);
}
function sapUrMapi_TextEdit_keydown(sId,oEvt) {
	if(oEvt.keyCode == "81" && oEvt.ctrlKey && !oEvt.altKey ){
		if (sapUrMapi_DataTip_isOpen(sId)) sapUrMapi_DataTip_hide(sId);
		else sapUrMapi_DataTip_show(sId,"keydown");
		sapUrMapi_cancelEvent(oEvt);
	}
	if(oEvt.keyCode == "27"){
		sapUrMapi_DataTip_hide(sId);
		sapUrMapi_cancelEvent(oEvt);
	}
}

//** TextView.ie5 **

function sapUrMapi_TextView_menuActivate(sTextViewId,e) {
	var o=ur_get(sTextViewId);
	if(sapUrMapi_checkKey(e,"keydown",new Array("32","40"))) {
		if(o.onclick) {o.onclick();return false;} 
		if(o.oncontextmenu) {o.oncontextmenu();return false;} 
		if(o.onmouseover) {o.onmouseover();return false;} 
	}
  return false;
}
function sapUrMapi_TextView_focus(sId,oEvt) {
	if(ur_system.is508) {
		var o=ur_get(sId);
		if(o!=null) o.title=ur_getTooltip(sId);
		else oEvt.srcElement.title=ur_getTooltip(oEvt.srcElement);
	}
}
//** Toolbar.ie5 **

function sapUrMapi_Toolbar_toggleItems(sControlId,e) {
  var oToggleButton = document.getElementById(sControlId+"-tgl");
  var oToolbar = document.getElementById(sControlId);
  var colItems = oToolbar.childNodes;
  e.cancelBubble=true;
  e.returnValue=false;
  var bShowAllState = oToggleButton.getAttribute("showall")=="true";
  for (var n=0;n<colItems.length;n++) {
  	var oItem=colItems.item(n);
  	if (oItem.nodeType!=3) {
	  	if (oItem.getAttribute("cancollapse")=="true") {
	  	  if (bShowAllState) {
	  		  oItem.style.display="none";
	  		  oItem.setAttribute("show","false");
	      } else {
	    	  oItem.style.display="inline";
	  		  oItem.setAttribute("show","true");
	    	}
	    }
	  }
    if (oItem==oToggleButton) break;
	}
  if (bShowAllState) {
    oToggleButton.setAttribute("showall","false");
    oToggleButton.getElementsByTagName("IMG").item(0).className="urTbarBtnCol";
  } else {
    oToggleButton.setAttribute("showall","true");
    oToggleButton.getElementsByTagName("IMG").item(0).className="urTbarBtnExp";
  }
  sapUrMapi_refocusElement(oToggleButton.id);
  sapUrMapi_Focus_showFocusRect(oToggleButton);
}

//** ToolbarButton.ie5 **
function sapUrMapi_ToolbarButton_setFunctionFromMenuItem(sMenuItemId) {
  if (ur_replace_function) {
  	var clickedItem = document.getElementById(sMenuItemId);
    var sImgSrc=""
    if (clickedItem.getElementsByTagName("img").length>0) {
      sImgSrc=clickedItem.getElementsByTagName("img").item(0).src;
    }
    var sText=clickedItem.getElementsByTagName("nobr").item(0).innerText;
    var effectedButtonId=ur_replace_function_button_id;
    ur_replace_function_button_id="";
    ur_replace_function=false;
    sapUrMapi_ToolbarButton_applyFunction( effectedButtonId, sText, sImgSrc, clickedItem.onclick)
  }
}
function sapUrMapi_ToolbarButton_applyFunction( sButtonId, sNewText, sNewImageSrc, fNewClickHandler){
  var effectedButton=document.getElementById(sButtonId);
  var bNoText=(document.getElementById(sButtonId+"-r").getAttribute("notext")=="true");
  effectedButton.onclick=fNewClickHandler;
  effectedButton.onkeydown=fNewClickHandler;
  var sButtonContent=effectedButton.getElementsByTagName("nobr").item(0).innerHTML;
  var oButtonContent = effectedButton.getElementsByTagName("nobr").item(0);
  if (oButtonContent.getElementsByTagName("img").length>0) {
    if (sNewImageSrc=="") {
    	if (!bNoText) { 
      effectedButton.getElementsByTagName("nobr").item(0).innerHTML="<img height=\"12\" width=\"1\" border=\"0\" align=\"absmiddle\" src=\""+ur_system.mimepath+"1x1.gif\">"+sNewText
    } else {
	      effectedButton.getElementsByTagName("nobr").item(0).innerHTML="<img height=\"12\" width=\"12\" border=\"0\" align=\"absmiddle\" src=\""+ur_system.mimepath+"1x1.gif\">";
    	}
    } else {
    	if (!bNoText) { 
      effectedButton.getElementsByTagName("nobr").item(0).innerHTML="<img border=\"0\" align=\"absmiddle\" src=\""+sNewImageSrc+"\">&nbsp;"+sNewText;
      } else {
        effectedButton.getElementsByTagName("nobr").item(0).innerHTML="<img border=\"0\" align=\"absmiddle\" src=\""+sNewImageSrc+"\">";
      }
    }
  } else {
    effectedButton.getElementsByTagName("nobr").item(0).innerHTML=sNewText;
  }
 }

//** ToolbarInputField.ie5 **

function sapUrMapi_ToolbarInputField_blur(sId,event){
	sapUrMapi_InputField_Blur(sId,event);
}
function sapUrMapi_ToolbarInputField_keydown(sId,oEvt) {
	if(oEvt.keyCode == "81" && oEvt.ctrlKey && !oEvt.altKey ){
		oEvt.keyCode = "";
		oEvt.cancelBubble = true;
		oEvt.returnValue = false;
		if (sapUrMapi_DataTip_isOpen(sId)) sapUrMapi_DataTip_hide(sId);
		else sapUrMapi_DataTip_show(sId,"keydown");
	}
	if(oEvt.keyCode == "27"){
		oEvt.keyCode = "";
		oEvt.cancelBubble = true;
		oEvt.returnValue = false;
		sapUrMapi_DataTip_hide();
	}
}

//** Tray.ie5 **

function sapUrMapi_Tray_RegisterCreate(sId, bScroll, bCollapsed) {
	sapUrMapi_Create_AddItem(sId, "sapUrMapi_Tray_create('" + sId + "',"+bScroll+","+bCollapsed+")");
}
function sapUrMapi_Tray_create(sId,bScroll,bCollapsed) {
}
function sapUrMapi_Tray_showOptionMenu2(sTrayId,sMenuContentId,oEvt) {
 	if (ur_system.direction=="rtl")
	  sapUrMapi_Tray_showOptionMenu(sTrayId,sTrayId+"-menu",sMenuContentId,sapPopupPositionBehavior.MENULEFT,oEvt) 
	else
	  sapUrMapi_Tray_showOptionMenu(sTrayId,sTrayId+"-menu",sMenuContentId,sapPopupPositionBehavior.MENURIGHT,oEvt) 
}
function sapUrMapi_Tray_showOptionMenu(sTrayId,sTriggerId,sMenuContentId,enumPositionBehavior,e) {
	if (e.type!="click") {
		if (!sapUrMapi_checkKey(e,"keydown",new Array("32","40"))) {
		  return false;
	  } else {
		  sapUrMapi_cancelEvent(e);
	  }
	}
	sapUrMapi_PopupMenu_showMenu(sTriggerId,sMenuContentId,enumPositionBehavior,e);
}
function sapUrMapi_Tray_toggle(sTrayId,x,e) {
  sCtlType="SAPUR_TRAY";
	if ((e.type!="click") && (!sapUrMapi_checkKey(e,"keydown",new Array("32","30")))) return false;
	e.cancelBubble=true;
	var elBody = document.getElementById(sTrayId+"-tbd"); 
	var sTitle = document.getElementById(sTrayId+"-hd");
	var elHeader = document.getElementById(sTrayId+"-hd");
	var oSkip = elHeader.parentNode;
	var elExp = document.getElementById(sTrayId+"-exp"); 
	if ( elBody != null && elExp != null ) {
		if ( elBody.style.display == "none" ) {
			elBody.style.display = "block";
			if (elExp.className.indexOf("Closed") != -1) {
				var re = /Closed/gi;
				var clsNm = elExp.className;
				
				elExp.className = clsNm.replace(re, "Open");
				
			}
			if (elHeader.className == "urTrcHdBgClosedIco" )	elHeader.className = "urTrcHdBgOpenIco";
			if (ur_system.is508) {
				if (oSkip.getAttribute("ot")==null || oSkip.getAttribute("ot")=="") {
				  oSkip.title=getLanguageText("SAPUR_TRAY_WHL",new Array(oSkip.getAttribute("ttl"),"SAPUR_TRAY","SAPUR_EXPANDED","SAPUR_SKIPSTART","SAPUR_ENTERTAB"));
				  
				} else {
				  oSkip.title=getLanguageText("SAPUR_TRAY_WHL",new Array(oSkip.getAttribute("ttl"),"SAPUR_TRAY","SAPUR_EXPANDED","SAPUR_SKIPSTART","SAPUR_ENTERTAB"));
				}
				elExp.title=getLanguageText(sCtlType + "_COLLAPSE_ACC");
			} else {
				elExp.title=getLanguageText(sCtlType + "_COLLAPSE");
			}
		} else {
			elBody.style.display = "none";
			if (elExp.className.indexOf("Open") != -1) {
				var re = /Open/gi;
				var clsNm = elExp.className;
				
				elExp.className = clsNm.replace(re, "Closed");
				
			}
			if (elHeader.className == "urTrcHdBgOpenIco" ) elHeader.className = "urTrcHdBgClosedIco";
			if (ur_system.is508) {
				if (oSkip.getAttribute("ot")==null || oSkip.getAttribute("ot")=="") {
				  oSkip.title=getLanguageText("SAPUR_TRAY_WHL",new Array(oSkip.getAttribute("ttl"),"SAPUR_TRAY","SAPUR_COLLAPSED","SAPUR_SKIPSTART","SAPUR_ENTERTAB"));
				} else {
				  oSkip.title=getLanguageText("SAPUR_TRAY_WHL",new Array(oSkip.getAttribute("ttl"),"SAPUR_TRAY","SAPUR_COLLAPSED","SAPUR_SKIPSTART","SAPUR_ENTERTAB"));
				}
				elExp.title=getLanguageText(sCtlType + "_EXPAND_ACC");
			} else {
				elExp.title=getLanguageText(sCtlType + "_EXPAND");
			}
		}
		sapUrMapi_focusElement(elExp);
	}
	return true;
}

//** Tree.ie5 **

function sapUrMapi_Tree_collapseAll(sTreeId) {
    var eRootNode = document.getElementById(sTreeId + "-r");
    var eNodes = eRootNode.getElementsByTagName("DIV");
    
    for (var i =  eNodes.length-1; i >-1; i--){
      var childDiv = document.getElementById(eNodes[i].id + "-child");
      if (childDiv) {
        sapUrMapi_Tree_toggle( sTreeId, eNodes[i].id, true, true)
      }
    }
}
function sapUrMapi_Tree_expandAll(sTreeId) {
    var eRootNode = document.getElementById(sTreeId + "-r");
    var eNodes = eRootNode.getElementsByTagName("DIV");
    
    for (var i =  eNodes.length-1; i >-1; i--){
      var childDiv = document.getElementById(eNodes[i].id + "-child");
      if (childDiv) {
        sapUrMapi_Tree_toggle( sTreeId, eNodes[i].id, false, true)
      }
    }
}
function sapUrMapi_Tree_toggle( sTreeId, sNodeId, bClose, bKey) {
	var nodeDiv = document.getElementById(sNodeId);
  var oMainContainerNode = document.getElementById(sTreeId+"-r");
  if (window.event)
    sapUrMapi_cancelEvent(window.event);
  if (!bKey) {
    oMainContainerNode.setAttribute("focuced_id",sNodeId);
    sapUrMapi_Tree_focusNode(sTreeId,sNodeId);
	}
  var childrenDiv = document.getElementById( nodeDiv.id + "-child" );
	var expander = document.getElementById( nodeDiv.id + "-exp" );
	if (((nodeDiv.status == "closed")&&(!bKey))||((bKey)&&(!bClose)&&(nodeDiv.status == "closed")))
	{
	  nodeDiv.className = nodeDiv.className+" urTreNlExp";
		if( childrenDiv != null) childrenDiv.style.display="block";
		eLength = expander.className.length;
		expander.className = expander.className.substr(0,eLength-3) + "Op";
    nodeDiv.setAttribute("status", "open");
    try { sapUrMapi_Tree_focusNode(sTreeId,sNodeId); } catch (e) {};
    return;
	}
	if (((nodeDiv.status == "open")&&(!bKey))||((bKey)&&(bClose)&&(nodeDiv.status == "open")))
	{
		if (nodeDiv.className.lastIndexOf(" ")>-1) {
		  nodeDiv.className = nodeDiv.className.substring(0,nodeDiv.className.lastIndexOf(" "));
		}
		if( childrenDiv != null) childrenDiv.style.display="none";
		eLength = expander.className.length;
		expander.className = expander.className.substr(0,eLength-2) + "Clo";
		nodeDiv.setAttribute("status", "closed");
    try { sapUrMapi_Tree_focusNode(sTreeId,sNodeId); } catch (e) {};
		return;
	}
}
function sapUrMapi_Tree_focusNode(sTreeId,sNodeId,bInit,bNoFocus) {
	var oMainContainerNode = document.getElementById(sTreeId+"-r");
	var oR=ur_get(sTreeId+"-skipstart");
	if (sNodeId=="") return;
	if (sNodeId.indexOf("-skipstart")>0) return;
	var oNode = document.getElementById(sNodeId);
	if (bInit) oMainContainerNode.setAttribute("focuced_id",null);
	var sOldNode = oMainContainerNode.getAttribute("focuced_id");
	try {
		if (sOldNode) {
		  sapUrMapi_setTabIndex(document.getElementById(sOldNode).lastChild,-1);
		}
  } catch (ex) {
  }
	oMainContainerNode.setAttribute("focuced_id",oNode.id);
	if(ur_system.is508) {
		var sSelectable   = "";
		var sSelected   = "";
		var sContext      = "";
		var sContainer    = "";
		var sState="";
		var sTutor="";
		var sSep=" "+getLanguageText("SAPUR_SEPARATOR")+" ";
		var sTtTree=oMainContainerNode.getAttribute("tt");
		var sTt=oNode.getAttribute("tt");	
		var sAccTt="";
			
		var oEventer= document.getElementById(oNode.id+"-cnt-start");
		if (oEventer==null) {
		  return;
		}
		
		
		if(oEventer.className.indexOf("Dsbl")>-1)  
			sState = getLanguageText("SAPUR_DISABLED");
		if (oNode.getAttribute("status")=="open")  {
			if (ur_get(oNode.id+"-child")){
				if(sState!="") sState+=" ";
				sState+=getLanguageText("SAPUR_EXPANDED");
			}
		} else {
		  if (ur_get(oNode.id+"-child")){
				if(sState!="") sState+=" ";
				sState+=getLanguageText("SAPUR_COLLAPSED");
			}
		}
		if(oEventer.sellevel=="1"){
			if(sState!="") sState+=" ";
			sState+=getLanguageText("SAPUR_TREE_ITEM_SELECTED1");
		}
		if(oEventer.sellevel=="2"){
			if(sState!="") sState+=" ";
			sState+=getLanguageText("SAPUR_TREE_ITEM_SELECTED2");
		}
		if (oEventer.getAttribute("container")=="true"){
			sContainer=getLanguageText("SAPUR_TREE_ITEM_CONTAINER");
		}
		
		if(bInit){
			sTutor=getLanguageText("SAPUR_TREE_NAV");
		}		
		if (oEventer.onclick){
			if(sTutor!="") sTutor+=" ";
			if (oEventer.getAttribute("container")=="true")
				sTutor+=getLanguageText("SAPUR_TREE_ITEM_ENTER");
			else
				sTutor+=getLanguageText("SAPUR_TREE_ITEM_SELECTABLE");
		}
		if (oEventer.oncontextmenu){
			if(sTutor!="") sTutor+=" ";
			sTutor+=getLanguageText("SAPUR_TREE_ITEM_CONTEXTMENU");
		}
		
		if(bInit){
			sAccTt=oR.innerText;
			if(sAccTt!="") sAccTt+=sSep;
			sAccTt+=getLanguageText("SAPUR_TREE");
			if(sTtTree!=null && sTtTree!="")
				sAccTt+=sSep+sTtTree;
		}
		if(sAccTt!="") sAccTt+=sSep;
		sAccTt+=oNode.lastChild.innerText;
		if(sState!=null && sState!="")
			sAccTt+=sSep+sState;
		if(sContainer!=null && sContainer!=""){
			if(sAccTt!="") sAccTt+=sSep;
			sAccTt+=" "+sContainer;		
		}	
		sAccTt+=" "+getLanguageText("SAPUR_TREE_ITEM_LEVEL")+" "+oEventer.level;			
		if(sTt!=null && sTt!="")
			sAccTt+=sSep+sTt;
		if(sTutor!=null && sTutor!="")
			sAccTt+=sSep+sTutor;
			
		oNode.lastChild.title=sAccTt;
	}
	sapUrMapi_setTabIndex(oNode.lastChild,0);
  if (!bNoFocus) ur_focus(oNode.lastChild);
  sapUrMapi_Focus_showFocusRect();
}
function sapUrMapi_TreeNode_keyDown(sTreeId,sNodeId,e) {
	if (sapUrMapi_checkKey(e,"keydown",new Array("32"))) {
		 
		 oNodeEvents = document.getElementById(sNodeId+"-cnt-start");
		 if (oNodeEvents.onclick) {
		 	  oNodeEvents.onclick();
		 	  return true;
		 } else {
		 	
		 	e.cancelBubble=false;
		 	e.returnValue=false;
		 }
	}
	if (sapUrMapi_checkKey(e,"keydown",new Array("121"))) { 
		 
		 if ((e.shiftKey))
		 oNodeEvents = document.getElementById(sNodeId+"-cnt-start");
		 if (oNodeEvents.oncontextmenu) {
		 	  oNodeEvents.oncontextmenu();
		 	  return true;
		 } else {
		 	
		 	e.cancelBubble=false;
		 	e.returnValue=false;
		 }
	}
	if (sapUrMapi_checkKey(e,"keydown",new Array("38","39","40","37","9","107","109"))) {
		sapUrMapi_Tree_keyDown(sTreeId,e)
  }
}
function sapUrMapi_TreeNode_hover(sTreeId,sNodeId,bIn,e) {
	if ((e.srcElement.level) && (!e.srcElement.container)) {
    if (bIn) e.srcElement.className="urTreNoEnblClk urTreNoEnblClkHover"
    else e.srcElement.className="urTreNoEnblClk";
  }
}
function sapUrMapi_TreeNode_mouseover(sTreeId,sNodeId,e) {
	sapUrMapi_TreeNode_hover(sTreeId, sNodeId, true, e);
}
function sapUrMapi_TreeNode_mouseout(sTreeId,sNodeId,e) {
	sapUrMapi_TreeNode_hover(sTreeId, sNodeId, false, e);
}
function sapUrMapi_Tree_enter (sTreeId,e) {
	
	
	var oFocusedNode=null;
	if (e.srcElement.id==sTreeId+"-skipstart") {
	  var oMainContainerNode = document.getElementById(sTreeId+"-r");
		
		
		if (document.getElementById(sTreeId+"-skipstart").getAttribute("exit")=="true") {
			document.getElementById(sTreeId+"-skipstart").setAttribute("exit","false");
			var sFocusedNode= oMainContainerNode.getAttribute("focuced_id");
		  if (sFocusedNode!="") {
		  	 oFocusedNode=document.getElementById(sFocusedNode);
			   sapUrMapi_setTabIndex(oFocusedNode.lastChild,-1);
		  }
		} else {
			
		  var sFocusedNode= oMainContainerNode.getAttribute("focuced_id");
		  if (sFocusedNode) {
				 oFocusedNode=document.getElementById(sFocusedNode);
		  } else {
		  	 var nodelist= oMainContainerNode.getElementsByTagName("DIV");
		  	 for (var nlc=0;nlc<nodelist.length;nlc++) {
		  	   if (nodelist.item(nlc).getAttribute("sellevel")=="1") {
		  	     oFocusedNode=nodelist.item(nlc);
		  	     break;
		  	   }
		  	 }
		     if (oFocusedNode==null) {
		       var nodelist=oMainContainerNode.getElementsByTagName("DIV");
		  	   oFocusedNode=nodelist.item(0);
		  	   if (oFocusedNode.id.indexOf("-")>0) {
		  	     oFocusedNode=oFocusedNode.childNodes.item(0);
		  	   }
			}
			}
			sapUrMapi_Tree_focusNode(sTreeId,oFocusedNode.id,true);
	  }
	} else {
		
		var oLastElement=document.getElementById(sTreeId+"-skipend")
		if (oLastElement.getAttribute("exit")=="true") {
			
			
			oLastElement.setAttribute("exit","false");
		} else {
			ur_focus(document.getElementById(sTreeId+"-skipstart"));
	  }
	}
}
function sapUrMapi_Tree_expandNode(sTreeId,sFocusedNode,sMainContainerNode) {
  if (!sFocusedNode) {
    sFocusedNode=sMainContainerNode.childNodes.item(0);
  } else {
	if ((sFocusedNode.getAttribute("status")=="closed")) {
	  if (sFocusedNode.parentElement!=sMainContainerNode) {
		if (sFocusedNode.parentElement.previousSibling) {
		  sFocusedNode=sFocusedNode.parentElement.previousSibling;
		}
	  }
	} else {
	  if (((sFocusedNode.nextSibling)&&(sFocusedNode.nextSibling.id.indexOf("-child")==-1))||(!sFocusedNode.nextSibling)) {
		if (sFocusedNode.parentElement!=sMainContainerNode) {
		  if (sFocusedNode.parentElement.previousSibling) {
			sFocusedNode=sFocusedNode.parentElement.previousSibling;
		  }
		}
	  } else {
		if (sFocusedNode.nextSibling) {
		  if (sFocusedNode.nextSibling.id.indexOf("-child")>-1) {
			sapUrMapi_Tree_toggle(sTreeId,sFocusedNode.id,sTreeId,true,true);
		  }
		}
	  }
	}
  }
}
function sapUrMapi_Tree_collapseNode(sTreeId,sFocusedNode, sMainContainerNode) {
  if (!sFocusedNode) {
	sFocusedNode=sMainContainerNode.childNodes.item(0);
  } else {
	if (sFocusedNode.getAttribute("status")=="open") {
	  if (sFocusedNode.nextSibling) {
		if (sFocusedNode.nextSibling.id.indexOf("-child")>-1) {
	  	  sFocusedNode=sFocusedNode.nextSibling.firstChild;
		}
	  }
	} else {
	  if (sFocusedNode.nextSibling.id.indexOf("-child")>-1) {
  		sapUrMapi_Tree_toggle(sTreeId,sFocusedNode.id,sTreeId,false,true);
  	  }
	}
  }
}
function sapUrMapi_Tree_keyDown(sTreeId,e) {
  var oFocusedNode=null;
  var oMainContainerNode = document.getElementById(sTreeId+"-r");
  var sFocusedNode= oMainContainerNode.getAttribute("focuced_id");
  if (sFocusedNode!="") {
  	 oFocusedNode=document.getElementById(sFocusedNode);
  }
  if (sapUrMapi_checkKey(e,"keydown",new Array("38","39","40","37","9","32","107","109"))) {
  	if (e.keyCode==9) { 
  		if (!e.shiftKey) {
  			oLastElement = document.getElementById(sTreeId+"-skipend");
  			oLastElement.setAttribute("exit","true");
  			ur_focus(oLastElement);
	  		e.cancelBubble=false;
	  		e.returnValue=true;
	  		return;
  		} else {
  			oFirstElement = document.getElementById(sTreeId+"-skipstart");
  			oFirstElement.setAttribute("exit","true");
  			ur_focus(oFirstElement);
  			e.cancelBubble=false;
	  		e.returnValue=true;
	  		return;
  		}
  	}
  	if (e.keyCode==40) { 
		  if (!oFocusedNode) {
	  	  oFocusedNode=oMainContainerNode.childNodes.item(0);
		  } else {
		  	if (oFocusedNode.getAttribute("status")=="open") { 
		  	  oNextContainer = document.getElementById(oFocusedNode.id+"-child");
		  	  if (oNextContainer && oFocusedNode.nextSibling.firstChild) oFocusedNode=oFocusedNode.nextSibling.childNodes.item(0);
          else if (oNextContainer && oFocusedNode.nextSibling.nextSibling) oFocusedNode=oFocusedNode.nextSibling.nextSibling; 
          else if (!oNextContainer && oFocusedNode.nextSibling) oFocusedNode=oFocusedNode.nextSibling; 
			  	     else if (oFocusedNode.parentElement !=oMainContainerNode)
			  	     { 
				  	     	oParent = oFocusedNode.parentElement.previousSibling;
				  	     	while ((!oParent.nextSibling.nextSibling) && (oParent.parentElement!=oMainContainerNode)) {
				  	     		 oParent=oParent.parentElement.previousSibling;
				  	     	}
				  	     	if (oParent.nextSibling.nextSibling) {
				  	     		oFocusedNode=oParent.nextSibling.nextSibling;
				  	     	}
			  	     }
			  } else {
		  		if (oFocusedNode.getAttribute("status")=="closed") {
			  		if (oFocusedNode.nextSibling.nextSibling) {
				  	  oFocusedNode=oFocusedNode.nextSibling.nextSibling;
			  		} else { 
		  	     	oParent = oFocusedNode;
		  	     	while ((!oParent.nextSibling.nextSibling) && (oParent.parentElement!=oMainContainerNode)) {
		  	     		 oParent=oParent.parentElement.previousSibling;
		  	     	}
		  	     	if (oParent.nextSibling.nextSibling) {
		  	     		oFocusedNode=oParent.nextSibling.nextSibling;
		  	     	}
			  		}
		  		}
		  	}
		  }
		}
		if (e.keyCode==39) {
		  if (ur_system.direction=="rtl") {
		    sapUrMapi_Tree_expandNode(sTreeId,oFocusedNode,oMainContainerNode)
		  } else {
		    sapUrMapi_Tree_collapseNode(sTreeId,oFocusedNode,oMainContainerNode);
		  }
		}
		if (e.keyCode==37) {
		  if (ur_system.direction=="rtl") {
		    sapUrMapi_Tree_collapseNode(sTreeId,oFocusedNode,oMainContainerNode);
		  } else {
		    sapUrMapi_Tree_expandNode(sTreeId,oFocusedNode,oMainContainerNode)
		  }
		}
		if (e.keyCode==109) 
			sapUrMapi_Tree_expandNode(sTreeId,oFocusedNode,oMainContainerNode);
		if (e.keyCode==107) 
		    sapUrMapi_Tree_collapseNode(sTreeId,oFocusedNode,oMainContainerNode);
		
		if (e.keyCode==38) {
		  if (!oFocusedNode) {
			  oFocusedNode=oMainContainerNode.childNodes.item(0);
		  } else {
			  oParent = oFocusedNode.parentElement;
	    	if (oFocusedNode != oMainContainerNode.childNodes.item(0)) {
		    	if (oFocusedNode==oParent.childNodes(0)) {
		    		if (oParent==oMainContainerNode) {
		    			oFocusedNode=oParent.lastChild;
				  		while ((oFocusedNode.id.indexOf("-child")>-1)&&(oFocusedNode.previousSibling.getAttribute("status")=="closed")) {
				  		  oFocusedNode=oFocusedNode.previousSibling;
				  		}
				  		while ((oFocusedNode.id.indexOf("-child")>-1)&&(oFocusedNode.previousSibling.getAttribute("status")=="open")) {
				  		  oFocusedNode=oFocusedNode.lastChild;
				  		}
				  		if (oFocusedNode.previousSibling) {
				  		  if (oFocusedNode.previousSibling.getAttribute("status")=="closed") {
				  		    oFocusedNode=oFocusedNode.previousSibling;
				  		  }
				  		}
		    		} else {
			  		  oFocusedNode=oParent.previousSibling;
						}
					} else {
						oFocusedNode=oFocusedNode.previousSibling;
							while ((oFocusedNode.id.indexOf("-child")>-1)&&(oFocusedNode.previousSibling.getAttribute("status")=="closed" || !oFocusedNode.lastChild)) {
						  oFocusedNode=oFocusedNode.previousSibling;
						}
							while ((oFocusedNode.id.indexOf("-child")>-1)&&(oFocusedNode.previousSibling.getAttribute("status")=="open") && oFocusedNode.lastChild) {
						  oFocusedNode=oFocusedNode.lastChild;
						}
						if (oFocusedNode.previousSibling) {
								if (oFocusedNode.previousSibling.getAttribute("status")=="closed" || !oFocusedNode.lastChild) {
							  oFocusedNode=oFocusedNode.previousSibling;
							}
						}
					}
				}
			}
	  }
 		e.cancelBubble=true;
  	sapUrMapi_Tree_focusNode(sTreeId,oFocusedNode.id)
  }
}
function sapUrMapi_Tree_controlExit(sTreeId, sNodeId,e) {
	var oContainer = document.getElementById(sNodeId+"-cnt-start");
  sapUrMapi_setTabIndex(oContainer,-1); 
  oContainer.onkeydown=null;  
  														
  oContainer.title = ""
  var oNode=document.getElementById(sNodeId);  														
	sapUrMapi_setTabIndex(oNode.lastChild,0);
	sapUrMapi_setTabIndex(document.getElementById(sNodeId+"-cnt-end"),-1);
	document.getElementById(sNodeId+"-cnt-end").title="";
	sapUrMapi_Tree_focusNode(sTreeId,sNodeId)
	e.cancelBubble=false;
  e.returnValue=false;
}
function sapUrMapi_Tree_ignoreControlEvents() {
	event.cancelBubble=true;
	event.returnValue=true;
}
function sapUrMapi_Tree_controlEnter(sTreeId, sNodeId,e) {
	var oControlExitPoint = document.getElementById(sNodeId+"-cnt-end");
	var oControlEventer   = document.getElementById(sNodeId+"-cnt-start");
  var sAllowTag=",INPUT,SELECT,TEXTAREA,";
	var sEvType = e.srcElement.type;
	if (sAllowTag.indexOf(","+e.srcElement.tagName+",")>-1) {
	  
		sapUrMapi_Tree_focusNode(sTreeId,sNodeId,true,true);
		sapUrMapi_setTabIndex(oControlExitPoint,0);
		sapUrMapi_setTabIndex(oControlEventer,0);
		if(sEvType.indexOf("select")>-1){
			ur_focus(e.srcElement.options[0]);
		}else{
			ur_focus(e.srcElement);
		}
		oControlEventer.onkeydown=sapUrMapi_Tree_ignoreControlEvents; 
		return true;
	}
	if (oControlExitPoint) {
		sapUrMapi_setTabIndex(oControlExitPoint,0);
		sapUrMapi_setTabIndex(oControlEventer,0);
		oControlExitPoint.title = getLanguageText("SAPUR_TREE_ITEM_CONTAINER_END");
		oControlEventer.title   = getLanguageText("SAPUR_TREE_ITEM_CONT_SELECTED");
		ur_focus(oControlEventer);
		oControlEventer.onkeydown=sapUrMapi_Tree_ignoreControlEvents; 
		e.cancelBubble=true;
		
		return true;
	}
	return false;
}
function sapUrMapi_Tree_getNodeId(sId) {
	var o=document.getElementById(sId);
	while (o.tagName!="BODY") {
		if (o.tagName=="DIV" && (o.getAttribute("status")=="open" || o.getAttribute("status")=="closed")) return o.id;
		o=o.parentNode;
	}
	return "";
}
function sapUrMapi_Tree_selectNode(sTreeId, sNodeId, iSelLevel) {
	var oNode   = document.getElementById(sNodeId);
	var bExp    = oNode.className.indexOf("urTreNlExp")>0;
	var sClass = oNode.className.substring(0,oNode.className.indexOf(" "));
	if (sClass=="") var sClass = oNode.className;
	oNode.setAttribute("sellevel",""+iSelLevel);
	document.getElementById(sNodeId+"-cnt-start").setAttribute("sellevel",""+iSelLevel);
	if (iSelLevel==1) sClass+=" urTreNSel";
	if (iSelLevel==2) sClass+=" urTreNSel2";
	if (bExp) sClass+=" urTreNlExp";
	oNode.className=sClass;
}
function sapUrMapi_Tree_deselectAll(sTreeId) {
	var colNodes   = document.getElementsByTagName("DIV");
	for (var n=0;n<colNodes.length;n++) {
		if (colNodes.item(n).sellevel) sapUrMapi_Tree_selectNode(sTreeId,colNodes.item(n).id,0);
	}
}

//** TriStateCheckBox.ie5 **

function sapUrMapi_TriStateCheckBox_toggle(sId,e) {
  var colBtn = document.getElementsByName(sId);
  for(idx=0;idx<colBtn.length && colBtn[idx].className!="urTriCbgCbx";idx++);
  var oBtn = colBtn[idx];
  if (oBtn.disabled) return false;
  var prevstate = oBtn.getAttribute("state");
  var state = "";
  if (prevstate == "Ind") {
	state = "Off";
  }
  else if (prevstate == "Off") {
	state = "On";
  }
  else if (prevstate == "On") {
	state = "Ind";
  }
  oBtn.setAttribute("state", state);
	var oImg = document.getElementById(sId + "-img");
  oImg.className = oImg.className.replace(prevstate, state);
	return true;
}
function sapUrMapi_TriStateCheckBox_setDisabled(sId) {
	var oBtn = document.getElementById(sId);
	oBtn.disabled=true;
	oBtn.className = oBtn.className + "Dsbl";
	sapUrMapi_Label_setDisabled(sapUrMapi_Label_getInputLabel(sId));
}
function sapUrMapi_TriStateCheckBox_setEnabled(sId) {
	var oBtn = document.getElementById(sId);
	oBtn.disabled=false;
	oBtn.className = oBtn.className.replace("Dsbl", "");
	sapUrMapi_Label_setEnabled(sapUrMapi_Label_getInputLabel(sId));
}
