  function launch(name,width,height,path){
  var win_dimensions = "height = " + eval(height + 90) + ", width = " + eval(width + 30);
  foto=window.open("/photo.php?foto_name="+name+"&path="+path,"foto", win_dimensions)
  foto.moveTo(100, 50);
  }

function $() {return document.getElementById(arguments[0]);}

function createRequestObject()
{
    var reqObj=null;
    try
	{
    	reqObj=new ActiveXObject('Msxml2.XMLHTTP');
    }
	catch (e){}
    if(!reqObj)
	try
	{
    	reqObj=new ActiveXObject('Microsoft.XMLHTTP');
	}
	catch (e){}
    if(!reqObj)
	try
	{
    	reqObj=new XMLHttpRequest();
    }
	catch (e){}
    return reqObj;
}

  function set_answer(fromurl)
{
	var http=createRequestObject();
	var url='http://bar-bq.ru/_set_answer.php?id_poll=';
	var oRadio;

	for (var i=0; (oRadio=$('pollform').getElementsByTagName('input')[i]); i++)
	{
		if (oRadio.checked)
		{
			http.open('GET', url+$('id_poll').value+'&id='+oRadio.value+'&from='+fromurl);

		   	http.onreadystatechange=function()
		   	{
		   		if (http.readyState==4)
		       		handleResponse(http,fromurl);
			}
		    http.send("");
	    }
	}
}

function handleResponse(http,fromurl)
{
    if(http.readyState==4)
	{
	    if (http.responseText!='')
	    {
			var arrEchoText=http.responseText.split('|');
	    	$('poll_question').innerHTML='<nobr>'+arrEchoText[0]+'</nobr>';
			$('poll_answers').innerHTML='<nobr>'+arrEchoText[1]+'<nobr>';
			$('poll_link').innerHTML='<a href="/votes">Архив опросов</a>';
		//alert(arrEchoText[1]);
		}
	}
}

jsHover = function(id, tag) {
    var hEls = document.getElementById(id).getElementsByTagName(tag);
    for (var i=0, len=hEls.length; i<len; i++) {
        hEls[i].onmouseover=function() { this.className+=" jshover"; }
        hEls[i].onmouseout=function() { this.className=this.className.replace(" jshover", ""); }
    }
}

function menu() { // run only for IE6 and 7
    if (window.attachEvent && navigator.userAgent.indexOf("Opera")==-1) 
    jsHover("mm", "li");
}


