/**********************************
***********************************
        модуль обработки ховеров 
 **********************************
 *********************************/

function H_preloadImages() 
	{
	var d=document; 
	if(d.images)
		{ 
		if ( !d.H_p ) 
			d.H_p=new Array();

		var i, j=d.H_p.length, a=H_preloadImages.arguments; 
		
		for(i=1; i<a.length; i++)
			{
			d.H_p[j] = new Image;
			d.H_p[j++].src = a[0] + a[i];
			}
		}
	}
	
//Префикс для Ховер файла
if ( !H_FilePrefix )
	var H_FilePrefix = "_over";
	
//Обработка Ховера; mode=["over", "out"]
function H_getImgSrc (el_name, mode , cur_prefix ) {
	var el  = getElement (el_name);
	if ( !el )
		return "";

	if  ( !el.getAttribute ("source_file") ) {
		var H_FileName = "";	
		var H_FileExt = "";	
		var str = el.src; //полное имя файла
		//Получаем индекс разделителя имени файла и расширения
		var H_PointIndex = str.lastIndexOf( ".", (str.length-1));
		//Выделяем полное имя файла без расширения из полного имени файла
		H_FileName = str.substring (0, H_PointIndex);
		//Выделяем расширение из полного имени файла
		H_FileExt = str.substring (H_PointIndex);
		//Формируем имя Ховер файла
		H_FileName += H_FilePrefix + ( cur_prefix ? cur_prefix : "" ) + H_FileExt;
		//Записываем имя файла и имя Ховер файла в атрибуты объекта
		if( mode && mode == "hard" ) {
			el.setAttribute ("source_file", H_FileName);
			el.setAttribute ("hover_file", H_FileName);
			}
		else {
			el.setAttribute ("source_file", str);
			el.setAttribute ("hover_file", H_FileName);
			}
		}
	if( mode && mode == "hard"	) { 
		el.src = el.getAttribute ("hover_file");
		}
	else if ( mode ) {
		//alert( el.getAttribute ("hover_file") );
		if( el.src != el.getAttribute ("hover_file") ) el.src = el.getAttribute ("hover_file");
		}
	else {
		if( el.src != el.getAttribute ("source_file") ) el.src = el.getAttribute ("source_file");	
		}
	}
	