
function setbg(e_who,e_color)
{
	//e_current.style.backgroundImage='url(templates/default/img/menu_left_bg2.gif)';
	//html_collection = window.document.getElementById( e_who );
	
	e_who.style.background = e_color;
	//alert( e_who.style.bgcolor );
}


function alphaimage( l_id, l_src )
{
//'78423759'
	var ver = navigator.appVersion;
	//l_img = window.document.getElementById(l_id);
	l_img = l_id;
	if (ver.indexOf("MSIE") != -1)
	{
		l_img.document.write( "<img src='./project/templates/site/img/blank.gif' style='filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+l_src+");'>" );
		//-debug
		//l_img.setAttribute( 'src',   theme+'img/blank.gif' );
		//l_style = 'filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='+theme+'img/index_LEFTUP_corner.png);';
		//alert( l_style );
//style="padding-top:35;padding-right:46; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src={theme}img/index_LEFTUP_corner.png);"
		//l_img.setAttribute( 'style', 'filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='+theme+'img/index_LEFTUP_corner.png);' );
	}else
	{
		//-debug
		l_img.document.write( "<img src='"+l_src+"'>" );
		//window.document.write( "<td valign='top' style='padding-top:35;padding-right:46;' background='{theme}img/index_LEFT_models.png'>" );
	}
}//end_ func_ alphaimg



/*function alphabackground( l_id, l_src )
{
	//l_img = window.document.getElementById(l_id);
	//l_img.setAttribute( 'background', l_src );
	//l_img.setAttribute( 'style', 'background-image:url(./project/templates/site/img/index_TOP_bg.png);' );
	//.document.write('zuzu')
}*/


function showhtmlelement( l_element_name )
{
	window.document.getElementById(l_element_name).style.visibility='visible';
}


function hidehtmlelement( l_element_name )
{
	window.document.getElementById(l_element_name).style.visibility='hidden';
}


function getgetvar(searchStr)
{
   start_var = 0;
   //while(1)
   for(i=0;i<100;i++)
   {
	//âûäèðàåò êóñîê ñòðîêè... ñíà÷àëî ñ 0 ýëåìåíòà äî êîíöà, ïîòîì ñ íàéäåííîãî è.ò.ä
	from_location = String(location).substring(start_var,String(location).length);
	start_var = String(from_location).indexOf(searchStr);
	if ( start_var==-1 )
	{
		return -1;
		break;
	}

	is_var = String(from_location).substring(start_var-1,start_var);
	if ( is_var=="&" || is_var=="?" )
	{
		start_value = from_location.indexOf(searchStr)+searchStr.length+1;

		end = (from_location.indexOf('&', start_value) == -1)
			? from_location.length
			: from_location.indexOf('&', start_value);

		return unescape( from_location.substring(start_value,end) );
	}


	start_var++;
   }//end_ while
}


function open_in_new_window(href,width,height)
{
	l_window = window.open(
		href,
		'',
		'width='+width+'px,height='+height+'px;toolbar=no,menubar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes');
}









//===================================
// ==== ÎÁÐÀÁÎÒÊÀ ÊÓÊÈÑÎÂ ==========
//===================================

function getCookieVal (offset)
{ 
	var endstr = document.cookie.indexOf (";", offset); 
	if (endstr == -1) 
	endstr = document.cookie.length; 
	return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name)
{ 
	alert( document.cookie );
	var arg = name + "="; 
	var alen = arg.length; 
	var clen = document.cookie.length; 
	var i = 0; 
//alert( document.cookie );
	while (i < clen)
	{ 
		var j = i + alen; 
		if (document.cookie.substring(i, j) == arg) 
		return getCookieVal (j); 
		i = document.cookie.indexOf(" ", i) + 1; 
		if (i == 0) break; 
	}//end_ while
	return null;
}



function SetCookie(name, value)
{ 
	alert( "zuuu" );
	var argv = SetCookie.arguments; 
	var argc = SetCookie.arguments.length; 
	var expires = (argc > 2) ? argv[2] : null; 
	var path = (argc > 3) ? argv[3] : null; 
	var domain = (argc > 4) ? argv[4] : null; 
	var secure = (argc > 5) ? argv[5] : false; 
	document.cookie = name + "=" + escape (value) + 
		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
		((path == null) ? "" : ("; path=" + path)) + 
		((domain == null) ? "" : ("; domain=" + domain)) + 
		((secure == true) ? "; secure" : "");
}


