var minScreen=Math.min(screen.width, screen.height);

function $(n)
{
	return document.getElementById(n);
}

function setSearch(iFil, cI, sSort, isCheck)
{
	var i;
	var fRm=document.formSearch;
	var f=fRm.elements;

	if(iFil == -1)
	{
		if(cI)
		{
			f.s.value=cI;
			f.s.disabled=false;
		}
		else f.s.disabled=true;
	}
	else if(iFil != null)
	{
		f.q.disabled=true;
		var sFil=[];
		var vFil=f.f.value.split('.');
		var fChk=document.getElementsByName('chFilter'+iFil);
		var c=fChk.length

		if(c>1)
		{
			for(i=0; c>i; i++)
			{
				if(fChk[i].checked)
					sFil[sFil.length]=fChk[i].value;
			}

			if(sSort != null)
			{
				if(cI && sSort) sSort=curSort;
				if(sSort)
				{
					if(cI && !isCheck) cI=(sFil.length)? sFil[sFil.length-1] : 0;

					if((cI && cI<4) || (!cI && iFil!=2 && iFil!=3 && iFil!=6))
						sSort='-'+sSort

					f.s.value=sSort;
					f.s.disabled=false;
				}
				else f.s.disabled=true;
			}

			if(!sFil.length && cI!=null && !sSort)	sFil[0]=0;

			vFil[iFil]=(iFil!=4 && c == sFil.length)? cI : sFil.join('_');
		}
		else
		{
			vFil[parseInt(iFil)]=($('chFilter'+iFil).checked)? cI : '';
		}

		vFil=vFil.join('.').replace(/\.+$/g, '')
		if(vFil) f.f.value=vFil; else f.f.disabled=true;
	}
	if(!f.f.value) f.f.disabled=true;

	if(f.q.value)
	{
		var q=f.q.value.replace(/[^A-z А-яё 0-9]/g, ' ').replace(/^\s+/g, '');

		if(/\d/.test(q))
		{
			q=q.replace(/(\d)\s+(\d)/g, '$1$2')
			if(parseInt(q.substr(0, 3))==380 && q.replace(/\D+/g, '').length>5) q=q.substr(2)
		}
		q=q.replace(/(^|\s)(\S{1,2})(\s|$)/g, '$1')
		q=q.replace(/^\s+/g, '').replace(/\s+$/g, '').replace(/\s+/g, ' ');

		if(q.replace(/\s+/g, '').length>2)
		{
			f.q.value=q;
			if(iFil == null){f.s.disabled=f.f.disabled=true;}
		}
		else {f.q.value='';f.q.disabled=true;}
	}
	else f.q.disabled=true;

	if(f.f.disabled && f.s.disabled && f.q.disabled && !f.en.checked)	document.location.assign('./');
	else fRm.submit();

	return false;
}
function goBack(id, uid, isRp)
{
	var l=location;
	var h=l.href+'';
	var r=document.referrer;
	var hs='http://'+l.hostname+l.pathname;

	if(id || r.substr(0, h.length)==h || r.indexOf(hs) == -1)
	{
		r=hs;
		if(id) r+='/prostitutes/'+id;
		else if(uid) r+='@_%5buid%5d='+uid;
	}

	if(isRp)
	{
		l.replace(r);
		return false;
	}
	else l.assign(r);
}
function setLogin(id)
{
	document.location.replace((id)? '@m=form&id='+id : '/');
}
function getRFoto(c, s)
{
	if(c<2) return 1;
	if(!window.NewListRF) window.NewListRF=[];
	else if(NewListRF[c]) return NewListRF[c];

	if(!window.ListRFCook)
	{
		try
		{
			var obj=document.cookie.split('rf=');
			obj=obj[1].split(';')
			obj=obj[0].split('_')
			window.ListRFCook=obj;
		}
		catch(e){window.ListRFCook=[];}
	}

	var cf=ListRFCook[c]
	if(cf)
	{
		var rf,i=0;
		cf=parseInt(cf);
		do{	rf=Math.ceil(c*Math.random()); i++; }
		while((cf == rf && i<10) || !rf);
	}
	else	var rf=Math.max(1, Math.ceil(c*Math.random()));

	NewListRF[c]=rf;
	window.isMakeRFoto=1

	if(s && cf) rf=cf;

	return rf;
}

function makeRFoto()
{
	if(!window.isMakeRFoto) return;
	try{document.cookie='rf='+NewListRF.join('_');}catch(e){}
	window.isMakeRFoto=0
}

function iLST()
{
	var arg=arguments;
	var c=arg.length;
	var isEng=arg[0];
	var countPage=arg[1];
	var page=arg[2];
	var pageUrl=arg[3];
	var id,freal,rf,cf,age,height,weight,bust,price,mf,phone,nm,services,about,site,uPanel,lnk;

	var str='<DIV align=center>';
	var strFreal=(isEng)? 'Real photo' : 'Фото проверено';

	var mOrd=new Object();
	mOrd.weight=mOrd.height=mOrd.bust=mOrd.price=mOrd.age='';
	mOrd.weight2=mOrd.height2=mOrd.bust2=mOrd.price2=mOrd.age2='';
	if(nSortOrder)
	{
		mOrd[nSortOrder]='<span style="color:#FFFFDC">';
		mOrd[nSortOrder+'2']='</span>';
	}

	for(var i=4; i<c;)
	{
		id=arg[i++]
		freal=arg[i++]
		rf=arg[i++]
		cf=arg[i++]
		age=arg[i++]
		height=arg[i++]
		weight=arg[i++]
		bust=arg[i++]
		price=arg[i++]
		mf=arg[i++]
		phone=arg[i++]+'';
		nm=arg[i++]
		services=arg[i++]
		about=arg[i++]
		site=arg[i++]
		uPanel=arg[i++]

		if(rf)
		{
			rf=getRFoto(cf)
			lnk='#f'+rf
		}
		else
		{
			rf=1
			lnk=''
		}

		lnk='href="/prostitutes/'+id+lnk+'/" target=_blank HIDEFOCUS';

		str+='<table cellpadding=0 cellspacing=0 class=tb><tr><td valign=bottom><div class=sf><div class=sf2><a '+lnk+' class=nl>'+nm+'</a></div></div></td><td class=fn><a '+lnk+' class=fl>+38-0'+phone.substr(0,2)+'-'+phone.substr(2,3)+'-'+phone.substr(5,2)+'-'+phone.substr(7)+'</a></td></tr><tr><td class=ft><a '+lnk+'><img src=/data/img/1.gif onload=lFT(this,'+id+','+rf+','+mf+') onerror=eFT(this) onmouseover=animImg('+id+',this,'+cf+') onmouseout=stopAnimImg('+id+') onmousedown=stopAnimImg('+id+') class=fb alt="" title=1></a></td><td class=t>';

		if(freal)
			str+='<div class=fr>'+strFreal+'</div>';

		if(isEng)
		{
			str+='Weight<i class=thk>. . </i>'+mOrd.weight+weight+mOrd.weight2+'<br>Height<i class=thk> . . </i>'+mOrd.height+height+mOrd.height2+'<br>Bust<i class=thk>. . . . . </i>'+mOrd.bust+bust+mOrd.bust2+'<br>Age<i class=thk>. . . . . . </i>'+mOrd.age+age+mOrd.age2+'<br><br>'+uPanel+'Price hour &nbsp;'+mOrd.price+price+' UAH'+mOrd.price2;
		}
		else
		{
			str+='Возраст<i class=thk>. .</i>'+mOrd.age+age+' лет'+mOrd.age2+'<br>Рост<i class=thk>. . . . . . </i>'+mOrd.height+height+mOrd.height2+'<br>Вес<i class=thk>. . . . . . . </i>'+mOrd.weight+weight+mOrd.weight2+'<br>Бюст<i class=thk>. . . . . </i>'+mOrd.bust+bust+mOrd.bust2+'<br><br>'+uPanel+'Услуги &nbsp;'+mOrd.price+price+' грн'+mOrd.price2;
		}

		str+='<br><b style=font-weight:normal>'+services+'</b></td></tr><tr><td class=d colspan=2><a '+lnk+' class=l name=ank>'+about+'<div class=si>'+site+'</div></a></td></tr></table>';

	}

	if(countPage>1)
	{
		str+='<table cellspacing=3 align=center cellpadding=0><tr>';
		for(i=1; i<=countPage; i++)
		{
			if(i==page)	str+='<td class=cPg>'+i+'</td>';
			else
				str+='<td class=Pg><a href="'+((i==1)? pageUrl.substr(0, pageUrl.length-3) : pageUrl+i)+'/" HIDEFOCUS class=lPg>'+i+'</a></td>';
		}
		str+='</tr></table><br>';
	}

	str+='</DIV>';
	document.write(str);
	str='';
	makeRFoto();

	setTimeout(wheelListSet, 200);
}

function wheelListSet()
{
	try
	{
		var l=document.getElementsByName('ank');
		var c=l.length;
		if(c<4)	return;
	}
	catch(e){return;}

	if(!window.listTabFiles)
	{
		window.iTabFiles=-1
		window.isWheelList=0
		window.countTabFiles=0
		window.listTabFiles=[];
		window.srollWheelList=0;
		window.wheelListStop=function(){window.isWheelList=0}
		window.scrollTo(0,0);

		if(document.addEventListener)
		{
			document.body.addEventListener('mousewheel', wheelList, false);
			document.body.addEventListener('DOMMouseScroll', wheelList, false);
		}
		else if(document.attachEvent)
			document.body.attachEvent('onmousewheel', wheelList);

		else return

		window.onresize=wheelListSet
		window.onscroll=function(){	if(isWheelList || countTabFiles<3) return; if(srollWheelList) srollWheelList=clearTimeout(srollWheelList);srollWheelList=setTimeout(wheelListPos,50)}
	}

	var sT=105;
	listTabFiles[0]=sT
	countTabFiles=c

	for (var i=0; i<c;)
	{
		sT+=l[i].offsetParent.offsetParent.clientHeight+30;
		listTabFiles[++i]=sT;
	}
}
function getScrollTop()
{
	return (window.scrollY || document.documentElement.scrollTop || document.body.scrollTop);
}
function wheelListPos()
{
	var i=0;
	var sT=getScrollTop()-32

	while(sT>listTabFiles[i++]){}

	iTabFiles=i-1.5
}

function wheelList(e)
{
	if(e.preventDefault)	e.preventDefault();
	else e.returnValue=false;

	if(isWheelList) return;
	isWheelList=1
	window.setTimeout(wheelListStop, 60)

	if(e.wheelDelta) var s=e.wheelDelta<0;
	else if(e.detail) var s=e.detail>0;

	var sT=iTabFiles+((s)? 1 : -1)
	if(Math.ceil(sT) != sT) sT=(s)? Math.floor(sT) : Math.ceil(sT)

	if(sT<0 && !s)
	{
		iTabFiles=-1;
		window.scrollTo(0, 0);
		return;
	}
	if(sT>countTabFiles && s)	return;

	iTabFiles=sT
	window.scrollTo(0, listTabFiles[sT]+32)
	if(window.animImgId) stopAnimImg(animImgId)
}

function addPhotoBlock(idx, c, rf, mf, video)
{
	var iRf,nRf,s=0;
	var str='<table cellpadding=0 cellspacing=0 style="margin-left:1px;margin-top:-4px;" oncontextmenu="return false"><tr>';

	if(document.location.hash)
	{
		var rh=parseInt((document.location.hash+'').substr(2));
		if(rh>0 && !isNaN(rh) && rh<=c)
		{
			nRf=[];
			rf=rh
		}
		else rf=1;
	}
	else if(rf && c>1)
	{
		nRf=[];
		rf=getRFoto(c, 1);
		makeRFoto();
	}
	else rf=1;

	for(var i=1; i<=c; i++)
	{
		s++;
		if(nRf)
		{
			if(nRf.length)
			{
				do{	iRf=Math.ceil(c*Math.random());}
				while(nRf[iRf] || !iRf);
			}
			else iRf=rf;
			nRf[iRf]=1;
		}
		else iRf=i;

		str+='<td><DIV onmousedown="cFT('+idx+','+iRf+','+mf+')" class=f onmouseover=fBrd(this.style,1,'+iRf+') onmouseout=fBrd(this.style,0,'+iRf+') id="iDF'+iRf+'"><img src=/data/img/1.gif onload=lFT(this,'+idx+','+iRf+','+mf+',1) onerror=eFT(this) class=fb2 alt="" title="'+i+'"></DIV></td>';
		if(s==2)
		{
			str+='</tr><tr>';
			s=0;
		}
	}
	str+='</tr></table>';

	if(c>4)
		str='<DIV id=blPreFoto class=blFt style="margin-top:-1px;margin-right:-3px" onmousewheel="wheelBlock(this,event,334)">'+str+'</DIV>';
	if(video)
		str+='<img src=/data/img/video.gif alt="Просмотр видео" style="width:289px;height:46px;margin:1px;cursor:pointer" onclick="openVideo('+idx+')">';

	str='<DIV style=margin-top:10px;-moz-user-select:none;-webkit-user-select:none; onselectstart="return false">'+str+'</DIV>';

	window.iDF=0;
	window.mdFoto=mf;
	window.iDFile=idx;
	window.imgFullCache=[];
	window.isFullShowFoto=0;

	var f='/prostitutes/'+idx+'/v'+rf+'.jpg?'+mf;
	str+='</td><td class=vf style="background:url(/prostitutes/'+idx+'/'+rf+'.jpg?'+mf+');background-repeat:repeat-y;background-position:50% 0px;background-color:#E7E9ED;overflow:hidden" id=oBg><table cellpadding=0 cellspacing=0 width=100% height=100% style="width:100%;height:100%"><tr><td style="text-align:center;background-image:url(/data/img/bgf.png)" onselectstart="return false"><DIV id=preFt  style="position:relative;z-index:2;margin-bottom:-16px;text-align:center"><img src="/data/img/pr.gif" alt="" style="width:128px;height:15px"></DIV><DIV id=oDivFt><DIV onclick="showPhoto()" style="cursor:pointer"><img src="'+f+'" id=oFT style="display:none;-webkit-transform:translate3d(0,0,0);-ms-interpolation-mode:bicubic;image-rendering:optimizeQuality;width:auto;height:auto;z-index:1;position:relative;box-shadow:0px 0px 25px 0px #333333;" onload="onLoadPhoto(this)" onerror=eFT(this) onmousewheel="wheelPhoto(event)" onmousemove=srollPhoto(this,event) onmouseout=window.xMousePhoto=0 alt=""></DIV></DIV></td></tr></table>';

	document.write(str);
	if(c>4 && document.addEventListener)
	{
		c=$('blPreFoto');
		c.addEventListener('DOMMouseScroll', function (e2){wheelBlock(c,e2,334)}, false);
	}
}

function advProfile(isListFriends, lRels, isReview)
{
	var	nm;
	if(isListFriends==null)
	{
		nm=(LNG)? 'Client review':'Ваши отзывы';
		document.write('<DIV class=sf1 style="margin-top:45px;"><DIV class=sf2 style="width:180px;"><DIV id=advTabView style="background-color:#B30300;color:white;height:20px;line-height:19px;text-align:center;font-size:100%;cursor:default">'+nm+'</div></div></div><DIV id=blockAdvProfile2 style="border-top:1px solid #B30300;border-bottom:1px solid #B30300;margin-bottom:1px;display:none;-moz-user-select:none;user-select:none" onselectstart="return false"></DIV><DIV id=blockAdvProfile3 style="border-top:1px solid #B30300;border-bottom:1px solid #B30300;margin-bottom:1px;display:none;-moz-user-select:none;user-select:none" onselectstart="return false"></DIV>');
		return;
	}

	var str='';
	if(lRels)
	{
		nm=(LNG)? 'Similar girls':'Похожие девушки';
		window.ListOtherFiles=lRels;
		str+='<DIV id=tabRev3 onclick="showFiles(3)" class=advLnk onmouseover=\'with(this.style){color="white";borderTopColor=backgroundColor="#B30300"}\' onmouseout=\'if(!window.objAdvProfile || objAdvProfile[0]!=3){with(this.style){color="#222731";borderTopColor="#DEDEDE";backgroundColor="white"}}\'><SPAN id=lnkAdv3>'+nm+'</SPAN></DIV>';
	}
	if(isListFriends)
	{
		nm=(LNG)? 'Girl friends':'Подружки';
		str+='<DIV id=tabRev2 onclick="showFiles(2)" class=advLnk onmouseover=\'with(this.style){color="white";borderTopColor=backgroundColor="#B30300"}\' onmouseout=\'if(!window.objAdvProfile || objAdvProfile[0]!=2){with(this.style){color="#222731";borderTopColor="#DEDEDE";backgroundColor="white"}}\'><SPAN id=lnkAdv2>'+nm+'</SPAN></DIV>';
	}

	nm=(LNG)? 'Add review':'Написать отзыв';
	str+='<DIV onclick="showFiles(1)" class=advLnk style="border-right:none" id=tabRev1 onmouseover=\'with(this.style){color="white";borderTopColor=backgroundColor="#B30300"}\' onmouseout=\'with(this.style){color="#222731";borderTopColor="#DEDEDE";backgroundColor="white"}\'><SPAN id=lnkAdv1>'+nm+'</SPAN></DIV>';

	document.write('<DIV style="margin-top:-1px;border:1px solid #B30300;border-top:none;float:right" onselectstart="return false">'+str+'</DIV>');
}

function showFiles(ind)
{
	if(!window.objAdvProfile)
		window.objAdvProfile=[1, $('blockAdvProfile1')];

	var oldInd=objAdvProfile[0];
	if(oldInd == ind)
	{
		if(ind==1) addReview(iDFile)
		else showFiles(1)
		return;
	}

	var dBy=document.documentElement;
	var oldScTop=getScrollTop();

	try{
		var oldScH=objAdvProfile[oldInd].clientHeight;
		objAdvProfile[oldInd].style.display='none';
	}
	catch(e){return;}

	if(objAdvProfile[ind])
	{
		var obj=objAdvProfile[ind];
		objAdvProfile[0]=ind;
	}
	else
	{
		var nObj=(ind==3)? 'ListOtherFiles':'ListFriends';

		try
		{
			var arg=window[nObj];
			var obj=$('blockAdvProfile'+ind);
		}
		catch(e){ return; }

		var cL=arg.length;
		objAdvProfile[0]=ind;
		objAdvProfile[ind]=obj;
		var txtRealFoto=(LNG)? 'Real photo':'Фото проверенно';

		var h,targ='';

		if(cL<38)		h=188
		else if(cL<79)	h=378
		else			h=564

		var cf=5;
		var nm=dBy.offsetWidth-dBy.clientWidth;
		if(nm>0)
		{
			cf=4;
			h+=2;
		}

		var str='<div class=blRev style="background-color:#B30300;padding:5px;padding-bottom:0px;padding-right:0px;height:'+h+'px" onmousewheel="wheelBlock(this,event,(this.clientHeight-'+cf+'),0,122)">';

		var id,im,mf,rf,freal,i=1;
		while(i<cL)
		{
			id=arg[i++]
			nm=arg[i++]
			mf=arg[i++]
			cf=arg[i++]
			rf=arg[i++]
			freal=arg[i++]
			if(rf)
			{
				im=getRFoto(cf)
				targ='#f'+im
			}
			else
			{
				im=1
				targ=''
			}
			if(ind==3) targ+=' target=_blank';

			str+='<div class=advL><div style="background-image:url(/data/img/shr.gif);background-position:right top;background-repeat:no-repeat"><a href=/prostitutes/'+id+targ+' style="display:inline-block;color:#222731" HIDEFOCUS onmouseover=this.style.color="#B30300" onmouseout=this.style.color="#222731">'+nm+'<BR><img src=/data/img/1.gif alt="" title=1 onload=lFT(this,'+id+','+im+','+mf+') onerror=eFT(this) onmouseover=animImg('+id+',this,'+cf+') onmouseout=stopAnimImg('+id+') onmousedown=stopAnimImg('+id+') class=fb2>';
			if(freal) str+='<img src="/data/img/real.png" class=chkFt alt="" title="'+txtRealFoto+'">';
			str+='</a></div></div>';
		}

		str+='</div>';
		try
		{
			obj.innerHTML=str;
			window[nObj]=str=null;
		}
		catch(e){return;}

		makeRFoto();

		if(obj.addEventListener)
		{
			var nObg=obj.firstChild;
			nObg.addEventListener('DOMMouseScroll', function (e2){wheelBlock(nObg,e2,(nObg.clientHeight-5),0,122)}, false);
		}
	}

	try
	{
		obj.style.display='block'
		obj.firstChild.scrollTop=0;

		with($('tabRev'+oldInd).style)
		{
			color='#222731';
			borderTopColor='#DEDEDE';
			backgroundColor='white';
		}

		$('advTabView').innerHTML=$('lnkAdv'+ind).innerHTML;

		if(oldInd == 1)
			$('lnkAdv1').innerHTML=(LNG)? 'Client review':'Ваши отзывы';
		if(ind == 1)
			$('lnkAdv1').innerHTML=(LNG)? 'Add review':'Написать отзыв';
		else
		{
			with($('tabRev'+ind).style)
			{
				color='white';
				borderTopColor=backgroundColor='#B30300';
			}
		}

		oldScTop-=getScrollTop();
		oldScH-=obj.clientHeight;
		window.scrollTo(0, getScrollTop()-(oldScH-oldScTop))
		//$('tabRev'+ind).scrollIntoView(false);
	}
	catch(_e){}
}

function fBrd(obj, s, i)
{
	if(i == iDF) return;
	if(window.isDeleyWheel) s=0;
	var c=(s)? '#E7E9ED' : '#FFFFFF';
	var c2=(s)? '#CC0500' : '#FFFFFF';

	obj.borderLeftColor=c;
	obj.borderTopColor=c;
	obj.borderRightColor=c2;
	obj.borderBottomColor=c2;
}
function showPhoto()
{
	if(!iDF) return;

	var img=window.objImgPhoto;
	var obj=window.objShowPhoto;

	if(obj)	var sObj=obj.style;
	else
	{
		window.objShowPhoto=obj=document.createElement('div');
		obj.onclick=hidePhoto;
		obj.oncontextmenu=function (){return false}

		var sObj=obj.style;
		sObj.zIndex=100;
		sObj.width='100%';
		sObj.display='none';
		sObj.cursor='pointer'
		sObj.textAlign='center'
		sObj.position='absolute';
		sObj.left=sObj.top='0px';
		sObj.backgroundColor='#E7E9ED';
		sObj.height=document.documentElement.scrollHeight+'px';

		window.objImgPhoto=img=document.createElement('img');

		img.alt='';
		img.onerror=function (){eFT(this)}
		img.onload=function ()
		{
			if(this.height>document.documentElement.scrollHeight) this.parentNode.style.height=this.height+'px';

			if(this.src.indexOf('#')==-1)
				this.src='/prostitutes/'+iDFile+'/p'+iDF+'.jpg?'+mdFoto+'#';
			else
			{
				imgFullCache[iDF]=1;
				this.style.opacity=1;
				objImgPreloader.style.display='none';
			}
		}

		img.style.msInterpolationMode='bicubic';
		img.style.imageRendering='optimizeQuality'
		obj.appendChild(objImgPhoto);

		window.objImgPreloader=img=document.createElement('img');

		img.alt='';
		img.style.left='49%';
		img.style.top='50%';
		img.style.zIndex=101;
		img.style.width='128px';
		img.style.height='15px';
		img.style.position='fixed';
		img.src='/data/img/pr.gif';
		obj.appendChild(objImgPreloader);

		document.body.appendChild(obj);
		document.onkeydown=function (e){if(!e)e=event;if(e.keyCode==27)hidePhoto();}
	}

	img=objImgPhoto;
	if(imgFullCache[iDF])	img.src='/prostitutes/'+iDFile+'/p'+iDF+'.jpg?'+mdFoto+'#';
	else
	{
		img.style.opacity=.8
		objImgPreloader.style.display='block';
		img.src='/prostitutes/'+iDFile+'/v'+iDF+'.jpg?'+mdFoto;
	}

	img.style.width=(parseInt(screen.availWidth)-21)+'px';
	img.style.height='auto';

	window.scrollTo(0,0);
	sObj.display='block';
}
function hidePhoto()
{
	window.scrollTo(0,0);
	window.objShowPhoto.style.display='none';
	window.focus();
}
function openVideo(id)
{
	openWindow('@h=video&id='+id, 420, 360, 1);
	return false;
}
function addFav(obj)
{
	obj.title=document.title;
	obj.href=document.location.href;

	if(!window.ActiveXObject) return;

	window.external.AddFavorite(obj.href, obj.title);
	return false;
}

function setActPreView(i)
{
	if(iDF)
	{
		with($('iDF'+iDF).style)
		{
			width='140px';
			height='160px';
			border='1px solid white';
			backgroundPosition='0px 0px'
		}
	}

	iDF=i;
	with($('iDF'+i).style)
	{
		width='138px';
		height='158px';
		border='2px dashed white';
		backgroundPosition='-1px -1px'
	}
}

function wheelBlock(obj, e, v, minTop, minBottom)
{
	if(window.animImgId) stopAnimImg(animImgId)
	if(window.isDeleyWheel)
	{
		if (e.preventDefault)	e.preventDefault();
		else e.returnValue=false;
		return;
	}

	if(e.wheelDelta) var s=(e.wheelDelta<0)? 1 : -1;
	else if(e.detail) var s=(e.detail>0)? 1 : -1;

	var ps=obj.scrollTop;
	var maxSt=obj.scrollHeight-obj.clientHeight
	var st=document.documentElement.scrollHeight-(document.documentElement.clientHeight+getScrollTop());

	if(s<0 && !ps || s>0 && ps>=maxSt) return;

	if (e.preventDefault)	e.preventDefault();
	else e.returnValue=false;

	if(minBottom)
	{
		var scT=getScrollTop();
		$('tabRev1').scrollIntoView(false);
		if(Math.abs(scT-getScrollTop())>120) return;
	}

	st=ps/v;
	st=v*((s>0)? Math.floor(st) : Math.ceil(st))
	v-=s*(ps-st);

	obj.scrollTop+=v*s;

	if(v>100)
	{
		window.isDeleyWheel=1;
		setTimeout(function (){window.isDeleyWheel=0}, 200);
	}
}
function moveFonFoto(obj, e)
{
	if(window.xMousePhoto)
	{
		var s=e.clientX-xMousePhoto;
		if(s>0.3 || s<-0.3)	s=(s>0)? 0.3 : -0.3;

		xFonPhoto-=s;
		xMousePhoto=e.clientX;

		s=e.clientY-yMousePhoto;
		if(s>0.3 || s<-0.3)	s=(s>0)? 0.3 : -0.3;

		yFonPhoto-=s
		yMousePhoto=e.clientY;
	}
	else
	{
		window.xMousePhoto=e.clientX;
		window.yMousePhoto=e.clientY;

		var f=obj.backgroundPosition;

		window.xFonPhoto=parseInt(f.substr(0, f.indexOf(' ')));
		window.yFonPhoto=parseInt(f.substr(f.indexOf(' ')+1));

		return;
	}

	obj.backgroundPosition=Math.round(xFonPhoto)+'px '+Math.round(yFonPhoto)+'px';
}
function srollPhoto(obj, e)
{
	if(!window.iWheelPhoto) return moveFonFoto(oFotoTD.style, e);
	if(!window.xMousePhoto)
	{
		window.xMousePhoto=e.clientX;
		window.yMousePhoto=e.clientY;
		return;
	}

	var s=e.clientX-xMousePhoto;
	if(s>10 || s<-10)	s=(s>0)? 10 : -10;

	var sX=s;
	xMousePhoto=e.clientX;

	s=e.clientY-yMousePhoto;
	if(s>10 || s<-10)	s=(s>0)? 10 : -10;

	var sY=s;
	yMousePhoto=e.clientY;

	blockFotoView.scrollTop+=sY
	blockFotoView.scrollLeft+=sX
}
function wheelPhoto(e)
{
	if(window.isPhotoWheel)
	{
		if (e.preventDefault)e.preventDefault();
		else e.returnValue=false;
	}

	try{
		var pObj=blockFotoView;
	}
	catch(_e){return;}

	var obj=oFotoView.style;

	if(e.wheelDelta) var s=(e.wheelDelta>0)? 0.1 : -0.1;
	else if(e.detail) var s=(e.detail<0)? 0.1 : -0.1;

	if(s>0 && getScrollTop()>172)	window.scrollTo(0, 145);

	var w=parseInt(photoMinW);
	var h=parseInt(photoMinH);

	if(isNaN(e.offsetX))
	{
		var sX=e.layerX;
		var sY=e.layerY;
	}
	else
	{
		var sX=e.offsetX;
		var sY=e.offsetY;
	}

	if(!window.iWheelPhoto)
	{
		if(s<0)	return;

		window.iWheelPhoto=1;

		var w1=oFotoTD.clientWidth;
		var h1=oFotoTD.clientHeight;

		xFonPhoto=Math.floor((w1/2)-parseInt(oFotoView.width)/2-1);
		yFonPhoto=Math.floor((h1/2)-parseInt(oFotoView.height)/2-1)
		xMousePhoto=e.clientX;
		yMousePhoto=e.clientY;
		oFotoTD.style.backgroundPosition=xFonPhoto+'px '+yFonPhoto+'px';

		pObj.style.width=w1+'px';
		pObj.style.height=h1+'px';
		pObj.style.overflow='hidden';

		window.fotoWidth=oFotoView.clientWidth;
		window.fotoHeight=oFotoView.clientHeight;
		var blockQ=w1/h1;
		var fotoQ=fotoWidth/fotoHeight;

		if(blockQ>fotoQ)
		{
			fotoWidth=w1;
			fotoHeight=Math.round(w1/fotoQ);
			s=fotoWidth/w-1
		}
		else
		{
			fotoHeight=h1;
			fotoWidth=Math.round(h1*fotoQ);
			s=fotoHeight/h-1
		}

		window.dWheelPhoto=s+1;
	}

	try
	{
		if (e.preventDefault)	e.preventDefault();
		else e.returnValue=false;
	}
	catch(_e){}

	if((iWheelPhoto+s) < dWheelPhoto)
	{
		iWheelPhoto=0;
		obj.width=photoMinW;
		obj.height=photoMinH;
		pObj.style.height='';
		pObj.style.width='100%';
		pObj.scrollLeft=pObj.scrollTop=0;
		pObj.style.overflow='visible';
		return;
	}
	iWheelPhoto+=s;

	if(s>0)
	{
		window.isPhotoWheel=1;
		window.setTimeout(function (){window.isPhotoWheel=0}, 10*iWheelPhoto);
	}

	if((iWheelPhoto > 1.5 || imgFullCache[iDF]) && (!isFullShowFoto))
	{
		isFullShowFoto=1;
		oFotoView.src='/prostitutes/'+iDFile+'/p'+iDF+'.jpg?'+mdFoto;
	}

	var scrX=pObj.scrollLeft+Math.round(w*s*(sX/parseInt(obj.width)))
	var scrY=pObj.scrollTop+Math.round(h*s*(sY/parseInt(obj.height)));

	obj.width=Math.round(w*iWheelPhoto)+'px';
	pObj.scrollLeft=scrX;

	obj.height=Math.round(h*iWheelPhoto)+'px';
	pObj.scrollTop=scrY;
}

function setMaxView()
{
	var obj=oFotoView;

	var maxW=Math.max(500, oFotoTD.clientWidth);
	var maxH=Math.max(560, oFotoTD.clientHeight);
	var w=parseInt(obj.width)
	var h=parseInt(obj.height)
	var k=w*h;

	if(k<1 || isNaN(k))
	{
		setTimeout(setMaxView, 10);
		return;
	}

	obj=obj.style;
	oFotoTD.style.height=maxH+'px'
	oFotoTD.style.backgroundPosition=Math.floor((oFotoTD.clientWidth/2)-w/2)+'px '+Math.floor((oFotoTD.clientHeight/2)-h/2)+'px';

	if(w<maxW && h<maxH)
	{
		k=h/w;
		var k2=maxH/maxW;
		if(k < k2)	maxH=Math.round(maxW*k);
		else		maxW=Math.round(maxH/k);

		w=maxW
		h=maxH
	}

	window.photoMinW=obj.width=w+'px'
	window.photoMinH=obj.height=h+'px'
}

function onLoadPhoto(obj)
{
	var i=parseInt(obj.src.substr(obj.src.lastIndexOf('/')+2));
	if(obj.src.indexOf('/p')!=-1) imgFullCache[i]=1;

	if(window.iWheelPhoto) return;
	if(!window.oFotoView)
	{
		window.oFotoView=obj;
		window.blockFotoView=$('oDivFt');
		window.oFotoTD=$('oBg');
		window.preLoaderFoto=$('preFt').style;
		window.viewFotoW=parseInt(oFotoTD.offsetWidth);

		if(document.addEventListener)
			obj.addEventListener('DOMMouseScroll', wheelPhoto, false);

		obj.style.display='inline';
	}

	preLoaderFoto.display='none';
	obj.style.width='auto';
	obj.style.height='auto';

	imgCache[i]=1;

	oFotoTD.style.background='url('+obj.src+')';
	oFotoTD.style.backgroundPosition='50% 50%'

	setMaxView();
	if(iDF != i) setActPreView(i);
}
function eFT(obj, isSet, setSrc, rPref)
{
	try
	{
		if(setSrc)
		{
			obj=$(obj);
			if(obj.src.indexOf(setSrc) != -1) obj.src=setSrc+'?'+rPref;
			return;
		}

		var s=obj.src;
		s=s.substr(0, s.indexOf('?'));
		var r=parseInt((Math.random()+'').substr(4));

		if(isSet)
		{
			obj.src=s+'?'+r;
			return;
		}

		if(obj.alt != obj.title)
		{
			obj.onload();
			return;
		}

		var idx=obj.id
		if(!idx) obj.id=idx='id'+r;
		window.setTimeout(function (){eFT(idx,0,s,r)}, 1000+Math.round(2000*Math.random()));
	}
	catch(e){}
}
function lFT(obj, id, i, mf, toBg)
{
	try
	{
		if(obj.alt == obj.title)
		{
			obj.style.backgroundImage='none';
			if(toBg)
			{
				obj.onload='';
				obj.parentNode.style.backgroundRepeat='no-repeat'
				obj.parentNode.style.backgroundImage='URL('+obj.src+')';
				obj.style.display='none';
			}
		}
		else
		{
			obj.title=obj.alt;
			obj.src='/prostitutes/'+id+'/'+i+'.jpg?'+mf;
		}
	}
	catch(e){}
}
function cFT(idx, i, mf)
{
	try
	{
		var w=Math.min(500, parseInt(oFotoTD.clientWidth));
	}
	catch(e){return;}

	if(getScrollTop()>172)	window.scrollTo(0, 145);

	if(window.iWheelPhoto)
	{
		viewFotoW--;
		iWheelPhoto=0;
		var pObj=blockFotoView.style;
		pObj.width='100%';
		pObj.height='';
		pObj.overflow='visible';
		oFotoView.style.width=photoMinW;
		oFotoView.style.height=photoMinH;
		blockFotoView.scrollLeft=blockFotoView.scrollTop=0;
	}

	if(viewFotoW<w)
	{
		viewFotoW=w;
		blockFotoView.style.width=w+'px';
	}

	if(iDF == i)
	{
		if(imgCache[i]) showPhoto();
		return;
	}
	setActPreView(i);

	try
	{
		if(!imgCache[i])
		{
			preLoaderFoto.top=(Math.round(parseInt(photoMinH)/2)-5)+'px';
			preLoaderFoto.display='block';
		}

		window.isFullShowFoto=0
		oFotoView.src='/prostitutes/'+idx+'/v'+i+'.jpg?'+mf;
	}
	catch(e){}
}
function checkForm(frm, isD)
{
	var f=frm.elements;

	if((f.login) && f.login.value.replace(/[^0-9A-Z_-]/ig, '')!=f.login.value)
	{
		alert('Не корректный Логин!\r\nТолько символы латиницы и цифры.');
		f.login.select();
		f.login.focus();
		return false;
	}

	if(f.email)
	{
		var m=f.email.value;
		if(!m || !m.match(/^[\d\w\.\-]+@[\d\w\-\.]+\.[A-z0-9]{2,6}$/i))
		{
			alert('Не корректный E-mail!');
			f.email.select();
			f.email.focus();
			return false;
		}
	}

	for(var n,i=0; i<f.length; i++)
	{
		n=f[i];
		if((n.type != 'text' && n.type != 'email' && n.type != 'tel' && n.type != 'password' && n.nodeName!='TEXTAREA') || n.getAttribute('isNull') || /\S+/.test(n.value)) continue;

		alert('Проверти заполнения поля: '+n.title+'!');
		n.select();
		n.focus();
		return false;
	}

	if(!isD)
	{
		f.oSubmit.disabled=true;
		f.oSubmit.style.cursor='wait';
	}

	return true;
}
function openWindow(url, w, h, n, left, top)
{
	if(!left)	var left=Math.max(Math.round(screen.availWidth/2-(w/2)), 0);
	if(!top)	var top=Math.max(Math.round(screen.availHeight/2-(h/2)), 0)

	try
	{
		var idx=n || '_W_'+url.replace(/[^a-z0-9]/gi, '');
		if(window[idx] && !window[idx].closed)
		{
			try{window[idx].focus();}catch(e){}
			return;
		}
		window[idx]=1;

		if(n)
		{
			if(window.showModalDialog)
			{
				window.showModalDialog(url, window, 'dialogLeft:'+left+'px;dialogTop:'+top+'px;status:0;resizable:1;scroll:1;help:0;dialogWidth:'+w+'px;dialogHeight:'+h+'px');
				window[idx]=0;
			}
			else
			{
				window[idx]=window.open(url, '_blank', 'width='+w+',height='+h+',left='+left+',top='+top+',scrollbars=1,resizable=1,toolbar=0,directories=0,status=0,menubar=0,modal=1');
				window[idx].focus();
			}
		}
		else
		{
			window[idx]=window.open(url, '_blank', 'width='+w+',height='+h+',left='+left+',top='+top+',scrollbars=0,resizable=1');
			window[idx].focus();
		}
	}
	catch(e){return;}
}
function addReview(id, i)
{
	var url='/review/?'+id;
	if(i) url+='&i='+i;
	var w=420;
	var h=330;
	openWindow(url, w, h);
}
function sWAP(obj)
{
	openWindow(obj.href, 350, 530, 'wap');
	return false;
}
function setRateFrame(id)
{
	try
	{
		var obj=$('rtFrame');
		if(obj.src) return;

		var d=new Date();
		obj.src='/module/rate/'+id+'&'+d.getTime();
	}
	catch(e){}
}
function confirmDelete(obj, lnk)
{
	if(!confirm('Вы действительно хотите удалить?')) return false;

	if(!lnk) return;
	submitSysForm(lnk);
	obj.disabled=true;
}
function stopAnimImg(id)
{
	try
	{
		clearInterval(ListAnimImg[id].run);
		ListAnimImg[id].run=animImgId=0;
	}
	catch(e){}

}
function runAnimImg(id, res)
{
	var A=ListAnimImg[id];
	var obj=A.obj;

	if(res)
	{
		clearInterval(A.run);
		A.run=setInterval(function (){runAnimImg(id)}, 1200);
	}

	if(obj.style.backgroundImage!='none' || window.isDeleyWheel)
	{
		try
		{
			obj.fireEvent('onmouseout');
		}catch(_e){}

		return;
	}
	if(A.i >= A.count) A.i=0;

	var i=++A.i;
	if((!A[i]) || !A[i].is)
	{
		var c=i
		for(var x=0; c<=A.count && x<2; c++)
		{
			x++;
			A[c]=new Image();
			A[c].src=A.srcStart+c+A.srcEnd;
		}
	}
	else if(!A[i].complete){A.i--;obj.onload='runAnimImg('+id+',1)';obj.onerror='runAnimImg('+id+',1)';return;}

	A[i].is=1;
	if(obj.onload) obj.onload='';
	obj.src=A[i].src;

	try
	{
		A.link.hash='#f'+i;
	}
	catch(_e){}

}
function animImg(id, obj, cf, is)
{
	if(cf==1 || window.isDeleyWheel) return;
	if(!window.ListAnimImg)	window.ListAnimImg=new Object();
	if(!ListAnimImg[id])	ListAnimImg[id]=new Object();

	var A=ListAnimImg[id];
	if(A.run) return;
	if(window.animImgId) stopAnimImg(animImgId)
	window.animImgId=id;

	if(!A.count)
	{
		if(obj.src.indexOf('.gif')!=-1) return;
		if(obj.onload) obj.onload='';
		if(obj.onerror) obj.onerror=function(){runAnimImg(id);};

		A.count=cf;
		var s=obj.src
		A.srcStart=s.substr(0, s.lastIndexOf('/')+1);
		A.i=parseInt(s.substr(A.srcStart.length));
		A.srcEnd=s.substr(s.lastIndexOf('.'));
		A.link=obj.parentNode;
	}

	A.obj=obj;
	A.run=setInterval(function (){runAnimImg(id)}, 1200);
	if(is) runAnimImg(id);
}
function menuFriends(phone, title, arg)
{
	var str='';
	var cL=arg.length-1;
	var id,nm,cf,mf,rf,freal,i=1

	while(i<cL)
	{
		id=arg[i++]
		nm=arg[i++]
		mf=arg[i++]
		cf=arg[i++]
		rf=arg[i++]
		freal=arg[i++]
		str+='<A href="/prostitutes/'+id+'/" class=me2 onmouseover="showPop(event,this,'+id+','+mf+','+cf+','+rf+','+freal+')" onmouseout="hidePop()">'+nm+'</A> '
	}

	str='<DIV class=tmen><DIV class=mh><A href="@q=0'+phone+'">'+title+'</a></DIV><DIV class=mh2>'+str+'</DIV></DIV>';
	str+='<a href=# HIDEFOCUS id=popLink class=popM onmouseover="clearTimeout(oPopTimer);oLinkFrend.backgroundColor=\'white\';animImg(idFotoProfile,oPopImg,countFotoProfile)" onmouseout="hidePop();oLinkFrend.backgroundColor=\'\';stopAnimImg(idFotoProfile)"><img src="/data/img/1.gif" alt="" id=popImg style="width:140px;height:160px;	border:1px solid white;background-image:none"><img src="/data/img/real.png" id="realFotoFnd" class=chkFt style="display:none;margin-top:-23px;margin-left:119px" alt="" title="'+((LNG)? 'Real photo':'Фото проверенно')+'"></a>';
	document.write(str);
	str='';

	window.oPopTimer=0;
	window.ListFriends=arg;
	window.myImages=new Object();
	window.oPopImg=$('popImg');
	window.oPopLink=$('popLink');
	window.oRealFotoFnd=$('realFotoFnd').style;
}
function menuFilter(cFil, nSort, isDesc, isList)
{
	var i,t,v,vT;
	window.curSort=nSort;
	window.MenuItemsFilter={0:0};

	if(LNG)
	{
		var Params={'-age':'by Age','bust':'by Bust','-price':'by Price','hit':'by Date','':'by Rating','phone':'by Phone','height':'by Height','-weight':'by Weight'}
	}
	else
	{
		var Params={'hit':'По Дате','-price':'По Цене','-weight':'По Весу','height':'По Росту','bust':'По Груди','':'По Рейтингу','-age':'По Возрасту','phone':'По Телефону'}
	}

	var cSort=(Params[nSort])? nSort: '-'+nSort;
	t=Params[cSort]

	if(cSort)
	{
		if(isDesc) var alt=(LNG)? 'Descending':'По убыванию';
		else  var alt=(LNG)? 'Ascending':'По возрастанию';

		t='<SPAN style="color:#B30300">'+t+'</SPAN>'
		var str=' onclick="setSearch(-1,\''+(isDesc? '-':'')+nSort+'\')" onmouseover="this.style.backgroundColor=\'#E7E9ED\'"  onmouseout="this.style.backgroundColor=\'white\'" title="&nbsp;'+alt+'&nbsp;"';
	}
	else var str='onclick="this.nextSibling.onclick()"'

	delete(Params[cSort]);

	str='<DIV class=tmen oncontextmenu="return false" onselectstart="return false"><DIV class=mh>'+((LNG)? 'SORTING':'СОРТИРОВАТЬ')+'</DIV><DIV class=mh2 style="padding-top:10px;padding-bottom:12px;"><DIV class="icRw" style="background-image:url(/data/img/'+(isDesc? 'desc.gif)':'asc.gif);background-position:16px 7px')+'"'+str+'></DIV><DIV class=mea style="color:#222731;padding-top:2px;padding-bottom:2px;" onclick='+((isList)? 'itemsFilterShow(this,0)':'location.href="./"')+'>'+t+'</DIV><DIV class=mep style=padding-top:3px;margin-bottom:0px>'

	for(i in Params)
	{
		str+='<LABEL class=lebF onclick="setSearch(-1,\''+i+'\')" onmouseover=\'with(this.style){color="white";backgroundColor="#B30300"}\' onmouseout=\'with(this.style){color="#222731";backgroundColor="white"}\'>'+Params[i]+'</LABEL>';
	}

	str+='</DIV></DIV></DIV><DIV class=tmen oncontextmenu="return false" onselectstart="return false"><DIV class=mh>'+((LNG)? 'SELECT':'ВЫБРАТЬ')+'</DIV><DIV class=mh2>';

	if(LNG)
	{
		Params={	0:{0:{	1:{'txt':'Teen','title':'18 - 25 years'},
					2:{'txt':'Girls','title':'25 - 30 years'},
					3:{'txt':'Women','title':'30 years +'}}, 1:2, 2:'By Age', 3:'age'},

			1:{0:{	1:{'txt':'Small','title':'1 - 2 размер'},
					2:{'txt':'Average','title':'2 - 3 размер'},
					3:{'txt':'Large','title':'3 размер +'}}, 1:3, 2:'By Bust', 3:'bust'},

			2:{0:{	1:{'txt':'Cheap','title':'300-500 UAH'},
					2:{'txt':'Average','title':'400-800 UAH'},
					3:{'txt':'Expensive','title':'800 UAH +'},
					4:{'txt':'VIP','title':'1000 UAH +'}}, 1:1, 2:'By Price', 3:'price'},

			3:{0:{	1:{'txt':'Low','title':'160 - 165 sm'},
					2:{'txt':'Average','title':'165 - 173 sm'},
					3:{'txt':'High','title':'173 sm +'}}, 1:6, 2:'By Height', 3:'height'},

			4:{0:{	1:{'txt':'Slender','title':'40 - 50kg'},
					2:{'txt':'Average','title':'50 - 60kg'},
					3:{'txt':'Thick','title':'60 kg +'}}, 1:7, 2:'By Weight', 3:'weight'},

			5:{0:{	1:{'txt':'Lesbos'},
					2:{'txt':'Strap'},
					3:{'txt':'Anal'},
					4:{'txt':'Group Sex'},
					5:{'txt':'Family Couples'}}, 1:4, 2:'By Service'},

			6:{0:{
					'01':{'txt':'Center'},
					'03':{'txt':'Podol'},
					'06':{'txt':'Dnipro'},
					'08':{'txt':'Obolon'},
					'09':{'txt':'Darnitsa'},
					'02':{'txt':'Pechersk'},
					'07':{'txt':'Holosiivskyi'},
					'010':{'txt':'Desnianskyi'},
					'05':{'txt':'Solomensky'},
					'04':{'txt':'Shevchenko'},
					'011':{'txt':'Svyatoshinsky'}}, 1:5, 2:'By Address'}};
	}
	else
	{
		Params={	0:{0:{	1:{'txt':'Доступные','title':'300 - 400 грн'},
					2:{'txt':'Недорогие','title':'400 - 800 грн'},
					3:{'txt':'Дорогие','title':'800 грн +'},
					4:{'txt':'VIP','title':'1000 грн +'}}, 1:1, 2:'По Цене', 3:'price'},

			1:{0:{	1:{'txt':'Стройные','title':'40 - 50 кг'},
					2:{'txt':'Средние','title':'50 - 60 кг'},
					3:{'txt':'Полные','title':'60 кг +'}}, 1:7, 2:'По Весу', 3:'weight'},

			2:{0:{	1:{'txt':'Низкие','title':'160 - 165 см'},
					2:{'txt':'Средние','title':'165 - 173 см'},
					3:{'txt':'Высокие','title':'173 см +'}}, 1:6, 2:'По Росту', 3:'height'},

			3:{0:{	1:{'txt':'Маленькие','title':'1 - 2 размер'},
					2:{'txt':'Средние','title':'2 - 3 размер'},
					3:{'txt':'Большие','title':'3 размер +'}}, 1:3, 2:'По Груди', 3:'bust'},

			4:{0:{	'01':{'txt':'Центр'},
					'02':{'txt':'Печерский'},
					'09':{'txt':'Дарницкий'},
					'010':{'txt':'Деснянский'},
					'03':{'txt':'Подольский'},
					'08':{'txt':'Оболонский'},
					'05':{'txt':'Соломенский'},
					'06':{'txt':'Днепровский'},
					'07':{'txt':'Голосеевский'},
					'011':{'txt':'Святошинский'},
					'04':{'txt':'Шевченковский'}}, 1:5, 2:'По Адресу', 3:''},

			5:{0:{	1:{'txt':'Лесбос'},
					2:{'txt':'Страпон'},
					3:{'txt':'Анальный'},
					4:{'txt':'Групповой секс'},
					5:{'txt':'Семейным парам'}}, 1:4, 2:'По Услугам', 3:''},

			6:{0:{	1:{'txt':'Девочки','title':'18 - 25 лет'},
					2:{'txt':'Девушки','title':'25 - 30 лет'},
					3:{'txt':'Женщины','title':'30 лет +'}}, 1:2, 2:'По Возрасту', 3:'age'}};
	}

	for(n in Params)
	{
		i=Params[n][1];

		cSort=Params[n][3];

		if(nSort)
		{
			if(nSort==cSort)
			{
				cSort=',0';
				cFil[i]=1;
			}
			else cSort='';
		}
		else cSort=(cSort)? ",'"+cSort+"'" : '';
		if(cFil[i])	MenuItemsFilter[i]=Params[n][3] || 1;

		str+='<DIV class=mef'+(cFil[i]? ' style="color:#b30300;background-color:white;margin-top:-1px;border:1px solid #cecece;border-left:none;border-bottom-right-radius:0px"':'')+' onclick="itemsFilterShow(this,'+i+cSort+')"'+(cFil[i]? '':' onmouseover=this.style.backgroundColor="white" onmouseout=\'if(!MenuItemsFilter['+i+'])this.style.backgroundColor="#E7E9ED"\'')+'>'+Params[n][2]+'</DIV><DIV class="mep"'+(cFil[i]? ' style="display:block"':'')+'>'

		cSort=(nSort && cSort)? 1:null;

		t=Params[n][0];

		for(v in t)
		{
			vT=t[v]
			v=parseInt(v,10);
			str+='<LABEL for="chFilter'+i+'_'+v+'" class="lebF"'+(cFil[i+'_'+v]? ' style="color:white;background-color:#B30300"':'')+' onmouseover="itemFilterOver(this)" onmouseout="itemFilterOut(this.style,this.firstChild)"><INPUT type="checkbox" id="chFilter'+i+'_'+v+'" name="chFilter'+i+'" value='+v+(cFil[i+'_'+v]? ' checked':'')+' onclick="setSearch('+i+',this.value,'+cSort+',this.checked);this.checked=!this.checked" style="margin-bottom:3px"><SPAN style="margin-left:6px">'+vT.txt+((vT.title)? '<DIV class=lebH>'+vT.title+'</DIV>' : '')+'</SPAN></LABEL>';
		}
		str+='</DIV>';
	}

	str+='</DIV></DIV>';

	document.write(str);
}
function itemFilterOver(s)
{
	s.style.color='white';
	s.style.backgroundColor='#B30300';
	//s.style.boxShadow='0px 1px 7px 1px #555';
}
function itemFilterOut(s, chk)
{
	//s.boxShadow='none';
	if(chk.checked) return;
	s.color='#222731';
	s.backgroundColor='white';
}
function itemsFilterShow(oM, n, sSort)
{
	var obj=oM.nextSibling;
	var s=MenuItemsFilter[n];

	if(s)
	{
		obj.style.display='none'
		MenuItemsFilter[n]=0;

		with(oM.style)
		{
			if(n) border='none';
			marginTop='0px';
			color='#222731';
			borderBottomRightRadius='10px';
		}

		var lstChk=obj.getElementsByTagName('INPUT');
		for(var isChk,i=0; i<lstChk.length; i++)
		{
			if(lstChk[i].checked)
			{
				isChk=true;
				lstChk[i].checked=false;
				try{lstChk[i].parentNode.onmouseout();}catch(e){}
			}
		}

		if(sSort != null)
		{
			for(i in MenuItemsFilter)
			{
				isChk=MenuItemsFilter[i];
				if(!isChk || isChk==1) continue;
				sSort=isChk;
				break;
			}
			isChk=1;
		}

		if(isChk)	return setSearch(n, null, sSort);
	}
	else
	{
		obj.style.display='block'
		with(oM.style)
		{
			color='#B30300';
			if(n){marginTop='-1px';border='1px solid #CECECE';}
			borderLeft='none';
			borderBottomRightRadius='0px';
		}

		MenuItemsFilter[n]=1;
	}

	if(sSort != null)	setSearch(n, null, sSort)
}
function showPop(e, obj, id, m, cf, rf, freal)
{
	if(oPopTimer)
	{
		clearTimeout(oPopTimer);
		oPopTimer=0;
		if(id == idFotoProfile) return;
		else if(idFotoProfile)	hidePop('hide');
	}

	window.oLinkFrend=obj.style;

	if (e.preventDefault)
	{
		e.preventDefault();
		e.stopPropagation();
	}
	else
	{
		e.cancelBubble=true;
		e.returnValue=false;
	}

	var x=200;
	var y=e.clientY+getScrollTop();
	y-=isNaN(e.offsetY)? (e.layerY) : (e.offsetY);

	if(!myImages[id])
	{
		myImages[id]=new Image();
		var i=1;
		if(rf) i=getRFoto(cf);
		myImages[id].src='/prostitutes/'+id+'/'+i+'.jpg?'+m;
	}
	oPopImg.src=myImages[id].src;

	oPopLink.style.left=x+'px';
	oPopLink.style.top=y+'px';
	oPopLink.href='/prostitutes/'+id;

	window.idFotoProfile=id;
	window.countFotoProfile=cf;

	if(freal) oRealFotoFnd.display='block';
	oPopLink.style.display='block';
	makeRFoto();
}
function hidePop(s)
{
	if(s == 'hide')
	{
		oPopLink.style.display='none';
		oRealFotoFnd.display='none';
		oPopImg.src='/data/img/1.gif';
		idFotoProfile=0
	}
	else	oPopTimer=setTimeout(function (){hidePop('hide')}, 240)
}

function BannerLeft()
{
	if(document.cookie.indexOf('PHPSESSID=')!=-1) return;
	var str='Your AD here';
	document.write('<DIV align=center>'+str+'</DIV>');
}

function BannerRight()
{
	var d=new Date();
	if(!parseInt(d.getHours()))
		document.write('<script src="?time&'+d.getDate()+'"></script>');
}
function BlockRight(s)
{
	if(s || minScreen<800) document.write('<DIV style="padding:10px"></DIV>');
	else
		document.write('<br><a href=/prostitutes/4591/ title="Выбор купидона" target=_blank HIDEFOCUS><img src="/data/img/pam.jpg" hspace=15 width=133 height=212></a><br><br><img src="/data/img/cc.jpg" vspace=20 width=175 height=131><br><img src="/data/img/cc.jpg" vspace=55 width=175 height=131><br><img src="/data/img/cc.jpg" vspace=20 width=175 height=131>');
	if(document.cookie.indexOf('PHPSESSID=')==-1)	BannerRight();
}
function pasteCounter()
{
	var s='<!--counter1-->';
	s+='<!--counter2-->';
	document.write('<DIV style="DISPLAY:none">'+s+'</DIV>');
}
