
var ie=document.all
var dom=document.getElementById
var ns4=document.layers

function MM_reloadPage(init) { 
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
function clearstatus () { window.status=''; setTimeout ("clearstatus()", 1); } clearstatus();
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function clearstatus () { window.status='Florisibuchete.ro'; setTimeout ("clearstatus()", 1); } clearstatus();


var persistmeniu="da" 
var persisttype="totsiteul"

if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.submeniu{display: none;}\n')
document.write('</style>\n')
}

function schimbameniu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("alldiv").getElementsByTagName("span");
		if(el.style.display != "block"){ 
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submeniu")
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "block";
		}
	}
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function onloadfunction(){
if (persistmeniu=="da"){
var cookiename=(persisttype=="totsiteul")? "schimbameniu" : window.location.pathname
var cookievalue=get_cookie(cookiename)
if (cookievalue!="")
document.getElementById(cookievalue).style.display="block"
}
}

function savemeniustate(){
var inc=1, blockid=""
while (document.getElementById("sub"+inc)){
if (document.getElementById("sub"+inc).style.display=="block"){
blockid="sub"+inc
break
}
inc++
}
var cookiename=(persisttype=="totsiteul")? "schimbameniu" : window.location.pathname
var cookievalue=(persisttype=="totsiteul")? blockid+";path=/" : blockid
document.cookie=cookiename+"="+cookievalue
}

if (window.addEventListener)
window.addEventListener("load", onloadfunction, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunction)
else if (document.getElementById)
window.onload=onloadfunction

if (persistmeniu=="da" && document.getElementById)
window.onunload=savemeniustate

function ShowTB(obj,id){
txt=obj.options[obj.selectedIndex].text;
if (txt.match('Alta-localitate')){ document.getElementById(id).style.visibility='visible';}
if (txt.match('Bucuresti') || txt.match('Alba-Iulia') || txt.match('Alexandria') || txt.match('Arad') || txt.match('Bacau') || txt.match('Baia-Mare') || txt.match('Alba-Iulia') || txt.match('Barlad') || txt.match('Bistrita') || txt.match('Botosani') || txt.match('Braila') || txt.match('Brasov') || txt.match('Buzau') || txt.match('Curtea-de-Arges') || txt.match('Calarasi') || txt.match('Campia-Turzi') || txt.match('Campina') || txt.match('Caracal') || txt.match('Cernavoda') || txt.match('Cluj-Napoca') || txt.match('Constanta') || txt.match('Craiova')){ document.getElementById(id).style.visibility='hidden'; }}

function ltrim(what)
{
var done=0;
var len=what.length;
while(what!=" " && done==0)
{
 if(what.charAt(0)==" ")
    {what=what.slice(1);}
 else done=1;
}

return what;
}
		
function isDigit (c)
{   return ((c >= "0") && (c <= "9"))
}

function isEmpty(s)
{   return (s.length == 0)
}

function isAlphanumeric(s)

{   var i;

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number or letter.
        var c = s.charAt(i);

        if (! (isDigit(c)) )
        return false;
    }

    // All characters are numbers or letters.
    return true;
}

function blinkIt() {
 if (!document.all) return;
 else {
   for(i=0;i<document.all.tags('blink').length;i++){
      s=document.all.tags('blink')[i];
      s.style.visibility=(s.style.visibility=='visible')  ?'hidden':'visible';
   }
 }
}

