// Time-stamp: <14:02 18.02.2008 kilm>
var docTitle=document.title;
var isIE=(document.all)?true:false;
var isDOM=(document.getElementById)?true:false;
var isOK=isIE||isDOM;
var curRowsDispState=0;
var totalRows=30;

function frame_check(){ // not show page in other frame (not frame only)
if(top.location.href!=location.href){top.location.href=location.href;}
}

function noframe_check(to_index){ // not show page without frame (frame only)
if(top.location.href==location.href){top.location.href=to_index;}
}

function code_orphus(){
/*
document.write('<p><small>На сайте работает система коррекции ошибок. Об');
document.write('наружив неточность в&nbsp;тексте, выделите ее и&nbsp;нажмит');
document.write('е <b>Ctrl+Enter</b>. Сообщение об ошибке будет отправлен');
document.write('о редактору сайта.<br>Спасибо за помощь!</small></p>');
*/
}

function MM_findObj(n,d){
var p,i,x;
if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(d.getElementById)return d.getElementById(n);
if(!(x=d[n])&&d.all)return d.all[n];
for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);
return x;
}

function ClearForm(f) {
for (var i=0;i<f.elements.length;i++){
e=f.elements[i];
if(e.type=='select-multiple')e.selectedIndex=-1;
else if(e.type=='select-one')e.selectedIndex=0;
else if(e.type=='text')e.value='';
else if(e.type=='checkbox')e.checked=false;
}}

function cmsIsEmailAddr(address){
var re =/^[\w-](\.?[\w-])*@([A-Za-z]{2,}|[\w-](\.?[\w-])*\.[A-Za-z]{2,})$/i;
return re.test(address);
}

function cmsSetCookie(name,value,expire,path,domain){
if(expire==null){
expire=new Date();
expire.setTime(expire.getTime()+24*3600*1000);// +24 hour
}
document.cookie=name+"="+escape(value)+((expire==null)?"":("; expires="+expire.toGMTString()))+((path==null)?"":("; path="+path))+((domain==null)?"":("; domain="+domain));
}

function cmsGetCookie(name){
var start=document.cookie.indexOf(name+"=");
var len=start+name.length+1;
if((!start)&&(name!=document.cookie.substring(0,name.length))){return null;}
if(start==-1)return null;
var end=document.cookie.indexOf(';',len);
if(end==-1)end=document.cookie.length;
return unescape(document.cookie.substring(len,end));
}

function cmsDeleteCookie(name,path,domain){
document.cookie=name+"="+((path)?";path="+path:"")+((domain)?";domain="+domain:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

// transparent png for IE<7
function fixPNG(element){
if (/MSIE (5\.5|6).+Win/.test(navigator.userAgent)){
var src;if(element.tagName=='IMG'){
if(/\.png$/.test(element.src)){src=element.src;element.src='/x/pics/pix.gif';
}}else{src=element.currentStyle.backgroundImage.match(/url\("(.+\.png)"\)/i)
if(src){src=src[1];element.runtimeStyle.backgroundImage="none";
}}
if(src)element.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"',sizingMethod='scale')";
}}
