function OpA(strURL) {self.open("http://"+strURL); return(false);}

function OpIMG(obj) {obj.previousSibling.previousSibling.click();}

function SndMl(obj) {
 if(obj.tagName) {obj.href="m" +  String.fromCharCode(97) + "ilto:" + obj.getAttribute("mto") + String.fromCharCode(64) + String.fromCharCode(101) + String.fromCharCode(45) + "river." + String.fromCharCode(114)+String.fromCharCode(117); return(true) }
 else      { document.write ( obj+String.fromCharCode(64)+String.fromCharCode(101)+String.fromCharCode(45)+"river."+String.fromCharCode(114)+String.fromCharCode(117) ); }
}

function OpenGalView(objA) {
self.open(objA.href,null,'directories=0, status=no, menubar=no, toolbar=no, location=no, scrollbars=yes, resizable=yes, top=0; left=15; width=' + (screen.availWidth-44) + '; height=' + (screen.availHeight-31));
return(false);
}

function onSearch(ind)
{
    if((self.location.href).indexOf('/gallery/')>0) {document.cookie="SrchFrom=gallery; path=/"}
    else                                            {document.cookie="SrchFrom=text; path=/"};
     var f_obj=document.getElementById("fSearch" + ind);
     f_obj.submit();
}
function onSearchKey(ind)
{
   var key=event.keyCode;
   if(key==13) onSearch(ind);
}


function CloseWindowEx() {
 try 
  {
		if(self.opener) {self.opener.focus()}
		else            {self.opener=null};
  }
 catch(e)
  {self.opener=null }  
 self.close();
}

window.onload=on_load;
function on_load() {
 objPrint=document.getElementById("printlink"); objTop=document.getElementById("Agotop");
 if(objPrint && objTop) {
	 if((document.body.offsetHeight+80)<objPrint.offsetTop) {objTop.style.display="inline"}
	 else                                                   {objTop.style.display="none"};
 }

}

function VBTrim(strVal)
{
 for(ij=0;ij<strVal.length;) {if(strVal.charCodeAt(ij)==32) {strVal=strVal.substr(1);} else {break;}};
 for(ij=(strVal.length-1);ij>0;) {if(strVal.charCodeAt(ij)==32) {strVal=strVal.substr(0,ij); ij=(strVal.length-1);} else {break;}};
 return(strVal.toString());
};


function filterQuot(strIn) {
 var strOut=""; k=0;
 for(i=0; i<strIn.length; i++)   
    {
    	k=strIn.charCodeAt(i);
    	if(k==171 || k==187 || k==8220 || k==8221) {k=34};
    	strOut=strOut+String.fromCharCode(k);
    }
    return	strOut;
}	


function onsubmitMes(obj)  {
	obj.elements["name"].value=VBTrim(filterQuot(obj.elements["name"].value));
	obj.elements["email"].value=VBTrim(filterQuot(obj.elements["email"].value));
	obj.elements["text"].value=VBTrim(filterQuot(obj.elements["text"].value));
	obj.submit();
	//return false;
}

function SrchCls(obj) {
if(obj.value=="поиск по сайту")	{obj.value=""};
obj.style.color="#000000";
}