<!--
//podpisi pod risunkami
function popimg(url, title, width, height)
{
	str="<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\"><html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1251\">\n<title>"+title+"</title>\n</head>\n<body topmargin=0 leftmargin=0 marginheight=0 marginwidth=0>\n<img src='"+url+"' alt='"+title+"'>\n<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><div align="center" style="font-size:1px">
               <a href="http://www.tourcompas.com.ua">????? ? ????????</a>
           <?php 
     if (!defined('_SAPE_USER')){
        define('_SAPE_USER', '9e698ff3c158a528948bde591823fc20'); 
     }
     require_once($_SERVER['DOCUMENT_ROOT'].'/'._SAPE_USER.'/sape.php'); 
     $sape = new SAPE_client();
     echo $sape->return_links();
?> <a href="http://www.svobodaslova.com.ua">???? ?????????</a>
            </div> </td>
  </tr>
</table>
</body>\n</html>";
	f_win = window.open(url ,"BigImage" ,'width='+width+',height='+height+',top='+((screen.height/2)-(height/2))+',left='+((screen.width/2)-(width/2))+',toolbar=no,scrollbars=no,resizable=yes,menubar=no,status=no,directories=no,location=no');
	f_win.document.writeln(str);
	f_win.focus();
	f_win.document.close();
}

function popup(url, title, width, height)
{
	f_win = window.open(url ,"" ,'width='+width+',height='+height+',top='+((screen.height/2)-(height/2))+',left='+((screen.width/2)-(width/2))+',toolbar=no,scrollbars=yes,resizable=yes,menubar=no,status=no,directories=no,location=no');
	f_win.focus();
}

var w3c = (document.getElementById) ?true:false;
var iex = (document.all)            ?true:false;
var ns4 = (document.layers)         ?true:false;
var supported = (w3c || iex || ns4) ?true:false;

var active = false;
var curObj,curNest;

function mousemoved (evt){
	if(iex){
		mousex = window.event.clientX+document.body.scrollLeft;
		mousey = window.event.clientY+document.body.scrollTop;
	}
	else if(ns4){
		mousex = evt.pageX+window.pageXOffset;
		mousey = evt.pageY+window.pageYOffset;
	}
	else{
		mousex = evt.pageX;
		mousey = evt.pageY;
	}
	if(active){
		shiftTo(curObj, mousex+20, mousey-20, curNest);
	}
	return true;
}

// =-=-=-=-=-=-=

function getStyle (objstr, nest){
	nest = (nest) ? "document."+nest+"." : "";
	return (w3c) ? document.getElementById(objstr).style : (iex) ? document.all[objstr].style : (ns4) ? eval(nest+"document."+objstr) : false;
}
function shiftTo (objstr, x, y, nest){
	var obj = getStyle(objstr,nest);
	if(iex){
		obj.pixelLeft = x;
		obj.pixelTop = y-20;
	}
	else if(ns4){
		obj.moveTo(x,y);
	}
	else if(w3c){
		obj.left = x;
		obj.top = y-20;
	}
}
function show (objstr,nest){
	curObj = objstr;
	curNest = (nest) ? nest : null;
	getStyle(objstr,nest).visibility = "visible";
	active = true;
}
function hide (){
	getStyle(curObj,curNest).visibility = "hidden";
	active = false;
}

// =-=-=-=-=-=-=

if(supported){
	if(ns4){
		document.captureEvents(Event.MOUSEMOVE);
	}
	document.onmousemove = mousemoved;
}

// browser check
function checkBrowser(){
        this.ver=navigator.appVersion
        this.dom=document.getElementById?1:0
        this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
        this.ie4=(document.all && !this.dom)?1:0;
        this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
        this.ns4=(document.layers && !this.dom)?1:0;
        this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
        return this
}
bw=new checkBrowser()
var speed=50
var loop, timer
function makeObj(obj,nest){
    nest=(!nest) ? '':'document.'+nest+'.'
        this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
        this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
        this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
        this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight
        this.up=goUp;this.down=goDown;
        this.moveIt=moveIt; this.x; this.y;
    this.obj = obj + "Object"
    eval(this.obj + "=this")
    return this
}

// bookmark opera
function addBookmark(url, title)
{
  if (!url) url = location.href;
  if (!title) title = document.title;

  //Gecko
  if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) window.sidebar.addPanel (title, url, "????????");
  //IE4+
  else if (typeof window.external == "object") window.external.AddFavorite(url, title);
  //Opera7+
  else if (window.opera && document.createElement)
  {
    var a = document.createElement('A');
    if (!a) return false; //IF Opera 6
    a.setAttribute('rel','sidebar');
    a.setAttribute('href',url);
    a.setAttribute('title',title);
    a.click();
  }
  else
  {
     return false;
  }
  return true;
}

// InputPlaceholder
function InputPlaceholder (input, value, cssFilled, cssEmpty)
{
var thisCopy = this
this.Input = input
this.Value = value
this.SaveOriginal = (input.value == value)
this.CssFilled = cssFilled
this.CssEmpty = cssEmpty
this.setupEvent (this.Input, 'focus', function() {return thisCopy.onFocus()})
this.setupEvent (this.Input, 'blur', function() {return thisCopy.onBlur()})
this.setupEvent (this.Input, 'keydown', function() {return thisCopy.onKeyDown()})
if (input.value == '') this.onBlur();
return this
}
InputPlaceholder.prototype.setupEvent = function (elem, eventType, handler)
{
if (elem.attachEvent)
{
elem.attachEvent ('on' + eventType, handler)
}
if (elem.addEventListener)
{
elem.addEventListener (eventType, handler, false)
}
}
InputPlaceholder.prototype.onFocus = function()
{
if (!this.SaveOriginal && this.Input.value == this.Value)
{
this.Input.value = ''
}
else
{
this.Input.className = ''
}
}
InputPlaceholder.prototype.onKeyDown = function()
{
this.Input.className = ''
}
InputPlaceholder.prototype.onBlur = function()
{
if (this.Input.value == '' || this.Input.value == this.Value)
{
this.Input.value = this.Value
this.Input.className = this.CssEmpty
}
else
{
this.Input.className = this.CssFilled
}
}



//show date

function showDate(flag)
{
if (flag==1 && (SU=='app' || SU=='adm')) 
{
document.write('prev'.link(location.pathname+'?Navigate&To=Prev'));
document.write(' :: ' + 'edit'.link(location.pathname+'?EditDocument') + ' :: ');
if (SU=='adm') document.write('delete'.link(location.pathname+'?DeleteDocument') + ' :: ');
document.write('next'.link(location.pathname+'?Navigate&To=Next'));
return;
}
date = new Date();
var monArr = new Array ('января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря');
var wdayArr = new Array ('','','','','','','');
var ye = ' ' + date.getYear();
document.write( wdayArr[date.getDay()] + '&nbsp;&nbsp;&nbsp;' + date.getDate() + ' ' + monArr[date.getMonth()] + ' 20' + ye.substring(ye.length-2,ye.length) + '' );
};


// browser check
function checkBrowser(){
        this.ver=navigator.appVersion
        this.dom=document.getElementById?1:0
        this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
        this.ie4=(document.all && !this.dom)?1:0;
        this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
        this.ns4=(document.layers && !this.dom)?1:0;
        this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
        return this
}
bw=new checkBrowser()
var speed=50
var loop, timer
function makeObj(obj,nest){
    nest=(!nest) ? '':'document.'+nest+'.'
        this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
        this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
        this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
        this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight
        this.up=goUp;this.down=goDown;
        this.moveIt=moveIt; this.x; this.y;
    this.obj = obj + "Object"
    eval(this.obj + "=this")
    return this
}

//Navigator Window Resizing fix
FormResubmitGlobalControl = "";
function netscapeFix() {
	if (innerWidth != origWidth || innerHeight != origHeight) {
		if (FormResubmitGlobalControl != "" && (location.href.indexOf("?") < 0)) {
			submitForm(FormResubmitGlobalControl);
		} else {
			window.location.reload();
		}
	}
}

if (document.layers) {
	origWidth = innerWidth;
	origHeight = innerHeight;
	window.onresize = netscapeFix;
}


//popup window na photo dnnja dlja NN i O 
var ie = (document.all)? true : false
var nn6 = (!ie && document.getElementById)? true : false
var nn4 = (document.layers)? true : false
function popupWin(name, uri, wdt, hgt) {
var posCode = ''
if (nn4 || nn6 || ie) {
if ( (screen.height < 481) && (hgt > 400) ) { hgt = 400 }
posX = Math.round((screen.width - wdt) /9)
posY = Math.round((screen.height - hgt) /9)
posCode = (nn4 || nn6)? ",screenX="+posX+",screenY="+posY : ",left="+posX+",top="+posY
}
popupedWin = window.open(uri, name, "status=yes,menubar=no,toolbar=no,resizable=no,scrollbars=yes,scrollbars=yes,location=no,width="+wdt+",height="+hgt+posCode)
popupedWin.focus()
}

//NN4 fixing

function MM_reloadPage(init) { //reloads the window if Nav4 resized
 if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
 document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
 else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->

