/////////////////////////////////////////////////////////
function isEmail(sEmail){
if(/([^@]+)@(.+)\.(.+)/.test(sEmail)){ return(1) } else { return(0) }
}
/////////////////////////////////////////////////////////
function isNumber(sNum){
if(/[^(1|2|3|4|5|6|7|8|9|0|\.)]/.test(sNum)){
return false
} else {
return true
}
}
/////////////////////////////////////////////////////////
function checkInt(obj,title){
obj.value = obj.value.replace(/\.{2,}/g,'.');
if(!isNumber(obj.value)){
obj.value = obj.value.replace(/[^(0-9|\.)]/g,'');
baloon('ОШИБКА','В поле «'+ title +'» должно быть цифровое значение');
};
}
/////////////////////////////////////////////////////////
function nowDate(){
var nowDate, hours, minutes, day, month, year;
nowDate = new Date();
hours = nowDate.getHours();
minutes = nowDate.getMinutes();
day = nowDate.getDate();
month = eval(nowDate.getMonth() + 1);
year = nowDate.getFullYear();
if(hours < 10){ hours = '0' + hours }
if(minutes < 10){ minutes = '0' + minutes }
if(day < 10){ day = '0' + day }
if(month < 10){ month = '0' + month }
return {hours:hours, minutes:minutes, day:day, month:month, year:year}
}
/////////////////////////////////////////////////////////
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 (navigator.appName.indexOf('Microsoft') >= 0){
if(element.tagName=='IMG'){
element.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ element.src +"',sizingMethod=scale)"
element.src = "/include/images/null.gif"
element.style.width = element.width+"px"
element.style.height = element.height+"px"
} 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 measureImg(obj){
if(obj.width && obj.height){
baloon('da','',1000)
var zoomImg, imgWidth, imgHeight, bodyWidth, bodyHeight, prop
imgWidth = obj.width
imgHeight = obj.height
bodyWidth = document.body.clientWidth/100*85
bodyHeight = document.body.clientHeight/100*85
if(imgWidth > bodyWidth || imgHeight > bodyHeight){
if(imgWidth >= imgHeight){
prop = imgWidth / imgHeight
imgWidth = parseInt(bodyWidth)
imgHeight = parseInt(imgWidth / prop)
if(imgHeight > bodyHeight){
imgHeight = bodyHeight
imgWidth = parseInt(imgHeight * prop)
}
} else {
prop = imgHeight / imgWidth
imgHeight = parseInt(bodyHeight)
imgWidth = parseInt(imgHeight / prop)
if(imgWidth > bodyWidth){
imgWidth = bodyWidth
imgHeight = parseInt(imgWidth * prop)
}
}
}
zoomImg = document.getElementById('img')
zoomImg.src = obj.src
zoomImg.width = imgWidth
zoomImg.height = imgHeight
} else {
baloon('net','',1000)
setTimeout("measureImg("+ obj +")", 2000)
}
}
function prosmotr(img){
var nov = document.createElement('div')
nov.setAttribute("id","nov")
nov.style.position = 'absolute'
nov.style.zIndex = '10010'
nov.style.width = document.body.clientWidth + 'px'
nov.style.height = document.body.clientHeight + 'px'
nov.style.left = document.body.scrollLeft + 'px'
nov.style.top = document.body.scrollTop + 'px'
nov.innerHTML = ''
+'
'
+' '
+' | '
+' '
+' | '
+'
'
+'
'
document.body.appendChild(nov)
// obj = new Image()
// obj.src = img
// measureImg(obj)
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.zIndex = '10000'
fon.style.backgroundColor = '#000'
if(nofade){
fon.style.opacity = '.65'
} else {
fon.style.opacity = '.65'
}
fon.style.filter = 'alpha(opacity=65)'
fon.style.width = document.body.clientWidth + 'px'
fon.style.height = document.body.clientHeight + 'px'
fon.style.left = document.body.scrollLeft + 'px'
fon.style.top = document.body.scrollTop + 'px'
document.body.appendChild(fon)
var selectList = document.getElementsByTagName("SELECT");
for(var i = 0; i i_finish){
clearTimeout(inTimer)
op -= step
obj.style.opacity = op/100
obj.style.filter = 'alpha(opacity='+ op +')'
var outTimer = setTimeout("fade('"+id+"',"+i_start+","+i_finish+")",speed)
} else {
obj.parentNode.removeChild(obj)
}
}
}
}
/////////////////////////////////////////////////////////
function isChecked(container_id){
if(document.getElementById(container_id)){
var list = document.getElementById(container_id).getElementsByTagName('input')
for(var i = 0; i < list.length; i++){
if(list[i].checked == true){ return(1) }
}
}
}
/////////////////////////////////////////////////////////
function preload(images) {
if (typeof document.body == "undefined") return;
try {
var div = document.createElement("div");
var s = div.style;
s.position = "absolute";
s.top = s.left = 0;
s.visibility = "hidden";
document.body.appendChild(div);
for (var i = 0; i < images.length; i++) div.innerHTML += "
";
} catch(e) {
// Error. Do nothing.
}
}
/////////////////////////////////////////////////////////
function send_form(uuid,title){
var dialogTitle, dialogCode, dialogButtons;
dialogCode = ''
+ ' '
+ ' '
+ ' '
+ ' '
+ ' '
+ ' ';
dialogButtons = [
'',
''
];
dialogTitle = 'Отправка сообщения';
dialog(dialogTitle,dialogCode,dialogButtons);
ten();
document.forms['nov_form'].kName1.style.display = 'none';
document.forms['nov_form'].kName2.style.display = 'none';
document.forms['nov_form'].kName3.style.display = 'none';
document.forms['nov_form'].kName4.style.display = 'none';
}
/////////////////////////////////////////////////////////
function checkFill(form){
if(!form.fName.value){
alert('Введите Ваше имя','5000');
form.fName.focus();
} else if(!form.fText.value){
alert('Введите текст сообщения','5000');
form.fText.focus();
} else if(!form.fContacts.value) {
alert('Введите Вашу контактную информацию','5000');
form.fContacts.focus();
} else {
form.submit();
}
}
/////////////////////////////////////////////////////////
function _blank(){
var aList = document.getElementsByTagName('a')
for(var i = 0; i < aList.length; i++){
if(aList[i].className.indexOf('_blank') >= 0){
aList[i].onclick = function(){ window.open(this.href); return(false) }
}
}
}
/////////////////////////////////////////////////////////
function dialog(sTitle,sCode,aButtons){
var sButtons = '';
if(aButtons){
for(var i = 0; i < aButtons.length; i++){
sButtons += aButtons[i]
}
}
if(aButtons){
var closeBtn = '';
var contentPadding = ''
} else {
var closeBtn = '';
var contentPadding = ' style="padding:10px"'
}
var nov = document.createElement('div');
nov.setAttribute("id","nov");
nov.style.position = 'absolute';
nov.style.zIndex = '10010';
nov.style.width = document.body.clientWidth + 'px';
nov.style.height = document.body.clientHeight + 'px';
nov.style.left = document.body.scrollLeft + 'px';
nov.style.top = document.body.scrollTop + 'px';
nov.innerHTML = ''
+ ''
document.body.appendChild(nov)
if(document.forms['nov_form'].elements && document.forms['nov_form'].elements[0]){
document.forms['nov_form'].elements[0].focus()
}
fon();
}
/////////////////////////////////////////////////////////
function removeOverlay(){
if(document.getElementById('nov')){
document.getElementById('nov').parentNode.removeChild(document.getElementById('nov'))
}
if(document.getElementById('fon')){
// if(nofade){
document.body.removeChild(document.getElementById('fon'))
// } else {
// fade('fon',65,0)
// }
}
var selectList = document.getElementsByTagName("SELECT");
for(var i = 0; i=0){
tenList[i].innerHTML='' +
'' +
//тень
''+ tenList[i].innerHTML +'' +
//текст
''+ tenList[i].innerHTML +'' +
''
tenList[i].className=''
}
}
}
/////////////////////////////////////////////////////////
function addFavorite(obj){
var title_0;
title_0 = obj.title;
obj.title = document.title;
window.external.AddFavorite(location.href,document.title);
obj.title = title_0;
return false;
}