$(document).ready(function () { var aux = document.URL.split("/")[ document.URL.split("/").length-1]; if(aux === "tab0.htm"){ document.getElementsByTagName("table")[0].id = "tab0"; $("#tab0").css("display","none"); window.localStorage.tab0 = document.getElementById("tab0").outerHTML; } if(aux === "menu.htm"){ document.getElementsByTagName("table")[0].id = "menu"; $("#menu").css("display","none"); window.localStorage.menu = document.getElementById("menu").outerHTML; var aux = ""; for(var x=0;x<=document.getElementsByTagName("style").length-1;x++){ document.getElementsByTagName("style")[x].id = "stm"+x; aux = aux + document.getElementById("stm"+x).outerHTML; } window.localStorage.style_z = aux; } if(aux === "formato.htm"){ document.getElementsByTagName("body")[0].id = "formato"; window.localStorage.formato = $("#formato").html(); var aux = ""; for(var x=0;x<=document.getElementsByTagName("style").length-1;x++){ document.getElementsByTagName("style")[x].id = "stm"+x; aux = aux + document.getElementById("stm"+x).outerHTML; } window.localStorage.style_y = aux; } });