var img_id = "imgFoto"
var photo_url_global
var win_domen_photos1, win_domen_photos2, win_domen_photos_text

function show_big_img(photo_url,win_id,HTML_file_url,win_format,OpenInNewWin) {
	photo_url_global = photo_url
	if (OpenInNewWin == 'new') 
		window.open(HTML_file_url,'',win_format)
	else 
		if (eval(win_id)==null || eval(win_id+".closed")) {
			eval(win_id+"=window.open('"+HTML_file_url+"','"+win_id+"','"+win_format+"')")
			eval(win_id+".focus()");
		}
		else {
			eval(win_id+'.document.images["'+img_id+'"].src="'+photo_url_global+'"')
			eval(win_id+".focus()")
		}
}

function big_img_set(type,photo_url,HTML_file_url,win_format,OpenInNewWin) {
	switch (type) {
		case "default":
			show_big_img(photo_url,'win_domen_photos1','win_photo.htm','width=580,height=410',1);
			break;
	}
}

//	<img src="project_braus_imagus/images/photos/automobiliai_daily.jpg" onclick="big_img_set_auto('default',this)">
function big_img_set_auto(type,obj_img,HTML_file_url,win_format,OpenInNewWin) {
	var big_img_ext = '_big'
	var img_src = obj_img.src
	var new_src = img_src.substring(0,img_src.length-4) + big_img_ext + img_src.substring(img_src.length-4,img_src.length)
	switch (type) {
		case "default":
			show_big_img(new_src,'win_domen_photos','window_photo.htm','width=500,height=378',1)
			break
	}
}

//-----------------------------------------------------------
//                      img in new window with text: begin
//-----------------------------------------------------------

function win_imgtext(photo_url,win_id,HTML_file_url,win_format,OpenInNewWin) {
	photo_url_global = photo_url
	if (OpenInNewWin == 'new') 
		window.open(HTML_file_url,'',win_format)
	else 
		if (eval(win_id)==null || eval(win_id+".closed")) {
			eval(win_id+"=window.open('"+HTML_file_url+"','"+win_id+"','"+win_format+"')");
			eval(win_id+".focus()");
		}
		else {
			eval(win_id+'.document.images["'+img_id+'"].src="'+photo_url_global+'"')
			win_domen_photos_text.zm_findObjById('photoText').innerHTML = photo_text
			eval(win_id+".focus()");
		}
}

function set_win_imgtext(type,photo_src,text) {
	photo_text = text
	if (type == 'photo_text') win_imgtext(photo_src,'win_domen_photos_text','window_photo-text.htm','width=500,height=420')
}

//	<img src="project_braus_imagus/images/photos/automobiliai_daily.jpg" onclick="set_win_imgtext_auto('default',this,'Nuotraukos parasas.')">
function set_win_imgtext_auto(type,obj_img,text) {
	var big_img_ext = '_big'
	var img_src = obj_img.src
	var new_src = img_src.substring(0,img_src.length-4) + big_img_ext + img_src.substring(img_src.length-4,img_src.length)
	photo_text = text
	if (type == 'photo_text') win_imgtext(new_src,'win_domen_photos_text','window_photo-text.htm','width=500,height=420')
}

//-----------------------------------------------------------
//                      img in new window with text: end
//-----------------------------------------------------------
