var engine,t,fog,fog_h,temp;var ts=Array();var session=ie_times=0;var tm=Array();var session=ie_times=0;var myimages=new Array()
function alpha_elem(id,alpha) {if (id){if (browserdetect) switch(browserdetect) {case "opera": id.style.opacity=alpha/100;break; case "mozilla": id.style.MozOpacity=alpha/100;break; case "ie": id.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+alpha+")";break; }}}
function clear_t(w){for (var i=0;i<w.lenght;i++) clearTimeout(w[i]); }
function correctPNG(){var arVersion=navigator.appVersion.split("MSIE");var version=parseFloat(arVersion[1]);if (version>=5.5&&version<7&&document.body.filters){for(var i=0;i<document.images.length;i++){ var img=document.images[i];var imgName=img.src.toUpperCase();if (imgName.substring(imgName.length-3,imgName.length)=="PNG"){var imgID=(img.id)?"id='"+img.id+"'":"";var imgClass=(img.className)?" class='"+img.className+"' ":"";var imgTitle=(img.title)?" title='"+img.title+"'":"title='"+img.alt+"' ";var imgStyle="display:inline-block;"+img.style.cssText;if(img.align=="left") imgStyle="float:left;"+imgStyle;if(img.align=="right") imgStyle="float:right;"+imgStyle;if(img.parentElement.href) imgStyle="cursor:hand;"+imgStyle;var strNewHTML="<span "+imgID+imgClass+imgTitle+" style=\""+"width:"+img.width+"px; height:"+img.height+"px;"+imgStyle+";"+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"+"(src=\'"+img.src+"\',sizingMethod='scale');\"></span>";img.outerHTML=strNewHTML;i--;}}}}
function getPageSizeWithScroll(){var yScroll,xScroll;if (window.innerHeight && window.scrollMaxY) {xScroll = document.body.scrollWidth;yScroll = window.innerHeight + window.scrollMaxY;} else if (document.body.scrollHeight > document.body.offsetHeight){xScroll = document.body.scrollWidth;yScroll = document.body.scrollHeight;} else if (document.documentElement && document.documentElement.scrollHeight > document.documentElement.offsetHeight){xScroll = document.documentElement.scrollWidth;yScroll = document.documentElement.scrollHeight;} else {xScroll = document.body.offsetWidth;yScroll = document.body.offsetHeight;}return {x:xScroll,y:yScroll};}
function hide_content(id){if(id){if(id.style.height=="0px"){id.style.height="auto";}else{id.style.overflow="hidden";id.style.height="0px";}}}
function hide_fog()	{session=0;clear_t(ts);fog_h.innerHTML="";alpha_elem(fog,70);ts[0]=setTimeout("alpha_elem(fog,50)",40);ts[1]=setTimeout("alpha_elem(fog,30)",80);ts[2]=setTimeout("loading_hide();alpha_elem(fog,0);fog.style.visibility='hidden';fog_h.style.visibility='hidden';fog.style.height='0px'",120);}
function hide_img(){hide_fog();img=document.getElementById('img_img');alpha_elem(img,0);img.src='server_files/images/base/none.gif';img.onload=function(){this.style.visibility='hidden';};document.getElementById('gal_img').style.visibility='hidden';}
function loading_show() {if (!document.getElementById('loading2')) {var newdiv=parent.document.createElement('div');newdiv.setAttribute('id',"loading2");newdiv.setAttribute('align',"center");newdiv.className="loading_t";newdiv.style.top=(parent.scrollofset().y)+"px";newdiv.style.width="100%";newdiv.innerHTML='<img style="margin-top:150px;" src="server_files/images/base/loading.gif" alt="" /><br />se incarca...';parent.document.getElementById('fog_h').appendChild(newdiv);}}
function loading_hide() {if (document.getElementById('loading2')) fog_h.removeChild(document.getElementById('loading2')); }
function preloadimages(){for (i=0;i<preloadimages.arguments.length;i++){myimages[i]=new Image();myimages[i].src=preloadimages.arguments[i];}}
function remeber_login(userid,hash,item){alert(item.checked); if (item.checked){document.cookie="userid="+userid+";expires: Mon, 1 Ian 2020 00:00:00 UTC;";document.cookie="userphash="+hash+";expires: Mon, 1 Ian 2020 00:00:00 UTC;";	document.cookie="remeber=1;expires: Mon, 1 Ian 2020 00:00:00 UTC;";}else{document.cookie="userid="+false;document.cookie="userphash="+false;document.cookie="remeber=0";}}
function scrollofset(){var x,y;if (self.pageYOffset){x=self.pageXOffset;y=self.pageYOffset;}else if (document.documentElement&&document.documentElement.scrollTop){x=document.documentElement.scrollLeft;y=document.documentElement.scrollTop;}else if (document.body){x=document.body.scrollLeft;y=document.body.scrollTop;}return {x:x,y:y};}
function show_fog()	{if (!session) {session=1;clear_t(ts);alpha_elem(fog,0);if(browserdetect=="ie")  {fog.style.height=getPageSizeWithScroll().y+"px";}else fog.style.height=getPageSizeWithScroll().y+"px";fog_h.style.visibility="visible";fog.style.visibility="visible";alpha_elem(fog,10);ts[0]=setTimeout("alpha_elem(fog,30)",40);ts[1]=setTimeout("alpha_elem(fog,50)",80);ts[2]=setTimeout("alpha_elem(fog,80)",120);}}
function show_img (url){show_fog();loading_show();var img=document.getElementById('img_img');alpha_elem(img,0);img.src=url;img.onload= function(){loading_hide();tm[1]=this;if (getPageSizeWithScroll().y>document.height)fog.style.height=(getPageSizeWithScroll().y+25)+"px";this.style.visibility='visible';setTimeout("alpha_elem(tm[1],10)",30);setTimeout("alpha_elem(tm[1],25)",60);setTimeout("alpha_elem(tm[1],45)",90);setTimeout("alpha_elem(tm[1],65)",120);setTimeout("alpha_elem(tm[1],85)",150);setTimeout("alpha_elem(tm[1],100)",180);}}
function window_cmd(w,fog_s) {if(!fog_s){show_fog();loading_show();}session=1;if(browserdetect!="ie") engine.src="engine.php?cmd="+w;else {ie_times++;engine.src="engine.php?cmd="+w+"&"+ie_times;}}
function window_cmd2(w,content,q,loading) {if(loading)loading_show();session=1;if(browserdetect!="ie") engine.src="engine.php?cmd2="+w+"&content="+content+"&"+q;else {ie_times++;engine.src="engine.php?cmd2="+w+"&content="+content+"&"+q+"&"+ie_times;}}


function onload_body()
	{if(document.height>700)
		document.getElementById('mirror_efect').style.height="43px";
	 tm[1]=document.getElementById('loading');
	 setTimeout("alpha_elem(tm[1],90)",75);
	 setTimeout("alpha_elem(tm[1],75)",150);
	 setTimeout("alpha_elem(tm[1],55)",225);
	 setTimeout("alpha_elem(tm[1],30)",300);
	 setTimeout("alpha_elem(tm[1],10)",375);
	 setTimeout("alpha_elem(tm[1],0);tm[1].style.visibility='hidden';document.getElementById('loading_h').style.visibility='hidden';delete(tm[1]);",450);
	}