﻿/*** Temporary text filler function. Remove when deploying template. ***/
var gibberish=["Это просто заполнитель текста", "Добро пожаловать на наш сайт", "Демонстрационное содержание, которое необязательно читать"]
function filltext(words){
for (var i=0; i<words; i++)
document.write(gibberish[Math.floor(Math.random()*3)]+" ")
}

function sw(v){window.open(v,'_blank');return false;}
function ws(v){window.open(v,'_blank');return true;}

function showdetails(p,n,w,h){
showwin(p,n,w,h,0);
}

function showwin(p,n,w,h,scroll){
                var s='';
                var width=w;
                var height=h;
                s=s+'left='+(screen.availWidth-width)/2+',';
                s=s+'top='+(screen.availHeight-height)/2+',';
                s=s+'width='+width+',height='+height+',toolbar=0,location=0,status=0,menubar=0,scrollbars='+1+',resizable=1';
                w=window.open(p,n,s);
                w.focus();
}

function capsDetect( e ) {
  var CapsMess = 'ОБРАТИТЕ ВНИМАНИЕ!\nУ Вас включен режим Caps Lock!\nСимволы в пароле регистрозависимые!';
  if( !e ) { e = window.event; } if( !e ) { return; }
  var theKey = 0;
  if( e.which ) { theKey = e.which; } //Netscape 4+, etc.
  else if( e.keyCode ) { theKey = e.keyCode; } //Internet Explorer, etc.
  else if( e.charCode ) { theKey = e.charCode } //Gecko - probably not needed
  var theShift = false;
  if( e.shiftKey ) { theShift = e.shiftKey; } //Internet Explorer, etc.
  else if( e.modifiers ) { //Netscape 4
    if( e.modifiers & 4 ) { //bitwise AND
      theShift = true;
    }
  }
  if( theKey > 64 && theKey < 91 && !theShift ) {
    alert( CapsMess );
  }
  else if( theKey > 96 && theKey < 123 && theShift ) {
    alert( CapsMess );
  }
}

function OpenEditor(idname)
{
	popUp = window.open('editor.htm?formname=' + document.forms[0].name + 
		'&id=' + idname , 
		'popupeditor', 
		'width=600,height=450,left=100,top=100,toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1');
}

function winopen(p){
var s=s+'top=50,left=50,toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1';
w=window.open(p,'_blank',s);
w.focus();
}


function getBrowserInfo() {
 var t,v = undefined;
 if (window.opera) t = 'Opera';
 else if (document.all) {
  t = 'IE';
  var nv = navigator.appVersion;
  var s = nv.indexOf('MSIE')+5;
  v = nv.substring(s,s+1);
 }
 else if (navigator.appName) t = 'Netscape';
 return {type:t,version:v};
}
 
function bookmark(a){
 var url = window.document.location;
 var title = window.document.title;
 var b = getBrowserInfo();

 if (b.type == 'IE' && 9 > b.version && b.version >= 4) window.external.AddFavorite(url,title);
 else if (b.type == 'Opera') {
  a.href = url;
  a.rel = "sidebar";
  a.title = url+','+title;
  return true;
 }
 else if (b.type == "Netscape") window.sidebar.addPanel(title,url,"");
 else alert("Нажмите CTRL-D, чтобы добавить страницу в закладки.");
 return false;
}

function homepage(a){


if (document.all)
  {
    a.style.behavior='url(#default#homepage)';
    a.setHomePage('http://www.aktodoma.ru/');

  }
  else
    if(!document.layers)
    {
      netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite");
      navigator.preference("browser.startup.homepage", "http://www.aktodoma.ru/"); 
    }

return false;
}



