function onCurrency() {
  if(document.frmCurr.currency.value>=0) document.frmCurr.submit();
}


function toggleMessage(id) {
	var m=document.all['msg'+id];
	if (m) {
		if (m.style.display=="inline")
			m.style.display="none";
		else
			m.style.display="inline";
	}
}

function CheckIE(id){
	if(!$.browser.msie)
		toggleTabs(id);
	else{
		if(getUrlParam('tabnum')!="")
		{
			var str = window.location + '';
			window.location=str.replace('&tabnum=' + getUrlParam('tabnum'), '&tabnum=' + id);
		}
		else
			window.location=window.location + '&tabnum=' + id;
	}
}


function toggleTabs(id) {
	for(var i=0; i<6; i++){
		var m = document.getElementById('tabsdiv'+i);
		var s = document.getElementById('tabspan'+i);
		if (m) {
			if (m.id=='tabsdiv'+id)
			{
				m.style.display="inline";
				m.className='onn';
			}
			else
			{
				m.style.display="none";
				m.className='off';
			}
		if(s)	{
			if (s.id=='tabspan'+id)
				s.className='onn';
			else
				s.className='off';
		}
		}
	}
}

 function include_js(file)

 {

     var include_file = document.createElement('script');

     include_file.type = 'text/javascript';

 	include_file.src = file;

 	document.getElementsByTagName('head')[0].appendChild(include_file);

 }
 
 
 function RefreshImage(valImageId) {
	var objImage = document.images[valImageId];
	if (objImage == undefined) {
		return;
	}
	var now = new Date();	
	objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
}

function getUrlParam(name){
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}
/*
$.fn.centerInClient = function(options) {
    /// <summary>Centers the selected items in the browser window. Takes into account scroll position.
    /// Ideally the selected set should only match a single element.
    /// </summary>    
    /// <param name="fn" type="Function">Optional function called when centering is complete. Passed DOM element as parameter</param>    
    /// <param name="forceAbsolute" type="Boolean">if true forces the element to be removed from the document flow 
    ///  and attached to the body element to ensure proper absolute positioning. 
    /// Be aware that this may cause ID hierachy for CSS styles to be affected.
    /// </param>
    /// <returns type="jQuery" />
    var opt = { forceAbsolute: false,
                container: window,    // selector of element to center in
                completeHandler: null
              };
    $.extend(opt, options);
   
    return this.each(function(i) {
        var el = $(this);
        var jWin = $(opt.container);
        var isWin = opt.container == window;

        // force to the top of document to ENSURE that 
        // document absolute positioning is available
        if (opt.forceAbsolute) {
            if (isWin)
                el.remove().appendTo("body");
            else
                el.remove().appendTo(jWin.get(0));
        }

        // have to make absolute
        el.css("position", "absolute");

        // height is off a bit so fudge it
        var heightFudge = isWin ? 2.0 : 1.8;

        var x = (isWin ? jWin.width() : jWin.outerWidth()) / 2 - el.outerWidth() / 2;
        var y = (isWin ? jWin.height() : jWin.outerHeight()) / heightFudge - el.outerHeight() / 2;

        el.css("left", x + jWin.scrollLeft());
        el.css("top", y + jWin.scrollTop());

        // if specified make callback and pass element
        if (opt.completeHandler)
            opt.completeHandler(this);
    });
}*/
