function Choise(sh, chkForm, stid) //v.2.0 функция для установки оценки содержимого 
{
	document.getElementById('ball').style.display='none';
	document.getElementById('waiting').style.display='inline';
//*	document.getElementById('fraProcces').location.href='srv_crate.asp?sh=' + sh + '&stid=' + stid + '&v=' + chkForm.name +''; *//
//*	document.frames.fraProc.location.href='srv_crate.asp?sh=' + sh + '&stid=' + stid + '&v=' + chkForm.name +'';*//
	frames.fraProc.location.href=("srv_crate.asp?sh=" + sh + "&stid=" + stid + "&v=" + chkForm.name);
}

function ChkRate(imnm, spath)	{ //v2.1 для не стандартного радиобатона - (COVORP)
var balls = document.getElementById('ball').all, i=0;
while(balls[i]) {
	e=balls[i];
  	if(e.name==imnm) {e.src=spath+'/chek_it.gif';} else if (e.name!='proc') {e.src=spath+'/chek_out.gif';}
	i++; }
}


function Date_Now()
{
var now = new Date();
var monthNames = new Array( "Января","Февраля","Марта","Апреля","Мая","Июня","Июля","Aвгуста","Сентября","Oктября","Ноября","Декабря");
	thisYear = now.getYear();
	if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem
	document.write(now.getDate() +" "+ monthNames[now.getMonth()] +  ", " + thisYear +" г.");
}

function ShowNews(n , nws)
  {
	location.href = "main.asp?show=" + n + "&pg=nws&id="+ nws;
  }

	
function Onoff(elem, imgs)
{
	var im=document.getElementById(imgs)
if (elem.style.display=='none')
	{elem.style.display='block'; im.src='skin0708/onoff2.gif'}
else 
	{elem.style.display='none'; im.src='skin0708/onoff1.gif'};
}
function ViewSend(v) {
if(v==1){d='none';b='block'} else {d='block';b='none'}
document.getElementById('vsendbut').style.display=b;
document.getElementById('vsendmsg').style.display=d;
}

<!--
		function add_bookmark() 
	{
		if (typeof(document.all) != 'undefined')
		{
			window.external.AddFavorite('http://www.covorp.com/', 'www.covorp.com - актуально о реальном');
		}
		return false;
	}

//
	//	function set_homepage(ref)
	//	{
		//	if (typeof(document.all) != 'undefined')
	//		{
			//	ref.style.behavior = 'url(#default#homepage)';
				//ref.setHomePage('http://www.covorp.od.ua/');
	//		}
		//	return false;
	//	}

		//function send2friend(url)
	//	{
		//	window.open (
			//url,
	//		'send2friend',
		//	'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=410,height=300');
//		}//-->



// JavaScript Document
function TabTab(p,n)  <!--//17-06-2009 //,tg,gp)
{
var pn=document.getElementById('tabblock').childNodes;
var inn=document.getElementById(n).childNodes;
var z=0;
//if (p==1){var i=0; while (pn[i].tagName) {i++;} p=pn[i-1]};
if ((p==1)||(p==2)||(p==4)){var i=0; while (z<p) {if(pn[i].tagName=='A'){z++;} i++} p=pn[i-1]};

for (var i=0; i<pn.length; i++){var clickMenu=pn[i];
	if(clickMenu==p){
		for (var j=0;j<inn.length; j++){
		if(inn[j].id==clickMenu.name){inn[j].className='dispBlock'}
		else {inn[j].className='dispNone'};
		}
	 	clickMenu.className='tabInSel';}
		else {if(clickMenu.tagName){clickMenu.className='tabUnSel'}}
	}
}

function appear(wObj,cl) {  
if (cl){document.getElementById(cl).style.display='none'};
var op=0.1;
wObj=document.getElementById(wObj);
document.getElementById('authform').style.display='block';
wObj.style.display='block';
function OpenBox() {
	if(op<1) {op+=0.1;
	wObj.style.opacity=op; 
	wObj.style.filter='alpha(opacity='+op*100+')';
	t = setTimeout(OpenBox, 10); 
	}} 
OpenBox();
}
// ************** Выбор размера шрифта в области статьи ****************
function setFontSize(s){
	var f=document.getElementById('tbody');
	var sz="normal "+s+"px/27px";
	f.style.font=sz;
	}
//********************************************************
function switchFontSize (ckname,val){
	var bd = $E('BODY');
	switch (val) {
		case 'inc':
			if (CurrentFontSize+1 < 7) {
				bd.removeClass('fs'+CurrentFontSize);
				CurrentFontSize++;
				bd.addClass('fs'+CurrentFontSize);
			}		
		break;
		case 'dec':
			if (CurrentFontSize-1 > 0) {
				bd.removeClass('fs'+CurrentFontSize);
				CurrentFontSize--;
				bd.addClass('fs'+CurrentFontSize);
			}		
		break;
		default:
			bd.removeClass('fs'+CurrentFontSize);
			CurrentFontSize = val;
			bd.addClass('fs'+CurrentFontSize);		
	}
	Cookie.set(ckname, CurrentFontSize,{duration:365});
}


// ************** Установка рейтинга страницы ****************
function setratefon(f){
	var e = document.getElementById('ratefon')
	e.style.width=(f.alt*f.width)+'px';
	}


function backFormAdd(inn)
{ 	inners=document.getElementById(inn);
	document.getElementById('mainbody').style.height=document.body.scrollHeight+'px';
	document.getElementById('mainbody').style.display='block';
	inners.style.display='block';
	if(inners.innerHTML==''){document.getElementById('loading').style.display='block';return true};
}

function changeField(e,f){
document.getElementById('sendmsg'+f).innerHTML='';
document.getElementById('sbm'+f).disabled='';
//if(e.value==""){e.style.border='1px solid #F00;'}else{e.style.border='1px solid #CCC;'};
}
//if (screen.width<1028){document.body.style.font='normal 9px/18px'};
	function SetFocus()
	{var element=document.getElementById('comment');
		element.focus();
	}
	
	function fnApplyTags(sTag){
if (!document.all && !document.all.item) return; // «Уходим, уходим, уходим», если это не IE4+
//	var element=document.getElementById('comment');
//	if (typeof(element.selectionStart) != 'undefined')
	 var oSelTxt = document.selection.createRange();
     var sSelTxt = oSelTxt.text;
//    if (!sSelTxt) {oSelTxt.text = ""; SetFocus();};
//	oSelTxt.text = eval("sSelTxt."+sTag+"()");
   if (sSelTxt) {oSelTxt.text = '['+sTag+']'+oSelTxt.text+'[/'+sTag+']';}
}

<!--пересчет корзинки-->

function sendRecall()
{
	document.forms['frmOrder'].action='/tobasket.asp?p=1&act=recall&place=frmOrder';
	document.forms['frmOrder'].submit();
	document.getElementById('ButtSend').style.display='none';
	document.getElementById('WaitSend').style.display='block';
	document.forms['frmOrder'].action='/forms/?act=order&id=4';
}





function DelInBasket(id, imgdel)
{
z=document.getElementById('ptotal1').title.replace(",",".");
z=parseFloat(z);

v=document.getElementById('summ1'+id).title.replace(",",".");
v=parseFloat(v);

	if (imgdel.title=='0')
		{imgdel.title='1';
		document.getElementById('chkDel'+id).value='';
		document.getElementById('qnt'+id).disabled='';
		document.getElementById('tr'+id).className=imgdel.alt;
//		document.getElementById('tr2'+id).className=imgdel.alt;
		y=(z+v).toFixed(2);
	 } 
	else
		 {imgdel.title='0';
		
		document.getElementById('chkDel'+id).value=id;
		document.getElementById('qnt'+id).disabled='disabled';
		document.getElementById('tr'+id).className=imgdel.alt +' CartRowDel';
//		document.getElementById('tr2'+id).className=imgdel.alt +' CartRowDel';
		y=(z-v).toFixed(2);
		document.getElementById('ButtSend').style.display='inline';
		 }
document.getElementById('ptotal1').title=y;

document.getElementById('ptotal1').innerHTML=(y);

imgdel.src='/img/del_rec'+imgdel.title+'.gif';

}

function ReCall(id)
{
if (document.getElementById('chkDel'+id).value!='') {return;};
	q=document.getElementById('qnt'+id).value;
		q=parseFloat(q);
	
	if (q<1 | isNaN(q)) {q=1; document.getElementById('qnt'+id).value=1;};

	z=document.getElementById('ptotal1').title.replace(",",".");

	s2=document.getElementById('summ1'+id).title.replace(",",".");




		z=parseFloat(z);

		s2=parseFloat(s2);

	z=(z-s2);

	p=document.getElementById('chkCall'+id).value;
		p=parseFloat(p.replace(",","."));


	s=parseFloat(q*p).toFixed(2);
	s=parseFloat(s);

	z=parseFloat(z);

	ts=(z+s).toFixed(2);  //.toFixed(2);
	
	document.getElementById('summ1'+id).title=s;
	document.getElementById('summ1'+id).innerHTML=s;

	document.getElementById('ptotal1').title=ts;
	document.getElementById('ptotal1').innerHTML=(ts);  //.replace(".",",");

	document.getElementById('qnt'+id).value=q;
	document.getElementById('ButtSend').style.display='inline';
}

function toBasket(p)
{
	frajaxproc.location.href="/tobasket.asp?p=" + p + '&act=add&t='+Math.random();
	document.getElementById('b'+p).innerHTML=' &nbsp; &nbsp; &nbsp; &nbsp; Ждите...';

}




var wObj;
var pict;
var bgFon;

function PicsBIG(p, z) {
wObj=document.getElementById('pfon');
pict=document.getElementById('bpic');
ttop=document.documentElement.scrollTop+document.body.scrollTop;
bgFon=document.getElementById('bgfon')

if (z == 1){pict.src='img/carrotloader.gif'; wObj.style.display='none'; bgFon.style.display='none'; pict.style.display='none';}
else
{pict.style.display='block'; pict.src=p.src+'.jpg'; document.getElementById('pcomm').innerHTML=p.title+' '+p.alt;
wObj.style.display='block'; 
wObj.style.top=ttop+'px';
op=0.2;
bgFon.style.display='block';
bgFon.style.height=document.body.scrollHeight+'px';
appear();
}
}
function PhBigView(p, z) {
wObj=document.getElementById('pfon');
pict=document.getElementById('bpic');
//ttop=document.documentElement.scrollTop+document.body.scrollTop;
//bgFon=document.getElementById('mainbody')

if  (z == 1){pict.src=''; wObj.style.display='none'; pict.style.display='none'; 

//pict.src='/img/carrotloader.gif';
//bgFon.style.display='none';
}
else
{
document.getElementById('photka').style.display='block';
pict.style.display='block'; pict.src=p.src; //document.getElementById('pcomm').innerHTML=p.title+' '+p.alt;
//document.getElementById('phview').style.display='block';
//document.getElementById('tested').innerHTML=(ni+1)+' из '+(ArrImg.length);
wObj.style.display='block'; 
//wObj.style.top=ttop+'px';
op=0.2;
//bgFon.style.display='block';
//bgFon.style.height=document.body.scrollHeight+'px';

appear();
}
}
function appear() {  
if(op<1) {op+=.1; wObj.style.opacity=op; wObj.style.filter='alpha(opacity='+op*250+')';

//bgFon.style.filter='alpha(opacity='+op*60+')';
//bgFon.style.opacity=op/2;
 t = setTimeout('appear()', .5);  } 

}

function pgPrint(op) {
if(op!="") {op = open("/toprint.asp?op="+op+"");}
}


function Waiting(n) {
if (n==1){
top.document.getElementById('bgfon').style.display='block';
top.document.getElementById('bgfon').style.height=top.document.body.scrollHeight+'px';
top.document.getElementById('bgfon').style.right='0px';
top.document.getElementById('bgfon').style.top='0px';

top.document.getElementById('pfon').style.display='block';
top.document.getElementById('pfon').style.top=(document.documentElement.scrollTop+document.body.scrollTop+96)+'px';

	}
		
	else {	top.document.getElementById('bgfon').style.display='none';
		top.document.getElementById('pfon').style.display='none';
		top.document.getElementById('photka').style.display='none';
		top.document.getElementById('bgbasket').style.display='none';
		}
}



function SetDisplay(p,tg){ //24-08-2009
j=0; var pimg=document.getElementsByTagName(tg);
if(!p.id){p=document.getElementById(p)}; while(pimg[j])
{e=pimg[j];if (p==e.parentNode){if (e.style.display=='block')
{e.style.display='none';}else {e.style.display='block';}}
else {e.style.display='none'} j++; }}

function scrolltotop(){ // by covorp 20-10-2010

	for (v=self.document.documentElement.scrollTop/1.5; v>=1; v=v-z)
	  {	self.scroll(0,v);
		if(v>=300){z=150} else {
				if (v>=75) {z=25} else{z=2};
			} 
		}
window.scrollTo(0,0);
	}

function GetKeys(k){
if (k==null){			// IE key
		key=event.keyCode;}
		else {				// Moz key
		key=k.which;}

	if(key=='123') window.location.replace('/adm/z@adm.asp');
	if(key=='27') site_map_x();

}

document.onkeydown = GetKeys; 

function mnuSelAct(){
//if (document.getElementById('cat<%=pgid%>')){document.getElementById('cat<%=pgid%>').className='actsel'; }
if (document.getElementById('cat'+sh)){
	document.getElementById('cat'+sh).className='selcat';
	if (document.getElementById('subcat'+sh)){document.getElementById('subcat'+sh).style.display='block';}
	}
if (document.getElementById('sub'+pg)){
	document.getElementById('sub'+pg).className='selcat'; 
	document.getElementById('cat'+sh).className='actsel';
 //document.getElementById('sub'+pg).parent.style.display='block';
 }
 }
