// JavaScript Document /* *********************************************************************************************** */ function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i element), // we need to traverse the parent nodes until we get a row element (TR) // Netscape has a weird node (if the mouse is over a text object, then there's no tagName while (myElement && ((myElement.tagName && myElement.tagName!="TR") || !myElement.tagName)) { myElement=myElement.parentNode; } // If you don't want a particular row to be highlighted, set it's id to "prodTableHeader" if (!myElement || (myElement && myElement.id && myElement.id=="prodTableHeader") ) return; // Highlight every cell on the row if (myElement) { var tableRow=myElement; // Save the backgroundColor style OR the style class of the row (if defined) if (tableRow) { savedStates[savedStateCount]=saveBackgroundStyle(tableRow); savedStateCount++; } // myElement is a , then find the first TD var tableCell=findNode(myElement, "TD"); var i=0; // Loop through every sibling (a sibling of a cell should be a cell) // We then highlight every siblings while (tableCell) { // Make sure it's actually a cell (a TD) if (tableCell.tagName=="TD") { // If no style has been assigned, assign it, otherwise Netscape will // behave weird. if (!tableCell.style) { tableCell.style={}; } else { savedStates[savedStateCount]=saveBackgroundStyle(tableCell); savedStateCount++; } // Assign the highlight color tableCell.style["backgroundColor"]=highlightColor; // Optional: alter cursor // tableCell.style.cursor='default'; i++; } // Go to the next cell in the row tableCell=tableCell.nextSibling; } } } ///////////////////////////////////////////////////// // This function is to be assigned to a mouse event handler. // If the element that fired the event is within a table row, // this function will highlight the row. ///////////////////////////////////////////////////// function trackTableHighlight(mEvent, highlightColor) { if (!mEvent) mEvent=window.event; // Internet Explorer if (mEvent.srcElement) { highlightTableRow( mEvent.srcElement, highlightColor); } else if (mEvent.target) { // Netscape and Firefox highlightTableRow( mEvent.target, highlightColor); } } ///////////////////////////////////////////////////// // Highlight table row. // newElement could be any element nested inside the table // highlightColor is the color of the highlight ///////////////////////////////////////////////////// function highlightTableRowVersionA(myElement, highlightColor) { var i=0; // Restore color of the previously highlighted row for (i; i, then find the first TD var tableCell=findNode(myElement, "TD"); var i=0; // Loop through every sibling (a sibling of a cell should be a cell) // We then highlight every siblings while (tableCell) { // Make sure it's actually a cell (a TD) if (tableCell.tagName=="TD") { // If no style has been assigned, assign it, otherwise Netscape will // behave weird. if (!tableCell.style) { tableCell.style={}; } else { savedStates[savedStateCount]=saveBackgroundStyle(tableCell); savedStateCount++; } // Assign the highlight color tableCell.style["backgroundColor"]=highlightColor; // Optional: alter cursor tableCell.style.cursor='default'; i++; } // Go to the next cell in the row tableCell=tableCell.nextSibling; } } } /* *********************************************************************************************** */ function textCounter(field, countfield, maxlimit) { if (field.value.length > maxlimit) { // if too long...trim it! field.value = field.value.substring(0, maxlimit); // otherwise, update 'characters left' counter } else { countfield.value = maxlimit - field.value.length; } } var textareaFocusCount = 0; function changeCol(which) { which.style.color = '#006'; which.style.fontWeight = 'normal'; which.style.fontStyle = 'normal'; if(textareaFocusCount == 0) { which.value = ""; // erase text only on first focus textareaFocusCount ++; } } /* *********************************************************************************************** */ function toggleLayer( whichLayer ) { var elem, vis; if( document.getElementById ) // this is the way the standards work elem = document.getElementById( whichLayer ); else if( document.all ) // this is the way old msie versions work elem = document.all[whichLayer]; else if( document.layers ) // this is the way nn4 works elem = document.layers[whichLayer]; vis = elem.style; // if the style.display value is blank we try to figure it out here if(vis.display=='' && elem.offsetWidth != undefined && elem.offsetHeight != undefined) vis.display = (elem.offsetWidth!=0 && elem.offsetHeight!=0) ? 'block' : 'none'; //vis.display = (vis.display==''||vis.display=='block')?'none':'block'; vis.display = (vis.display!='' && vis.display!='block') ? 'block' : 'none'; } /* *********************************************************************************************** */ function hideShow( whichLayer, hideShow ) { var elem, vis; if( document.getElementById ) // this is the way the standards work elem = document.getElementById( whichLayer ); else if( document.all ) // this is the way old msie versions work elem = document.all[whichLayer]; else if( document.layers ) // this is the way nn4 works elem = document.layers[whichLayer]; vis = elem.style; if(hideShow == 'show') { vis.display = 'block'; } else { vis.display = 'none'; } } /* *********************************************************************************************** */ //Gets the browser specific XmlHttpRequest Object function getXmlHttpRequestObject() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else if(window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); } else { // alert("Your Browser Sucks!\nIt's about time to upgrade don't you think?"); } } //Our XmlHttpRequest object to get the auto suggest var searchReq = getXmlHttpRequestObject(); //Called from keyup on the search textbox. //Starts the AJAX request. function searchSuggest() { if (searchReq.readyState == 4 || searchReq.readyState == 0) { var str = escape(document.getElementById('searchText').value); if (str.length > 2) { hideShow('search_suggest', 'show'); } else { hideShow('search_suggest', 'none'); } var randomnumber=Math.floor(Math.random()*1024); searchReq.open("GET", '/includes/searchSuggest.php?r=' + randomnumber + '&search=' + str, true); searchReq.onreadystatechange = handleSearchSuggest; searchReq.send(null); } } //Called when the AJAX response is returned. function handleSearchSuggest() { if (searchReq.readyState == 4) { var ss = document.getElementById('search_suggest') ss.innerHTML = ''; var str = searchReq.responseText.split("\n"); for(i=0; i < str.length - 1; i++) { if (str[i].length > 1 && str[i].substring(0,14) != "") { ss.innerHTML += str[i]; } else if (str[i].substring(0,14) == "") { ss.innerHTML = '
' + str[i] + '
'; } } } } //Mouse over function function suggestOver(div_value) { div_value.className = 'suggest_link_over'; } //Mouse out function function suggestOut(div_value) { div_value.className = 'suggest_link'; } //Click function function setSearch(value) { document.getElementById('searchText').value = value; document.getElementById('search_suggest').innerHTML = ''; hideShow('search_suggest', 'none'); } /* *********************************************************************************************** */ function bookmark(url,title){ if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) { window.external.AddFavorite(url,title); } else if (navigator.appName == "Netscape") { window.sidebar.addPanel(title,url,""); } else { alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark"); } }