<!-- document.oncontextmenu=new Function("return false"); -->
<!-- document.onselectstart = new Function( "return false" ); -->
var UA = navigator.userAgent.toLowerCase();
var OP = ( UA.indexOf('opera')   != -1);
var FF = ( UA.indexOf('firefox') != -1);
var IE = ((UA.indexOf('msie')    != -1) && (!OP) && (!FF));
var DOM = (document.getElementsByTagName) ? true : false;

function FindObject(name)
{
	if (IE || FF) return document.getElementById(name);
	if (OP) return document.layers[name];
}

function Ask(uyari, hedef)
{
	if( confirm( uyari ) )
	{
		self.location = hedef;
	}
}

function Popup(URL, W, H, SB, NM)
{
	window.open( URL, NM, "top=0,left=0,width=" + W + ",height=" + H + ",status,resize=no,scrollbars=" + SB );
}

function GosterGizle(name)
{
	var nesne = FindObject(name);

	if( nesne.style.display != 'none' )
		nesne.style.display = 'none';
	else
		nesne.style.display = '';
}

function setStatus(string)
{
	window.status = string;
}

function resetStatus()
{
	window.status = '';
}

function fillOptions(box, list)
{
	box.options.length = 0;
	for( i = 0; i < list.length; i += 2 )
	{
		box.options[i/2] = new Option(list[i], list[i+1]);
	}
}

function changeSelected( box, selected )
{
	box.readonly = false;
	for( i = 0; i < box.options.length; i++ )
	{
		if( box.options[i].value == selected )
			box.options[i].selected = 'selected';
	}
}

function mOver(Nesne)
{
	Nesne.className = Nesne.className + 'Over';
	Nesne.onmouseout = function(){mOut(Nesne);}
	return true;
}

function mOut(Nesne)
{
	Nesne.className = Nesne.className.substring( 0, Nesne.className.length - 4 );
	return true;
}

function replaceAll( str, bul, deg ) {
    while ( str.indexOf( bul ) != -1 ) {
        str = str.replace( bul, deg );
    }
    return str;
}

function in_array(the_needle, the_haystack)
{
	var the_hay = ','+the_haystack.toString()+',';
	if(the_hay == ',,') return false;
	if(the_hay.indexOf(','+the_needle+',') == -1) return false
	return true;
}


