/*
 
 -----------------------------------------
   Ie.js
 -----------------------------------------

 * @version 0.1
 * @author LBi - http://www.lbi.com/en
 * @requires jQuery Core 1.3.2 - http://www.jquery.com/

*/

/**
 * @namespace Root namespace for holding all objects created for BT Tradespace.
 */
 
if (typeof BTT == "undefined") {BTT = {}; }





/**
 * Contains methods used by different versions of Internet Explorer
 * @namespace Contains methods used by different versions of Internet Explorer
 * @member BTT
 */
BTT.IE = {
	
	/**
	* IE6, 7:  Wraps input elements in empty spans to remove inherited margin bug
	*/
	fixInheritedMarginBug:  function() {
		$('input').wrap('<span></span>');
		return true;
	},
	
	/**
	* IE6:  Remove hidden elements in the media editor
	*/
	fixHiddenElements:  function() {
		$('div#mediaFile .JS_hidden').each(function(i){
			$(this).removeClass('JS_hidden');
		});
	},
	
	/**
	* IE6, 7, 8:  Inserts empty DIV to help IE style a lightbox's transparent background
	*/
	fixLightboxes:  function() {
		// Seems currently not to work
		//$('*.layoutAreaLightbox').append('<div class="IE_lightboxBg">TEST!</div>');
		//return true;
		
	},
	
	/**
	* IE6:  Creates classes on input elements to help set input widths in ie6
	*/
	fixInputWidths:  function() {
		$('input[type="radio"]')	.addClass("IE_inputRadio");
		$('input[type="checkbox"]')	.addClass("IE_inputCheckbox");
		$('input[type="text"]')		.addClass("IE_inputText");
		$('input[type="password"]')	.addClass("IE_inputPassword");
		$('input[type="image"]')	.addClass("IE_inputImage");
		$('input[type="submit"]')	.addClass("IE_inputSubmit");
	},
	
	/**
	* IE6:  IE7, 8:  Makes round cornered buttons, woo!
	*/
	roundButtons:  function() {
		var extraBits = '<div class="buttonIE-tl">&nbsp;</div>' +
						'<div class="buttonIE-tr">&nbsp;</div>' +
						'<div class="buttonIE-bl">&nbsp;</div>' +
						'<div class="buttonIE-br">&nbsp;</div>'
		$('div.button')
			.not('div.buttonPlain')
			.addClass("buttonIE")
			.append(extraBits);
	},
	
	/**
	* IE6, 7, 8:  Makes round corners
	*/
	roundCorners:  function() {
		DD_roundies.addRule('*.contentAreaPanel *.contentAreaPanel', '5px');
		DD_roundies.addRule('ul#sessionDetails', '0 0 10px 10px');
	},
	
	/**
	* IE6:  PNG fix solution for IE6. The PNG fix will only operate on those PNGs
	* postfixed with '-alpha' as in: 'my-image-alpha.png'. The requirement of the
	* 'alpha' postfix is a BT customisation of 'DD belated PNG'.
	* @requires DD belated PNG - http://www.dillerdesign.com/experiment/DD_belatedPNG/
	*/
	fixPNGs:  function() {
		
		if(typeof DD_belatedPNG !== undefined) {
			DD_belatedPNG.fix('*');
		}
		
	}
	
};



