function copyValue(to, from)
{
	document.getElementById(to).value = document.getElementById(from).value;
	return true;
}

// создание ajax объекта  
function createRequestObject()   
{  
    try { return new XMLHttpRequest() }  
    catch(e)   
    {  
        try { return new ActiveXObject('Msxml2.XMLHTTP') }  
        catch(e)   
        {  
            try { return new ActiveXObject('Microsoft.XMLHTTP') }  
            catch(e) { return null; }  
        }  
    }  
 }  

function showContent(link, content, loading) {  
	if (!link) return false; 
	if (!content) content = 'contentBody'; 
	if (!loading) loading = 'loadingBody'; 
    var cont = document.getElementById(content);  
    var loading = document.getElementById(loading);  
  
    cont.innerHTML = loading.innerHTML;  
  
    var http = createRequestObject();  
    if( http )   
    {  
        http.open('get', link);  
        http.onreadystatechange = function ()   
		{  
            if(http.readyState == 4)   
            {  
                cont.innerHTML = http.responseText;  
            }  
        }  
        http.send(null);      
    }  
    else   
    {  
		document.location = link;  
    }  
 }  
 
 function add_favorite(a) { 
  title=document.title; 
  url=document.location; 
  try { 
    // Internet Explorer 
    window.external.AddFavorite(url, title); 
  } 
  catch (e) { 
    try { 
      // Mozilla 
      window.sidebar.addPanel(title, url, ""); 
    } 
    catch (e) { 
      // Opera 
      if (typeof(opera)=="object") { 
        a.rel="sidebar"; 
        a.title=title; 
        a.url=url; 
        return true; 
      } 
      else { 
        // Unknown 
        alert('Unknown browser!'); 
      } 
    } 
  } 
  return false; 
}

function clearBox(box, text, action, password)
{
	if (action == 'click')
	{
		if (box.value == text) 
		{
			box.value = "";
			if (password) 
			{
				box.type = "password";
			}
		}
	}
	else if (action == 'blur')
	{
		if (box.value == "") 
		{
			if (password) 
			{
				box.type = "text";
			}		
			box.value = text;
		}
	}	
}
