// JavaScript Document

function roundNumber(rnum) {
	

	var rlength = 2; // The number of decimal places to round to
	/*
	if (rnum > 8191 && rnum < 10485) {
		rnum = rnum-5000;
		var newnumber = Math.round(rnum*Math.pow(10,rlength))/Math.pow(10,rlength);
		newnumber = newnumber+5000;
	} else {
		var newnumber = Math.round(rnum*Math.pow(10,rlength))/Math.pow(10,rlength);
	}
	
	*/
	var newnumber = Math.round(rnum*Math.pow(10,rlength))/Math.pow(10,rlength);
	
	return newnumber;
}

	function toggle(obj)
		{
		        var el = document.getElementById(obj);
				
		        if ( el.style.display != 'none') {
					
		                el.style.display = 'none';
		        }
		        else {
		                el.style.display = 'Block';
		        }
		}


// -- Fuck Toggle !

	
	//  ---  date Time  Formating  
	
function DetectBrowser()
{
        var temp = navigator.appName;
        temp = temp.toLowerCase();

        if (temp == 'microsoft internet explorer')
                return 'IE';
        else
                return 'NS';
}


//-- Combo Functions 

function ComboAdd(Object, Value, String)

	{
			Value = Value
			String = String
	
			if (Value.length < 1 || String.length < 1)
					return false
	
			Object[Object.length] = new Option(String, Value);
			//Object.selectedIndex = Object.length-1;
	}


function ComboDel(Object)
{
        var selected_index = Object.selectedIndex
        if (selected_index >= 0)
        {
                Object.options[Object.selectedIndex] = null;
                if (selected_index > 0)
                        Object.selectedIndex = selected_index -1
                else
                        Object.selectedIndex = 0;
        }
}

//-- End Aditional Functions 
