/***************************************************Created: 09/25/2009Author: Spencer Smith Description: Common Javascript functions***************************************************/// temporary fix for Kennyvar stopWordsList = "[a, about, advent, after, all, also, an, and, any, applying, are, at, because, been, before, being, believe, between, beyond, but, by, can, cant, carrying, clases, class, could, do, does, doesnt, during, each, eg, et, eta, etal, follows, for, fore, found, from, gave, generally, give, given, gives, giving, good, gr, grade, grd, group, groups, had, has, have, hence, here, however, if, iii, in, inc, index, into, is, it, key, less, many, more, most, mostly, must, neither, never, not, nu, occurs, of, on, once, or, other, out, path, play, ran, ref, refer, repeat, running, said, same, see, select, several, should, shouldnt, similar, some, still, such, than, that, the, them, then, there, thereby, therefore, these, this, through, to, tp, type, use, used, uses, using, usually, utilize, utilized, utilizes, utilizing, various, was, well, were, when, whence, where, whereas, which, while, will, with, without]";/* Configuration Options */var hideDelay = 1000;var iTimeoutID;  // set this to two weeksvar cookiesExpireInSeconds = 1209600;// is this ie6?var isIE6 = navigator.userAgent.toLowerCase().indexOf('msie 6') != -1;/* Global Variables */var divToHide;var okToHideDiv = true;var IE6 = false /*@cc_ON || @_jscript_version < 5.7 @*/;function disableDropDowns() {elements = document.getElementsByTagName("select");if (elements) {for (var e=0; e < elements.length; e++) {elements[e].style.visibility = 'hidden';}}	}function enableDropDowns() {elements = document.getElementsByTagName("select");if (elements) {for (var e=0; e < elements.length; e++) {elements[e].style.visibility = 'visible';}}	}	function getElementsByClassName(className, tag, elm){var testClass = new RegExp("(^|\\s)" + className + "(\\s|$)");var tag = tag || "*";var elm = elm || document;var elements = (tag == "*" && elm.all)? elm.all : elm.getElementsByTagName(tag);var returnElements = [];var current;var length = elements.length;for(var i=0; i<length; i++){current = elements[i];if(testClass.test(current.className)){returnElements.push(current);}}return returnElements;}	function stripHTML(oldString) {   var newString = "";   var inTag = false;   for(var i = 0; i < oldString.length; i++) {           if(oldString.charAt(i) == '<') inTag = true;        if(oldString.charAt(i) == '>') {              inTag = false;              i++;        }           if(!inTag) newString += oldString.charAt(i);   }   return newString;}function jumpToPage(page) {var pageId = 'quotes_page' + page;						var el = document.getElementById(pageId);if (el) {// turn off all the other blocksfor (var i=1; i < 6; i++) {var blockId = 'quotes_page' + i;				var blockEl = document.getElementById(blockId);				if (blockEl) {				blockEl.style.display = 'none';}}	el.style.display = 'block';}// jump to the top of the pagedocument.location = '#top';}function showDiv(id) {var el = document.getElementById(id);if (id) {el.style.display = 'block';}}function hideDiv(id) {var el = document.getElementById(id);if (id) {el.style.display = 'none';}}function addToFavorites() {// Mozilla Firefox Bookmark		if (window.sidebar) { var okToAdd = confirm('Click OK to add Knovel to your favorites');if (okToAdd) {window.sidebar.addPanel(bookmarkSiteName, bookmarkSiteAddress, "");	}	} else if (window.external) { // IE Favorite		var okToAdd = confirm('Click OK to add Knovel to your favorites');if (okToAdd) {		window.external.AddFavorite(bookmarkSiteAddress, bookmarkSiteName); }	}	}function openNew(url){var standardProps = 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no';var win = window.open(url,'popup',standardProps +',width=500,height=400');win.focus();}function openFullPopup(url) {var w = 480, h = 340;if (document.body) {   w = document.body.clientWidth;   h = document.body.clientHeight;}// window width and heightvar popW = 792, popH = 662;var leftPos = (w-popW)/2;var topPos = (h-popH)/2;if (leftPos < 0) {leftPos = 0;}	if (topPos < 0) {topPos = 20;}var parameters = 'menubar=no, resizable=no, directories=no, status=no, toolbar=no, width=' + popW + ', height=' + popH + ', top=' + topPos + ', left=' + leftPos;	var win = window.open(url, 'popupWindow', parameters);win.focus();}function openScrollableWindowPopup(url, width, height) {var w = 480, h = 340;if (document.body) {   w = document.body.clientWidth;   h = document.body.clientHeight;}// window width and heightvar popW = width, popH = height;var leftPos = (w-popW)/2;var topPos = (h-popH)/2;if (leftPos < 0) {leftPos = 0;}	if (topPos < 0) {topPos = 20;}var parameters = 'menubar=no, scrollbars=yes, resizable=yes, directories=no, status=no, toolbar=no, width=' + popW + ', height=' + popH + ', top=' + topPos + ', left=' + leftPos;	var win = window.open(url, 'popupWindow', parameters);win.focus();}function openWindowPopup(url, width, height, windowname) {var w = 480, h = 340;if (document.body) {   w = document.body.clientWidth;   h = document.body.clientHeight;}// window width and heightvar popW = width, popH = height;var leftPos = (w-popW)/2;var topPos = (h-popH)/2;if (leftPos < 0) {leftPos = 0;}	if (topPos < 0) {topPos = 20;}if (!windowname) {windowname = 'popupWindow';}var parameters = 'menubar=no, resizable=no, directories=no, status=no, toolbar=no, width=' + popW + ', height=' + popH + ', top=' + topPos + ', left=' + leftPos;	var win = window.open(url, windowname, parameters);win.focus();}function openResizableWindowPopup(url, width, height) {var w = 480, h = 340;if (document.body) {   w = document.body.clientWidth;   h = document.body.clientHeight;}// window width and heightvar popW = width, popH = height;var leftPos = (w-popW)/2;var topPos = (h-popH)/2;if (leftPos < 0) {leftPos = 0;}	if (topPos < 0) {topPos = 20;}var parameters = 'menubar=no, resizable=yes, directories=no, status=no, toolbar=no, width=' + popW + ', height=' + popH + ', top=' + topPos + ', left=' + leftPos;	var win = window.open(url, 'resizablePopupWindow', parameters);win.focus();}function openNewResizableWindowPopup(url, width, height, winname) {var w = 480, h = 340;if (document.body) {   w = document.body.clientWidth;   h = document.body.clientHeight;}// window width and heightvar popW = width, popH = height;var leftPos = (w-popW)/2;var topPos = (h-popH)/2;if (leftPos < 0) {leftPos = 0;}	if (topPos < 0) {topPos = 20;}var parameters = 'menubar=no, resizable=yes, directories=no, status=no, toolbar=no, width=' + popW + ', height=' + popH + ', top=' + topPos + ', left=' + leftPos;	var win = window.open(url, winname, parameters);win.focus();}function setPopupTitle() {// set the popup title if a popupTitle Div existsif (document.getElementById('popupTitle')) {var title = document.getElementById('popupTitle').innerHTML;if (title.length > 75) {title = title.substring(0, 75) + '...';}document.getElementById('popupTitleContent').innerHTML = title;}}function redirectParentURL(url) {window.opener.top.location.href = url;window.top.close();}function linkOn(el) {el.style.color = '#003C79';}function linkOff(el) {el.style.color = '#a3b9cf';}function openLoginPage() {openScrollableWindowPopup(loginURL, 792, 555);}function openLogoutPage(loggedIntoAthens) {clearLoginCookies();if (loggedIntoAthens) { var ok = confirm('You are being logged out of Knovel.\n Click OK to log out of Athens or \nCancel to stay logged into Athens ');if (ok) {var siteurl = window.top.location.href;var endindex = siteurl.indexOf("/web");var domain = siteurl.substring(0, endindex);	var referer = domain + "/web/portal/main?_EXT_KNOVEL_TEMP_LOGIN_ATH_LOGOUT";		var fullLogoutURL = logoutURL + "?referer=" + referer;window.top.location.href = fullLogoutURL;		} else {var siteurl = window.top.location.href;var endindex = siteurl.indexOf("/web");var domain = siteurl.substring(0, endindex);	var referer = domain + "/web/portal/main?_EXT_KNOVEL_TEMP_LOGIN_LOGOUT";		var fullLogoutURL = logoutURL + "?referer=" + referer;window.top.location.href = fullLogoutURL;	}	} else {var siteurl = window.top.location.href;var endindex = siteurl.indexOf("/web");var domain = siteurl.substring(0, endindex);	var referer = domain + "/web/portal/main?_EXT_KNOVEL_TEMP_LOGIN_LOGOUT";		var fullLogoutURL = logoutURL + "?referer=" + referer;window.top.location.href = fullLogoutURL;		}	}function openOrderInfoPage() {openWindowPopup('/web/portal/ordering_info', 792, 365, 'ordering_info_popup');}function openFreeTitlesPopup() {  openScrollableWindowPopup('http://why.knovel.com/information/free-package.html', 1024, 768);}function openPeriodicTablePopup() {openResizableWindowPopup('/web/portal/periodic_table', 792, 662);}function openSupportAccountServicesPage() {window.top.location.href = supportAccountServicesPage;}function loginRedirect() {window.opener.location.href = loginRedirectURL;}function openSubscribePage() {window.top.location.href = subscribePage;}function subscribeRedirect() {openWindowPopup(subscribePage, 792, 415);}function freeTrialPageRedirect() {window.top.location.href = subscribePage;}function redirectToPage(page) {window.top.location.href = page;}/* pagination highlight functions */function paginationBoxOn(el) {el.style.background = '#E0DCDC';}function paginationBoxOff(el) {el.style.background = 'white';}function findPos(obj) {var curleft = curtop = 0;if (obj.offsetParent) {do {curleft += obj.offsetLeft;curtop += obj.offsetTop;} while (obj = obj.offsetParent);}return [curleft,curtop];}function showVideo(videoId) {// only show the video oncevar videoSeen = getCookieValue("videoSeen");// if (videoSeen == null) {createCookie("videoSeen","true", cookiesExpireInSeconds);var url = '/web/portal/tutorial_videos?Video='+videoId;var width = 800;var height = 640;if(videoId == 4){width = 720;height = 580;}openResizableWindowPopup(url, width, height);// now, hide the button// document.getElementById('flash-button').style.display = 'none';// }	}function showMyKnovelVideo() {var url = '/web/portal/myknovel_video';var width = 855;var height = 680;openResizableWindowPopup(url, width, height);		}function openUnitConverterPopup() {openWindowPopup('/web/portal/knovel_tools?p_p_id=EXT_KNOVEL_TOOLS&p_p_action=1&p_p_state=normal&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&_EXT_KNOVEL_TOOLS_struts_action=/ext/knovel_tools/view&_EXT_KNOVEL_TOOLS_toolType=2', 750, 440, 'unitconverter');}	function getRadioValue(formID, controlName){var frm = document.getElementById(formID);	var el = frm[controlName];	for (var i=0; i < el.length; i++){if (el[i].checked)    	{    	return el[i].value;    }}	}	function stripCellHTML(oldString){var test1 = new RegExp("<b>|<font>|<i>|<em>|<big>|<strong>|<small>|<sup>|<sub>|<bdo>|<u>","gi");var whereTag, startIndex = 0, endIndex = 0, tags = " ";if(test1.test(oldString)){test1 = new RegExp("b|/b|font|/font|i|/i|em|/em|big|/big|strong|/strong|small|/small|sup|/sup|sub|/sub|bdo|/bdo|u|/u","i");while ((whereTag = oldString.indexOf("<", startIndex)) != -1) {endIndex = oldString.indexOf(">", whereTag) + 1;var sub = oldString.substring(whereTag + 1, endIndex - 1);if (sub.indexOf(" ") != -1) {sub = sub.substring(0, sub.indexOf(" "));}if (test1.test(sub)) {startIndex = endIndex;continue;}else{tags += oldString.substring(whereTag, endIndex) + " ";startIndex = endIndex;}}var html = tags.trim().split(" ");for(var i = 0; i < html.length; i++){oldString = oldString.replace(html[i],"");}return oldString;}else{var reTag = /<(?:.|\s)*?>/g;		return oldString.replace(reTag, "");  }}function stripHTML(oldString) {    var reTag = /<(?:.|\s)*?>/g;    return oldString.replace(reTag, ""); }function showHelpAndClose() {openFullPopup('/html/themes/knovel_mktg/pdf/Knovel_Help%20Guide.pdf');window.top.close();}function showDownloadTitles() {openWindowPopup('/web/portal/knovel_tools?p_p_id=EXT_KNOVEL_TOOLS&p_p_action=1&p_p_state=normal&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&_EXT_KNOVEL_TOOLS_struts_action=/ext/knovel_tools/view&_EXT_KNOVEL_TOOLS_toolType=3', 750, 330);}function setLoginCookie(cookieValue) {createCookie("Username", cookieValue);	}function setIURLoginCookie(cookieValue) {createCookie("KnovelProfile", cookieValue);}function setParamLoginCookie(cookieValue) {createCookie("KnovelParam", cookieValue);}function setDownloadCookie(cookieValue) {createCookie("KnovelDownload", cookieValue);}function clearLoginCookies() {eraseCookie("Username");eraseCookie("KnovelProfile");eraseCookie("KnovelParam");eraseCookie("keepMeSignedIn");}	function createCookie(name,value,seconds,escaped) {    if (seconds) {        var date = new Date();        date.setTime(date.getTime()+(seconds*1000));        var expires = "; expires="+date.toGMTString();    } else {var expires = "";}if (escaped) {    document.cookie = name+"="+escape(value)+expires+"; path=/";	} else {	    document.cookie = name+"="+value+expires+"; path=/";}	}	function getCookieValue(check_name) {// first we'll split this cookie up into name/value pairs// note: document.cookie only returns name=value, not the other componentsvar a_all_cookies = document.cookie.split( ';' );var a_temp_cookie = '';var cookie_name = '';var cookie_value = '';var b_cookie_found = false; // set boolean t/f default ffor ( i = 0; i < a_all_cookies.length; i++ ){// now we'll split apart each name=value paira_temp_cookie = a_all_cookies[i].split( '=' );// and trim left/right whitespace while we're at itcookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');// if the extracted name matches passed check_nameif ( cookie_name == check_name ){b_cookie_found = true;// we need to handle case where cookie has no value but exists (no = sign, that is):if ( a_temp_cookie.length > 1 ){cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );}// note that in cases where cookie is initialized but no value, null is returnedreturn cookie_value;break;}a_temp_cookie = null;cookie_name = '';}if ( !b_cookie_found ){return null;}}function eraseCookie(name) {    createCookie(name,"",-1);}function doNothing() {}function closeLoginPopup() {if (window.popupWindow != null) {window.popupWindow.close();}	}function swapImage(el, newSrc) {el.src = newSrc;}/* new functions for search result pages */ function findPosX(obj) {   var curleft = 0;   if(obj.offsetParent)       while(1)        {         curleft += obj.offsetLeft;         if(!obj.offsetParent)           break;         obj = obj.offsetParent;       }   else if(obj.x)       curleft += obj.x;   return curleft; } function findPosY(obj) {   var curtop = 0;   if(obj.offsetParent)       while(1)       {         curtop += obj.offsetTop;         if(!obj.offsetParent)           break;         obj = obj.offsetParent;       }   else if(obj.y)       curtop += obj.y;   return curtop; }	  function toggleSubjectTopicContainer(subjectAreaID, clearSecondary) {var imageId = 'subjectTopicImage_' + subjectAreaID;var containerId = 'subjectTopicContainer_' + subjectAreaID;var imageEl = document.getElementById(imageId);var containerEl = document.getElementById(containerId);var imageEndIndex = imageEl.src.lastIndexOf('/') + 1;var newSrc = imageEl.src.substring(0, imageEndIndex);// if the block is already on, turn it offif (containerEl.style.display == 'block') {containerEl.style.display = 'none'newSrc += 'plus_sign.gif';imageEl.src = newSrc;} else {containerEl.style.display = 'block'			newSrc += 'minus_sign.gif';imageEl.src = newSrc;		}	}function addKnovelToSearchBar() {  var knovelAddedToSearchBar = getCookieValue("knovelAddedToSearchBar");var engineUrl = 'http://proto.knovel.com/opensearch.xml';if (knovelAddedToSearchBar == null) {if (window.external && ("AddSearchProvider" in window.external)) {  		   createCookie("knovelAddedToSearchBar","true", cookiesExpireInSeconds);		      // Firefox 2 and IE 7, OpenSearch   window.external.AddSearchProvider(engineUrl);      document.getElementById('addKnovelToSearchBar').style.display = 'none';   /*   } else if (window.sidebar && ("addSearchEngine" in window.sidebar)) {   // Firefox <= 1.5, Sherlock   window.sidebar.addSearchEngine("http://example.com/search-plugin.src",                                  "http://example.com/search-icon.png",                                  "Search Plugin", "");*/  } else {   // No search engine support (IE 6, Opera, etc).   var message = "Open Search is not currently supported by your browser.";   alert(message);				  }			}	}function checkVideoButton() {var videoSeen = getCookieValue("videoSeen");if (videoSeen == null) {document.getElementById('flash-button').style.display = 'block';	}	}function checkAddKnovelLink() {var knovelAddedToSearchBar = getCookieValue("knovelAddedToSearchBar");if (knovelAddedToSearchBar == null) {document.getElementById('addKnovelToSearchBarLink').style.display = 'block';	}	}function openAthensPopup() {var athensURL = 'https://auth.athensams.net/?ath_dspid=KNOVEL&ath_returl=%22http://proto.knovel.com/%22';openScrollableWindowPopup(athensURL, 792, 555);}function toggleMySubFilter(state) {var mySubFilterEl = document.getElementById('mySubSearchFilter');if (mySubFilterEl) {			if (state == 'on') {mySubFilterEl.style.display = 'block';} else {mySubFilterEl.style.display = 'none';			}}	}function setMySubSearchFilter(option) {    var inurl = window.top.location.href;// turn the filter onif (option == 'on') {document.getElementById('mySubFilterOn').className = "filterActive";document.getElementById('mySubFilterOff').className = "";		var url = '/html/includes/mySubFilter.jsp?filterOption=on';// turn the filter onvar subscriptionAjax = new slimAjax(function () {});   subscriptionAjax.post(url, '');// else, turn it off	} else {document.getElementById('mySubFilterOn').className = "";document.getElementById('mySubFilterOff').className = "filterActive";	var url = '/html/includes/mySubFilter.jsp?filterOption=off';// turn the filter offvar subscriptionAjax = new slimAjax(function () {});   subscriptionAjax.post(url, '');			}	        if ((inurl.indexOf('/browse') > 0 && inurl.indexOf('/display?') == -1) || inurl.indexOf('main') > 0) { // if on browse or home page: redraw    	if (option == 'on') {    		browseMySubscription(inurl);    	} else {    		browseAllContent(inurl);    	}    }}	function browseMySubscription(url) {var newurl = (url.indexOf('/web/portal/main') >= 0) ? url : '/web/portal/browse/subject/-6/mysub/1';window.top.location.href = newurl;}function browseAllContent(url) {var newurl = (url.indexOf('/web/portal/main') >= 0) ? url : '/web/portal/browse';window.top.location.href = newurl;}/* perform a basic search */function submitBasicSearchForm() {var inputtedValue = document.getElementById('topTextInput').value;			document.getElementById('errorMsg1').innerHTML = '';// validate the inputvar passed = validate(document.getElementById('topTextInput'));if (!passed) {return false;} else if (inputtedValue.toLowerCase() == 'search knovel...') {if (isWithin == 1) isWithin = 0;else document.getElementById('errorMsg1').innerHTML = 'Please enter a valid search term.';document.getElementById('subTabSearchHelpText').style.display = 'none';document.getElementById('searchOptionsContainer').style.display = 'none';		document.getElementById('errorMsg1').style.display = 'block';						return false;	} else {var secondSelectEl = document.getElementById('SecondSelect1Ref');if (secondSelectEl) {// get the search filter (All / Title / Author)var searchByFilterID = getRadioValue('searchForm', 'searchOptionSecondSelect1');		secondSelectEl.value = searchByFilterID; }	// submit the formvar topFormEl = document.getElementById('searchForm');		topFormEl.submit();return false;						}	}function switchClass(el, className) {el.className = className;}// jump to a pagefunction jumpToBookPage(page) {// get the first part of the url (before Page)var currentURL = window.document.location.href;var startIndex = currentURL.indexOf('_Page=') + 6;var urlStart = currentURL.substring(0, startIndex);// get the last part of the url (after Page)var endPart = currentURL.substring(startIndex, currentURL.length);var endIndex = endPart.indexOf('&');var urlEND = endPart.substring(endIndex, currentURL.length);// build up the new url with the pagevar newURL = urlStart + page + urlEND;// go to that urlwindow.top.location.href = newURL;}function showSearchWithin(el, divid) {el.style.display = 'none';document.getElementById(divid).style.display = 'block';}var isWithin = 0;function performSearchWithinBook(bookId, controlId, sistring, ststring) {if (document.getElementById('errorMsg1')) {document.getElementById('errorMsg1').innerHTML = '';		document.getElementById('errorMsg1').style.display = 'none';				}	var controlEl = document.getElementById(controlId);if (controlEl) {isWithin = 1;var searchTerm = controlEl.value;var displayPortletId = 'EXT_KNOVEL_DISPLAY';var displayPortletNamespace = '_EXT_KNOVEL_DISPLAY_';  if (searchTerm != '') {	searchTerm = searchTerm.replace("%", "!!PERCENT!!");var searchUrl = '/web/portal/basic_search/display?p_p_id=' + displayPortletId + '&p_p_action=1&p_p_state=normal&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&' + displayPortletNamespace + 'struts_action=%2Fext%2Fknovel_display%2Fview';searchUrl += '&' + displayPortletNamespace + 'bookid=' + bookId;searchUrl += '&' + displayPortletNamespace + 'Page=1';searchUrl += '&' + displayPortletNamespace + 'SearchTermA1=' + searchTerm;searchUrl += '&' + displayPortletNamespace + 'searchWithinBook=true';searchUrl += '&' + displayPortletNamespace + 'searchType=basic';	searchUrl += '&' + displayPortletNamespace + 'sistring='+sistring;	searchUrl += '&' + displayPortletNamespace + 'ststring='+ststring;window.top.location.href = searchUrl;} }} function setBookFilterType(type, bookId) {	var displayPortletId = 'EXT_KNOVEL_DISPLAY';var displayPortletNamespace = '_EXT_KNOVEL_DISPLAY_';var newUrl = '/web/portal/basic_search/display?p_p_id=' + displayPortletId + '&p_p_action=1&p_p_state=normal&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&' + displayPortletNamespace + 'struts_action=%2Fext%2Fknovel_display%2Fview';newUrl += '&' + displayPortletNamespace + 'bookid=' + bookId;newUrl += '&' + displayPortletNamespace + 'Page=1';newUrl += '&' + displayPortletNamespace + 'type=' + type;window.top.location.href = newUrl;}/* browse page functions */function toggleChildNodes(nodeId) {var imgEl = document.getElementById('img_' + nodeId);var childNodeContainerEl = document.getElementById('children_' + nodeId);// if the node is not expandedif (imgEl.src.indexOf('plus_sign') > 0) {// if it's already been loaded, just show itif (childNodeContainerEl.innerHTML != '') {imgEl.src = '/html/themes/knovel_mktg/images/custom/minus_sign.gif';childNodeContainerEl.style.display = 'block';// else, load the child nodes} else {  imgEl.src = '/html/themes/knovel_mktg/images/custom/minus_sign.gif';// do some crazy ajax stuffloadChildNode(nodeId, 15);					}// it's expanded, so close it	} else {imgEl.src = '/html/themes/knovel_mktg/images/custom/plus_sign.gif';childNodeContainerEl.style.display = 'none';}}function loadChildNode(nodeID) {var hasBookmarks = false;var useLargeSize = false;var browser = false;var fromSearch = false;var bookID = document.getElementById('bookid').value;var url = "/web/portal/browse/display?p_p_id=EXT_KNOVEL_DISPLAY&p_p_action=0&p_p_state=exclusive&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&_EXT_KNOVEL_DISPLAY_struts_action=%2Fext%2Fknovel_display%2Fload_nodes"		+ "&BookID=" + bookID + "&NodeID=" + nodeID + "&VerticalID=0"; 	// load the child nodevar childNodeAjax = new slimAjax(function () {var divID = 'children_' + nodeID;document.getElementById(divID).innerHTML = childNodeAjax.responseText;	});   childNodeAjax.post(url, '');									}function OpenContent(page, sistring, ststring) {/* call expiringMessage.js to first check for account expiration before opening content */OpenPortalContent(page, sistring, ststring, 'small_structureWindow', 'yes', 'Small_Structure');}function OpenContent(page, sistring, ststring, windowName, scroll, windowType) {/* call expiringMessage.js to first check for account expiration before opening content */if(typeof OpenPortalContent == 'function') { 	OpenPortalContent(page, sistring, ststring, windowName, scroll, windowType);} else {NewWindow(page, windowName, true, windowType); }} /* to disable content */function OpenContentLab(page, sistring, ststring) {OpenContent(mypage, sistring, ststring, 'small_structureWindow', 'yes', 'Small_Structure');}  function OpenContentLab(mypage, sistring, ststring, myname, scroll, windowType) {var protoMessage = "Knovel Lab is an experimental area where users can try out new features and " +    "functionality before they go live. Reference content is not accessible within Knovel Lab.<br/><br/>" +    "If you wish to access your subscribed content, please <a href='http://www.knovel.com/web/portal/browse'><font style='font-size: 9pt'>return to Knovel.</font></a>"; protoMessage += "<br/><br/><center><button style='width:60px' onclick='slimPopup.hide()'>OK</button></center>";   showStandardModalMessage(protoMessage, 260);				   }function showStandardPublisherDisclaimer() {var messageEl = document.getElementById('disclaimerContent');if (messageEl) {var message = messageEl.innerHTML;showStandardMessage(message, 510, true);				}	}	function showTitleDetails() {var messageEl = document.getElementById('titleDetailsContent');if (messageEl) {var message = messageEl.innerHTML;showStandardMessage(message, 510, true);		}	}	function showCitation() {var messageEl = document.getElementById('citationContent');if (messageEl) {var message = messageEl.innerHTML;showStandardMessage(message, 678, true);		}	}	function isNotebookItemChecked() { var els = getElementsByClassName('notebook-item', null, null);if (els && els.length > 0) {for (var i=0; i<els.length; i++) {if (els[i].checked) {return true;}}}return false;	}function notebookToggleCheckAll(el) {var els = getElementsByClassName('notebook-item', null, null);if (els && els.length > 0) {for (var i=0; i<els.length; i++) {els[i].checked = el.checked;}}}function notebookAddFolder() {slimPopup.show({popupId: 'addFolderPopup', popupWidth: 300, stayOpen: true});	}function showNotebookError() {var msg = "<div style='padding: 10px'><center>Please select an item";msg += "<br/><br/><button style='width:60px' onclick='slimPopup.hide()'>OK</button></center></div>";showStandardMessage(msg, 200, true);}function notebookSendEmail() {if (!isNotebookItemChecked()) {showNotebookError();} else {	slimPopup.show({popupId: 'emailPopup', popupWidth: 310, stayOpen: true});	}	}function notebookDeleteAction() {if (!isNotebookItemChecked()) {showNotebookError();} else {	slimPopup.show({popupId: 'deleteAction', popupWidth: 340, stayOpen: true});	}	}function notebookDeleteAllAction() {if (!isNotebookItemChecked()) {showNotebookError();} else {	slimPopup.show({popupId: 'deleteAllAction', popupWidth: 340, stayOpen: true});}	}function notebookDeleteThisAction() {slimPopup.show({popupId: 'deleteThisAction', popupWidth: 340, stayOpen: true});}function notebookCopyToFolderAction() {if (!isNotebookItemChecked()) {showNotebookError();} else {	slimPopup.show({popupId: 'copyToFolder', popupWidth: 360, stayOpen: true});}	}function notebookMoveToFolderAction() {if (!isNotebookItemChecked()) {showNotebookError();} else {	slimPopup.show({popupId: 'moveToFolder', popupWidth: 360, stayOpen: true});}	}function showSearchOptions() {if (document.getElementById('searchOptionsContainer').style.display == '' ||document.getElementById('searchOptionsContainer').style.display == 'none') {document.getElementById('errorMsg1').innerHTML = '';document.getElementById('errorMsg1').style.display = 'none';document.getElementById('subTabSearchHelpText').style.display = 'none';document.getElementById('searchOptionsContainer').style.display = 'block';	} else {document.getElementById('searchOptionsContainer').style.display = 'none';	document.getElementById('errorMsg1').innerHTML = '';document.getElementById('errorMsg1').style.display = 'block';document.getElementById('subTabSearchHelpText').style.display = 'block';}	}function toggleFullArticle(m) {var summaryName = 'articlesummary_' + m;var fullName = 'articlefull_' + m;var summaryEl = document.getElementById(summaryName);var fullEl = document.getElementById(fullName);	if (summaryEl.style.display == 'block') {summaryEl.style.display = 'none';fullEl.style.display = 'block';} else {fullEl.style.display = 'none';summaryEl.style.display = 'block';		}		}function returnToKnovel() {var msg = "<div style='padding:15px; border: 1px solid #C1C6C8'>";msg +=  "<center>";msg += "Would you like to participate in a brief survey?<br/>" +   	"Any feedback you provide will be greatly appreciated."; msg += "<br/><br/>";msg += "<button style='width:40px' onclick='takeKnovelSurvey()'>Yes</button>";msg += "&nbsp;&nbsp;";msg += "<button style='width:40px' onclick='returnToKnovelSite()'>No</button>";msg += "</center></div>";   showStandardModalMessage(msg, 340);				   }function takeKnovelSurvey() {slimPopup.hide();window.top.location.href = 'http://prototype3survey.questionpro.com/';}function returnToKnovelSite() {slimPopup.hide();window.top.location.href = 'http://www.knovel.com/web/portal/browse';	}function getCalendarDate(){   var months = new Array(13);   months[0]  = "January";   months[1]  = "February";   months[2]  = "March";   months[3]  = "April";   months[4]  = "May";   months[5]  = "June";   months[6]  = "July";   months[7]  = "August";   months[8]  = "September";   months[9]  = "October";   months[10] = "November";   months[11] = "December";   var now         = new Date();   var monthnumber = now.getMonth();   var monthname   = months[monthnumber];   var monthday    = now.getDate();   var year        = now.getYear();   if(year < 2000) { year = year + 1900; }   var dateString = monthname +                    ' ' +                    monthday +                    ' ' +                    year;   return dateString;}// dynamically resize the content container (and pdf_viewer if it exists)function setPopupContainerHeight() {var popupContainerEl = document.getElementById('popupContentContainer');var iframeContainerEl = document.getElementById('pdf_viewer');  	if (popupContainerEl) {			  	 	popupContainerEl.style.height = "auto"; // helps resize (for some) if new doc shorter than previous		  		// need to add to height to be sure it will all show		    		var h = alertSize();  		var new_h = (h-96);		// account for top header height  // account for firefox url barif (!document.all) {h = h - 10;}  		popupContainerEl.style.height = new_h + "px";if (iframeContainerEl) {  		iframeContainerEl.style.height = new_h + "px";				}// alert('new_h: ' + new_h);  	}	}function alertSize() {		  var myHeight = 0;		  if (typeof( window.innerWidth ) == 'number' ) {    // Non-IE		    myHeight = window.innerHeight;		  } else if (document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight )) {		    // IE 6+ in 'standards compliant mode'    myHeight = document.documentElement.clientHeight;		  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight )) {		    // IE 4 compatible		    myHeight = document.body.clientHeight;  	}		  return myHeight;		}function addBookToNotebook(bookId, el, notebookName) {// add the book to the Notebookvar url = '/html/notebook/addBookToNotebook.jsp?bookId=' + bookId;var myKnovelAjax = new slimAjax(function () {showAddToNotebookMessage(notebookName);});   myKnovelAjax.post(url, '');			if (el && el.style) {el.style.display = 'none';} else {document.getElementById('addBookToNotebook').style.display = 'none';		}	}function addSearchToNotebook(searchTitle, searchURL, controlId, notebookName) {// add the book to the Notebookvar url = '/html/notebook/addSearchToNotebook.jsp?title=' + searchTitle + '&url=' + searchURL;var myKnovelAjax = new slimAjax(function () {showAddToNotebookMessage(notebookName);});   myKnovelAjax.post(url, '');	document.getElementById(controlId).style.display = 'none';		}function addContentToNotebook() {var title = 'Knovel Content';var titleEl = document.getElementById('popupTitle');if (titleEl && titleEl.innerHTML != '') {title = titleEl.innerHTML;title = escape(title);} var currentURL = window.top.location.href;var contentURL = escape(currentURL);// get the bookIdvar startIndex = currentURL.indexOf('BookID=') + 7;var parsedUrl = currentURL.substring(startIndex, currentURL.length);var endIndex = parsedUrl.indexOf('&');	var bookId = parsedUrl.substring(0, endIndex);// add the content to the Notebookvar url = '/html/notebook/addContentToNotebook.jsp?title=' + title + '&url=' + contentURL + '&bookId=' + bookId;var notebookName = document.getElementById('knovelNotebookName').innerHTML;if (notebookName.charAt(0) == '\n') notebookName = notebookName.substring(1);var myKnovelAjax = new slimAjax(function () {showAddToNotebookMessageAlert(notebookName);});   myKnovelAjax.post(url, '');		document.getElementById('addContentButton').style.display = 'none';		}function addEngCaseToNotebook(bookId, notebookName) {  var title = 'Knovel Content';var titleEl = document.getElementById('bookTitle');if (titleEl && titleEl.innerHTML != '') {title = titleEl.innerHTML;title = escape(title);} // add the content to the Notebookvar contentURL = "/web/portal/browse/display?_EXT_KNOVEL_DISPLAY_bookid=" + bookId;var url = '/html/notebook/addContentToNotebook.jsp?title=' + title + '&url=' + contentURL + '&bookId=' + bookId;var myKnovelAjax = new slimAjax(function () {showAddToNotebookMessage(notebookName);});   myKnovelAjax.post(url, '');		document.getElementById('addBookToNotebook').style.display = 'none';	}function notebookShow(itemName) {var mybookshelfContainerEl = document.getElementById('mybookshelf_container');var myrecentsearchesContainerEl = document.getElementById('myrecentsearches_container');var mysavedsearchesContainerEl = document.getElementById('mysavedsearches_container');		var mybookshelfImageEl = document.getElementById('mybookshelf_image');var myrecentsearchesImageEl = document.getElementById('myrecentsearches_image');var mysavedsearchesImageEl = document.getElementById('mysavedsearches_image');		if (itemName == 'mybookshelf') {myrecentsearchesContainerEl.style.display = 'none';mysavedsearchesContainerEl.style.display = 'none';		mybookshelfContainerEl.style.display = 'block';		myrecentsearchesImageEl.src = '/html/themes/knovel_mktg/images/kenny/btn_myrecentsearches_off.gif';mysavedsearchesImageEl.src = '/html/themes/knovel_mktg/images/kenny/btn_mysavedsearches_off.gif';mybookshelfImageEl.src = '/html/themes/knovel_mktg/images/kenny/btn_mybookshelf_on.gif';} else if (itemName == 'myrecentsearches') {mybookshelfContainerEl.style.display = 'none';				mysavedsearchesContainerEl.style.display = 'none';myrecentsearchesContainerEl.style.display = 'block';	mysavedsearchesImageEl.src = '/html/themes/knovel_mktg/images/kenny/btn_mysavedsearches_off.gif';mybookshelfImageEl.src = '/html/themes/knovel_mktg/images/kenny/btn_mybookshelf_off.gif';			myrecentsearchesImageEl.src = '/html/themes/knovel_mktg/images/kenny/btn_myrecentsearches_on.gif';} else if (itemName == 'mysavedsearches') {myrecentsearchesContainerEl.style.display = 'none';		mybookshelfContainerEl.style.display = 'none';				mysavedsearchesContainerEl.style.display = 'block';		mybookshelfImageEl.src = '/html/themes/knovel_mktg/images/kenny/btn_mybookshelf_off.gif';			myrecentsearchesImageEl.src = '/html/themes/knovel_mktg/images/kenny/btn_myrecentsearches_off.gif';							mysavedsearchesImageEl.src = '/html/themes/knovel_mktg/images/kenny/btn_mysavedsearches_on.gif';}}function turnNotebookTabOn(el) {if (el.src.indexOf('_on.gif') > -1) {return;}var currentSrc = el.src;endIndex = currentSrc.indexOf('_off.gif');var newSrc = currentSrc.substring(0, endIndex);newSrc += '_on.gif';el.src = newSrc;}function turnNotebookTabOff(el) {var thisId = el.id;var endIndex = thisId.indexOf("_");var mainId = thisId.substring(0, endIndex) + "_container";var containerEl = document.getElementById(mainId);if (containerEl.style.display == 'block') {return;}var currentSrc = el.src;endIndex = currentSrc.indexOf('_on.gif');var newSrc = currentSrc.substring(0, endIndex);newSrc += '_off.gif';el.src = newSrc;		}	function showAddToNotebookMessage(notebookName) {    var message = '<center>Added to ' + notebookName + '</center>';showStandardMessage(message, 120);setTimeout('slimPopup.hide()', 2000);	}function showAddToNotebookMessageAlert(notebookName) {var message = "Added to " + notebookName + ""; alert(message);	}// shows the popup in modal modefunction showStandardModalMessage(message, width) {slim.get('#standardMessage').innerHTML = message;slim.get('#standardMessage').style.width = width + 'px';slimPopup.show({popupId: 'standardMessage', popupWidth: width, stayOpen: true, modal: true});	}// if keepOpen is true, the window does not close with any screen clickfunction showStandardMessage(message, width, keepOpen) {slim.get('#standardMessage').innerHTML = message;slim.get('#standardMessage').style.width = width + 'px';slimPopup.show({popupId: 'standardMessage', popupWidth: width, stayOpen: keepOpen});	}// if keepOpen is true, the window does not close with any screen clickfunction showStandardMessageAndFade(message, width) {slim.get('#standardMessage').innerHTML = message;slim.get('#standardMessage').style.width = width + 'px';slimPopup.show({popupId: 'standardMessage', popupWidth: width});setTimeout('slimPopup.hide()', 2000);	}function showExtMessage(message) {// if EXT library is loadedif (Ext) {Ext.MessageBox.show({		msg: message,buttons: Ext.MessageBox.OK});	} else {showStandardMessage(message, 300);		}	}function openLiveChat() {window.open('http://server.iad.liveperson.net/hc/7013782/?cmd=file&file=visitorWantsToChat&site=7013782&byhref=1&imageUrl=http://images.liveperson.com/lp/7013782', 'chat7013782', 'width=475,height=400,resizable=yes');}function openContextualHelp(articleName) {var articleURL = '/web/portal/help/article/' + articleName;openResizableWindowPopup(articleURL, 792, 662, 'contextual_help_window');}function checkContextualHelp() {// nothing to do yet  }/*function changeopacity( imageobject, opacity ) {    var object = imageobject.style;    object.opacity = ( opacity / 100 );    object.MozOpacity = ( opacity / 100 );    object.KhtmlOpacity = ( opacity / 100 );    object.filter = “alpha(opacity=” + opacity + “)”;}*///-->	 // action: print title details	function printTitleDetails() {   	var disp_setting="location=no,directories=yes,"; disp_setting+="scrollbars=yes,width=550, height=400, left=100, top=25"; var content_value = document.getElementById("titleDetailsInnerContainer").innerHTML;var docprint=window.open("","",disp_setting); docprint.document.open(); docprint.document.write('<html><head><title>Title Details</title>'); docprint.document.write('</head><body onLoad="self.print()">');          docprint.document.write(content_value);          docprint.document.write('</body></html>'); docprint.document.close(); docprint.focus();  }    function saveTitleDetails() {var bookID = document.getElementById('currentBookID').value;window.top.location.href='/servlets/BookDetails?BookID=' + bookID;}function citationContinue() {var el = document.getElementById('citationPages');if (el) {if (el.value == '') {alert('Please enter a page or pages');} else {    		var pages = document.getElementById('citationPages').value;    		var desc = document.getElementById('citationTextBefore').value;    		var existingText = document.getElementById('results');    		var temp = new Array();    		var newText = null;   		     		temp = desc.split("..");    		newText = temp[0] + ". (pp: " + pages + "). " + temp[1];     		    		if (existingText != null){    			existingText.value = newText;    		}document.getElementById('citationStart').style.display = 'none';document.getElementById('citationEnd').style.display = 'block';document.getElementById('citationToolbarStart').style.display = 'none';document.getElementById('citationToolbarEnd').style.display = 'block';			document.getElementById('citationTextBefore').disabled = false;document.getElementById('citationTextBefore').value =  newText;}}}function saveCitation() {var bookID = document.getElementById('bookID').value;var text = document.getElementById('citationTextBefore').value;var pages = document.getElementById('citationPages').value;window.top.location.href='/servlets/CitationExport?BookID=' + bookID + '&citation='+ text +'&pages=' + pages +'';}function copyCitation() {var inElement = document.getElementById('citationTextBefore');   	if (inElement.createTextRange) {    	var range = inElement.createTextRange();    	if (range)     		range.execCommand('Copy');    		}    		else {    		var flashcopier = 'flashcopier';    		if(!document.getElementById(flashcopier)) {      		var divholder = document.createElement('div');      		divholder.id = flashcopier;      		document.body.appendChild(divholder);    	}   		document.getElementById(flashcopier).innerHTML = '';       	var divinfo = '<embed src="/html/themes/knovel_mktg/flash/_clipboard.swf" FlashVars="clipboard='+escape(inElement.value)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';   		document.getElementById(flashcopier).innerHTML = divinfo;}	}function printCitation() {   	var disp_setting="location=no,directories=yes,"; disp_setting+="scrollbars=yes,width=450, height=400, left=100, top=25"; var content_value = document.getElementById("citationTextBefore").value;var docprint=window.open("","",disp_setting); docprint.document.open(); docprint.document.write('<html><head><title>Citation</title>'); docprint.document.write('</head><body onLoad="self.print()">');          docprint.document.write(content_value);          docprint.document.write('</body></html>'); docprint.document.close(); docprint.focus();  }function showDisclaimerEmbed() {showStandardPublisherDisclaimer();}function showDisclaimerFromResults(id) {showStandardPublisherDisclaimer();}function showDynamicMessage(url, width) {// get the HTMLvar htmlAjax = new slimAjax(function () {var html = htmlAjax.responseText;	html += "<br/><br/><center><button style='width:120px' onclick='slimPopup.hide()'>Try It Now</button></center>";showStandardMessage(html, width);});   htmlAjax.post(url, '');		}/* MARKETING BANNER */function closeBanner() {createCookie("hideBanner", "1", 86400); // keep it closed for 24 hoursclearTimeout(fadeTimeoutVar);clearTimeout(displayTimeoutVar);clearTimeout(nextPrevTimeoutVar);var bannerElt = document.getElementById("topbanner");bannerElt.style.visibility = "hidden";document.getElementById("page").style.top = '0px';}var bannerHeight = 65;/* images, imageLinks, imageWidths, imageHeights, headerText, headerTextSizes, headerTextFonts, bodyText, bodyTextSizes, and bodyTextFonts will all come from the database. */var images = new Array("/html/themes/knovel_mktg/images/banners/book1.gif", "/html/themes/knovel_mktg/images/banners/book2.png", "");var imageLinks = new Array("/web/portal/browse","http://www.knovel.com", "");var imageWidths = new Array(26, 160, 0);var imageHeights = new Array(40, 46, 0);var headerText = new Array("New Title: Self-Assembly and Nanotechnology - A Force Balance Approach", "STUDENTS! Take the University Challenge!", "Here's a NON-IMAGE type of Marketing message!");var headerTextSizes = new Array(12, 14, 12);var headerTextFonts = new Array('Arial Black', 'Courier New', 'Comic Sans MS');var bodyText = new Array("By: Lee, Yoon S. &copy; 2008 John Wiley &amp; Sons Description: This book is an ideal text for courses that span different disciplines or different departmnents - a very effective approach for teaching nanotechnology.", "Win big prizes and gain fame and recognition like you never thought possible! Everyone's a winner! It's simple, just click on the image to the left to enter and you could be living on easy street! What are you waiting for?", 				 "This marketing banner message exhibits what happens when you have a message without an image. Note also that this item contains a <a href='http://www.google.com' target='_blank_'>hyperlink</a>.");var bodyTextSizes = new Array(12, 10, 14);var bodyTextFonts = new Array('Arial', 'Courier New', 'Century Schoolbook');var firstBanner = true;var ixBanner = -1;var maxIxBanner = images.length - 1;var nextPrevTimeoutVar = null;var displayTimeoutVar = null;var fadeTimeoutVar = null;/* Switch time and fade time will come from the database. */var switchTime = 10000; // auto switch banners every 10 secondsvar fadeTime = 300.0;function nextBanner() {++ixBanner;if (ixBanner > maxIxBanner) ixBanner = 0;displayBanner();}function prevBanner() {--ixBanner;if (ixBanner < 0) ixBanner = maxIxBanner;displayBanner();}function displayBanner() {if (firstBanner) {firstBanner = false;nextPrevTimeoutVar = setTimeout("nextBanner();", switchTime + fadeTime + 5);displayTheBanner();} else {clearTimeout(displayTimeoutVar);clearTimeout(nextPrevTimeoutVar);fade("topinnerbanner", "out");displayTimeoutVar = setTimeout("displayTheBanner();", fadeTime + 5); // wait for fadeout to finishnextPrevTimeoutVar = setTimeout("nextBanner();", switchTime + fadeTime + fadeTime + 5);}}function displayTheBanner() {	var bannerImageElt = document.getElementById("bannerimage");var bannerHeaderTextElt = document.getElementById("bannerheadertext");var bannerBodyTextElt = document.getElementById("bannerbodytext");var imageLink = imageLinks[ixBanner];var image = images[ixBanner];var imageString = "";if (imageLink != null && imageLink != "") imageString += "<a href='" + imageLinks[ixBanner] + "' target='_blank_'>"if (image != null && image != "") imageString += "<img src='" + images[ixBanner] + "'>"if (imageLink != null && imageLink != "") imageString += "</a>";bannerImageElt.innerHTML = imageString;bannerImageElt.style.width = imageWidths[ixBanner] + 'px';var bannerTop = (bannerHeight - imageHeights[ixBanner]) / 2;bannerImageElt.style.top = bannerTop + 'px';var left = 25 + imageWidths[ixBanner];bannerHeaderTextElt.innerHTML = headerText[ixBanner];bannerHeaderTextElt.style.left = left + 'px';bannerHeaderTextElt.style.fontSize = headerTextSizes[ixBanner] + 'px';bannerHeaderTextElt.style.fontFamily = headerTextFonts[ixBanner];bannerBodyTextElt.innerHTML = bodyText[ixBanner];bannerBodyTextElt.style.left = left + 'px';bannerBodyTextElt.style.fontSize = bodyTextSizes[ixBanner] + 'px';bannerBodyTextElt.style.fontFamily = bodyTextFonts[ixBanner];fade("topinnerbanner", "in");}function fade(elementID, inOrOut) {var isIn = (inOrOut == "in");clearTimeout(fadeTimeoutVar);var element = document.getElementById(elementID);if (element == null) return;   if (element.FadeState == null)if (element.style.opacity == null || element.style.opacity == '' || element.style.opacity == '1')element.FadeState = 2;else element.FadeState = -2; if ((isIn  && element.FadeState == 2) ||(!isIn && element.FadeState == -2)) return; // already fully opaque or transparentelement.FadeState = (isIn) ? 1 : -1;element.FadeTimeLeft = fadeTime;fadeTimeoutVar = setTimeout("animateFade('" + elementID + "', " + new Date().getTime() + ")", 33);}function animateFade(elementID, lastTick) {    var curTick = new Date().getTime();  var elapsedTicks = curTick - lastTick;   var element = document.getElementById(elementID);   if (element.FadeTimeLeft <= elapsedTicks) {    element.style.opacity = element.FadeState == 1 ? '1' : '0';    element.style.filter = 'alpha(opacity = '        + (element.FadeState == 1 ? '100' : '0') + ')';    element.FadeState = element.FadeState == 1 ? 2 : -2;    return;  }   element.FadeTimeLeft -= elapsedTicks;  var newOpVal = element.FadeTimeLeft/fadeTime;  if(element.FadeState == 1) newOpVal = 1 - newOpVal;  element.style.opacity = newOpVal;  element.style.filter = 'alpha(opacity = ' + (newOpVal*100) + ')';   fadeTimeoutVar = setTimeout("animateFade('" + elementID + "', " + curTick + ")", 33);}