function new_getElementsByClassName(obj_src, clsName)
{
	var all_elems = Array();
	var all_elems_app = obj_src.getElementsByTagName("*");

	var ps = 0;
	for ( j=0 ; j<all_elems_app.length ; j++ )
	{
		if ( all_elems_app[j].className == clsName )
		{
			all_elems[ps] = all_elems_app[j];
			ps++;
		}
	}

	return all_elems;
}

function fix_chars_tosend(txt)
{
	txt = escape(txt);
	txt = txt.replace(/%u201C/g, "%93");
	txt = txt.replace(/%u201D/g, "%94");
	txt = txt.replace(/%u2018/g, "%91");
	txt = txt.replace(/%u2019/g, "%92");
	txt = txt.replace(/%u2026/g, "%85");
	txt = txt.replace(/\+/g, "%2B");
	return txt;
}

function get_url_resized_image(path, w, h)
{
	path = fix_chars_tosend(path);
	w = parseInt(w);
	h = parseInt(h);

	var url = './toolsajax.php?opt=photos&act=geturlresizedimage&path='+path+'&w='+w+'&h='+h;

	var sts = getWithAjax(url);

	if ( sts != "" )
	{
		return sts;
	}
}
function get_url_resized_images(paths, w, h)
{
	w = parseInt(w);
	h = parseInt(h);
	strpaths = "";
	for ( j=0 ; j<paths.length ; j++ )
	{
		if ( j>0 ) strpaths = strpaths + ";";
		strpaths = strpaths + fix_chars_tosend(paths[j]);
	}
	if ( j==0 ) return null;

	var vals = Array();
	vals[0] = Array("strpaths", strpaths);
	vals[1] = Array("w", w);
	vals[2] = Array("h", h);

	var url = "./toolsajax.php?opt=photos&act=geturlresizedimages";

	var sts = getWithAjaxPost2(url, vals);

	if ( sts != "" )
	{
		rows = sts.split(';');
		return rows;
	}
}
