$(function() {
	//$('#container').wrapAll('<table class="ui-c"><tr class="ui-c"><td class="ui-c"></td></tr></table>');
	$('body').addClass('ui-js-active');
	

	if( jQuery.browser.msie &&  jQuery.browser.version == '6.0' ) {
		
		for( var i = 0 ; i<document.styleSheets.length ; i++ ) {
			scanStyleSheet(document.styleSheets[i]);
		}
		
	}
});


function scanStyleSheet( sheet, base ) {
	if( base == null ) base = '';
	
	var path = sheet.href.split('/');
	path.pop();
	path = path.join('/');
	
	
	if( base != ''  ) {
		if( path != '' ) {
			path = base+'/'+path;
		} else {
			path = base;
		}
	}
	
	for( var j = 0 ; j<sheet.imports.length ; j++ ) {
		scanStyleSheet(sheet.imports[j],path);
	}
	for( var j = 0 ; j<sheet.rules.length ; j++ ) {
		if( jQuery.browser.version == '6.0' ) {
			var bgImg = new String(sheet.rules[j].style.backgroundImage);
			if(bgImg.indexOf(".png")!=-1) {
				var iebg = bgImg.split('url(')[1].split(')')[0];
				sheet.rules[j].style.backgroundImage = 'none';
				sheet.rules[j].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+path+"/" + iebg + "',sizingMethod='scale')";
			}
		}
		if( sheet.rules[j].style.opacity != null ) {
			sheet.rules[j].style.filter = "alpha(opacity = "+(sheet.rules[j].style.opacity*100)+")";
		}
	}
}

