  function transformValue( val, asInt ) {
    var asInt = asInt || false;
    var numeric = val.replace(/([^0-9^\,^\-^\.])/g, '');
    numeric = numeric.replace(/(\,\-\-)|(\,\-)/g, '');
    var matches = numeric.match(/([0-9]*)\.([0-9]{3,})/g);
    var i;

    if (matches) {
      for (i = 0; i < matches.length; ++i) {
        numeric = numeric.replace(/\./, '');
      }
    }

    matches = numeric.match(/^(([0-9]*)\,([0-9]{0,2}))$/g);
    if (matches) {
      for (i = 0; i < matches.length; ++i) {
        numeric = numeric.replace(/\,/, '.');
      }
    }

    matches = numeric.match(/^(([0-9]*)\,([0-9]{2})([0-9]+))$/g);
    if (matches) {
      for (i = 0; i < matches.length; ++i) {
        numeric = numeric.replace(/\,/, '');
      }
    }

    matches = numeric.match(/((([0-9]*)\,([0-9]*))*)\.([0-9]*)/g);
    if (matches) {
      numeric = numeric.replace(/\,/g, '');
    }

    if(asInt) {
      var aNum = numeric.split('.');
      if(aNum.length > 1 && aNum.pop().match(/([0-9]+)/g)) {
        numeric = aNum.join('.');
      }
    }

    if(!(numeric.match(/\./g))) {
	numeric = numeric+'.00';
    }

    return parseFloat(numeric).toFixed(2);
  }


function summerize() {
}


var OE3Main = function(){
	
	this.init = function(){
		$(document).ready(	function(){ 
								//forms
								//$('input, select, textarea').mouseover( function(){ $(this).addClass('selected') } );
								//$('input, select, textarea').mouseout( function(){ $(this).removeClass('selected') } );
								
								$('input, select, textarea').keydown( function(){ $(this).addClass('selected') } );
								$('input, select, textarea').focus( function(){ $(this).addClass('selected') } );
								$('input, select, textarea').change( function(){ $(this).removeClass('selected') } );
								
								$('input, select, textarea').change( function(){ $(this).addClass('selectedFixed') } );
								$('select').click( function(){ $(this).addClass('selectedFixed') } );
								
								//rollover div.nav ul li
								$('div.nav ul li').mouseenter(	function(){
																	  		var imgSrc = $('img', this).attr('src');
																			var rolloverSrc = $('img', this).attr('rel');
																			
																			$('img', this).attr('rel', imgSrc);
																			$('img', this).attr('src', rolloverSrc);
																			
																	  	} );
								
								$('div.nav ul li').mouseleave(	function(){
																	  		var imgSrc = $('img', this).attr('src');
																			var rolloverSrc = $('img', this).attr('rel');
																			
																			$('img', this).attr('rel', imgSrc);
																			$('img', this).attr('src', rolloverSrc);
																			
																	  	} );


								$("input.decimal").blur( function(){
									var val = $(this).val();
									if(jQuery.trim(val) !== '') {
										val = transformValue( val, false );
										$(this).val(val);
									}

									summerize();
								} );								
							});
	}
	
}

var OE3MAIN = new OE3Main();
OE3MAIN.init();



