function noDemo() {alert("this feature or link is not used in this demo");return;}function logoutDrop() {if (confirm("Are you really sure you want to erase the auto login information?. \n\n select  'OK' to erase it. \n select 'Cancel'  to keep the information and logout"))	{     deleteCookie('usr',"/","");          location.href = filenameR + "?logout&redirectTo=/byd/bydweb.nsf"	} else {			location.href = filenameR + "?logout&redirectTo=/byd/bydweb.nsf"			}	}function pleasewait(close) {  posx=screen.width/2-380/2;  posy=screen.height/2-250/2;  w3= window.open('Pleasewait','w3','top=' + posy + ',left=' + posx + ',width=350,height=100,resizable=no,status=no,menubar=no,toolbar=no,scrollbars=no');  if (close == 1) {    w3.close();  } else {    return w3;  }}function getHelp(helppage){var newWindow = window.open(filename + 'pages/' + helppage +'?Open','secondary_window','toolbar=no,location=no,scrollbars=yes,directories=no,height=500,width=630');newWindow.focus();}/*getPathNameRequired due to Opera bug where location.pathnamereturns location.search as well.*/function getPathName(){var pth = location.pathname.split('?');return pth[0];}/*NavigateView cycles through a view using thestart and count paramaters of the ?OpenView method.Required as @Commands do not work with single category views on the web !! Arguments:d = direction, either "prev" or "next"n = incremental count number*/function navigateView (d, n) {var c = 0;//alert( location.href)var args = location.search.split('&');//alert(args.length);var news = new Array();var ii = 0;for (var i = 0; i < args.length; i ++) {				if ( args[i].toLowerCase().indexOf('start=') != -1){			c = parseInt(args[i].split('=')[1]);		} else {			news[ii] = args[i];			ii ++;		}	}	 	var strt = getPathName();	//var strt = getPathName();  		if (args[0] == ''){		location.href = strt + '&start=' + n ;	} else if (c == 0 && d == 'next'){		location.href += '&start=' + n ;	} else if (c == 0 && d == 'prev'){		return alert('There are no more documents in that direction.');	} else 	if (c <= n && d == 'prev'){		location.href = strt + news.join('&');	} else 	if (d == 'next'){		location.href = strt + news.join('&') + '&start=' + ( c + n );	} else 	if (d == 'prev'){		location.href = strt + news.join('&') + '&start=' + ( c - n);	}}function findSize(headerSize) {	if (document.all) {		available_width=document.body.clientWidth;		available_height=document.body.clientHeight;	} else {	available_width = innerWidth;	available_height = innerHeight;	}		document.getElementById("TheView").style.height = available_height - headerSize;}function findCatSize(headerSize) {	if (document.all) {		available_width=document.body.clientWidth;		available_height=document.body.clientHeight;	} else {	available_width = innerWidth;	available_height = innerHeight;	}		document.getElementById("TheCatView").style.height = available_height - headerSize;}function winResize() {history.go(0); }function getCookieVal (offset) {  var endstr = document.cookie.indexOf (";", offset);  if (endstr == -1)    endstr = document.cookie.length;  return unescape(document.cookie.substring(offset, endstr));}function SetCookie ( name, value, expires, path, domain, secure ) {	document.cookie = name + "=" + (value) +	((expires) ? "; expires=" + expires.toGMTString() : "") +	((path) ? "; path=" + path : "") +	((domain) ? "; domain=" + domain : "") +	((secure) ? "; secure" : "");}function getCookie (name) {  var arg = name + "=";  var alen = arg.length;  var clen = document.cookie.length;  var i = 0;  while (i < clen) {    var j = i + alen;    if (document.cookie.substring(i, j) == arg)      return getCookieVal (j);    i = document.cookie.indexOf(" ", i) + 1;    if (i == 0) break;   }  return null;}function deleteCookie (name,path,domain) {  if (getCookie(name)) {    document.cookie = name + "=" +      ((path) ? "; path=" + path : "") +      ((domain) ? "; domain=" + domain : "") +      "; expires=Thu, 01-Jan-70 00:00:01 GMT";  }}function logout() {	//alert(filenameR);	if (confirm("You are being Logged Out!!\n\nDo you with to continue?")) {	top.document.location.href = filenameR + "?logout&RedirectTo=" + filenameR;	return true;	} else {	return false;	}}function showLinkInfo(theid) {//alert(theid);document.getElementById("mainText").innerHTML = document.getElementById(theid).innerHTML;return;}function returnInfo() {//alert(theid);document.getElementById("mainText").innerHTML = document.getElementById("holder").innerHTML;return;}function displaydiv(divname , disptype) {	var el = document.getElementById(divname);	if (disptype == 'Y')		{			el.style.display =  'block' ;			el.style.visibility = 'visible';		}	else		{			el.style.display =  'none' ;			el.style.visibility = 'hidden';				}}function setType() {	//set a cookie for contact us to determine the type of request	SetCookie("contacttype","ra","","/","","");	window.location.href = '/web/contact-us.html';}function xformView(tableToProcess) {	var table = document.getElementById(tableToProcess) ;	table.cellSpacing = '0' ; // removes space between cells	headers = table.getElementsByTagName("th") ;	for( i = 0; i < headers.length; i++) {		headers[i].bgColor = '#cccccc' ;	}	rows = table.getElementsByTagName("tr") ;	var counter = 0	for( i = 0; i < rows.length; i++) {		rows[i].bgColor = (i % 2 ? '' : '#e4e4e4'  ) ;	}}function transformView() {	var tableElements = document.getElementsByTagName('table') ;	// alert('tableElements.length = ' + tableElements.length) ;	//var table = tableElements[tableElements.length - 1] ; // change this value if the view table is not the last table on the page, this varies depending on how you layout your $$ViewTemplateDefault form	var table = tableElements[tableElements.length - 2] ; // at least for open orders	table.cellSpacing = '0' ; // removes space between cells	headers = table.getElementsByTagName("th") ;	for( i = 0; i < headers.length; i++) {		headers[i].bgColor = '#cccccc' ;	}	rows = table.getElementsByTagName("tr") ;	var counter = 0	for( i = 0; i < rows.length; i++) {		rows[i].bgColor = (i % 2 ? '#e4e4e4' : '') ;	}}function TCCtransformView(tableToProcess) {	var tableElements = document.getElementsByTagName('table') ;	// alert('tableElements.length = ' + tableElements.length) ;	//var table = tableElements[tableElements.length - 1] ; // change this value if the view table is not the last table on the page, this varies depending on how you layout your $$ViewTemplateDefault form	var table = tableElements[tableElements.length -  tableToProcess] ; // at least for open orders	table.cellSpacing = '0' ; // removes space between cells	headers = table.getElementsByTagName("th") ;	for( i = 0; i < headers.length; i++) {		headers[i].bgColor = '#cccccc' ;	}	rows = table.getElementsByTagName("tr") ;	var counter = 0	for( i = 0; i < rows.length; i++) {		rows[i].bgColor = (i % 2 ? '' : '#e4e4e4'  ) ;	}}function emailCheck (emailStr) {/* The following variable tells the rest of the function whether or notto verify that the address ends in a two-letter country or well-knownTLD.  1 means check it, 0 means don't. */var checkTLD=1;/* The following is the list of known TLDs that an e-mail address must end with. */var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;/* The following pattern is used to check if the entered e-mail addressfits the user@domain format.  It also is used to separate the usernamefrom the domain. */var emailPat=/^(.+)@(.+)$/;/* The following string represents the pattern for matching all specialcharacters.  We don't want to allow special characters in the address. These characters include ( ) < > @ , ; : \ " . [ ] */var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";/* The following string represents the range of characters allowed in a username or domainname.  It really states which chars aren't allowed.*/var validChars="\[^\\s" + specialChars + "\]";/* The following pattern applies if the "user" is a quoted string (inwhich case, there are no rules about which characters are allowedand which aren't; anything goes).  E.g. "jiminy cricket"@disney.comis a legal e-mail address. */var quotedUser="(\"[^\"]*\")";/* The following pattern applies for domains that are IP addresses,rather than symbolic names.  E.g. joe@[123.124.233.4] is a legale-mail address. NOTE: The square brackets are required. */var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;/* The following string represents an atom (basically a series of non-special characters.) */var atom=validChars + '+';/* The following string represents one word in the typical username.For example, in john.doe@somewhere.com, john and doe are words.Basically, a word is either an atom or quoted string. */var word="(" + atom + "|" + quotedUser + ")";// The following pattern describes the structure of the uservar userPat=new RegExp("^" + word + "(\\." + word + ")*$");/* The following pattern describes the structure of a normal symbolicdomain, as opposed to ipDomainPat, shown above. */var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");/* Finally, let's start trying to figure out if the supplied address is valid. *//* Begin with the coarse pattern to simply break up user@domain intodifferent pieces that are easy to analyze. */var matchArray=emailStr.match(emailPat);if (matchArray==null) {/* Too many/few @'s or something; basically, this address doesn'teven fit the general mould of a valid e-mail address. */alert("Email address seems incorrect (check @ and .'s)");return false;}var user=matchArray[1];var domain=matchArray[2];// Start by checking that only basic ASCII characters are in the strings (0-127).for (i=0; i<user.length; i++) {if (user.charCodeAt(i)>127) {alert("Ths username contains invalid characters.");return false;   }}for (i=0; i<domain.length; i++) {if (domain.charCodeAt(i)>127) {alert("Ths domain name contains invalid characters.");return false;   }}// See if "user" is valid if (user.match(userPat)==null) {// user is not validalert("The username doesn't seem to be valid.");return false;}/* if the e-mail address is at an IP address (as opposed to a symbolichost name) make sure the IP address is valid. */var IPArray=domain.match(ipDomainPat);if (IPArray!=null) {// this is an IP addressfor (var i=1;i<=4;i++) {if (IPArray[i]>255) {alert("Destination IP address is invalid!");return false;   }}return true;}// Domain is symbolic name.  Check if it's valid. var atomPat=new RegExp("^" + atom + "$");var domArr=domain.split(".");var len=domArr.length;for (i=0;i<len;i++) {if (domArr[i].search(atomPat)==-1) {alert("The domain name does not seem to be valid.");return false;   }}/* domain name seems valid, but now make sure that it ends in aknown top-level domain (like com, edu, gov) or a two-letter word,representing country (uk, nl), and that there's a hostname preceding the domain or country. */if (checkTLD && domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1) {alert("The address must end in a well-known domain or two letter " + "country.");return false;}// Make sure there's a host name preceding the domain.if (len<2) {alert("This address is missing a hostname!");return false;}// If we've gotten this far, everything's valid!return true;}function sendEmail(CustomerNumber, SendTo)	{		baseurl = "/transaction/tac.nsf/memo?openform&CustomerNumber="+CustomerNumber+"&sendto=" + SendTo ; 			options = "height=420, width=650, center=Yes; resizable=Yes; status=No; help=no";			var CustInvite = window.open(baseurl , "windowSendEmail" , options) ; 			}function opensearchdoc(viewdocid)	{//		alert(document.forms[0].SearchQuery.value)		var url = sWebDbName+"/0/"+viewdocid+"?opendocument&highlight=0,"+document.forms[0].SearchQuery.value;//		alert(url)		document.location.href=url;	}/* document.getElementsBySelector(selector)   - returns an array of element objects from the current document     matching the CSS selector. Selectors can contain element names,      class names and ids and can be nested. For example:            elements = document.getElementsBySelect('div#main p a.external')          Will return an array of all 'a' elements with 'external' in their      class attribute that are contained inside 'p' elements that are      contained inside the 'div' element which has id="main"   New in version 0.4: Support for CSS2 and CSS3 attribute selectors:   See http://www.w3.org/TR/css3-selectors/#attribute-selectors   Version 0.4 - Simon Willison, March 25th 2003   -- Works in Phoenix 0.5, Mozilla 1.3, Opera 7, Internet Explorer 6, Internet Explorer 5 on Windows   -- Opera 7 fails */function getAllChildren(e) {  // Returns all children of element. Workaround required for IE5/Windows. Ugh.  return e.all ? e.all : e.getElementsByTagName('*');}document.getElementsBySelector = function(selector) {  // Attempt to fail gracefully in lesser browsers  if (!document.getElementsByTagName) {    return new Array();  }  // Split selector in to tokens  var tokens = selector.split(' ');  var currentContext = new Array(document);  for (var i = 0; i < tokens.length; i++) {    token = tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');;    if (token.indexOf('#') > -1) {      // Token is an ID selector      var bits = token.split('#');      var tagName = bits[0];      var id = bits[1];      var element = document.getElementById(id);      if (tagName && element.nodeName.toLowerCase() != tagName) {        // tag with that ID not found, return false        return new Array();      }      // Set currentContext to contain just this element      currentContext = new Array(element);      continue; // Skip to next token    }    if (token.indexOf('.') > -1) {      // Token contains a class selector      var bits = token.split('.');      var tagName = bits[0];      var className = bits[1];      if (!tagName) {        tagName = '*';      }      // Get elements matching tag, filter them for class selector      var found = new Array;      var foundCount = 0;      for (var h = 0; h < currentContext.length; h++) {        var elements;        if (tagName == '*') {            elements = getAllChildren(currentContext[h]);        } else {            elements = currentContext[h].getElementsByTagName(tagName);        }        for (var j = 0; j < elements.length; j++) {          found[foundCount++] = elements[j];        }      }      currentContext = new Array;      var currentContextIndex = 0;      for (var k = 0; k < found.length; k++) {        if (found[k].className && found[k].className.match(new RegExp('\\b'+className+'\\b'))) {          currentContext[currentContextIndex++] = found[k];        }      }      continue; // Skip to next token    }    // Code to deal with attribute selectors    if (token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)) {      var tagName = RegExp.$1;      var attrName = RegExp.$2;      var attrOperator = RegExp.$3;      var attrValue = RegExp.$4;      if (!tagName) {        tagName = '*';      }      // Grab all of the tagName elements within current context      var found = new Array;      var foundCount = 0;      for (var h = 0; h < currentContext.length; h++) {        var elements;        if (tagName == '*') {            elements = getAllChildren(currentContext[h]);        } else {            elements = currentContext[h].getElementsByTagName(tagName);        }        for (var j = 0; j < elements.length; j++) {          found[foundCount++] = elements[j];        }      }      currentContext = new Array;      var currentContextIndex = 0;      var checkFunction; // This function will be used to filter the elements      switch (attrOperator) {        case '=': // Equality          checkFunction = function(e) { return (e.getAttribute(attrName) == attrValue); };          break;        case '~': // Match one of space seperated words           checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('\\b'+attrValue+'\\b'))); };          break;        case '|': // Match start with value followed by optional hyphen          checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('^'+attrValue+'-?'))); };          break;        case '^': // Match starts with value          checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) == 0); };          break;        case '$': // Match ends with value - fails with "Warning" in Opera 7          checkFunction = function(e) { return (e.getAttribute(attrName).lastIndexOf(attrValue) == e.getAttribute(attrName).length - attrValue.length); };          break;        case '*': // Match ends with value          checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) > -1); };          break;        default :          // Just test for existence of attribute          checkFunction = function(e) { return e.getAttribute(attrName); };      }      currentContext = new Array;      var currentContextIndex = 0;      for (var k = 0; k < found.length; k++) {        if (checkFunction(found[k])) {          currentContext[currentContextIndex++] = found[k];        }      }      // alert('Attribute Selector: '+tagName+' '+attrName+' '+attrOperator+' '+attrValue);      continue; // Skip to next token    }    // If we get here, token is JUST an element (not a class or ID selector)    tagName = token;    var found = new Array;    var foundCount = 0;    for (var h = 0; h < currentContext.length; h++) {      var elements = currentContext[h].getElementsByTagName(tagName);      for (var j = 0; j < elements.length; j++) {        found[foundCount++] = elements[j];      }    }    currentContext = found;  }  return currentContext;}/* That revolting regular expression explained /^(\w+)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/  \---/  \---/\-------------/    \-------/    |      |         |               |    |      |         |           The value    |      |    ~,|,^,$,* or =    |   Attribute    Tag*/function show(a) {  str = '';    str2 = '';        str3 = '';    newspaces = '';  newSubject = '' ; for (i = 0; i != a.length; i++) {	newspaces = '';	str = a[i].innerHTML + '\n';	str2 = getFront(str ,"~" , 1  )+ '\n';	for (var z=0 ; z < str2.length ; z++)		{			newspaces = newspaces + "&nbsp;";		}	str3 = newspaces + str.slice(str2.length - 1) ;	a[i].innerHTML = str3 ;	}}function getFront(mainStr,searchStr,ourOffset)	{		foundOffset = mainStr.indexOf(searchStr) ; 		if (foundOffset == -1)				{					return null;				}		return mainStr.substring(0,foundOffset + ourOffset )	}function setOpacityWebCCL( element, alpha )	{	      var style = element.style;     	 if( style.MozOpacity != undefined ) { //Moz and older	     	 style.MozOpacity = alpha;	      }     	 else if( style.filter != undefined ) { //IE	     	 style.filter = "alpha(opacity=0)";		      element.filters.alpha.opacity = ( alpha * 100 );	      }	      else if( style.opacity != undefined ) { //Opera		      style.opacity = alpha;	      }      }