(function($){
$.fn.popupWindow = function(instanceSettings){
return this.each(function(){
$(this).click(function(){
$.fn.popupWindow.defaultSettings = {
centerBrowser:0, 
centerScreen:0, 
height:500, 
left:0, 
location:0, 
menubar:0, 
resizable:0, 
scrollbars:0, 
status:0, 
width:500, 
windowName:null, 
windowURL:null, 
top:0, 
toolbar:0 
};
settings = $.extend({}, $.fn.popupWindow.defaultSettings, instanceSettings || {});
var windowFeatures = 'height=' + settings.height +
',width=' + settings.width +
',toolbar=' + settings.toolbar +
',scrollbars=' + settings.scrollbars +
',status=' + settings.status +
',resizable=' + settings.resizable +
',location=' + settings.location +
',menuBar=' + settings.menubar;
settings.windowName = this.name || settings.windowName;
settings.windowURL = this.href || settings.windowURL;
settings.windowURL = settings.windowURL.replace('{url}',$('#shr-lnk').val());
var centeredY,centeredX;
if(settings.centerBrowser){
if ($.browser.msie) {
centeredY = (window.screenTop - 120) + ((((document.documentElement.clientHeight + 120)/2) - (settings.height/2)));
centeredX = window.screenLeft + ((((document.body.offsetWidth + 20)/2) - (settings.width/2)));
}else{
centeredY = window.screenY + (((window.outerHeight/2) - (settings.height/2)));
centeredX = window.screenX + (((window.outerWidth/2) - (settings.width/2)));
}
window.open(settings.windowURL, settings.windowName, windowFeatures+',left=' + centeredX +',top=' + centeredY).focus();
}else if(settings.centerScreen){
centeredY = (screen.height - settings.height)/2;
centeredX = (screen.width - settings.width)/2;
window.open(settings.windowURL, settings.windowName, windowFeatures+',left=' + centeredX +',top=' + centeredY).focus();
}else{
window.open(settings.windowURL, settings.windowName, windowFeatures+',left=' + settings.left +',top=' + settings.top).focus();
}
return false;
});
});
};
})(jQuery);
var isIE6 = /msie|MSIE 6/.test(navigator.userAgent);
var top=80;
var opac=0.38;
var tt=0;
var lungs=Array();
function strr( string ){
string=string.replace(/\n/g,'');
string=string.replace('function anonymous(){','');
string=string.replace('}','');
string=string.replace("this.src='","");
string=string.replace("'","");
return string;
}
function strrr( string ){
string=string.replace(/\n/g,'');
string=string.replace('function anonymous(){','');
string=string.replace('}','');
return string;
}
function correctPNG() 
{
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])
if ((version >= 5.5) && (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
if(img.onmouseover) { mo=strr(''+img.onmouseover); moo=strr(''+img.onmouseout); }
if(img.onclick) { onc=strrr(''+img.onclick); }
var strNewHTML = "<span ";
if(img.onclick) strNewHTML += " onClick=\""+onc+"\" ";
if(img.onmouseover) strNewHTML += " onMouseOver=\"this.style.position='relative'; this.style.top='0px';this.style.filter=''; this.style.background='url("+mo+")'\" onMouseOut=\"this.style.filter=''; this.style.background='url("+moo+")'\"";
strNewHTML += 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 = i-1
}
}
}
}
function ArataTooltip(f)
{
document.getElementById("tooltext").innerHTML=f;
document.getElementById("tooltip").style.display='block';
document.onmousemove=follow;
}
function mouseX(evt)
{
if (!evt) evt = window.event; if (evt.pageX) return evt.pageX; else if (evt.clientX)return evt.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft); else return 0;}
function mouseY(evt) {if (!evt) evt = window.event; if (evt.pageY) return evt.pageY; else if (evt.clientY)return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); else return 0;}
function follow(evt)
{
if(evt=='stop') { document.onmousemove=null; document.getElementById("tooltip").style.display='none'; return false; }
if (document.getElementById) {var obj = document.getElementById("tooltip").style; obj.display = 'block';
obj.left = (parseInt(mouseX(evt)))+10+'px';
obj.top = (parseInt(mouseY(evt)))-40+'px';}
}
function gojos(div,cur,max,cat)
{
scr=document.getElementById('divpoza-'+div).scrollTop;
if(scr<cur)
{
scr=scr+2;
document.getElementById('divpoza-'+div).scrollTop=scr;
setTimeout("gojos('"+div+"',"+cur+","+max+","+cat+")",1);
}
else
{
document.getElementById('divpoza-'+div).scrollTop=cur;
if(isIE6) var check=max+100-document.getElementById('divpoza-'+div).offsetHeight;
else var check=max+104-document.getElementById('divpoza-'+div).offsetHeight;
if(cur==check)
{
document.getElementById('gojos-'+div).onclick='';
document.getElementById('gojos-'+div).innerHTML='<img src="/general/sageti/butgal_disabled-jos.png" alt="s"/>';
document.getElementById('gojos-'+div).style.cursor='default';
}
else
{
document.getElementById('gojos-'+div).onclick=new Function("gojos("+div+","+(cur+100)+","+max+","+cat+")");
document.getElementById('gojos-'+div).innerHTML='<img src="/general/sageti/butgal'+cat+'-jos.png" alt="s"/>';
document.getElementById('gojos-'+div).style.cursor='pointer';
}
document.getElementById('gosus-'+div).onclick=new Function("gosus("+div+","+(cur-100)+","+max+","+cat+")");
document.getElementById('gosus-'+div).innerHTML='<img src="/general/sageti/butgal'+cat+'-sus.png" alt="s"/>';
document.getElementById('gosus-'+div).style.cursor='pointer';
correctPNG();
}
}
function gosus(div,cur,max,cat)
{
scr=document.getElementById('divpoza-'+div).scrollTop;
if(scr>cur)
{
scr=scr-2;
document.getElementById('divpoza-'+div).scrollTop=scr;
setTimeout("gosus('"+div+"',"+cur+","+max+","+cat+")",1);
}
else
{
document.getElementById('divpoza-'+div).scrollTop=cur;
if(cur==0)
{
document.getElementById('gosus-'+div).onclick='';
document.getElementById('gosus-'+div).innerHTML='<img src="/general/sageti/butgal_disabled-sus.png" alt="s"/>';
document.getElementById('gosus-'+div).style.cursor='default';
}
else
{
document.getElementById('gosus-'+div).onclick=new Function("gosus("+div+","+(cur-100)+","+max+","+cat+")");
document.getElementById('gosus-'+div).innerHTML='<img src="/general/sageti/butgal'+cat+'-sus.png" alt="s"/>';
document.getElementById('gosus-'+div).style.cursor='pointer';
}
document.getElementById('gojos-'+div).onclick=new Function("gojos("+div+","+(cur+100)+","+max+","+cat+")");
document.getElementById('gojos-'+div).innerHTML='<img src="/general/sageti/butgal'+cat+'-jos.png" alt="s"/>';
document.getElementById('gojos-'+div).style.cursor='pointer';
correctPNG();
}
}
function gojos2(div,cur,max,cat)
{
scr=document.getElementById('divpoza-'+div).scrollTop;
if(scr<cur)
{
scr=scr+2;
document.getElementById('divpoza-'+div).scrollTop=scr;
setTimeout("gojos2('"+div+"',"+cur+","+max+","+cat+")",1);
}
else
{
document.getElementById('divpoza-'+div).scrollTop=cur;
if(cur>=(max+116-document.getElementById('divpoza-'+div).offsetHeight)-10)
{
document.getElementById('gojos-'+div).onclick='';
document.getElementById('gojos-'+div).innerHTML='<img src="/general/sageti/butgal_disabled-jos.png" alt="s"/>';
document.getElementById('gojos-'+div).style.cursor='default';
}
else
{
document.getElementById('gojos-'+div).onclick=new Function("gojos2("+div+","+(cur+115)+","+max+","+cat+")");
document.getElementById('gojos-'+div).innerHTML='<img src="/general/sageti/butgal'+cat+'-jos.png" alt="s"/>';
document.getElementById('gojos-'+div).style.cursor='pointer';
}
document.getElementById('gosus-'+div).onclick=new Function("gosus2("+div+","+(cur-115)+","+max+","+cat+")");
document.getElementById('gosus-'+div).innerHTML='<img src="/general/sageti/butgal'+cat+'-sus.png" alt="s"/>';
document.getElementById('gosus-'+div).style.cursor='pointer';
correctPNG();
}
}
function gosus2(div,cur,max,cat)
{
scr=document.getElementById('divpoza-'+div).scrollTop;
if(scr>cur)
{
scr=scr-2;
document.getElementById('divpoza-'+div).scrollTop=scr;
setTimeout("gosus2('"+div+"',"+cur+","+max+","+cat+")",1);
}
else
{
document.getElementById('divpoza-'+div).scrollTop=cur;
if(cur==0)
{
document.getElementById('gosus-'+div).onclick='';
document.getElementById('gosus-'+div).innerHTML='<img src="/general/sageti/butgal_disabled-sus.png" alt="s"/>';
document.getElementById('gosus-'+div).style.cursor='default';
}
else
{
document.getElementById('gosus-'+div).onclick=new Function("gosus2("+div+","+(cur-115)+","+max+","+cat+")");
document.getElementById('gosus-'+div).innerHTML='<img src="/general/sageti/butgal'+cat+'-sus.png" alt="s"/>';
document.getElementById('gosus-'+div).style.cursor='pointer';
}
document.getElementById('gojos-'+div).onclick=new Function("gojos2("+div+","+(cur+115)+","+max+","+cat+")");
document.getElementById('gojos-'+div).innerHTML='<img src="/general/sageti/butgal'+cat+'-jos.png" alt="s"/>';
document.getElementById('gojos-'+div).style.cursor='pointer';
correctPNG();
}
}
function ValidateLocatie()
{
var er=0;
if(!document.getElementById('tiploc').value)
{
alert('Alege tipul locatiei !');
document.getElementById('tiploc').focus();
return false;
}
if(!document.getElementById('nume').value)
{
alert('Completeaza numele locatiei !');
document.getElementById('nume').select();
document.getElementById('nume').focus();
return false;
}
}
function jsUpload(upload_field)
{
upload_field.form.submit();
document.getElementById("loading1").style.display='block';
return true;
}
function ValidateContact()
{
contact.contnume.style.border='solid 1px #b8b8b8';
contact.contnume.style.color='#a2a2a2';
contact.contprenume.style.border='solid 1px #b8b8b8';
contact.contprenume.style.color='#a2a2a2';
contact.conttel.style.border='solid 1px #b8b8b8';
contact.conttel.style.color='#a2a2a2';
contact.contemail.style.border='solid 1px #b8b8b8';
contact.contemail.style.color='#a2a2a2';
contact.contsubiect.style.border='solid 1px #b8b8b8';
contact.contsubiect.style.color='#a2a2a2';
contact.contmesaj.style.border='solid 1px #b8b8b8';
contact.contmesaj.style.color='#a2a2a2';
var len=contact.contemail.value.length;
var ok=1;
if(!contact.contnume.value || contact.contnume.value=='Nume')
{
contact.contnume.style.border='solid 1px #ff0000';
contact.contnume.style.color='#ff0000';
ok=0;
}
if(!contact.contprenume.value || contact.contprenume.value=='Prenume')
{
contact.contprenume.style.border='solid 1px #ff0000';
contact.contprenume.style.color='#ff0000';
ok=0;
}
if(!contact.conttel.value || contact.conttel.value=='Telefon')
{
contact.conttel.style.border='solid 1px #ff0000';
contact.conttel.style.color='#ff0000';
ok=0;
}
if(!contact.contemail.value || contact.contemail.value.indexOf('@')==-1 || contact.contemail.value.indexOf('@')==0 ||
contact.contemail.value.indexOf('@')==len || contact.contemail.value.indexOf('.')==-1 || contact.contemail.value.indexOf('.')==0
|| contact.contemail.value.indexOf('@')==1 || contact.contemail.value.indexOf('.')==2 || contact.contemail.value.indexOf('.')==len ||
len<7)
{
contact.contemail.style.border='solid 1px #ff0000';
contact.contemail.style.color='#ff0000';
ok=0;
}
if(!contact.contsubiect.value || contact.contsubiect.value=='Subiectul mesajului')
{
contact.contsubiect.style.border='solid 1px #ff0000';
contact.contsubiect.style.color='#ff0000';
ok=0;
}
if(!contact.contmesaj.value || contact.contmesaj.value=='Mesaj')
{
contact.contmesaj.style.border='solid 1px #ff0000';
contact.contmesaj.style.color='#ff0000';
ok=0;
}
if(!ok) return false;
return true;
}
function ValidateContact1()
{
contact1.nume.style.border='solid 1px #b8b8b8';
contact1.nume.style.color='#a2a2a2';
contact1.tel.style.border='solid 1px #b8b8b8';
contact1.tel.style.color='#a2a2a2';
contact1.email.style.border='solid 1px #b8b8b8';
contact1.email.style.color='#a2a2a2';
contact1.oras.style.border='solid 1px #b8b8b8';
contact1.oras.style.color='#a2a2a2';
contact1.mesaj.style.border='solid 1px #b8b8b8';
contact1.mesaj.style.color='#a2a2a2';
var len=contact1.email.value.length;
var ok=1;
if(!contact1.nume.value || contact1.nume.value=='Nume')
{
contact1.nume.style.border='solid 1px #ff0000';
contact1.nume.style.color='#ff0000';
ok=0;
}
if(!contact1.tel.value || contact1.tel.value=='Telefon')
{
contact1.tel.style.border='solid 1px #ff0000';
contact1.tel.style.color='#ff0000';
ok=0;
}
if(!contact1.email.value || contact1.email.value.indexOf('@')==-1 || contact1.email.value.indexOf('@')==0 ||
contact1.email.value.indexOf('@')==len || contact1.email.value.indexOf('.')==-1 || contact1.email.value.indexOf('.')==0
|| contact1.email.value.indexOf('@')==1 || contact1.email.value.indexOf('.')==2 || contact1.email.value.indexOf('.')==len ||
len<7)
{
contact1.email.style.border='solid 1px #ff0000';
contact1.email.style.color='#ff0000';
ok=0;
}
if(!contact1.oras.value || contact1.oras.value=='Localitate')
{
contact1.oras.style.border='solid 1px #ff0000';
contact1.oras.style.color='#ff0000';
ok=0;
}
if(!contact1.mesaj.value || contact1.mesaj.value=='Mesaj')
{
contact1.mesaj.style.border='solid 1px #ff0000';
contact1.mesaj.style.color='#ff0000';
ok=0;
}
if(!ok) return false;
return true;
}
function XHTMLDobitocCareEstiTu()
{
var len=newsl.newsmail.value.length;
if(!newsl.newsmail.value || newsl.newsmail.value.indexOf("@")==-1 || newsl.newsmail.value.indexOf("@")==0 ||
newsl.newsmail.value.indexOf("@")==len || newsl.newsmail.value.indexOf(".")==-1 || newsl.newsmail.value.indexOf(".")==0
|| newsl.newsmail.value.indexOf("@")==1 || newsl.newsmail.value.indexOf(".")==2 || newsl.newsmail.value.indexOf(".")==len ||
len<7)
{
alert("Adresa de email incorecta");
return false;
}
}
function topjos(div)
{
$('#'+div.id).animate({top: '0px'}, 200);
}
function Promote(loc_id) {
$.post('/ajax/admin_ajax.php',{action:'promote',loc_id: loc_id});
$('#adminloclist tr').each(
function()
{
$(this).css({background: 'none'});
}
);
$('.promote').each(
function()
{
if($(this).html()=='Despromote') {
$(this).html('Promote');
var id=$(this).attr('id').split('promote_');
id=id[1];
document.getElementById($(this).attr('id')).onclick = new Function("Promote('"+id+"'); return false");
}
}
);
$('#loc_'+loc_id).css({background: '#cfad23'});
$('#promote_'+loc_id).html('Despromote');
document.getElementById('promote_'+loc_id).onclick = new Function("Despromote('"+loc_id+"'); return false");
}
function Despromote(loc_id) {
$.post('/ajax/admin_ajax.php',{action:'despromote',loc_id: loc_id});
$('#loc_'+loc_id).css({background: 'none'});
$('#promote_'+loc_id).html('Promote');
document.getElementById('promote_'+loc_id).onclick = new Function("Promote('"+loc_id+"'); return false");
}
function ResizeBareSTDR()
{
if(document.getElementById){
c = document.getElementById('chenarcazare').offsetHeight;
}
else if (document.layers){
c = document.layers['chenarcazare'].clip.height;
}
c=c-30;
if(document.getElementById){
l = document.getElementById('chenarlocaluri').offsetHeight;
}
else if (document.layers){
l = document.layers['chenarlocaluri'].clip.height;
}
l=l-30;
if(document.getElementById){
t = document.getElementById('chenartimpliber').offsetHeight;
}
else if (document.layers){
t = document.layers['chenartimpliber'].clip.height;
}
t=t-30;
document.getElementById('stcazare').style.height=c+'px';
document.getElementById('drcazare').style.height=c+'px';
document.getElementById('stlocaluri').style.height=l+'px';
document.getElementById('drlocaluri').style.height=l+'px';
document.getElementById('sttimpliber').style.height=t+'px';
document.getElementById('drtimpliber').style.height=t+'px';
}
function ResizeSidebarSTDR()
{
if(document.getElementById){
c = document.getElementById('lmenu').offsetHeight;
}
else if (document.layers){
c = document.layers['lmenu'].clip.height;
}
c=c-30
document.getElementById('stsidebar').style.height=c+'px';
document.getElementById('drsidebar').style.height=c+'px';
}
function ResizeDivPublicitate()
{
if(!document.getElementById('publicitate')) return;
if(document.getElementById){
c = document.getElementById('publicitate').offsetHeight;
}
else if (document.layers){
c = document.layers['publicitate'].clip.height;
}
c=c-30;
document.getElementById('pubst').style.height=c+'px';
document.getElementById('pubdr').style.height=c+'px';
if(document.getElementById){
cc = document.getElementById('recst').offsetHeight;
}
else if (document.layers){
cc = document.layers['recst'].clip.height;
}
cc=cc-30;
document.getElementById('recstst').style.height=cc+'px';
document.getElementById('recstdr').style.height=cc+'px';
}
function GoDownSubm(what)
{
if(document.getElementById){
l = document.getElementById('chenar'+what).offsetHeight;
}
else if (document.layers){
l = document.layers['chenar'+what].clip.height;
}
document.getElementById('chenar'+what).style.display='block';
document.getElementById('chenar'+what).style.height=(l+2)+'px';
if(l<215) setTimeout("GoDownSubm('"+what+"',400)");
ResizeBareSTDR();
}
function GoUpSubm(what)
{
document.getElementById('chenar'+what).style.display='none';
}
function DelPozaEv(eid,id)
{
xmlH=GetXmlHttpObject();
var url="/ajax.php?loc=delpozaev&eid="+eid+"&id="+id;
xmlH.onreadystatechange=function()
{
if (xmlH.readyState==4)
{
document.getElementById("lpoze").innerHTML=xmlH.responseText;
}
};
xmlH.open("GET",url,true);
xmlH.send(null);
}
function ListaOrase(j,div)
{
if(!document.getElementById(div)) return;
else divu=document.getElementById(div);
xmlH=GetXmlHttpObject();
var url="/ajax.php?loc=listaorase&j="+j;
xmlH.onreadystatechange=function()
{
if (xmlH.readyState==4)
{
divu.innerHTML=xmlH.responseText;
}
};
xmlH.open("GET",url,true);
xmlH.send(null);
}
function DelPozaAtr(aid,id)
{
xmlH=GetXmlHttpObject();
var url="/ajax.php?loc=delpozaatr&aid="+aid+"&id="+id;
xmlH.onreadystatechange=function()
{
if (xmlH.readyState==4)
{
document.getElementById("pozeatr").innerHTML=xmlH.responseText;
}
};
xmlH.open("GET",url,true);
xmlH.send(null);
}
function DelPozaLocalitate(lid,id)
{
xmlH=GetXmlHttpObject();
var url="/ajax.php?loc=delpozalocalitate&lid="+lid+"&id="+id;
xmlH.onreadystatechange=function()
{
if (xmlH.readyState==4)
{
document.getElementById("listapoze").innerHTML=xmlH.responseText;
}
};
xmlH.open("GET",url,true);
xmlH.send(null);
}
function DelPozaTaxi(tid,id)
{
xmlH=GetXmlHttpObject();
var url="/ajax.php?loc=delpozataxi&tid="+tid+"&id="+id;
xmlH.onreadystatechange=function()
{
if (xmlH.readyState==4)
{
document.getElementById("lpoze").innerHTML=xmlH.responseText;
}
};
xmlH.open("GET",url,true);
xmlH.send(null);
}
function DelPozaLoc(lid,id)
{
xmlH=GetXmlHttpObject();
var url="/ajax.php?loc=delpozaloc&lid="+lid+"&id="+id;
xmlH.onreadystatechange=function()
{
if (xmlH.readyState==4)
{
document.getElementById("lpoze").innerHTML=xmlH.responseText;
}
};
xmlH.open("GET",url,true);
xmlH.send(null);
}
function DefaultPozaLoc(lid,id)
{
xmlH=GetXmlHttpObject();
var url="/ajax.php?loc=defaultpozaloc&lid="+lid+"&id="+id;
alert(url);
xmlH.onreadystatechange=function()
{
if (xmlH.readyState==4)
{
}
};
xmlH.open("GET",url,true);
xmlH.send(null);
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
function CheckTipLoc(lid)
{
xmlH=GetXmlHttpObject();
var url="/ajax.php?loc=checktiploc&lid="+lid;
xmlH.onreadystatechange=function()
{
if (xmlH.readyState==4)
{
var res=xmlH.responseText;
if(res==1)
{
document.getElementById('dateloc').innerHTML='Detalii camere';
document.getElementById('dateloc').style.display='block';
document.getElementById('dateloc').style.display='block';
document.getElementById('tipc1').style.display='block';
document.getElementById('tipcc1').style.display='block';
document.getElementById('tipm1').style.display='none';
document.getElementById('tipmm1').style.display='none';
document.getElementById('tags1').style.display='block';
document.getElementById('tags2').style.display='none';
document.getElementById('tags3').style.display='none';
}
if(res==2)
{
document.getElementById('dateloc').innerHTML='Detalii mese';
document.getElementById('dateloc').style.display='block';
document.getElementById('dateloc').style.display='block';
document.getElementById('tipm1').style.display='block';
document.getElementById('tipmm1').style.display='block';
document.getElementById('tipc1').style.display='none';
document.getElementById('tipcc1').style.display='none';
document.getElementById('tags1').style.display='none';
document.getElementById('tags2').style.display='block';
document.getElementById('tags3').style.display='none';
}
if(res==3)
{
document.getElementById('dateloc').style.display='none';
document.getElementById('dateloc').style.display='none';
document.getElementById('tipc1').style.display='none';
document.getElementById('tipcc1').style.display='none';
document.getElementById('tipm1').style.display='block';
document.getElementById('tipmm1').style.display='block';
document.getElementById('tags1').style.display='none';
document.getElementById('tags2').style.display='none';
document.getElementById('tags3').style.display='block';
}
}
};
xmlH.open("GET",url,true);
xmlH.send(null);
}
function AdminListaLocatii(s,tiploc,stele)
{
xmlH=GetXmlHttpObject();
var url="/ajax.php?loc=adminlistalocatii&list=1&sort="+s+"&tiploc="+tiploc+"&stele="+stele;
xmlH.onreadystatechange=function()
{
if (xmlH.readyState==4)
{
document.getElementById("listaloc").innerHTML=xmlH.responseText;
}
};
xmlH.open("GET",url,true);
xmlH.send(null);
}
function FaRezervare()
{
if(!ValidateRezervari()) return false;
var url="/ajax.php?loc=farezervare&lid="+document.getElementById("forma").lid.value+"&nume="+document.getElementById("forma").nume.value+"&prenume="+document.getElementById("forma").prenume.value+"&adresa="+document.getElementById("forma").adresa.value+"&tel="+document.getElementById("forma").tel.value+"&msg="+document.getElementById("forma").msg.value;
document.getElementById("rezervare").innerHTML='<table style="width:100%;height:250px"><tr><td valign="middle" align="center"><img src="/surse/loading.gif" alt="loading"/></td></tr></table>';
xmlH=GetXmlHttpObject();
xmlH.onreadystatechange=function()
{
if (xmlH.readyState==4)
{
document.getElementById("rezervare").innerHTML=xmlH.responseText;
}
};
xmlH.open("GET",url,true);
xmlH.send(null);
}
function TrimiteContact()
{
if(!ValidateContact()) return false;
var url="/ajax.php?loc=trimitecontact&lid="+document.getElementById("cforma").lid.value+"&nume="+document.getElementById("cforma").nume.value+"&prenume="+document.getElementById("cforma").prenume.value+"&adresa="+document.getElementById("cforma").adresa.value+"&tel="+document.getElementById("cforma").tel.value+"&msg="+document.getElementById("cforma").msg.value;
document.getElementById("contact").innerHTML='<table style="width:100%;height:250px"><tr><td valign="middle" align="center"><img src="/surse/loading.gif" alt="loading"/></td></tr></table>';
xmlH=GetXmlHttpObject();
xmlH.onreadystatechange=function()
{
if (xmlH.readyState==4)
{
document.getElementById("contact").innerHTML=xmlH.responseText;
}
};
xmlH.open("GET",url,true);
xmlH.send(null);
}
function ValidateRezervari()
{
document.getElementById('nume').style.border='solid 1px #A17C45';
document.getElementById('nnume').style.color='#000000';
document.getElementById('prenume').style.border='solid 1px #A17C45';
document.getElementById('nprenume').style.color='#000000';
document.getElementById('adresa').style.border='solid 1px #A17C45';
document.getElementById('nadresa').style.color='#000000';
document.getElementById('tel').style.border='solid 1px #A17C45';
document.getElementById('ntel').style.color='#000000';
document.getElementById('msg').style.border='solid 1px #A17C45';
document.getElementById('nmsg').style.color='#000000';
document.getElementById('data1').style.border='solid 1px #A17C45';
document.getElementById('ndata1').style.color='#000000';
document.getElementById('data2').style.border='solid 1px #A17C45';
document.getElementById('ndata2').style.color='#000000';
if(!document.getElementById('nume').value)
{
document.getElementById('nume').style.border='solid 1px #ff0000';
document.getElementById('nnume').style.color='#ff0000';
document.getElementById('nume').focus();
document.getElementById('nume').select();
return false;
}
if(!document.getElementById('prenume').value)
{
document.getElementById('prenume').style.border='solid 1px #ff0000';
document.getElementById('nprenume').style.color='#ff0000';
document.getElementById('prenume').focus();
document.getElementById('prenume').select();
return false;
}
if(!document.getElementById('adresa').value)
{
document.getElementById('adresa').style.border='solid 1px #ff0000';
document.getElementById('nadresa').style.color='#ff0000';
document.getElementById('adresa').focus();
document.getElementById('adresa').select();
return false;
}
if(!document.getElementById('tel').value)
{
document.getElementById('tel').style.border='solid 1px #ff0000';
document.getElementById('ntel').style.color='#ff0000';
document.getElementById('tel').focus();
document.getElementById('tel').select();
return false;
}
if(!document.getElementById('msg').value)
{
document.getElementById('msg').style.border='solid 1px #ff0000';
document.getElementById('nmsg').style.color='#ff0000';
document.getElementById('msg').focus();
document.getElementById('msg').select();
return false;
}
if(!document.getElementById('data1').value)
{
document.getElementById('data1').style.border='solid 1px #ff0000';
document.getElementById('ndata1').style.color='#ff0000';
document.getElementById('data1').focus();
document.getElementById('data1').select();
return false;
}
if(!document.getElementById('data2').value)
{
document.getElementById('data2').style.border='solid 1px #ff0000';
document.getElementById('ndata2').style.color='#ff0000';
document.getElementById('data2').focus();
document.getElementById('data2').select();
return false;
}
return true;
}
function DetaliiJos(id,lungs,cpz)
{
document.getElementById('textu-'+id).style.height=document.getElementById('textu-'+id).offsetHeight+6+'px';
if(document.getElementById('textu-'+id).offsetHeight<lungs['textu-'+id]) setTimeout("DetaliiJos("+id+",lungs,"+cpz+")",1);
else {
var divi = document.getElementsByTagName('div');
for (var i=0; i<divi.length; i++)
{
if(divi[i].id.substr(0,6) == 'textu-') divi[i].style.height='106px';
if(divi[i].id.substr(0,8) == 'divpoza-') divi[i].style.height='112px';
}
document.getElementById('textu-'+id).style.height=lungs['textu-'+id]+'px';
document.getElementById('divpoza-'+id).style.height=Math.max(112,Math.min(Math.floor(lungs['textu-'+id]/112),cpz)*112)+'px';
document.getElementById('butdel-'+id).src='/general/sageti/sageata_vezi-detalii.png';
document.getElementById('but-'+id).onclick=new Function("DetaliiSus("+id+",lungs,"+cpz+")");
}
}
function DetaliiSus(id,lungs,cpz)
{
document.getElementById('divpoza-'+id).style.height='112px';
document.getElementById('textu-'+id).style.height=document.getElementById('textu-'+id).offsetHeight-6+'px';
if(document.getElementById('textu-'+id).offsetHeight>106) setTimeout("DetaliiSus("+id+",lungs,"+cpz+")",1);
else
{
document.getElementById('textu-'+id).style.height='106px';
document.getElementById('butdel-'+id).src='/general/sageti/sageata_ascunde-detalii.png';
document.getElementById('but-'+id).onclick=new Function("DetaliiJos("+id+",lungs,"+cpz+")");
}
}
function Voteaza(lid,ip,nota)
{
var dd=document.getElementById('voteaza');
document.getElementById('notta').innerHTML="<center><img src='/surse/loading.gif' /></center>";
var url="/ajax.php?loc=voteaza&lid="+lid+"&ip="+ip+"&nota="+nota;
xmlH=GetXmlHttpObject();
xmlH.onreadystatechange=function()
{
if (xmlH.readyState==4)
{
if(xmlH.responseText)
{
document.getElementById('voteaza').style.display='none';
document.getElementById('notta').innerHTML=xmlH.responseText;
}
}
};
xmlH.open("GET",url,true);
xmlH.send(null);
}
function TabelUseri(n)
{
var url="/ajax.php?loc=tabeluseri&nume="+n;
xmlH=GetXmlHttpObject();
xmlH.onreadystatechange=function()
{
if (xmlH.readyState==4)
{
document.getElementById('tabeluseri').innerHTML=xmlH.responseText;
}
};
xmlH.open("GET",url,true);
xmlH.send(null);
}
function RStatus(id,s)
{
xmlH=GetXmlHttpObject();
var url="/ajax.php?loc=rstatus&id="+id+"&s="+s;
alert(url);
xmlH.open("GET",url,true);
xmlH.send(null);
}
function RStatus2(id,s)
{
xmlH=GetXmlHttpObject();
var url="/ajax.php?loc=rstatus2&id="+id+"&s="+s;
alert(url);
xmlH.open("GET",url,true);
xmlH.send(null);
}
function CheckSomething()
{
if(document.getElementById('z1').value && document.getElementById('l1').value && document.getElementById('a1').value && document.getElementById('z2').value && document.getElementById('l2').value && document.getElementById('a2').value)
{
var pz = new Date(document.getElementById('a1').value,document.getElementById('l1').value,document.getElementById('z1').value);
var uz = new Date(document.getElementById('a2').value,document.getElementById('l2').value,document.getElementById('z2').value);
if(uz<=pz) alert('Data plecarii nu poate fi mai mica sau aceasi cu data sosirii !');
else
{
document.getElementById('dat1').innerHTML=document.getElementById('z1').value+"."+document.getElementById('l1').value+"."+document.getElementById('a1').value;
document.getElementById('dat2').innerHTML=document.getElementById('z2').value+"."+document.getElementById('l2').value+"."+document.getElementById('a2').value;
dd=new Date();
dd.setTime(Math.abs(pz.getTime() - uz.getTime()));
dd=dd.getTime();
dd = Math.floor(dd / (1000 * 60 * 60 * 24));
document.getElementById('zilelore').innerHTML=dd;
GenerareLibere(-1);
}
}
}
function ofc_ready()
{
}
function open_flash_chart_data()
{
return JSON.stringify(data);
}
function findSWF(movieName) {
if (navigator.appName.indexOf("Microsoft")!= -1) {
return window[movieName];
} else {
return document[movieName];
}
}
function Arata(div,ce,id)
{
if(!document.getElementById(ce+'-'+id)) return;
if(document.getElementById(ce+'-'+id).style.display=='block')
{
document.getElementById(ce+'-'+id).style.display='none';
div.style.fontWeight='normal';
div.onmouseover=new Function("this.style.fontWeight='bold'");
div.onmouseout=new Function("this.style.fontWeight='normal'");
return;
}
document.getElementById('adresa-'+id).style.display='none';
if(document.getElementById('tabtags-'+id)) document.getElementById('tags-'+id).style.display='none';
if(document.getElementById('tabstruct-'+id)) document.getElementById('struct-'+id).style.display='none';
document.getElementById('tabadresa-'+id).style.fontWeight='normal';
document.getElementById('tabadresa-'+id).onmouseover=new Function("this.style.fontWeight='bold'");
document.getElementById('tabadresa-'+id).onmouseout=new Function("this.style.fontWeight='normal'");
if(document.getElementById('tabtags-'+id)) document.getElementById('tabtags-'+id).style.fontWeight='normal';
if(document.getElementById('tabtags-'+id)) document.getElementById('tabtags-'+id).onmouseover=new Function("this.style.fontWeight='bold'");
if(document.getElementById('tabtags-'+id)) document.getElementById('tabtags-'+id).onmouseout=new Function("this.style.fontWeight='normal'");
if(document.getElementById('tabstruct-'+id)) document.getElementById('tabstruct-'+id).style.fontWeight='normal';
if(document.getElementById('tabstruct-'+id)) document.getElementById('tabstruct-'+id).onmouseover=new Function("this.style.fontWeight='bold'");
if(document.getElementById('tabstruct-'+id)) document.getElementById('tabstruct-'+id).onmouseout=new Function("this.style.fontWeight='normal'");
document.getElementById(ce+'-'+id).style.display='block';
div.style.fontWeight='bold';
div.onmouseover='';
div.onmouseout='';
}
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
function ControlVersion()
{
var version;
var axo;
var e;
try {
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
version = axo.GetVariable("$version");
} catch (e) {
}
if (!version)
{
try {
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
version = "WIN 6,0,21,0";
axo.AllowScriptAccess = "always";
version = axo.GetVariable("$version");
} catch (e) {
}
}
if (!version)
{
try {
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
version = axo.GetVariable("$version");
} catch (e) {
}
}
if (!version)
{
try {
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
version = "WIN 3,0,18,0";
} catch (e) {
}
}
if (!version)
{
try {
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
version = "WIN 2,0,0,11";
} catch (e) {
version = -1;
}
}
return version;
}
function GetSwfVer(){
var flashVer = -1;
if (navigator.plugins != null && navigator.plugins.length > 0) {
if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
var descArray = flashDescription.split(" ");
var tempArrayMajor = descArray[2].split(".");
var versionMajor = tempArrayMajor[0];
var versionMinor = tempArrayMajor[1];
var versionRevision = descArray[3];
if (versionRevision == "") {
versionRevision = descArray[4];
}
if (versionRevision[0] == "d") {
versionRevision = versionRevision.substring(1);
} else if (versionRevision[0] == "r") {
versionRevision = versionRevision.substring(1);
if (versionRevision.indexOf("d") > 0) {
versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
}
}
var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
}
}
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
else if ( isIE && isWin && !isOpera ) {
flashVer = ControlVersion();
}
return flashVer;
}
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
versionStr = GetSwfVer();
if (versionStr == -1 ) {
return false;
} else if (versionStr != 0) {
if(isIE && isWin && !isOpera) {
tempArray = versionStr.split(" "); 
tempString = tempArray[1]; 
versionArray = tempString.split(","); 
} else {
versionArray = versionStr.split(".");
}
var versionMajor = versionArray[0];
var versionMinor = versionArray[1];
var versionRevision = versionArray[2];
if (versionMajor > parseFloat(reqMajorVer)) {
return true;
} else if (versionMajor == parseFloat(reqMajorVer)) {
if (versionMinor > parseFloat(reqMinorVer))
return true;
else if (versionMinor == parseFloat(reqMinorVer)) {
if (versionRevision >= parseFloat(reqRevision))
return true;
}
}
return false;
}
}
function AC_AddExtension(src, ext)
{
if (src.indexOf('?') != -1)
return src.replace(/\?/, ext+'?');
else
return src + ext;
}
function AC_Generateobj(objAttrs, params, embedAttrs)
{
var str = '';
if (isIE && isWin && !isOpera)
{
str += '<object ';
for (var i in objAttrs)
{
str += i + '="' + objAttrs[i] + '" ';
}
str += '>';
for (var i in params)
{
str += '<param name="' + i + '" value="' + params[i] + '" /> ';
}
str += '</object>';
}
else
{
str += '<embed ';
for (var i in embedAttrs)
{
str += i + '="' + embedAttrs[i] + '" ';
}
str += '> </embed>';
}
document.write(str);
}
function AC_FL_RunContent(){
var ret =
AC_GetArgs
( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
, "application/x-shockwave-flash"
);
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_SW_RunContent(){
var ret =
AC_GetArgs
( arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
, null
);
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
var ret = new Object();
ret.embedAttrs = new Object();
ret.params = new Object();
ret.objAttrs = new Object();
for (var i=0; i < args.length; i=i+2){
var currArg = args[i].toLowerCase();
switch (currArg){
case "classid":
break;
case "pluginspage":
ret.embedAttrs[args[i]] = args[i+1];
break;
case "src":
case "movie":
args[i+1] = AC_AddExtension(args[i+1], ext);
ret.embedAttrs["src"] = args[i+1];
ret.params[srcParamName] = args[i+1];
break;
case "onafterupdate":
case "onbeforeupdate":
case "onblur":
case "oncellchange":
case "onclick":
case "ondblclick":
case "ondrag":
case "ondragend":
case "ondragenter":
case "ondragleave":
case "ondragover":
case "ondrop":
case "onfinish":
case "onfocus":
case "onhelp":
case "onmousedown":
case "onmouseup":
case "onmouseover":
case "onmousemove":
case "onmouseout":
case "onkeypress":
case "onkeydown":
case "onkeyup":
case "onload":
case "onlosecapture":
case "onpropertychange":
case "onreadystatechange":
case "onrowsdelete":
case "onrowenter":
case "onrowexit":
case "onrowsinserted":
case "onstart":
case "onscroll":
case "onbeforeeditfocus":
case "onactivate":
case "onbeforedeactivate":
case "ondeactivate":
case "type":
case "codebase":
case "id":
ret.objAttrs[args[i]] = args[i+1];
break;
case "width":
case "height":
case "align":
case "vspace":
case "hspace":
case "class":
case "title":
case "accesskey":
case "name":
case "tabindex":
ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
break;
default:
ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
}
}
ret.objAttrs["classid"] = classid;
if (mimeType) ret.embedAttrs["type"] = mimeType;
return ret;
}

