/**
 * @fileoverview tdc.colorscheme
 */

/**
 * tdc.tdc.colorscheme object
 * @constructor
 */
tdc.tdc.colorscheme = function() {
	/**
	 * Determines the colorscheme
	 * @author kimblim
	 */
	var color;
	
	function getColor() {
		return color;
	}
	
	return {
		
		/**
		 * returns a hex-code to use for sifr
		 */
		returnHex : function(){
			if(typeof(color) == "undefined"){
				getColor();
			}
			switch(color){
				case "blue":
					return "#006cb8";
					break;
				case "green":
					return "#4db848";
					break;
				case "purple":
					return "#802990";
					break;
				case "red":
					return "#ed1941";
					break;
				case "orange":
					return "#f7941d";
					break;
					
			}
		},
		
		/**
		 * Makes it possible to force a colorscheme
		 * @author kimblim
		 */
		forceColor : function(aColor){
			color = aColor;
		},
		
		/**
		 * Prints the stylesheet in the right color
		 * @author kimblim
		 */
		printStylesheet : function(){
			if(typeof(color) == "undefined"){
				getColor();
			}
			tdc.addStylesheet(tdc.getI()+"/css/f5/colorschemes/"+color+".css");			
		},
		
		/**
		 * Prints the logo in the right color
		 * @author kimblim
		 */
		printLogo : function(pUrl){
			if(typeof(color) == "undefined"){
				getColor();
			}
			if(!pUrl) pUrl = "http://tdc.dk/";
			if(tdc.browser.hasFlash() >= 6 && color != "blue"){
				document.writeln("<div id=\"t_globallogo_anim\">");
				document.writeln("<object type=\"application/x-shockwave-flash\" data=\""+tdc.getI()+"/swf/f5/colorschemes/"+color+"/logo/tdclogo_anim.swf?linkUrl="+pUrl+"\" width=\"175\" height=\"76\">");
				document.writeln("<param name=\"movie\" value=\""+tdc.getI()+"/swf/f5/colorschemes/"+color+"/logo/tdclogo_anim.swf?linkUrl="+pUrl+"\" \/>");
				document.writeln("<param name=\"wmode\" value=\"transparent\" \/>");
				document.writeln("<param name=\"AllowScriptAccess\" value=\"always\" \/>");
				document.writeln("</object>");
				document.writeln("</div>");
			} else {
				document.writeln("<a href=\""+pUrl+"\" title=\"TDC\"><img src=\""+tdc.getI()+"/gfx/f5/colorschemes/"+color+"/logo/tdclogo.gif\" id=\"t_globallogo\" /></a>");
			}
		}
	}
}();
