
function peidaValik(){document.getElementById('peidaValik').style.display='none';document.getElementById('naitaValik').style.display='';document.getElementById('iframe').style.display='none';}
function naitaValik(){document.getElementById('peidaValik').style.display='';document.getElementById('naitaValik').style.display='none';document.getElementById('iframe').style.display='';}
function moreSelections(){document.getElementById('moreSelections').style.display='none';document.getElementById('lessSelections').style.display='';document.getElementById('otherSelections').style.display='';document.getElementById('firstSearch').style.display='none';document.getElementById('secondSearch').style.display='';}
function lessSelections(){document.getElementById('moreSelections').style.display='';document.getElementById('lessSelections').style.display='none';document.getElementById('otherSelections').style.display='none';document.getElementById('secondSearch').style.display='none';document.getElementById('firstSearch').style.display='';}
var currentDropIdx='0';function dropDownGo(idx){var count=9;if(currentDropIdx!=idx){for(var i=1;i<=count;i++){document.getElementById('ddHead'+i).className='dropDownHeadOff';document.getElementById('ddContent'+i).style.display='none';document.getElementById('ddContent'+i).style.width='';}}
currentDropIdx=idx;var headId='ddHead'+idx;var contentId='ddContent'+idx;var headStatus=document.getElementById(headId).className;var ddStatus=document.getElementById(contentId).style.display;if(headStatus=='dropDownHeadOff'){document.getElementById(headId).className='dropDownHeadOn';}else{document.getElementById(headId).className='dropDownHeadOff';}
if(ddStatus=='none'){document.getElementById(contentId).style.display='';var headWidth=document.getElementById(headId).clientWidth;var contentWidth=document.getElementById(contentId).clientWidth;if(contentWidth<headWidth){document.getElementById(contentId).style.width=headWidth-4;}else{document.getElementById(contentId).style.width=contentWidth+2;}}else{document.getElementById(contentId).style.display='none';document.getElementById(contentId).style.width='';}}
function hiLite(cell){var row=cell.parentNode;var originalclass=row.className;row.className=originalclass+'Hover';}
function deLite(cell){var row=cell.parentNode;var newclass=row.className;row.className=newclass.replace(/Hover/,'');}
function getOnlineData(request,clist,statusbox)
{if(!clist){return true;}
var clst;clst=new Array();clst=clist.split(';;');updateControlColor('#AAAAAA',clst,statusbox);doRequest(request+(request.indexOf('?')>0?'&c=':'?c=')+new Date(),clst,statusbox,null);return true;}
function getOnlineData(request,clist,statusbox,caller)
{if(caller){if(caller.type=='button'){caller.disabled=true;}else{caller.style.display='none';}}
if(!clist){return true;}
var clst;clst=new Array();clst=clist.split(';;');updateControlColor('#AAAAAA',clst,statusbox);doRequest(request+(request.indexOf('?')>0?'&c=':'?c=')+new Date(),clst,statusbox,null);return true;}
function getOnlineData(request,clist,statusbox,caller,stind)
{if(caller){if(caller.type=='button'){caller.disabled=true;}else{caller.style.display='none';}}
if(!clist){return true;}
var clst;clst=new Array();clst=clist.split(';;');updateControlColor('#AAAAAA',clst,statusbox);doRequest(request+(request.indexOf('?')>0?'&c=':'?c=')+new Date(),clst,statusbox,stind);return true;}
function doRequest(url,clst,statusbox,stind)
{if(window.XMLHttpRequest){req=new XMLHttpRequest();}else if(window.ActiveXObject){req=new ActiveXObject("MSXML2.XMLHTTP.3.0")}
if(req!=undefined){req.onreadystatechange=function(){rqstDone(url,clst,statusbox,stind);};req.open("GET",url,true);req.send(null);}else{try{document.getElementById(statusbox).innerHTML="Error:\nYour browser does not support XMLHTTP.";}catch(ex){}}}
function rqstDone(url,clst,statusbox,stind){if(req.readyState==4){if(req.status==200){updateControls(req.responseText.split(';;'),clst,statusbox,stind);}else{try{document.getElementById(statusbox).innerHTML="rqst Error:\n"+req.status+"\n"+req.statusText;}catch(ex){}}}}
function updateControlColor(color,clst,statusbox)
{var c;c=new Array();var cf;cf=0;for(i=0;i<clst.length;i++)
{try{c=clst[i].split(';');cf=0;for(j=cf;j<c.length;j++)
{var ostyle;var o;if(c[j]!=''){o=document.getElementById(c[j]);}
if(o){o.style.color=color;}}}catch(ex){}}
try{document.getElementById(statusbox).style.display=''}catch(ex){}}
function updateControls(response,clst,statusbox,stind)
{var c;c=new Array();var v;v=new Array();var cf;cf=0;var vf;vf=0;var o;var showalert=false;if(!stind){var stind=new Array();}
if(stind.length==0){stind[0]='';stind[1]='';}
for(i=0;i<clst.length;i++)
{c=clst[i].split(';');for(j=0;j<response.length;j++)
{cf=0;vf=0;v=response[j].split(';');while(c[cf]==''&&cf<c.length){cf++;}
while(v[vf]==''&&vf<v.length){vf++;}
if(document.getElementById(c[cf]).value==v[vf])
{var dataok;dataok=true;for(k=1;k<9;k++){if(v[vf+k]=='undefined'||v[vf+k]==null||dataok!=true){dataok=false;}}
if(dataok==true)
{o=document.getElementById(c[cf+1]);if(o){o.innerHTML=v[vf+2];if(v[vf+3]>0){o.innerHTML+=stind[0];}if(v[vf+3]<0){o.innerHTML+=stind[1];}}
o=document.getElementById(c[cf+2]);if(o){o.innerHTML=v[vf+4];v[vf+4]=='null'?o.style.display='none':o.style.display='';}
o=document.getElementById(c[cf+3]);if(o){v[vf+4]=='null'?o.style.display='':o.style.display='none';}
o=document.getElementById(c[cf+4]);if(o){o.innerHTML=v[vf+6];if(v[vf+7]>0){o.innerHTML+=stind[0];}if(v[vf+7]<0){o.innerHTML+=stind[1];}}
o=document.getElementById(c[cf+5]);if(o){o.innerHTML=v[vf+8];}
if(v[vf+9]=="1"){showalert=true;}}}}}
o=document.getElementById('isChangedmsg');if(o&&showalert){o.style.display='';}
updateControlColor('',clst,statusbox);try{document.getElementById(statusbox).style.display='none';}catch(ex){}}
function currentParam(name,value,removeValue){pageParam(window.location.href,name,value,removeValue);}
function pageParam(url,name,value,removeValue){window.location=urlParam(url,name,value,removeValue);}
function currentParams(params){pageParams(window.location.href,params);}
function pageParams(url,params){window.location=urlParams(url,params);}
function urlParams(url,params){for(var i=0;i<params.length;i++){var value=params[i].value;if(value==undefined){var el=document.getElementById(params[i].element);if(el.type=="checkbox"){value=el.checked;}else{value=el.value;}}
var remove=params[i].remove;if(remove==undefined){remove=null;}
url=urlParam(url,params[i].name,value,remove);}
return url;}
function urlParam(url,name,value,removeValue){var ex=new RegExp("([\\?&]"+name+"=)[^&#]*");if(value===removeValue){var newUrl=url.replace(ex,"");var q=newUrl.indexOf("?");var a=newUrl.indexOf("&");if(q==-1&&a!=-1){return newUrl.substring(0,a)+"?"+newUrl.substring(a+1);}else{return newUrl;}}else{if(ex.exec(url)){return url.replace(ex,"$1"+encodeURIComponent(value));}else{var a=url.indexOf("#");var newUrl=url;var anchor="";if(a!=-1){newUrl=url.substring(0,a);anchor=url.substring(a);if(anchor==="#")anchor="";}
return newUrl+((newUrl.indexOf("?")==-1)?"?":"&")+name+"="+encodeURIComponent(value)+anchor;}}}
function fixTable(tableId){var table=document.getElementById(tableId);var rows=table.rows;var i;var lastVisible=0;var setEndRow=function(){if(rows[lastVisible].className===''||rows[lastVisible].className==null)
rows[lastVisible].className='endRow';};for(i=0;i<rows.length;i++){if(rows[i].className==='endRow')
rows[i].className=null;if(rows[i].cells.length>0&&i!=lastVisible&&rows[i].cells[0].tagName.toLowerCase()=='th')
setEndRow();if(rows[i].style.display!='none')
lastVisible=i;}
setEndRow();}
function LoadFragmentInToElement(target,rqsturl){if(window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();}
else if(window.ActiveXObject){xmlhttp=new ActiveXObject("MSXML2.XMLHTTP.3.0")}
if(xmlhttp){xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4)
if(xmlhttp.status==200){target.innerHTML=xmlhttp.responseText;}else{try{target.innerHTML="rqst Error:\n"+xmlhttp.status+"\n"+xmlhttp.statusText;}catch(ex){target.innerHTML=ex.message;}}}
xmlhttp.open("GET",rqsturl,true);if(window.XMLHttpRequest)
xmlhttp.send(null);else
xmlhttp.send();}
else{target.innerHTML="Error:\nYour browser does not support XMLHTTP.";}}