$(document).ready(function() {
		$('#sslpartner_container').tabs({ cookie: { expires: 7} });
		//Check for IE6, then add css style to 1st li element (tab)
		$.each($.browser, function(i, val) {
			if(i=="msie" && $.browser.version.substr(0,1)=="6") {
				$("#sslpartner_container .ui-tabs-nav li").css({"margin-left" : "5px"});
				$("#sslpartner_container .ui-tabs-nav li:first").css({"margin-left" : "0px"});
				$("#sslpartner_container .ui-tabs-nav li a").css({"margin-left" : "0px"});
				$("#sslpartner_container .ui-tabs-nav li a span").css({"width" : "82px", "padding-left": "5px", "padding-right":"5px" });
				$("#sslpartner_container .ui-tabs-nav li:last").css({"width":"110px", "margin-left":"0px", "padding-left": "5px", "padding-right":"5px"});
				$("#sslpartner_container .ui-tabs-nav li:last span").css({"width":"90px"});
			}
		});
		$.each($.browser, function(i, val) {
			if(i=="msie") {
				$("#tab4").css({"padding-bottom":"23px"});
				$("tr.blueHead th:first-child").css({"background" : "url(/assets/partners/images/bluebox_head_left-ie.gif) repeat-x left top"});
			}
		});
		$("#imgToggle").css({"padding-top":"7px"});
		
		/*
		var img_items = $('#imgToggle div');
		var i = 0;
		var maxheight =0;
		//Get max height
		for (i = 0; i < img_items.length; i++) {
			if (img_items.eq(i).height() > maxheight) {
				maxheight = img_items.eq(i).height();
			}
		}
		
		for (i = 0; i < img_items.length; i++) {
			if (img_items.eq(i).height() < maxheight) {
				var height_diff = maxheight - img_items.eq(i).height();
				var topmarg = (height_diff / 2) + "px";
				img_items.eq(i).css({"padding-top": topmarg});
			}
		}
		
		$("#imgToggle").css({"height":maxheight});
		*/
		
		//Function that makes the Featured SSL Partner Image toggler work
		function toggleFeaturedImg () {
			var img_items = $('#imgToggle div');
			var img_items_id = img_items.filter(':visible').attr('id');
			var i = 0;
			
			for (i = 0; i < img_items.length; i++) {
				//console.log(img_items_id + " = " + img_items.eq(i).width() + " x " + img_items.eq(i).height());
				if (img_items_id == "fimg" + (i)) {
					img_items.hide();
					if ( i == (img_items.length -1)) {
						img_items.eq(0).show();
					}
					else {
						img_items.eq(i+1).show().find('p').css({"text-align":"center","padding":"0px","margin":"0px"});
					}
						
				}
			}
		}
		
		//Execute image toggler function every 5 seconds
		$("#imgToggle").everyTime(3000, toggleFeaturedImg);

	});
