﻿function msieversion() {
	var ua = window.navigator.userAgent
	var msie = ua.indexOf ( "MSIE " )

	if ( msie > 0 )      // If Internet Explorer, return version number
		return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )))
	else                 // If another browser, return 0
		return 0
}

$(function() {  
  $(".centered").each(function() {
    var elm = $(this);
    var wIn = elm.width();
    var wOut = elm.parent().width();
    
    if (msieversion() == 6) {
      elm.css("margin-left", (wOut - wIn) / 4);
    } else {
      elm.css("margin-left", (wOut - wIn) / 2);
    }
  });

  $(".centered2").each(function() {
    var elm = $(this);
    var wIn = elm.width();
    var wOut = elm.parent().width();
    elm.css("margin-left", (wOut - wIn) / 2);
  });
});
