Hej
Det är koden jag använder i en .js fil men tycker att det verkar vara lite för mycket kod. Går det att rensa ut lite???
------------------.js-----------------
var today = new Date();
var expiry = new Date(today.getTime() + 365 * 24 * 60 * 60 * 1000);
var nu = navigator.userAgent.toLowerCase();
function doCookie(skin) {
document.getElementById("skin").href='/css/' + skin + '.css';
document.cookie="skin=" + escape(skin) + "; expires=" + expiry.toGMTString() + "; path=/";
document.getElementById("logo").src = "/images/logo_" + skin + ".gif";
if (document.all) {// Internet Explorer (and opera too but that's ok)
var sel = document.getElementsByTagName("SELECT")
for (i=0;i<sel.length;i++) { // hide and show all select boxes otherwise their colours won't change in IE (GRRRR!!!)
sel*.style.visibility = "hidden";
sel*.style.visibility = "visible";
}
}
var nu2 = (nu.indexOf("opera") != -1);
if (nu2) {
// reload for opera, as it doesn't support dynamic css switching
window.location.reload();
}
}
<!-- popup rutan --->
function freeDLterms(app) {
var ie = (nu.indexOf("msie") != -1);
var op = (nu.indexOf("opera") != -1);
if (ie && document.getElementById && !op) {
var termsbox = window.open("Terms of Use for.htm", "", "width=350,height=320,toolbar=no");
}
else {
var termsbox = showModelessDialog("Terms of Use for.htm", "", "dialogWidth:350px; dialogHeight:320px; status:no; help:no; resizable:yes");
}
}
-----------------------**