function dbwt_addonLoadEvent(functionName, browser){//this function attaches window obj on load events
	var browserExp, old_onload;

	switch( browser ){
		case 'all'://any browser
			browserExp = true;
			break;
		case 'IE':// all MS Internet Explorer verssions
			browserExp = ( document.all && !navigator.language ) ? (true) : (false);
			break;
		case 'IE6':// MS Internet Explorer6 and above
			browserExp = ( document.all && !navigator.language && (-1 == navigator.appVersion.indexOf("MSIE 7")) ) ? (true) : (false);
			break;
		case 'IE7':// MS Internet Explorer7
			browserExp = ( document.all && !navigator.language && (-1 != navigator.appVersion.indexOf("MSIE 7")) ) ? (true) : (false);
			break;
		case 'Gecko':// firefox and other gecko browsers
			browserExp = ( !document.all ) ? (true) : (false);
			break;
		case 'Opera'://opera browsers
			browserExp = ( document.all && navigator.language ) ? (true) : (false);
			break;
		default:
			browserExp = false;
			break;
	}

	if( browserExp == false ) return false;

	if( functionName.substr(functionName.length-1,1) != ")" && functionName.substr(functionName.length-1,1) != ";" )
		functionName += "();";
	else if( functionName.substr(functionName.length-1,1) == ")" )
		functionName += ";";

	if( typeof window.onload == 'function' ) {
		old_onload = window.onload;
		window.onload = function (){ old_onload(); eval(functionName); }
		return true;
	}else{
		window.onload = function(){ eval(functionName); };
		return true;
	}
}

//-------- function that display's an confirmation box --------
// Displays an confirmation box, and returns true if user agree and false if user desagree
function confirmBox(){
		var is_confirmed = confirm('Do you want to delete this article?');
		return is_confirmed;

}
//-------- confirmBox end's --------


function moveBG(id,position)
{
	document.getElementById(id).style.backgroundPosition = position + 'px 0px';
}

function toggleVisibility(divID,state) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[divID].visibility = state ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(divID);
        obj.style.visibility = state ? "visible" : "hidden";
        obj.style.display = state ? "block" : "none";
    }
    else if(document.all)	// IE 4
    {
        document.all[divID].style.visibility = state ? "visible" : "hidden";
    }
}

function changeBGColor(item)
{
	if(document.getElementById(item).style.backgroundColor == '')
	{
		document.getElementById(item).style.backgroundColor = '#E9E9E9';
	}
	else
	{
		document.getElementById(item).style.backgroundColor = '';
	}
}
