///////////////////////////////////////////////////////// function isEmail(sEmail){ if(/([^@]+)@(.+)\.(.+)/.test(sEmail)){ return(1) } else { return(0) } } ///////////////////////////////////////////////////////// function symCount(field_id,counter_id,maxNum){ var field = document.getElementById(field_id); var counter = document.getElementById(counter_id); counter.innerHTML = field.value.length + '/' + maxNum if(field.value.length > maxNum){field.value = field.value.substr(0,maxNum)} } ///////////////////////////////////////////////////////// function fixPNG(element,margin){ if (/MSIE (5\.5|6).+Win/.test(navigator.userAgent)){ if(element.tagName=='IMG'){ element.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ element.src +"',sizingMethod=scale)" element.src = "null.gif" } else { var backimg = element.style.backgroundImage var regexp = /url\((.+)\)/ var url = backimg.match(regexp) element.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ url[1] +"',sizingMethod=scale)" element.style.backgroundImage = '' } if(margin){ element.style.marginTop = "3px" } } } //////////////////////////////////////////////// function prosmotr(img){ var nov = document.createElement('div') nov.setAttribute("id","nov") nov.style.position = 'absolute' nov.style.zIndex = '100' nov.style.width = document.body.clientWidth nov.style.height = document.body.clientHeight nov.style.left = document.body.scrollLeft nov.style.top = document.body.scrollTop nov.innerHTML = '
щелчок для закрытия
' document.body.appendChild(nov) fon() } ///////////////////////////////////////////////////////// function fon(){ if(document.getElementById('fon')){ document.body.removeChild(document.getElementById('fon')) } var fon = document.createElement('div') fon.setAttribute("id","fon") fon.style.position = 'absolute' fon.style.backgroundColor = '#000' fon.style.opacity = '.6' fon.style.filter = 'alpha(opacity=60)' fon.style.width = document.body.clientWidth fon.style.height = document.body.clientHeight fon.style.left = document.body.scrollLeft fon.style.top = document.body.scrollTop document.body.appendChild(fon) var selectList = document.getElementsByTagName("SELECT"); for(var i = 0; i