
var clX=0;var clY=0;var topMenuCount=7;var leftMenu=10;var clickedPage=1;var activePage=1;var firstLoad=true;function $(id)
{return document.getElementById(id);}
var newsDetail=1;var newsScrolling=null;var newsScrollStep=0;var newsShow=5;var newsBFoto;function rightClick(e)
{var targ;if(!e)var e=window.event;if(e.target)targ=e.target;else if(e.srcElement)targ=e.srcElement;if(targ.nodeType==3)targ=targ.parentNode;var tname;tname=targ.tagName;alert(e.button);}
var scrollTime=null;function findObjPos(obj)
{var curleft=curtop=0;if(obj.offsetParent)
{do
{curleft+=obj.offsetLeft;curtop+=obj.offsetTop;}while(obj=obj.offsetParent);return curtop;}}
function scrollDiv(div)
{if(div!=null)
{var top=findObjPos(div);var width=div.style.width;var height=div.style.height.replace("px","");switch(div.id)
{case"divItemDetailFotos":case"divChapters":case"newsFoto":case"infoText":if(clY<(top+(height/4)))
{div.scrollTop-=2;}
else
{if(clY>(top+(3*height/4)))
{div.scrollTop+=2;}}
break;}
clearTimeout(scrollTime);scrollTime=setTimeout("scrollDiv($('"+div.id+"'))",20);}
else
{clearTimeout(scrollTime);}}
function newsActionClick()
{if($("newsAction").style.display=="none")
{if($('newsText').style.display=="block")
{myFade('newsText',0.8,-0.1,0,'$(\"newsText\").style.display=\"none\";$(\"newsAction\").style.display=\"block\";myFade(\"newsAction\",0.1, 0.1, 1,\"\");');}
if($('newsBigFoto').style.display=="block")
{myFade('newsBigFoto',0.8,-0.1,0,'$(\"imgNewsFoto\").src=\"\";$(\"newsBigFoto\").style.display=\"none\";newsBFoto = null;$(\"newsAction\").style.display=\"block\";myFade(\"newsAction\",0.1, 0.1, 1,\"\");');}}
else
{myFade('newsAction',0.8,-0.1,0,'$(\"newsAction\").style.display=\"none\";$(\"imgNewsFoto\").src=\"\";$(\"newsBigFoto\").style.display=\"none\";newsBFoto = null;$(\"newsText\").style.display=\"block\";myFade(\"newsText\",0.1, 0.1, 1,\"\");');}}
function setDetailNewsBigFoto()
{if((newsBFoto!=null)&&(newsBFoto.complete))
{$("imgNewsFoto").src=newsBFoto.src;$("imgNewsFoto").style.width=newsBFoto.width+"px";$("imgNewsFoto").style.height=newsBFoto.height+"px";newsBFoto=null;$('newsText').style.display="none";$('newsAction').style.display="none";$('newsBigFoto').style.display="block";if(parseInt($('imgNewsFoto').height.toString().replace("px",""))>parseInt($('newsBigFoto').style.height.toString().replace("px","")))
{var height=parseInt($('newsBigFoto').style.height.toString().replace("px",""))-3;$('imgNewsFoto').style.height=height.toString()+"px";}
myFade('newsBigFoto',0.1,0.1,1,'');}
else
{setTimeout("setDetailNewsBigFoto()",50);}}
function detailNewsFotoClick(src)
{if((src!=null)&&($('imgNewsFoto').src.toString().indexOf(src)==-1))
{newsBFoto=new Image();newsBFoto.src=src;if($('newsText').style.display=="none")
{myFade('newsBigFoto',0.8,-0.1,0,'setDetailNewsBigFoto();');}
else
{myFade('newsText',0.8,-0.1,0,'setDetailNewsBigFoto();');}}
else
{myFade('newsBigFoto',0.8,-0.1,0,'$(\"imgNewsFoto\").src=\"\";$(\"newsBigFoto\").style.display=\"none\";newsBFoto = null;$(\"newsText\").style.display=\"block\";myFade(\"newsText\",0.1, 0.1, 1,\"\");');}}
function newsShowClick(val)
{newsShow=val;SwitchPage(2,val,null,null);}
function newsScroll()
{if((newsScrollStep!=0)&&(!lockAll))
{$('divNews').scrollLeft=$('divNews').scrollLeft+newsScrollStep;newsScrolling=setTimeout("newsScroll()",1);}
else
{newsScrolling=null;}}
function newsTryScroll()
{var tab=screen.width/10;if(clX<tab*3)
{newsScrollStep=-((tab*3-clX)/20);}
else
{if(clX>screen.width-tab*3)
{newsScrollStep=((tab*3-(screen.width-clX))/20);}
else
{newsScrollStep=0;}}
if((newsScrollStep!=0)&&(newsScrolling==null))
{newsScrolling=setTimeout("newsScroll()",1);}}
function saveClientPos(e)
{if(!e)var e=window.event;if(e.pageX||e.pageY)
{clX=e.pageX;clY=e.pageY;}
else if(e.clientX||e.clientY)
{clX=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;clY=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;}}
function setMouseCheck(val)
{if(val)
{document.onmousemove=function(event)
{saveClientPos(event||window.event);}}
else
{document.onmousemove=null;}}
var moveTimeOut=new Array(topMenuCount+1);function moveVertical(id,time,step,top,zindex,endAction)
{window.clearTimeout(moveTimeOut[id]);obj=$(id);obj.style.top=parseInt(obj.style.top.replace("px",""))+parseInt(step)+"px";if(((step<0)&&(parseInt(obj.style.top.toString().replace("px",""))>top))||((step>0)&&(parseInt(obj.style.top.toString().replace("px",""))<top)))
{moveTimeOut[id]=setTimeout("moveVertical('"+id+"',"+time+","+step+","+top+", "+zindex+", \""+endAction+"\")",time);}
else
{obj.style.top=top+"px";if(zindex!=-1)
{obj.style.zIndex=zindex;}
if(endAction!="")
{setTimeout(endAction,0);}}}
function setTopMenuImages()
{var loaded=true;for(var i=1;((i<=topMenuCount)&&(loaded));i++)
{for(var j=1;((j<4)&&(loaded));j++)
{if(!topMenuImages[i-1][j-1].complete)
{loaded=false;}}}
if(loaded)
{for(var i=1;((i<=topMenuCount)&&(loaded));i++)
{for(var j=1;((j<4)&&(loaded));j++)
{$("menu"+i.toString()+j.toString()).src=topMenuImages[i-1][j-1].src;$("menu"+i.toString()+j.toString()).width=topMenuImages[i-1][j-1].width;}}
firstStart();}
else
{setTimeout("setTopMenuImages()",50);}}
var topMenuImages=new Array(topMenuCount);function onFirstLoad()
{var name="";for(var i=1;i<=topMenuCount;i++)
{switch(i)
{case 1:name="main";break;case 2:name="news";break;case 3:name="galery";break;case 4:name="contact";break;case 5:name="info";break;case 6:name="guest";break;case pageFriends:name="ssilki";break;}
topMenuImages[i-1]=new Array(3);for(var j=1;j<4;j++)
{topMenuImages[i-1][j-1]=new Image();topMenuImages[i-1][j-1].src="pic/menu/"+name+j+".gif";}}
var strConfig=getCookie("oConfig");if(strConfig!=null)
oConfig.setData(strConfig);setTopMenuImages();}
function firstStart()
{var hash=window.location.hash.replace("#","");var search=window.location.search.replace("?","");if((hash.length==0)&&(search.length>0))
{window.location.hash=search;}
if(isIE)
{if(window.location.hash.length==0)
{window.location.hash="p=1";}
$("pagingIFR").src="paging.php?"+window.location.hash.replace("#","");}
else
{currentHASH=window.location.hash;reloadHASH();}
timerHASH=setTimeout("checkHASH()",500);}
function startMenu()
{$("menu").style.top=topDownMenu-1;for(i=1;i<=topMenuCount;i++)
{for(j=1;j<=3;j++)
{$("menu"+i+j).style.top=topDownMenu+"px";if(i==1)
{$("menu"+i+j).style.left=leftMenu+"px";}
else
{tmp=i-1;$("menu"+i+j).style.left=parseInt($("menu"+tmp+j).style.left.replace("px",""))+$("menu"+tmp+j).width+leftMenu+"px";}
$("menu"+i+j).style.visibility="visible";}}
var time=0;var clPage=parseInt(clickedPage.toString().charAt(0));for(i=1;i<=topMenuCount;i++)
{if(clPage==i)
{setTimeout("setMenuBG('"+$('menu'+i+'3').style.left+"', "+$('menu'+i+'3').width+"); moveVertical('menu"+i+"3', 1, -4, "+topUpMenu+", 110,'hideMenuBG();')",time+=200);}
else
{setTimeout("moveVertical('menu"+i+"1', 20, -4, "+topUpMenu+", -1, '')",time+=200);}}}
var menuClick=false;function changeStatus(clI,from,to,needSwitch)
{var i=clI.toString().substring(0,1);if(!((from==2)&&(to==1)&&(menuClick)))
{endAction="";if(to==2)
{setMouseCheck(true);endAction="checkMousePos("+i+")";}
if(to==3)
{menuClick=true;clickedPage=clI;for(var j=1;j<=topMenuCount;j++)
{if(parseInt($("menu"+j+"3").style.top.toString().replace("px",""))==topUpMenu)
{endAction="changeStatus("+j+", 3, 1, "+needSwitch+");";}}
zindex=110;}
else
{zindex=40;}
if(from==3)
{setMenuBG($('menu'+i+from).style.left,$('menu'+i+from).width);setZindex('menu'+i+from,60);if(needSwitch)
moveVertical("menu"+i+from,1,+4,topDownMenu,-1,"menuClick=false; hideMenuBG(); moveVertical('menu"+i+to+"', 1, -4, "+topUpMenu+", "+zindex+",'"+endAction+"');SwitchPage("+clickedPage+",null,null,null);");else
moveVertical("menu"+i+from,1,+4,topDownMenu,-1,"menuClick=false; hideMenuBG(); moveVertical('menu"+i+to+"', 1, -4, "+topUpMenu+", "+zindex+",'"+endAction+"');");}
else
{if((to==3)&&(!lockAll))
{moveVertical("menu"+i+from,1,+4,topDownMenu,-1,"menuClick=false; setMenuBG('"+$('menu'+i+to).style.left+"', "+$('menu'+i+to).width+"); moveVertical('menu"+i+to+"', 1, -6, "+topUpMenu+", "+zindex+",'hideMenuBG();"+endAction+"')");}
else
{moveVertical("menu"+i+from,1,+4,topDownMenu,-1,"menuClick=false; moveVertical('menu"+i+to+"', 1, -4, "+topUpMenu+", "+zindex+",'"+endAction+"')");}}}}
function hideMenuBG()
{$("menu").style.display="none";}
function setMenuBG(left,width)
{$("menu").style.left=parseInt(left.replace("px",""))+6;$("menu").width=width-18;$("menu").style.zIndex=150;$("menu").style.display="block";}
function setZindex(id,index)
{$(id).style.zIndex=index;}
function checkMousePos(i)
{var left=parseInt($("menu"+i+"2").style.left.replace("px",""));var right=left+parseInt($("menu"+i+"2").width);if((clX<left)||(clX>right)||(clY<topUpMenu)||(clY>topDownMenu-6))
{setTimeout("changeStatus("+i+", 2, 1, true)",100);}
if(activePage!=2)
{setMouseCheck(false);}}
function myFade(id,op,step,top,action)
{if($(id)!=null)
{setElementOpacity($(id),op);if(op==0)
{$(id).style.visibility="hidden";}
else
{$(id).style.visibility="visible";}
if(((step>0)&&(op<top))||((step<0)&&(op>0)))
{op=op+step;setTimeout("myFade('"+id+"',"+op+","+step+","+top+",'"+action+"')",17);}
else
{if(action!='')
{setTimeout(action,0);}}}
else
{if(action!='')
{setTimeout(action,0);}}}
function setSmallLoader(obj,w,h)
{obj.innerHTML="<table width='"+w.toString()+"px' height='"+h.toString()+"px' class='topborder'><tr><td><img src='pic/loaderSmall.gif'><br>загрузка</td></tr></table>";}
function switchBigLoader(on)
{if(on)
{$("loaderPer").innerHTML="0%";$("mainwindow").style.visibility="hidden";$("loaderBig").style.visibility="visible";}
else
{$("loaderPer").innerHTML="100%";$("mainwindow").style.visibility="visible";$("loaderBig").style.visibility="hidden";}}
function indexItemClick(id)
{if(!lockAll)
SwitchPage(31,null,id,null);}
function toMain()
{if((!lockAll)&&(activePage!=1))
SwitchPage(1,null,null,null);}
function setVote()
{var vote=0;for(var i=1;(i<6)&&(vote==0);i++)
{if($("quest"+i)!=null)
{if($("quest"+i).checked)
{vote=i;}}}
if(vote!=0)
{setSmallLoader($("voteTable"),150,328);CallBack("setVote",vote);}}
var ua=navigator.userAgent.toLowerCase();var isIE=(ua.indexOf("msie")!=-1&&ua.indexOf("opera")==-1&&ua.indexOf("webtv")==-1);var isGecko=((ua.indexOf("gecko")!=-1)&&(ua.indexOf("safari")==-1));var isOpera=(ua.indexOf("opera")!=-1);var isSafari=(ua.indexOf("safari")!=-1);function beginRegistry(v,top,on)
{if(on)
{$('tdIntro').style.display='none';if(isGecko)
{setTimeout("$('tdLogin').colSpan=2;$('tdLogin').setAttribute('colSpan',2);$('light0').style.left='-306px';regWidth("+v+", "+top+", "+on+");",2);}
else
{$('tdLogin').colSpan=2;$('tdLogin').setAttribute('colSpan',2);regWidth(v,top,on);}}
else
{$('tdLogin').colSpan=1;$('tdLogin').setAttribute('colSpan',1);$('light0').style.left=0;try{$('tdIntro').style.display='table-cell';}
catch(err){$('tdIntro').style.display='block';}}}
function regWidth(v,top,on)
{if(!isIE)
{tmp=v/2-400+5;$("light0").style.left=tmp.toString()+"px";}
$("login1").style.width=v+"px";$("loginw2").style.width=v+8+"px";$("loginw3").style.width=v+1+"px";if(on)
v=v+30;else
v=v-30;if(((on)&&(v<top))||((!on)&&(v>top)))
{setTimeout("regWidth("+v+", "+top+", "+on+")",10);}
else
{$("login1").style.width=top+"px";$("loginw2").style.width=top+8+"px";$("loginw3").style.width=top+1+"px";if(!isIE)
{$("light0").style.left=top/2-400+5+"px";}
if(!on)
{beginRegistry(null,null,false);}
finishedMove=true;}}
function mainIntroClick(open)
{if(open)
{myFade('light3',0.8,-0.1,0,'');setTimeout("myFade('light4', 0.8, -0.1, 0, 'beginMoveIntro("+open.toString()+");')",200);}
else
{myFade('light4',0.3,0.1,1,'');setTimeout("myFade('light3', 0.3, 0.1, 1, '');",200);}}
function beginMoveIntro(open)
{if(open)
{if($("regBtn")!=null)$("regBtn").style.visibility='hidden';$("tdNews").style.display='none';$("tdItems").style.display='none';$("tdIntro").setAttribute('rowSpan',3);$("tdIntro").rowSpan=3;$("aIntro").innerHTML="свернуть";$("aIntro").href="javascript:moveIntro(false);";moveIntro(open);}
else
{if($("regBtn")!=null)$("regBtn").style.visibility='visible';$("tdIntro").setAttribute('rowSpan',1);$("tdIntro").rowSpan=1;try{$('tdNews').style.display='table-cell';}
catch(err){$('tdNews').style.display='block';}
try{$('tdItems').style.display='table-cell';}
catch(err){$('tdItems').style.display='block';}
$("aIntro").innerHTML="подробнее";$("aIntro").href="javascript:mainIntroClick(true);";mainIntroClick(open);}}
function moveIntro(open)
{var step=-35;var top=110;if(open)
{step=35;top=495;}
if(((open)&&(parseInt($("introText").style.height.replace("px",""))<top))||((!open)&&(parseInt($("introText").style.height.replace("px",""))>top)))
{$("introText").style.height=(parseInt($("introText").style.height.replace("px",""))+step)+"px";$("introh3").style.height=(parseInt($("introh3").style.height.replace("px",""))+step)+"px";setTimeout("moveIntro("+open.toString()+")",40);}
else
{if(!open)beginMoveIntro(open);}}
var tdLoginTableHTML="";var tdLoginTableVisible=true;var finishedMove=true;var tdInfoVisible=true;function login()
{myFade('login1',0.8,-0.1,0,'tdLoginTableVisible=false');CallBack("login",null);}
function logoutClick()
{myFade('login1',0.8,-0.1,0,'tdLoginTableVisible=false');CallBack("logout",null);}
function regClick()
{myFade('login1',0.8,-0.1,0,'tdLoginTableVisible=false');CallBack("getRegTable",null);finishedMove=false;tdInfoVisible=false;myFade('light1',0.8,-0.1,0,"clearLoginTable(); beginRegistry(200,780, true);");}
function closeRegClick()
{CallBack("getLoginTable",null);finishedMove=false;myFade('login1',0.8,-0.1,0,'clearLoginTable(); tdLoginTableVisible=false; regWidth(780,180, false);');}
function clearLoginTable()
{$("tdLoginTable").innerHTML="";}
function setLoginTable()
{if((!tdLoginTableVisible)&&(finishedMove))
{$("tdLoginTable").innerHTML=tdLoginTableHTML;tdLoginTableHTML="";setTimeout("myFade('login1',0.1, 0.1, 1,'tdLoginTableVisible=true;');",10);if(!tdInfoVisible)
{setTimeout("myFade('light1',0.1, 0.1, 1,'tdInfoVisible=true;');",150);}}
else
{setTimeout("setLoginTable();",150);}}
function newRegClick()
{if($("login").value.toString().length>0)
{if($("email").value.toString().length>0)
{if($("pwd1").value.toString().length>0)
{if($("pwd2").value.toString().length>0)
{if($("pwd1").value==$("pwd2").value)
{CallBack("reg",null);}
else
{alert("Введеные пароли не совпадают.");}}
else
{alert("Повторите Пароль.");}}
else
{alert("Введите Пароль.");}}
else
{alert("Введите E-mail.");}}
else
{alert("Введите Имя Пользователя.");}}
function UserConfigClick()
{SwitchPage(11,null,null,null);}
function setLoginInputReadOnly(readonly)
{$('inLogin').readOnly=readonly;$('inName').readOnly=readonly;$('inFam').readOnly=readonly;$('inTel').readOnly=readonly;$('inWWW').readOnly=readonly;$('inEmail').readOnly=readonly;$('inICQ').readOnly=readonly;$('inSkype').readOnly=readonly;$('inAdr').readOnly=readonly;var className;if(readonly)
{className="lockInput";}
else
{className="unlockInput";}
$('inLogin').className=className;$('inName').className=className;$('inFam').className=className;$('inTel').className=className;$('inWWW').className=className;$('inEmail').className=className;$('inICQ').className=className;$('inSkype').className=className;$('inAdr').className=className;}
function changeLoginPwd()
{var currPwd=window.prompt("Введите Ваш текущий пароль:","");if(currPwd!=null)
{var newPwd0=window.prompt("Введите Ваш новый пароль:","");if(newPwd0!=null)
{var newPwd1=window.prompt("Повторите Ваш новый пароль:","");if(newPwd1!=null)
{if(newPwd0==newPwd1)
{CallBack("changeLoginPwd",encodeURIComponent(currPwd)+"<separate>"+encodeURIComponent(newPwd0));}
else
{alert("Неверно введен новый пароль.");}}}}}
function changeLoginInfo()
{setLoginInputReadOnly(false);$('tdUserActions').innerHTML="<a href='javascript:cancelLoginInfo();'>отмена</a>&nbsp;&nbsp;&nbsp;<a href='javascript:saveLoginInfo();'>сохранить</a>";}
function cancelLoginInfo()
{setLoginInputReadOnly(true);$('tdUserActions').innerHTML="<a href='javascript:changeLoginPwd();'>изменить пароль</a>&nbsp;&nbsp;&nbsp;<a href='javascript:changeLoginInfo();'>изменить данные</a>";}
function saveLoginInfo()
{if($("inLogin").value.length>0)
{setLoginInputReadOnly(true);CallBack("saveLoginInfo",null);}
else
{alert("Поле Login не может быть пустым.");}}
var avatarIsLoading=false;function sendForm()
{if(!avatarIsLoading)
{if($("newAvatar").value.toString().length>0)
{if(!document.createElement)return;var form=$("avatarForm");form.setAttribute('target','ifAvatar');form.setAttribute('action','core.php');avatarIsLoading=true;$("imgUserAvatar").src="pic/loaderSmall.gif";form.submit();}
else
{alert("Не выбран файл. Для выбора файла нажмите на ссылку 'Выбрать файл'.");}}}
function sendComplete()
{var doc=getIFrameXML($("ifAvatar"));if(doc!=null)
{var result=doc.getElementById("result").innerHTML;if(result=="ok")
{useravatar=doc.getElementById("newFileAvatar").innerHTML;$("imgUserAvatar").src=useravatar;cancelAvChange();}
else
{alert(result);}
avatarIsLoading=false;}}
function getIFrameXML(iframe){var doc=iframe.contentDocument;if(!doc&&iframe.contentWindow)doc=iframe.contentWindow.document;if(!doc)doc=window.frames[iframe.id].document;if(!doc)return null;if(doc.location=="about:blank")return null;if(doc.XMLDocument)doc=doc.XMLDocument;return doc;}
function cancelAvChange()
{$('tdChangeAvatar').innerHTML="<a href='javascript:ChangeAvatar();'>изменить</a>";}
function clearAvatar()
{if(!avatarIsLoading)
{avatarIsLoading=true;$("imgUserAvatar").src="pic/loaderSmall.gif";CallBack("clearAvatar",null);cancelAvChange();}}
function ChangeAvatar()
{if(isGecko)
{$('tdChangeAvatar').innerHTML="<form id='avatarForm' method='post' enctype='multipart/form-data'><input type='hidden' name='type' value='setAvatar'><input type='file' id='newAvatar' width='64px' height='16px' style='width:60px;height:14px;cursor:pointer;position:relative;left:-154px;z-index:500;' name='uploadFile' onchange='sendForm();' onfocus='alert();'/><br><a href='javascript:clearAvatar();'>удалить</a><br><a href='javascript:cancelAvChange();'>отмена</a><br><a style='position:relative;top:-48px' href='javascript:;'>выбрать файл</a></form>";}
else
{if(isOpera)
{$('tdChangeAvatar').innerHTML="<form id='avatarForm' method='post' enctype='multipart/form-data'><input type='hidden' name='type' value='setAvatar'><input type='file' id='newAvatar' width='64px' height='16px' style='width:60px;height:14px;cursor:pointer;position:relative;z-index:500;' name='uploadFile' onchange='sendForm();' /><br><a href='javascript:clearAvatar();'>удалить</a><br><a href='javascript:cancelAvChange();'>отмена</a><br><a style='position:relative;top:-46px' href='javascript:;'>выбрать файл</a></form>";}
else
{if(isSafari)
{$('tdChangeAvatar').innerHTML="<form id='avatarForm' method='post' enctype='multipart/form-data'><input type='hidden' name='type' value='setAvatar'><input type='file' id='newAvatar' width='64px' height='16px' style='width:60px;height:14px;cursor:pointer;position:relative;z-index:500;' name='uploadFile' onchange='sendForm();' /><br><a href='javascript:clearAvatar();'>удалить</a><br><a href='javascript:cancelAvChange();'>отмена</a><br><a style='position:relative;top:-46px' href='javascript:;'>выбрать файл</a></form>";}
else
{$('tdChangeAvatar').innerHTML="<form id='avatarForm' method='post' enctype='multipart/form-data'><input type='hidden' name='type' value='setAvatar'><input type='file' id='newAvatar' width='64px' height='16px' style='width:60px;height:14px;cursor:pointer;position:relative;z-index:500;' name='uploadFile' onchange='sendForm();' /><br><a href='javascript:clearAvatar();'>удалить</a><br><a href='javascript:cancelAvChange();'>отмена</a><br><a style='position:relative;top:-48px' href='javascript:;'>выбрать файл</a></form>";}}}
setElementOpacity($("newAvatar"),0);}
function setCookie(name,value,days)
{if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else var expires="";document.cookie=name+"="+value+expires+"; path=/;";}
function getCookie(name)
{var nameEQ=name+"=";var ca=document.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(nameEQ)==0)return c.substring(nameEQ.length,c.length);}
return null;}