function login() { ieheight(); login_show(); } function $(id) { return document.getElementById(id); } function login_show() { $('auth').style.display = "block"; $('authdialog').style.left = '50%'; $('loginfocusneeded').focus(); } function login_hide() { $('authdialog').style.position = 'absolute'; $('authdialog').style.left = '-2000px'; $('auth').style.display = "none"; } document.onkeypress = function(ev){ ev = ev || event; if(ev.keyCode==27) login_hide(); } function ieheight() { var bg = $('body').offsetHeight; $('bg').style.height = bg + 'px'; }var inputs = document.getElementsByTagName('input'); var buttons = new Array(); var imagesPath = "style_images/people.az/images/"; function init() { // quit if this function has already been called if (arguments.callee.done) return; // flag this function so we don't do the same thing twice arguments.callee.done = true; // kill the timer if (_timer) clearInterval(_timer); // do stuff preloadImages(); separateElements(); buttonHovers(); replaceChecks(); replaceRadios(); } function preloadImages() { preloads = new Object(); preloads[0] = new Image(); preloads[0].src = imagesPath + "button_left_xon.gif"; preloads[1] = new Image(); preloads[1].src = imagesPath + "button_right_xon.gif";} function separateElements() { var b = 0; for (var q = 0; q < inputs.length; q++) { if((inputs[q].type == "submit") || (inputs[q].type == "button")) {buttons[b] = inputs[q]; ++b;}}} function buttonHovers() { for (var i = 0; i < buttons.length; i++) { buttons[i].className = "buttonSubmit"; var buttonLeft = document.createElement('img'); buttonLeft.src = imagesPath + "button_left.gif"; buttonLeft.className = "buttonImg"; buttons[i].parentNode.insertBefore(buttonLeft, buttons[i]); var buttonRight = document.createElement('img'); buttonRight.src = imagesPath + "button_right.gif"; buttonRight.className = "buttonImg"; if(buttons[i].nextSibling) {buttons[i].parentNode.insertBefore(buttonRight, buttons[i].nextSibling);} else {buttons[i].parentNode.appendChild(buttonRight);} buttons[i].onmouseover = function() { this.className += "Hovered"; this.previousSibling.src = imagesPath + "button_left_xon.gif"; this.nextSibling.src = imagesPath + "button_right_xon.gif";} buttons[i].onmouseout = function() { this.className = this.className.replace(/Hovered/g, ""); this.previousSibling.src = imagesPath + "button_left.gif"; this.nextSibling.src = imagesPath + "button_right.gif";}}} function replaceChecks() { for(var i=0; i < inputs.length; i++) { if(inputs[i].getAttribute('type') == 'checkbox') { var img = document.createElement('img'); if(inputs[i].checked) {{img.src = imagesPath + "checkbox_checked.gif";}} else {{img.src = imagesPath + "checkbox_unchecked.gif";}} img.id = 'checkImage'+i;if(!inputs[i].disabled) img.onclick = new Function('checkChange('+i+')'); inputs[i].parentNode.insertBefore(img, inputs[i]); inputs[i].style.display='none';}}} function checkChange(i) { if(inputs[i].checked) { inputs[i].checked = ''; document.getElementById('checkImage'+i).src=imagesPath + "checkbox_unchecked.gif"; } else { inputs[i].checked = 'checked'; document.getElementById('checkImage'+i).src=imagesPath + "checkbox_checked.gif";}} function replaceRadios() { for(var i=0; i < inputs.length; i++) { if(inputs[i].getAttribute('type') == 'radio') { var img = document.createElement('img'); if(inputs[i].checked) {{img.src = imagesPath + "radio_checked.gif";}} else {{img.src = imagesPath + "radio_unchecked.gif";}} img.id = 'radioImage'+inputs[i].id; if(!inputs[i].disabled) img.onclick = new Function('radioChange('+i+')'); inputs[i].parentNode.insertBefore(img, inputs[i]); inputs[i].style.display='none';}}} function radioChange(i) { var radios=new Array(); var tmpradios; tmpradios = document.getElementsByTagName('input'); for(var j=0; j < tmpradios.length; j++) { if(tmpradios[j].getAttribute('name') == inputs[i].getAttribute('name')) {radios.push(tmpradios[j]);}} if(inputs[i].checked) {} else { for(var j=0; j < radios.length; j++) { document.getElementById('radioImage'+radios[j].id).src= imagesPath + "radio_unchecked.gif"; document.getElementById('radioImage'+radios[j].id).checked=''; } inputs[i].checked = 'checked'; document.getElementById('radioImage'+inputs[i].id).src = imagesPath + "radio_checked.gif";}} /* for Mozilla/Opera9 */ if (document.addEventListener) { document.addEventListener("DOMContentLoaded", init, false); } /* for Internet Explorer */ if (window.attachEvent) { window.attachEvent("onload", function() {init()}); } /* for Safari */ if (/WebKit/i.test(navigator.userAgent)) { // sniff var _timer = setInterval(function() { if (/loaded|complete/.test(document.readyState)) { init(); // call the onload handler } }, 10); } /* for other browsers */ window.onload = init;imgout=new Image(); imgin=new Image(); imgout.src="style_images/people.az/images/bl_show.gif"; imgin.src="style_images/people.az/images/bl_hide.gif"; function filter(imagename,objectsrc){if (document.images){document.images[imagename].src=eval(objectsrc+".src");}} function sh(id) {if (document.getElementById) { // DOM3 = IE5, NS6 if (document.getElementById(id).style.display == "none"){document.getElementById(id).style.display = 'block';filter(("img"+id),'imgin');} else {filter(("img"+id),'imgout');document.getElementById(id).style.display = 'none';}} else {if (document.layers) {if (document.id.display == "none"){document.id.display = 'block';filter(("img"+id),'imgin');} else {filter(("img"+id),'imgout');document.id.display = 'none';}} else {if (document.all.id.style.visibility == "none"){document.all.id.style.display = 'block';} else {filter(("img"+id),'imgout');document.all.id.style.display = 'none';}}}}