/** _________ .__ _____ __________ \_ ___ \ ____ _____ _____________|__| ____ ___________ / _ \\______ \ (.JS) / \ \/ / _ \ / \\____ \_ __ \ |/ ___\/ __ \_ __ \ / /_\ \| | _/ \ \___( <_> ) Y Y \ |_> > | \/ \ \__\ ___/| | \/ / | \ | \ \______ /\____/|__|_| / __/|__| |__|\___ >___ >__| \____|__ /______ / \/ \/|__| \/ \/ \/ \/ Compricer (std.func) | client-side-script Compricer AB **/ function toggleInsuranceCarReadMoreText(id, linkid, readmore, readless) { var elid = document.getElementById(id+"_id"); var img = document.getElementById(id+"img_id"); var linkid = document.getElementById(linkid); var imgdomain = ("https:" == document.location.protocol) ? "https://www.compricer.se/images/" : "http://images.compricer.se/"; if(elid.style.visibility == "hidden") { elid.style.display = ""; elid.style.visibility = "visible"; linkid.innerHTML = readless; img.src = imgdomain+"general/icons/small_arrow_down13x13.gif"; } else { elid.style.display = "none"; elid.style.visibility = "hidden"; linkid.innerHTML = readmore; img.src = imgdomain+"general/icons/small_arrow_right13x13.gif"; } } function toggleDisplayRow(id, _anchor, imgid, imgshow, imghide) { row = document.getElementById(id); if(row.style.display == '' || row.style.display == 'none') { document.getElementById(imgid).src = imghide; if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)) // MSIE x.x; row.style.display = 'block'; else row.style.display = 'table-row'; if(_anchor) _anchor.innerHTML = hideRowAnchorText; } else { document.getElementById(imgid).src = imgshow; row.style.display = 'none'; if(_anchor) _anchor.innerHTML = showRowAnchorText; } /* if(row.style.display != 'table-row' && row.style.display != "block") { try { row.style.display = 'table-row'; } catch(e) { row.style.display = 'block'; } if(_anchor) _anchor.innerHTML = hideRowAnchorText; if(imgid) document.getElementById(imgid).src = imghide; } else { row.style.display = 'none'; if(_anchor) _anchor.innerHTML = showRowAnchorText; if(imgid) document.getElementById(imgid).src = imgshow; }*/ } /* function changeCheckboxImg(id){ radio = document.getElementById(id); image = document.getElementById("icon_"+id); if(radio.checked == false){ document.getElementById("icon_"+id).style.backgroundPosition = "left bottom"; radio.checked = true; //"checked"; } else { radio.checked = false; //"checked"; image.style.backgroundPosition = "0 0px"; } } */ function updateCheckboxImg(id) { radio = document.getElementById(id); image = document.getElementById("icon_"+id); if(radio.checked) { image.style.backgroundPosition = "left bottom"; } else { image.style.backgroundPosition = "0 0px"; } } function changeCheckboxImg(id) { radio = document.getElementById(id); image = document.getElementById("icon_"+id); if(radio.checked == false) { radio.checked = true; } else { radio.checked = false; } updateCheckboxImg(id); } function updateRadioImg(id){ radio = document.getElementById(id); image = document.getElementById("icon_"+id); inputs = document.getElementsByTagName("input"); for(n=0; n