function fixImgs() {
var obj = document.getElementById('fotogallery').getElementsByTagName( 'div' );
if(obj){

		var max = 0;
		
		for(var y = 0; y < obj.length; y++) {
			if(obj[y].getAttribute('name') == 'TexturePhotoBlock'){
				if(obj[y].clientHeight > max){
					max = obj[y].clientHeight;	
				}
			}
		}
		
		for(var z = 0; z < obj.length; z++){
			if(obj[z].getAttribute('name') == 'TexturePhotoBlock'){
				obj[z].style.height = max;
			}
		}
		
	}
	
}

function pagenum(p, filename){
    document.forms["nav"].elements["page"].value = p;
    document.forms["nav"].elements["filename"].value = filename;
    document.forms["nav"].submit();
}

function my_confirm(to, what){
	if (confirm(what))
		document.location=to;
}
				
var foto_windows = new Array();
function open_foto(url, winname, width, height){
	foto_windows[foto_windows.length] = window.open(url,winname,'height='+height+',width='+width+',resizable=0,scrollbars=no,menubar=no,status=no');
	for(i = 0; foto_windows.length > i; i++){
		if(!foto_windows[i].closed)
			foto_windows[i].focus();
	}
}

function do_search(text){
	var search_line = document.getElementById('sline');
	search_line.value = text;
	document.forms['web'].submit();
}

function newWindow(url,w,h){
w = w + 18;
h = h + 27;
Win = window.open(url, "Win", "width=" + w + ",height=" + h + "location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0","top=0,left=0");}

function tableLinesOn(pos)
{
	if (!document.getElementById) return;
	var id1 = document.getElementById('id1' + pos );
	var id2 = document.getElementById('id2' + pos );
	var id3 = document.getElementById('id3' + pos );
	if(id1.className == 'number')
		id1.className = 'numberOn';
	if(id2.className == 'name')
		id2.className = 'nameOn';
	if(id3.className == 'price')
		id3.className = 'priceOn';
	}

function tableLinesOff(pos)
{
	if (!document.getElementById) return;
	var id1 = document.getElementById('id1' + pos );
	var id2 = document.getElementById('id2' + pos );
	var id3 = document.getElementById('id3' + pos );
	if(id1.className == 'numberOn')
		id1.className = 'number';
	if(id2.className == 'nameOn')
		id2.className = 'name';
	if(id3.className == 'priceOn')
		id3.className = 'price';
	
	}

function tableClick(host, mode, pos)
{
	alert("aa1");
	alert(host + mode + pos);
	}
/*
function viewParagraph(Obj_id, mode_obj_id){
	var itemObj = document.getElementById("tab" + Obj_id);
	var tableObj = document.getElementById("table" + Obj_id);
	var tabs = document.getElementById('car_mode_tabs' + mode_obj_id).getElementsByTagName( 'div' );
	var tables = document.getElementById('car_mode_tabs' + mode_obj_id).getElementsByTagName( 'table' );
	
	for( var i = 0 ; tabs.length > i; i++ )
		if(tabs[i].className == 'tabs_item_on')
			tabs[i].className = 'tabs_item_off';
	
	for( var i = 0 ; tables.length > i; i++ )
		if(tables[i].className == 'tabs_table_on')
			tables[i].className = 'tabs_table_off';
	
	itemObj.className = 'tabs_item_on';
	tableObj.className = 'tabs_table_on';
	}*/
	function viewParagraph(ptable, link){
	var obj = document.getElementById(ptable);
	obj.className = obj.className == 'none' ? 'visible' : 'none';
	link.className = link.className == 'cur' ? '' : 'cur';
}
