function Gid(id){
 return document.getElementById(id);
}

function hideShow(id,flag) {
 var aim = Gid('tab'+id);

 var status = (flag==0) ? (aim && aim.className == 'akt' ? '' : 'akt') : 'akt';
 var aim = Gid('tab'+id);
 
 if(aim) aim.className = status;
 
 
 var aim = Gid('subtab'+id);
 var status = (flag==0) ? (aim && aim.className == 'hide' ? 'show' : 'hide') : 'show';
 
 var aim = Gid('subtab'+id);
 if(aim) aim.className = status;
}  
			
function OpenSubMenu(id){ 
 if(!id || id=='') return;
}

function showGal(src){
 var x = window.open(src,'',config='width=700,height=700,toolbar=no,resizable=yes,scrollbars=auto,location=no,menubar=yes,status=no');
 return false;
}

function VirtualTur(){
 var x = window.open('/a25/index.html?i=imagesFFFdef_presentation.flv&w=320&h=240&t=VIRTUAL TUR','',config='width=320,height=240,toolbar=no,resizable=yes,scrollbars=auto,location=no,menubar=yes,status=no');
 return false;
}


function SetPriceDigits(){

 var tags = document.getElementsByTagName('TD'),i,b;
 
 for(i=0,b=tags.length; i<b; i++){
  if(tags[i].className != 'price') continue;
  
  tags[i].innerHTML =  number_format(tags[i].innerHTML, 0, '.', '&nbsp;');
  //alert(tags[i].innerHTML);
 }
}

function number_format( number, decimals, dec_point, thousands_sep ) {
 var n = number, c = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals;
 var d = dec_point == undefined ? "." : dec_point;
 var t = thousands_sep == undefined ? "," : thousands_sep, s = n < 0 ? "-" : "";
 var i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0;
                                                             
 return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
 
}
	    
				  
