D=document,W=window,IS_OLEG=0;
function noBub(){event.cancelBubble=true}
function noRet(){event.returnValue=false}
function $(id){return D.getElementById(id)}
function _(s){D.write(s)}
function __(s){D.writeln(s)}
B=navigator.appName;
switch(B){
	case "Opera":B="Op";break;
	case "Microsoft Internet Explorer":B='IE';break;
	case "Netscape":B=(navigator.userAgent.toLowerCase().indexOf('chrome')>-1)?'CR':'NS';break;
	default: B='';
}
if(B=='IE'){
	BVer=4;
	if(navigator.appVersion.indexOf("MSIE")!=-1)BVer=parseFloat(navigator.appVersion.split("MSIE")[1]);   
}else{
	BVer=parseFloat(navigator.appVersion);
}

function isGoTo(u){
	if(u=='gv_faq10')u='magazin-faq-10.html';
	else if(u=='specials')u='specialnoe-sportivnoe-pitanie.html';
	else u='index.php?creatine='+u;
	location.href='http://www.ironsport.com.ua/'+u;
}

function getPos(o){
	var x=y=0;
	if(o.offsetParent)do{x+=o.offsetLeft;y+=o.offsetTop}while(o=o.offsetParent);
	return [x,y];
}

//-
setTimeout(function(){
	if(typeof ISTopText!="undefined"){
		var o=fadeOpacity;o.addRule("opctRl2",1,0,100);o("ISTopText","opctRl2");
		setTimeout(function(){$("ISTopText").innerHTML=""},2000)
	}},7000);

//- ISCookie -
function ISCookie(n,v,d){
	this.name='ISCookieDef';
	if(typeof(n)!='undefined')this.name=n;
	if(typeof(v)!='undefined'){
		this.set(v,n,d);
	}
	ISCookie.prototype.get=function(n){
		if(typeof(n)!='undefined')this.name=n;
		var nEQ=this.name+"=";
		var ca=D.cookie.split(";");
		for(var i=0;i<ca.length;i++) {
			var c=ca[i];
			while(c.charAt(0)==" ") c=c.substring(1,c.length);
			if (c.indexOf(nEQ)==0) 
				return c.substring(nEQ.length,c.length);
		}
		return null;
	}
	ISCookie.prototype.set=function(v,n,days){
		if(typeof(n)!='undefined')this.name=n;
		var ex="";
		if(typeof(days)=='undefined')days=356;
		if(days){
			var d=new Date();
			d.setTime(d.getTime()+(days*86400000));
			ex="; expires="+d.toGMTString();
		}
		D.cookie=this.name+"="+v+ex;
	}
}

//- Manuf Select
function manufSelChng(e,n){
	if(B=='IE')e.setAttribute('size',n);
}

//- Cat Descr
function chVisMoreDescr(e){
	if(!e || !e.lastChild) return;
	var l=e.lastChild.style;
	var f=(l.display=='' || l.display=='none');
	l.display=f?'block':'none';
	l.paddingBottom=f?'12px':'';
}

//- new
var aCurVisDescr=['',''];
var oCurVisDescrCookie=new ISCookie();
function chVisDescrIni(){
	var c=oCurVisDescrCookie;
	var idM=c.get('curVisDescrM');
	var idD=c.get('curVisDescrD');
	var f=c.get('curVisDescrF');
	if(idM && idD){
		if(f) chVisDescr(idM,idD,0);
	}else{
		chVisDescr('liCatMenuSort','catMenuSort',0);
	}
}
function chVisDescr(mId,bId,f){
	var e0=$(mId), e1=$(bId);
	if(aCurVisDescr[0]!=e0){
		aCurVisDescr[0].className='';
		aCurVisDescr[1].className='unvis';
	}
	try{
		if(e0.className=='selected'){
			e0.className='';
			e1.className='unvis';
		}else{
			e0.className='selected';
			e1.className='vis';
		}
		var c=oCurVisDescrCookie;
		c.set(mId,'curVisDescrM');
		c.set(bId,'curVisDescrD');
		c.set(e0.className,'curVisDescrF');
		aCurVisDescr=[e0,e1];
		if(f) noRet();
	}catch(e){}
}

//- SUPPER NEW
var cVMBlockId='', cVMBlockCooName='curVisMenuBlock', cVMBlockCookie=new ISCookie();
function chVisMenuBlockIni(showId,cookieId){
	cVMBlockCooName+=cookieId;
	var c=cVMBlockCookie, id=c.get(cVMBlockCooName);
	try{
		if(id){
			var f=c.get(cVMBlockCooName+'F');
			if(f) chVisMenuBlock(id,0);
		}else{
			chVisMenuBlock('CatMenuBlock'+showId,1);
		}
	}catch(e){}
}
function chVisMenuBlock(bId,f){
	var eM=$('li'+bId), eB=$(bId);
	try{
		if(cVMBlockId!=eB.id){
			$('li'+cVMBlockId).className='';
			$(cVMBlockId).className='catMenuBlockUnvis';
		}
	}catch(e){}
	try{
		if(eM.className=='selected'){
			eM.className='';
			eB.className='catMenuBlockUnvis';
		}else{
			eM.className='selected';
			eB.className='catMenuBlockVis';
		}
		var c=cVMBlockCookie;
		c.set(bId,cVMBlockCooName);
		c.set(eM.className,cVMBlockCooName+'F');
		cVMBlockId=bId;
		if(f) noRet();
	}catch(e){}
}


//- ISFavor -
function crtOISFavor(){
	oFavor=new ISFavor();
	oFavor.writeLinks('oFavor');
}
function ISFavor(){
	this.nameOfClass="oFavor";
	this.f=0;
	this.u=D.location.href;
	this.t=D.title;
	this.show=function(){
		if(!this.f){
			this.f=1;
			$('favor').style.display='none';
			$('favorSelect').style.display='block';
		}
		noBub();
	}
	this.hide=function(){
		if(this.f){
			$('favorSelect').style.display='none';
			$('favor').style.display='block';
			this.f=0;
		}
		noBub();
	}
	this.writeLinks=function(o){
		var s='<a href="/" class="favor" onmouseover="noBub()" onmouseout="noBub()" onmousemove="noBub()" ';
		_('<noindex><div id="favor" onmouseover="'+this.nameOfClass+'.show()"></div><div id="favorSelect" onmouseover="noBub()" onmouseout="'+this.nameOfClass+'.hide()">'+s+'onmouseout="noBub()" onclick="'+o+'.homepage(this);return false">Сделать домашней</a>'+s+'onclick="if('+o+'.bookmark())return false" rel="sidebar" title="'+this.t+'">В закладки</a></div></noindex>');
	}
	this.homepage=function(o){
		noBub();
		o.style.behavior='url(#default#homepage)';
		o.setHomePage(this.u);
	}
	this.bookmark=function(){
		noBub();
		if(B=='FF')return false;
		else if(B=='IE')W.external.AddFavorite(this.u,this.t);
		else if(B=='Op')return false;
		else alert('Нажмите CTRL+D чтобы добавить страницу в закладки');
		return true;
	}

}

//-
function chBNewsIni(){
	fadeOpacity.addRule('oisBTV',0,1,50);
	isBTVF=0,isBTVI=0,isBTVMax=5;
	chBNewsItem();
}
function chBNewsItem(){
	var time=$('isBTV'+isBTVI).getAttribute('time');
	if(time==null)time=4;
	fadeOpacity('isBTV'+isBTVI,'oisBTV');
	if(isBTVF)fadeOpacity.back('isBTV'+((isBTVI==0?isBTVMax:isBTVI)-1));
	isBTVI++;
	if(isBTVI>=isBTVMax)isBTVI=0;
	if(!isBTVF)isBTVF=1;
	setTimeout(chBNewsItem,(time*1000));
}

//- ISCompare -
function ISCompare(){
	this.nameOfClass="oCompare";
	this.oCL;
	this.oCId=0;
	this.oCName;
	this.oCVis=0;
	this.aCIds=[];
	this.aCNames=[];
	this.iSTOC0,this.iSTOC1,this.iSTOC2;
	this.iMax=5;
	this.allowBrowser=0;
	this.cooName="oCompare";
	this.sImgsDir="";
	this.sImgs=[];
	this.browser=B;
	this.browserVer=BVer;
	this.allowBrowser=(this.browser=="Op" || this.browser=="IE"/* || this.browser=="NS"*/);
	this.is_oleg=0;
}
ISCompare.prototype.ini=function(sIDir){
	if(typeof(sIDir)!='undefined') this.sImgsDir=sIDir;
	if(this.allowBrowser){
		var c=this.cooGet();
		if(c) this.aCIds=c.split("|");
		this.sImgs=['<img src="'+this.sImgsDir+'sravnit-sportivnoe-pitanie.gif" alt="" width="34" height="28"/>','<img src="'+this.sImgsDir+'sravnit-sportivnoe-pitanie-v.gif" alt="" width="34" height="28"/>'];
		oCompare.createBlockLinks();
		fadeOpacity.addRule('oisBCompare',0.1,1,50);
	}
}
ISCompare.prototype.createBlockLinks=function(){
	var s='<div id="oCompareLinks" onmouseout="'+this.nameOfClass+'.showCompareLinks()" class="unvis"><div><div><div>'
	+'<img src="'+this.sImgsDir+'sportivnoe-pitanie-sravnenie.gif" alt="" width="13" height="25" style=""/>'
	+'<a id="oCompareLinksOper" onmouseout="'+this.nameOfClass+'.noBub()" onmousemove="'+this.nameOfClass+'.hideDelayedCompareLinks()" onclick="'+this.nameOfClass+'.operateCompareLinks()"></a>'
	+'<a id="oCompareLinksTable" onmouseout="'+this.nameOfClass+'.noBub()" onmousemove="'+this.nameOfClass+'.hideDelayedCompareLinks()" onclick="'+this.nameOfClass+'.goCompare()" class="last"></a>'
	+'</div></div></div></div>';
	D.writeln(s);
}
ISCompare.prototype.createLink=function(id, name){
	if(this.allowBrowser){
		var sImg=this.sImgs[ (this.checkCompareACIds(id)>-1?1:0) ];
		var s='<div class="oCompareLink"><a href="" onmouseover="oCompare.showCompareLinks(1,'+ id +',\''+ name +'\',this)" onclick="noRet()">'+ sImg +'</a></div>';
		D.writeln(s);
	}
}
ISCompare.prototype.goCompare=function(){
	var url=this.aCIds.join("|");
	if(this.aCIds.length < this.iMax) url+="|";
	/*this.aCIds=[];this.cooSet();*/
	D.location="http://www.ironsport.com.ua/index.php?creatine=product_compare&products_ids="+url;
	event.returnValue=false;
}
ISCompare.prototype.noBub=function(){
	event.cancelBubble=true;
}
ISCompare.prototype.cooGet=function(){
	var nEQ=this.cooName+"=";
	var ca=D.cookie.split(";");
	for(var i=0;i<ca.length;i++) {
		var c=ca[i];
		while(c.charAt(0)==" ") c=c.substring(1,c.length);
		if(c.indexOf(nEQ)==0){
			var r=c.substring(nEQ.length,c.length);
			return (r=='undefined') ? null : r;
		}
	}
	return null;
}
ISCompare.prototype.cooSet=function(s){
	D.cookie=this.cooName+"="+ (typeof(s)=='undefined' ? this.aCIds.join("|") : s);
}
ISCompare.prototype.setImg=function(f){
	this.oCL.firstChild.src=this.sImgsDir+"sravnit-sportivnoe-pitanie"+(f?".gif":"-v.gif");
}
ISCompare.prototype.operateCompareLinks=function(){
	if(this.oCId){
		var src=this.sImgsDir+"sravnit-sportivnoe-pitanie";
		var i=this.checkCompareACIds(this.oCId);
		if(i>-1){
			var a=[];
			var len=this.aCIds.length;
			for(var k=0;k<len;k++)
				if(i!=k) a[a.length]=this.aCIds[k];
			this.aCIds=a;
			this.setImg(1);
		}else{
			this.aCIds[this.aCIds.length]=this.oCId;
			this.aCNames[this.aCNames.length]=this.oCName;
			this.setImg(0);
		}
		this.cooSet();
	}
	event.returnValue=false;
	this.showCompareLinks();
}
ISCompare.prototype.checkCompareACIds=function(id){
	var len=this.aCIds.length;
	for(var i=0;i<len;i++)
		if(this.aCIds[i]==id) return i;
	return -1;
}
ISCompare.prototype.$=function(s){
	return D.getElementById(s);
}
ISCompare.prototype.showCompareLinks=function(toVis, id, name, o){
	if(typeof(toVis)=="undefined") toVis=0;
	var oC=ISCompare.prototype.$("oCompareLinks");
	if(toVis){
		var oCO=ISCompare.prototype.$("oCompareLinksOper");
		var oCT=ISCompare.prototype.$("oCompareLinksTable");
		this.oCId=id;
		this.oCName=name;
		this.oCL=o;
		var sInfo="";
		if(this.checkCompareACIds(id) > -1){
			oCO.style.display="";
			oCO.innerHTML='<span class="del"><b>[-] Удалить</b> '+name+' из таблицы сравнения</span>';
		}else{
			if(this.aCIds.length<this.iMax){
				oCO.style.display="";
				oCO.innerHTML='<b>[+] Добавить</b> '+name+' для сравнения';
			}else{
				oCO.style.display="none";
				oCO.innerHTML="";
				sInfo='<br/><br/><span>Достигнут максимум ('+this.iMax+' шт.) товаров для сравнения</span>';
			}
		}
		if(this.aCIds.length){
			oCT.innerHTML="<b>Просмотреть</b> таблицу сравнения"+sInfo;
			oCT.style.padding=oCT.style.fontSize=oCT.style.height=oCT.style.overflow="";
		}else{
			oCT.innerText="";
			oCT.style.padding=oCT.style.fontSize=oCT.style.height="0";
			oCT.style.overflow="hidden";
		}
		var aPos=getPos(this.oCL);
		oC.style.left=(aPos[0]-10)+"px";
		var iTopShift=22;
		if(this.browser=='IE' && this.browserVer>=8){
			iTopShift+=30;
		}else if(this.browser=='NS'){
			iTopShift+=20;
		}
		oC.style.top=(aPos[1]-iTopShift)+"px";
		if(this.browser=='IE'){
			oC.className="vis";
			this.oCVis=1;
		}else{
			clearTimeout(this.iSTOC0);
			clearTimeout(this.iSTOC1);
			clearTimeout(this.iSTOC2);
			this.iSTOC2=setTimeout(function(){this.oCVis=1;oC.className="vis"},100);
			fadeOpacity(oC.id,'oisBCompare');
		}
		this.hideDelayedCompareLinks();
	}else{
		if(this.browser=='IE'){
			oC.className="unvis";
			this.oCVis=0;
		}else{
			fadeOpacity.back(oC.id);
			clearTimeout(this.iSTOC0);
			clearTimeout(this.iSTOC1);
			clearTimeout(this.iSTOC2);
			this.iSTOC1=setTimeout(function(){oC.className="unvis"},1000);
			this.oCVis=0;
		}
	}
}
ISCompare.prototype.hideDelayedCompareLinks=function(){
	clearTimeout(this.iSTOC0);
	this.iSTOC0=setTimeout(this.nameOfClass+".showCompareLinks()",1500);
}
/*ISCompare.prototype.add2ACompare=function(a){
	try{ var c=this.cooGet();a.href+=c+'|';}catch(e){}
}*/


//=================
//- ISTicker -
function ISTicker(id){
	this.e=$(id);
	this.content=this.e.innerHTML;
	this.toLeft=false;
	this.speed=2;
	this.style="font-family:Arial;font-size:12px;color:#333";
	this.paused=false;
	this.ticker_start=function(){
		var tickerSupported=false;
		var width=520;//this.e.style.width;
		var img="<img src='http://www.ironsport.com.ua/includes/templates/iron_sport/images/spacer.gif' width="+width+" height=0 border=0>";
		if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("Safari")!=-1) {	// Firefox
			this.e.innerHTML="<TABLE cellspacing='0' cellpadding='0' width='100%'><TR><TD style='white-space:nowrap' nowrap='nowrap'>"+img+"<SPAN style='"+this.style+"' ID='TICKER_BODY' width='100%'>&nbsp;</SPAN>"+img+"</TD></TR></TABLE>";
			/*-*/if(navigator.userAgent.indexOf("Firefox")!=-1){	this.e.style.marginTop="-13px";	}
			tickerSupported=true;
		} else if (/*navigator.userAgent.indexOf("MSIE")!=-1 ||*/ navigator.userAgent.indexOf("Opera")!=-1) {	// IE
			this.e.innerHTML="<DIV nowrap='nowrap' style='width:100%'>"+img+"<SPAN style='"+this.style+"' ID='TICKER_BODY' width='100%'></SPAN>"+img+"</DIV>";
			tickerSupported=true;
		}
		if(!tickerSupported) this.e.outerHTML="";else{
			this.e.scrollLeft=this.toLeft ? this.e.scrollWidth-this.e.offsetWidth : 0;
			$("TICKER_BODY").innerHTML=this.content;
			this.e.style.display="block";
			this.ticker_tick();
		}
		this.e.onmouseover=function(){oISTicker.paused=true}
		this.e.onmouseout=function(){oISTicker.paused=false}
	}
	this.ticker_tick=function(){
		if(!this.paused)this.e.scrollLeft+=this.speed*(this.toLeft?-1:1);
		if(this.toLeft && this.e.scrollLeft<=0)this.e.scrollLeft=this.e.scrollWidth-this.e.offsetWidth;
		if(!this.toLeft && this.e.scrollLeft>=this.e.scrollWidth-this.e.offsetWidth)this.e.scrollLeft=0;
		window.setTimeout('oISTicker.ticker_tick()',50);
	}
}


//=================
/* http://www.tigir.com/opacity.htm
Установка прозрачности
Пример: setElementOpacity(document.body, 0.5);//сделать прозрачным на половину
*/	
function setElementOpacity(oElem, nOpacity){
	var p=getOpacityProperty();
	(setElementOpacity=p=="filter"?new Function('oElem','nOpacity','nOpacity*=100; var oAlpha=oElem.filters["DXImageTransform.Microsoft.alpha"] || oElem.filters.alpha;	if(oAlpha)oAlpha.opacity=nOpacity; else oElem.style.filter += "progid:DXImageTransform.Microsoft.Alpha(opacity="+nOpacity+")";'):p?new Function('oElem','nOpacity','oElem.style.'+p+'=nOpacity;'):new Function)(oElem, nOpacity);
}
// возвращает свойство которое используется для смены прозрачности или undefined
function getOpacityProperty(){
	var p;
	if (typeof document.body.style.opacity=='string') p='opacity';
	else if (typeof document.body.style.MozOpacity=='string') p='MozOpacity';
	else if (typeof document.body.style.KhtmlOpacity=='string') p='KhtmlOpacity';
	else if (document.body.filters && navigator.appVersion.match(/MSIE ([\d.]+);/)[1]>=5.5) p='filter';
	return (getOpacityProperty=new Function("return '"+p+"';"))();
}
/* плавное изменения прозрачности:
1) fadeOpacity.addRule('opacityRule1', 1, 0.5, 30);//вначале создаем правило, задаем имя правила, начальную прозрачность и конечную, необязательный параметр задержки, влийяющий на скорость смены прозрачности
2) fadeOpacity('elemID', 'opacityRule1');// выполнить плавную смену прозрачности элемента с id равным elemID, по правилу opacityRule1
3) fadeOpacity.back('elemID');//вернуться в исходное сотояние прозрачности
*/
function fadeOpacity(sElemId, sRuleName, bBackward){
	var elem=document.getElementById(sElemId);
	if(!elem || !getOpacityProperty() || !fadeOpacity.aRules[sRuleName]) return;
	var rule=fadeOpacity.aRules[sRuleName];
	var nOpacity=rule.nStartOpacity;
	if(fadeOpacity.aProc[sElemId]) {clearInterval(fadeOpacity.aProc[sElemId].tId); nOpacity=fadeOpacity.aProc[sElemId].nOpacity;}
	if((nOpacity==rule.nStartOpacity && bBackward) || (nOpacity==rule.nFinishOpacity && !bBackward)) return;
	fadeOpacity.aProc[sElemId]={'nOpacity':nOpacity,'tId':setInterval('fadeOpacity.run("'+sElemId+'")',fadeOpacity.aRules[sRuleName].nDalay),'sRuleName':sRuleName,'bBackward':Boolean(bBackward)};
}
fadeOpacity.addRule=function(sRuleName, nStartOpacity, nFinishOpacity, nDalay){fadeOpacity.aRules[sRuleName]={'nStartOpacity':nStartOpacity,'nFinishOpacity':nFinishOpacity,'nDalay':(nDalay || 30),'nDSign':(nFinishOpacity-nStartOpacity > 0?1:-1)};};
fadeOpacity.back=function(sElemId){fadeOpacity(sElemId,fadeOpacity.aProc[sElemId].sRuleName,true);};
fadeOpacity.run=function(sElemId){
	var proc=fadeOpacity.aProc[sElemId];
	var rule=fadeOpacity.aRules[proc.sRuleName];
	var nSteps=B=='IE' ? 8 :10;//-
	proc.nOpacity=Math.round(( proc.nOpacity + .1*rule.nDSign*(proc.bBackward?-1:1) )*nSteps)/nSteps;
	setElementOpacity(document.getElementById(sElemId), proc.nOpacity);
	if(proc.nOpacity==rule.nStartOpacity || proc.nOpacity==rule.nFinishOpacity) clearInterval(fadeOpacity.aProc[sElemId].tId);
}
fadeOpacity.aProc={};
fadeOpacity.aRules={};

//===
function ISShowPhoto(){
	this.f=0;
	this.iT0,this.iT1,this.iT2;
	fadeOpacity.addRule('oisBShowPhoto',0,1,40);
	this.run=function(e,f){
		try{
		var eI=$('isShowPhoto');
		if(e){
			if(!this.f){
				eI.src=e.src.replace('images/','images/large/');
				var a=getPos(e);
				fadeOpacity('isShowPhoto','oisBShowPhoto');
				clearTimeout(this.iT0); clearTimeout(this.iT1); clearTimeout(this.iT2);
				this.iT0=setTimeout(function(){eI.style.left=(a[0]-90)+'px'; eI.style.top=(a[1]-90)+'px'; this.f=1}, 100);
			}
		}else{
			fadeOpacity.back('isShowPhoto');
			clearTimeout(this.iT0); clearTimeout(this.iT1); clearTimeout(this.iT2);
			this.iT1=setTimeout(function(){eI.style.left='-9999px'; eI.style.top='-9999px'}, 1000);
			this.iT2=setTimeout(function(){this.f=0}, 100);
		}
		}catch(e){}
	}
}
var oisShowPhoto=new ISShowPhoto();

//=== Call Me!
function fOrderCallBlock(f){
	var c=$('orderCall'),b=$('orderCallBlock');
	if(f==0){c.className='hide';b.className='hide';
	}else if(f==1){c.className='hide';b.className='show';
	}else if(f==2){c.className='show';b.className='hide';}
}
function fOrderCallBlockSend(){
	ajaxObj.Open('orderCall.php?p='+$('call_phone').value+'&w='+$('call_when').value, fOrderCallBlockResponse);
	$('orderCall').innerHTML='Запрос обрабатывается ..';
	fOrderCallBlock(2);
}
function fOrderCallBlockResponse(){
	var ret=ajaxObj.GetData();
	if(ret==null)return;
	if(ret=="OK"){
		$('orderCall').innerHTML='<div id="orderCallSuccess">Ваш запрос успешно отправлен!</span>';
	}else{
		$('orderCall').innerHTML+='<div id="orderCallSuccess" style="color:#f00">Ошибка! Ваш запрос не отправлен.</span>';
		$('orderCall').className='block';
	}
}
var AjaxKtClass=function(host){
	this.xmlHttp=false; this.host=""; this.url=""; this.updateFun=null;
	if(typeof host!='undefined'){this.host=host}
	/*@cc_on @*/
	/*@if(@_jscript_version>=5)
	try{this.xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	}catch(e){try{this.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e2){this.xmlHttp=false;}}
	@end @*/
	if(!this.xmlHttp&&typeof XMLHttpRequest!='undefined')this.xmlHttp=new XMLHttpRequest();
	this.Open=function(url,updateFun){
		this.url=url;
		this.updateFun=updateFun;
		this.xmlHttp.open("GET",this.host+this.url,true);
		this.xmlHttp.onreadystatechange=this.updateFun;
		this.xmlHttp.send(null);
	}
	this.GetData=function(){
		if(this.xmlHttp.readyState==4) return this.xmlHttp.responseText;
		return null;
	}
}

//=== Poll
function sndReq(els,action) {
	var e,form=D.poll_box,fVoted=1;
    for(var i=0;i<form.elements.length;i++){
    	e=form.elements[i];
        if((e.type=='checkbox'||e.type=='radio')&&e.checked==true)fVoted=0;
    }
    if(fVoted) return;
	var el=els[0],zenid=els[1],a=sndReq.arguments,s='',ii=-1,H=B=='IE'?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();
	for(var i=2;i<24;i+=2,ii++){
		p=typeof(a[i])!='undefined'?a[i]:('dummy'+ii);
		v=typeof(a[i+1])!='undefined'?a[i+1]:'';
		s+='&'+p+'='+v;
	}
    H.open('GET', 'zcrpc.php?action='+action+s+'&zenid='+zenid+'&wqp='+new Date().getTime(), true);
    H.send(null);
    H.onreadystatechange=function(){ D.getElementById(el).innerHTML=H.readyState==4?H.responseText:'<img src="images/icons/indicator.gif"/>'; }
}

//=== Social
function writeSocialLnks(aVrs){
setTimeout(function(){
var s='',a=[
[0,'Написать e-mail','mailto:post@[IS_MAIL_HOST]'],
[1,'RSS','[IS_RSS]'],
/*?*/[3,'Я.ru','my.ya.ru/posts_add_link.xml?URL=[U]&title=[T]&body=[D]'],
[6,'Мой Мир','connect.mail.ru/login?connect=1&amp;page=http%3a%2f%2fconnect.mail.ru%2fshare%3fshare_url%3d[U]'],
/*?*/[7,'Одноклассники','odnoklassniki.ru/dk?st.cmd=addShare&amp;st._surl=[U]'],
[2,'В Контакте','vkontakte.ru/share.php?url=[U]&amp;title=[T_UTF]&amp;description=[D_UTF]&amp;image=[I]', 'UTF-8'],
[5,'Facebook','facebook.com/sharer.php?src=sp&amp;u=[U]&amp;t=[T]&amp;description=[D]&amp;picture=[I]'],
[4,'Twitter','twitter.com/login?redirect_after_login=%2Fhome%3Fstatus%3D[D_SHORT_UTF]']
];
for(var i=0,x=a.length;i<x;i++){
var t=a[i][1],u=a[i][2];
for(n in aVrs)u=u.replace(n,aVrs[n]);
if(i>1)u='http://'+u;
s+='<a href="'+u+'" class="bm'+a[i][0]+'" title="'+t+'" target="_blank"> &nbsp; </a>';
}
$('socialBM').innerHTML=s;
},1000);
}

//=== SearchPlus
try{
var iCurE=0,maxCurE=1,keyCurCode=0,srchPlsInpt='srchPlsInpt0';
function getSrchPlsClck(s){$(srchPlsInpt).value=s;quick_find.submit()}
function getSrchPlsDspl(f){$('srchPls').style.display=f?'block':'none'}
function getSrchPlsBlr(){setTimeout(function(){getSrchPls(1)},222)}
function getSrchPls(f){
	if(keyCurCode==38||keyCurCode==40){setCurFocus();return}
	var e=$(srchPlsInpt), aj=new AjaxKtClass('http://www.ironsport.com.ua/');
	if(f==1){getSrchPlsDspl(0);return}
	aj.Open('srch-pls.php?q='+e.value,
		function(){
			var r=aj.GetData();
			if(r==null||r==''){getSrchPlsDspl(0);return}
			r=r.split('|');
			var s='<div></div>';
			for(var i=0,x=r.length;i<x;i++){maxCurE=i+1;s+='<a id="srchPlsInpt'+maxCurE+'" onclick="getSrchPlsClck(\''+r[i]+'\')">'+r[i]+'</a>'}
			$('srchPls').innerHTML=s+'<div class="btm"></div>';
			getSrchPlsDspl(1);
			setCurFocus();
		}
	)
}
function setCurFocus(){
	var iCurEOld=iCurE;
	if(keyCurCode==38&&iCurE>0)iCurE--;else if(keyCurCode==40&&iCurE<maxCurE)iCurE++;
	if(iCurE==0)return;
	if(iCurEOld!=0)$('srchPlsInpt'+iCurEOld).className='';
	$('srchPlsInpt'+iCurE).className='srchPlsInptSel';
	$(srchPlsInpt).value=$('srchPlsInpt'+iCurE).innerText;
}
function getSrchPlsCode(e){
	var w=window.event;
	keyCurCode=w?w.keyCode:e.which;
}
setCurFocus();
}catch(e){
$(srchPlsInpt).setValue('autocomplete','on');
}
