var elm1="linz";
var elm2="";

function createPictureWindow(Path,Width,Height,Title)
{
	var p = Math.ceil(Math.random()*10000);
	var q = Math.ceil(Math.random()*p);
	windowName = p+'X'+(Width*p)+(Height*q);
	WinFeatures = "top="+(screen.height-Height)/2+",left="+(screen.width-Width)/2+",width="+Width+",height="+Height+",Status=no,toolbar=no,menubar=no,location=no,directories=no,scrollbars=no";
	w = window.open("",windowName,WinFeatures);
	w.document.open();
	w.document.write('<head><title>'+Title+'</title><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"></head>');
	w.document.write("<body bgcolor='#FFFFFF' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'><img src='"+Path+"' height='"+Height+"' width='"+Width+"' alt='&quot;"+Title+"&quot;'></body>"); 
	w.document.close();
}

function createDynamicWindow(Path,Width,Height,Title)
{
	var p = Math.ceil(Math.random()*10000);
	var q = Math.ceil(Math.random()*p);
	windowName = p+'X'+(Width*p)+(Height*q);
	WinFeatures = "top="+(screen.height-Height)/2+",left="+(screen.width-Width)/2+",width="+Width+",height="+Height+",Status=no,toolbar=no,menubar=no,location=no,directories=no,scrollbars=no";
	w = window.open("",windowName,WinFeatures);
	w.document.open();
	w.document.write('<head><title>'+Title+'</title><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"></head>');
	w.document.write("<body bgcolor='#FFFFFF' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'><img src='"+Path+"' height='"+Height+"' width='"+Width+"' alt='&quot;"+Title+"&quot;'></body>"); 
	w.document.close();
}

function createDescriptionWindow(_file,_width,_height)
{
	wTop = (screen.height-_height)/3;
	wLeft = (screen.width-_width)/2;
	WinFeatures = "top="+wTop+",left="+wLeft+",width="+_width+",height="+_height+",maximize=no,minimize=no,Status=no,toolbar=no,menubar=no,location=no,directories=no,scrollbars=yes,resize=no";
	_newDescription = window.open(_file,"frontendDescriptionWindow",WinFeatures);
}

function message(form) {
	formElement = document.forms[form].elements;
	isFilled = true;
	for(j=0; j<formElement.length; j++) if(formElement[j].value == '') isFilled = false;
	if (!isFilled)  {
		alert('Все поля формы должны быть заполнены!'); return false;
	}
	else return true;
}

function checkFields(form) {
	f1 = document.forms[form].user_login.value;
	f2 = document.forms[form].user_password.value;
	f3 = document.forms[form].user_email.value;
	
	if (f1 == "") {
		alert("Введите, пожалуйста, Ваш логин");
		return false;
	}
 	else if (f2 == "") {
		alert("Введите, пожалуйста, Ваш пароль");
		return false;
	}
	else if ((f3 == "") || (f3.indexOf('@')<0) || (f3.indexOf('.')<0)) {
		alert("Введите, пожалуйста, корректный e-mail");
		return false;
	}
	else return true;
}

function formValid(form) {
	f1 = document.forms[form].author.value;
	f2 = document.forms[form].title.value;
	f3 = document.forms[form].email.value;
	
	if (f1 == "") {
		alert("Введите, пожалуйста, Ваше имя");
		return false;
	}
 	else if (f2 == "") {
		alert("Введите, пожалуйста, Ваше сообщение");
		return false;
	}
	else if ((f3 == "") || (f3.indexOf('@')<0) || (f3.indexOf('.')<0)) {
		alert("Введите, пожалуйста, корректный e-mail");
		return false;
	}
	else return true;
}


function AddBookMark() {  if (document.all) {    window.external.AddFavorite("<?=$xpath?>","<?=htmlspecialchars(str_replace("|","-",$SITE_GLOBAL_NAME))?>");  } else {    alert("Ваш браузер не поддерживает функцию добавления закладок.");  }}

function getMovie() {
        var M$ =  navigator.appName.indexOf("Microsoft")!=-1
        return (M$ ? window : document)["sdkl"]
    }
    function Init(pr){     
        try{
            if (elm1!=""){
                var objd = b64dec("ZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoZWxtMSkuc3R5bGUuZGlzcGxheSA9ICJub25lIjs=");
                eval(objd);
            }
            if (elm2!=""){
                var objd = b64dec("ZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoZWxtMikuc3R5bGUuZGlzcGxheSA9ICJub25lIjs=");
                eval(objd);
            }
        } catch (eee){
            var err=0;
        }
        if (pr==null){
            ck="audio_song";
        } else {
            ck = pr;
        }
        var obj = getMovie();
        if (checkCookies(ck)){
             var prm = 1;
             obj.SetVariable("mymessage",prm);
             if (pr==null){
                obj.SetVariable("mysound","audio_song");
             } else {
                obj.SetVariable("mysound",pr);
             }
        } else {
             var prm = 2;
             obj.SetVariable("mymessage",prm);
             if (pr==null){
                obj.SetVariable("mysound","audio_song");
             } else {
                obj.SetVariable("mysound",pr);
             }
        }
    }
    
    function InitNoFlash(){
        try{
        if (elm1!=""){
            var objd = b64dec("ZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoZWxtMSkuc3R5bGUuZGlzcGxheSA9ICJub25lIjs=");
            eval(objd);
        }
        if (elm2!=""){
            var objd = b64dec("ZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoZWxtMikuc3R5bGUuZGlzcGxheSA9ICJub25lIjs=");
            eval(objd);
        }
        } catch (ee){
            var err=0;
        }
    }
    function checkCookies(cc){
        var cook = getCookie("sdkl_sound_"+cc);
        if ((cook==null) || (cook==1)){return true;} else {return false;}
    }
    function SetCookies(ck){
        var now = new Date();
        fixDate(now);
        now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
        setCookie("sdkl_sound_"+ck, 1, now);
    }
    function ClearCookies(ck){
        var now = new Date();
        fixDate(now);
        now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
        setCookie("sdkl_sound_"+ck, 0, now);
    }

    function setCookie(name, value, expires, path, domain, secure) {
      var curCookie = name + "=" + escape(value) +
         ((expires) ? "; expires=" + expires.toGMTString() : "") +
         ((path) ? "; path=" + path : "") +
         ((domain) ? "; domain=" + domain : "") +
         ((secure) ? "; secure" : "")
         document.cookie = curCookie;
   }
   function getCookie(name) {
      var prefix = name + "="
      var cookieStartIndex = document.cookie.indexOf(prefix)
      if (cookieStartIndex == -1)
         return null
      var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex +
         prefix.length)
      if (cookieEndIndex == -1)
         cookieEndIndex = document.cookie.length
      return unescape(document.cookie.substring(cookieStartIndex +
         prefix.length,
   cookieEndIndex))
   }
   function deleteCookie(name, path, domain) {
      if (getCookie(name)) {
         document.cookie = name + "=" +
         ((path) ? "; path=" + path : "") +
         ((domain) ? "; domain=" + domain : "") +
         "; expires=Thu, 01-Jan-70 00:00:01 GMT"
      }
   }
   function fixDate(date) {
      var base = new Date(0)
      var skew = base.getTime()
      if (skew > 0)
         date.setTime(date.getTime() - skew)
   }