var tabs = new Array(); tabs[0] = "rollfeatures"; tabs[1] = "rollinstallation"; var pageCache = new Hash(); var globalIdCounter = 0; var activeId = null; var defaultcontentarray = new Object(); var loadedobjects = ""; var loadstatustext = " Requesting content..."; window.onresize = null; function loadpage(page_request, containerid, tab_id) { if (page_request.readyState == 4 && (page_request.status == 200 || window.location.href.indexOf("http") == -1)) { var text = page_request.responseText; /* if (!pageCache[tab_id]) { var newId = globalIdCounter; pageCache[tab_id] = { htmlContent: '
' + text + "
", id: newId }; } if (activeId) { $('ajaxTabContent' + activeId).style.display = "none"; } activeId = pageCache[tab_id].id; $('ajaxTabContent' + activeId).style.display = "block"; */ document.getElementById(containerid).innerHTML = text; if(typeof(deButtonsOcms)!="undefined"){ var newBulletsArray = deButtonsOcms; deButtonsOcms = new Array(); for(var i = 0; i < newBulletsArray.length; i++) { if ($(newBulletsArray[i])) { registerButtonOcms(newBulletsArray[i]); } } } text.evalScripts(); } } function showButtonsOcms() { var visStyle = "visible"; if (!visibleOcmsButtons) { visStyle = "hidden"; } for (var i = 0; i < deButtonsOcms.length; i++) { var btid = deButtonsOcms[i]; var deButton = document.getElementById("buttons_" + btid); deButton.style.right = "20px"; deButton.style.top = "0px"; deButton.style.visibility = visStyle; } } function activateOcms(id) { } function fixTables(){ document.body.style.height = (document.body.style.height == "")? "100%" : ""; setTimeout("try { showButtonsOcms(); } catch (e){}", 100); } function startajaxtabs() { for (var i = 0; i < arguments.length; i++) { var ulobj = document.getElementById(arguments[i]); var ulist = ulobj.getElementsByTagName("div"); for (var x = 0; x < ulist.length; x++) { var ulistlink = ulist[x].getElementsByTagName("a")[0]; if (ulistlink.getAttribute("rel")) { var modifiedurl = ulistlink.getAttribute("href").replace(/^http:\/\/[^\/]+\//i, "http://" + window.location.hostname + "/"); ulistlink.setAttribute("href", modifiedurl); savedefaultcontent(ulistlink.getAttribute("rel")); ulistlink.onclick = function() { ajaxpage(this.getAttribute("href"), this.getAttribute("rel"), this); loadobjs(this.getAttribute("rev")); fixTables(); return false; } if (ulistlink.className == "download_tab_features current") { ajaxpage(ulistlink.getAttribute("href"), ulistlink.getAttribute("rel"), ulistlink); loadobjs(ulistlink.getAttribute("rev")); } } } } } function startajaxtabs2() { for (var i = 0; i < arguments.length; i++) { var ulobj = document.getElementById(arguments[i]); var ulist = ulobj.getElementsByTagName("div"); for (var x = 0; x < ulist.length; x++) { var ulistlink = ulist[x].getElementsByTagName("a")[0]; if (ulistlink.getAttribute("rel")) { var modifiedurl = ulistlink.getAttribute("href").replace(/^http:\/\/[^\/]+\//i, "http://" + window.location.hostname + "/"); ulistlink.setAttribute("href", modifiedurl); savedefaultcontent(ulistlink.getAttribute("rel")); ulistlink.onclick = function() { ajaxpage(this.getAttribute("href"), this.getAttribute("rel"), this); loadobjs(this.getAttribute("rev")); fixTables(); return false; } if (ulistlink.className == "download_tab_features current") { ajaxpage(ulistlink.getAttribute("href"), ulistlink.getAttribute("rel"), ulistlink); loadobjs(ulistlink.getAttribute("rev")); } } } } } function savedefaultcontent(contentid) { if (typeof defaultcontentarray[contentid] == "undefined") { defaultcontentarray[contentid] = (document.getElementById(contentid)); } } function loadobjs(revattribute) { if (revattribute != null && revattribute != "") { var objectlist = revattribute.split(/\s*,\s*/); for (var i = 0; i < objectlist.length; i++) { var file = objectlist[i]; var fileref = ""; if (loadedobjects.indexOf(file) == -1) { if (file.indexOf(".js") != -1) { fileref = document.createElement('script'); fileref.setAttribute("type", "text/javascript"); fileref.setAttribute("src", file); } else if (file.indexOf(".css") != -1) { fileref = document.createElement("link"); fileref.setAttribute("rel", "stylesheet"); fileref.setAttribute("type", "text/css"); fileref.setAttribute("href", file); } } if (fileref != "") { document.getElementsByTagName("head").item(0).appendChild(fileref); loadedobjects += file + " "; } } } } function ajaxpage(url, containerid, targetobj) { var page_request = false; if (window.XMLHttpRequest) { page_request = new XMLHttpRequest(); } else if (window.ActiveXObject) { try { page_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { page_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { } } } else { return false; } var ullist = targetobj.parentNode.parentNode.getElementsByTagName("div"); for (var i = 0; i < ullist.length; i++) { var ulistlink = ullist[i].getElementsByTagName("a")[0]; //deselect all tabs ulistlink.className = ulistlink.className.replace(" current", ""); } //highlight currently clicked on tab targetobj.className = targetobj.className + " current"; if (url.indexOf("#default") != -1) { //if simply show default content within container (verus fetch it via ajax) document.getElementById(containerid).innerHTML = defaultcontentarray[containerid]; return; } document.getElementById(containerid).innerHTML = loadstatustext; page_request.onreadystatechange = function() { loadpage(page_request, containerid, url); } page_request.open('GET', url, true); page_request.send(null); } function openEnlargeImage(imgURL) { window.open(imgURL,'largImage','resizable=no,location=no,menubar=no,scrollbars=yes,status=yes,toolbar=no,fullscreen=no,dependent=no,width=510,height=380,status'); } function closePopup() { var objPopup = document.getElementById('popup'); objPopup.style.display = "none"; } function showHideDownloadPopup(attrib) { document.getElementById('divDownloadPopup').style.display = (attrib == "show") ? 'block' : 'none'; }