function xhr()
{
	var _xhr=null;
	if (window.XMLHttpRequest)
	{
		try
		{
	        _xhr = new XMLHttpRequest();
		}
		catch(ex)
		{
			alert(ex);
		}
		return _xhr;
    }
	else if (window.ActiveXObject)
	{
		
        try
		{
			_xhr = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(ex)
		{
			alert(ex);
		}
		return _xhr;
    }
	else
	{
		return null;
	}
}

function bindEvent(n,o,f)//nesne,olay,fonksiyon
{
	if(n.addEventListener)return n.addEventListener(o,f,false);
	else if(n.attachEvent)return n.attachEvent("on"+o,f);
}
function unbindEvent(n,o,f)
{
	if(n.detachEvent)return n.detachEvent("on"+o,f);
	if(n.removeEventListener)return n.removeEventListener(o,f,false);
}

function fillSelect(s,v)
{
	clearSelect(s);
	var i;
	var ss;
	s.options[0] = new Option(v[0],"");
	for(i=1;i<v.length;i++)
	{
		s.options[i] = new Option(v[i],v[i]);
	}
}

function clearSelect(s)
{
	var i;
	if(s)
	{
		for(i=s.options.length-1;i>-1;i--)s.options[i]=null;
	}
}
