﻿/*
	HTML Template Utility
	$Revision: 1.27 $
*/
com.adobe.htmltemplate = (function() {
var _scriptsSoFar,
_path = (_scriptsSoFar = document.getElementsByTagName("script"))[_scriptsSoFar.length - 1].getAttribute("src"),
_EXP_DOMAIN = new RegExp("^.+:\/\/[^\/]+"),
_DOMAIN = _path.match(_EXP_DOMAIN) || "";
function Single() {}
Single.prototype = {
cssloaded:0,
cssQueue: [],
enqueueCssPath: function(path) {
this.cssQueue.push(_DOMAIN + path);
}, 
featureTestReady: function() {
return ($("test-css") && com.adobe.css);
},
loadCondAssets: function() {
var head = document.getElementsByTagName('HEAD')[0]; 
if(!head) return;
var csspaths = new Array();
if(this.featureTestReady()) {
com.adobe.cssprofile.init();
if(browser.ua.indexOf('msie 5.2') == -1 && (browser.ua.indexOf('playstation') == -1) ) {
for(var i=0,len=arguments.length;i<len;i++) {
var arg = arguments[i];
switch(arg) {
case "pod": 
this.enqueueCssPath("/css/layout/units/pod.css");
if(com.adobe.cssprofile.features.iebox) {
this.enqueueCssPath("/css/layout/units/pod_ie.css");
}
com.adobe.ui.register('pods');
break;
case "tree": 
this.enqueueCssPath("/css/layout/modules/treelist.css");
com.adobe.ui.register('trees','explodes');
break;
case "tab": 
this.enqueueCssPath("/css/layout/modules/tabsection.css");
if(com.adobe.cssprofile.features.stretch) {
this.enqueueCssPath("/css/layout/modules/tabsection_ie.css");
}
com.adobe.ui.register('tabs');
break;
case "backcompat": 
var compatmode = true;
break;
}
}
}
if(com.adobe.cssprofile.isIE7) {
this.enqueueCssPath("/css/layout/units/pod_ie7.css");
}			
if(!com.adobe.cssprofile.features.after) {
this.enqueueCssPath("/css/layout/units/compact_noafter.css");	
com.adobe.ui.register('markers');	
}
if(com.adobe.cssprofile.features.stretch) {
this.enqueueCssPath("/css/layout/units/compact_ie.css");
this.enqueueCssPath("/css/layout/units/pullout_ie.css");
}
if(!com.adobe.cssprofile.features.adjacent) {
this.enqueueCssPath("/css/themes/markers_help.css");	
}
if(com.adobe.cssprofile.features.iebox) {
this.enqueueCssPath("/css/layout/units/menu_ie.css"); 
if(!compatmode)
{
this.enqueueCssPath("/css/layout/master_ie.css"); 
}
}
if(browser.isSafari && browser.kitV < 420) {
this.enqueueCssPath("/css/layout/units/swfcontent_help.css");	
}
if(browser.ua.indexOf('msie 5.2') != -1) {		
this.enqueueCssPath("/css/layout/master_macie.css");
this.enqueueCssPath("/css/layout/modules/tabsection.css");
}		
if(browser.ua.indexOf('playstation') != -1) {
document.write('<link href="/css/layout/ps3.css" type="text/css" rel="stylesheet" media="screen" />');
}
}
this.cssloaded = com.adobe.css.attachCssToDOM(this.cssQueue,head);
return true;
}
};
return new Single();			   
})();

