function BWWgetObject(objID) {
 var obj;
 
 if (document.getElementById) { // DOM3 = IE5, NS6
 	obj = document.getElementById(objID);
 }
 else if (document.layers) { // Netscape 4
 	eval("obj = document." + objID);
 }
 else if (document.all) { // IE 4
 	eval("obj = document.all." + objID);
 }
 
 return obj;
}

function updateDisplay(elementID, displayType) {
 if (document.getElementById) { // DOM3 = IE5, NS6
  document.getElementById(elementID).style.display = displayType;
 }
 else if (document.layers) { // Netscape 4
  eval("document." + elementID + ".display = '" + displayType + "';");
 }
 else if (document.all) { // IE 4
  eval("document.all." + elementID + ".style.display = '" + displayType + "';");
 }
}

function showDisclaimer() {
 return confirm('You have selected a link to a website that exists outside of Cubicin.com. Cubist provides access to these websites as a service to our visitors. These websites are maintained by third parties over which Cubist has no control. As such, Cubist makes no representation as to the accuracy, currency, or completeness of any information contained in such websites and expressly disclaims any warranties, express or implied, including any implied warranties of merchantability, title, noninfringement or fitness for a particular purpose. Such websites are not endorsed by Cubist. Cubist is not responsible or liable for the content and information presented within any external site. Copyrights contained on the websites are owned by the website owners or as otherwise indicated.');
}

function addDisclaimer() {
 var elements = (document.links) ? document.links : document.getElementsByTagName("a");
 var searchStr = "elements[i].href.search(/^" + document.location.protocol + "\\/\\/" + document.location.hostname + "\\//)";
 
 for (var i = 0; i < elements.length; ++i) {
  if (elements[i].href && elements[i].href.search(/^javascript:/) == -1 && elements[i].href.search(/^mailto:/) == -1 && elements[i].href.search(/^http:\/\/(www\.)?cubist\.com/) == -1 && elements[i].href.search(/^http:\/\/cubist\.presentationplanner\.com/) == -1 && eval(searchStr) == -1) {
   elements[i].onclick = function() { return showDisclaimer(); };
  }
 }
}

function nextElement(element, nextID) {
 if (element.value.length < element.getAttribute('maxlength')) return;
 
 var nextElement = BWWgetObject(nextID);
 if (nextElement && nextElement.focus) nextElement.focus();
}

function linkDisclaimer(linkURL) {
 if (showDisclaimer() == true) {
  document.location = linkURL;
 }
}