var AutoClose = false;

if (parseInt(navigator.appVersion.charAt(0))>=4)

{

	var isNN=(navigator.appName=="Netscape")?1:0;

	var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;

}

var optNN='scrollbars=no,width=200,height=200,left=10,top=10';

var optIE='scrollbars=no,width=150,height=100,left=10,top=10';

function deschide(imageURL)
{
	if (isNN){	imgWin=window.open('about:blank','',optNN);	}

	if (isIE){	imgWin=window.open('about:blank','',optIE);	}
	with (imgWin.document)
	{
		writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
		writeln('var isNN,isIE;');
		writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
		writeln('isNN=(navigator.appName=="Netscape")?1:0;');
		writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
		writeln('function reSizeToImage(){');
		writeln('if (isIE){');
		writeln('window.resizeTo(300,300);');
		writeln('width=300-(document.body.clientWidth-document.images[0].width);');
		writeln('height=300-(document.body.clientHeight-document.images[0].height);');
		writeln('window.resizeTo(width,height);}');
		writeln('if (isNN){');      
		writeln('window.innerWidth=document.images["imagine"].width;');
		writeln('window.innerHeight=document.images["imagine"].height;}}');
		writeln('function doTitle(){document.title="Termosanitare";}');
		writeln('</sc'+'ript>');
		if (!AutoClose)	{	writeln('</head><body bgcolor=#FFFFFF scroll="no" onload="reSizeToImage();doTitle();self.focus()">')}
		else {	writeln('</head><body bgcolor=#FFFFFF scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');	}
		  writeln('<img id="imagine" src="'+imageURL+'" style="display:block"></body></html>');
		  close();
	}
}

if (!document.layers&&!document.all&&!document.getElementById)
event="test"
	
function showtip(current,e,text){
  if (document.all||document.getElementById){
  thetitle=text.split('<br>')
  if (thetitle.length>1){
    thetitles=''
    for (i=0;i<thetitle.length;i++)
      thetitles+=thetitle[i]
      current.title=thetitles
  }else
    current.title=text
  } else if (document.layers){
    document.tooltip.document.write('<layer bgColor="white" style="border:1px solid black;font-size:12px;">'+text+'</layer>')
    document.tooltip.document.close()
    document.tooltip.left=e.pageX+5
    document.tooltip.top=e.pageY+5
    document.tooltip.visibility="show" 
   }

}

function hidetip(){
 if (document.layers)
  document.tooltip.visibility="hidden"
}


function permite(e,allow)
{ 
 var k;
 k=document.all?parseInt(e.keyCode): parseInt(e.which);
 return (allow.indexOf(String.fromCharCode(k))!=-1);	
}

var numbers='1234567890'
var custom='32, 46'

function confirmSubmit(mesaj, url)
{
	var mesaj;
	var url;
	var agree=confirm(mesaj);
	if (agree)
		document.location = url;
	else
	return false ;
}


function deschide_html (url, w, h, scrollb)
{
	open(url, "",'menubar=no,directories=no,location=no,resizable=no,scrollbars=' + scrollb + ',width=' + w + ',height=' + h);

}



function showSubcateg(id){
	if($('#subcateg_link_'+id).hasClass('open')){
		$('#subcateg_link_'+id).removeClass('open');
		$('#subsubcateg_'+id).css('display','none');
		return false;
	} else {
		$('#subsubcateg_'+id).css('display','block');
		$('#subcateg_link_'+id).addClass('open');
		return false;
	}
}
