// Template Class for javascript

function template(){
	
	// Layout Elements
	this.layout = 'standard';
	this.color	= 'blue';
	this.logo	= 'images/logo_blue.gif';
	this.nav	= '';
	this.banner = banner;
	
	// Banner Elements
	this.url	= 'http://bdaley.webtools.ucdev.selfip.net/php/banner.php?';
	this.style	= 1;
	this.type	= 'gif';
	this.line1	= '';
	this.line2	= 'Web Tools';
	this.type	= 'gif';
	
	
	

	this.render = render;

	function banner(){
		
		// Base url
		var temp = this.url;
		
		// Style
		temp += "style=" + this.style;
		
		// Type
		temp += "&type=" + this.type;
		
		// Line 1
		temp += "&line1=" + escape(this.line1);
		
		// Line 2
		temp += "&line2=" + escape(this.line2);
		
		// Color
		temp += "&color=" + this.color;
		
		return temp;
	}	
	
	
	function render(){
		// Change the logo
		document.getElementById("head_uconn").style.background = "transparent url(http://web.uconn.edu/webtools/global/images/logo_"+this.color+".gif) no-repeat scroll 0%";
		
		// Change the banner
		document.getElementById("header").style.backgroundImage = "url("+document.getElementById("banner").src+")";

		// Change the left nav color
		var nav_left = document.getElementById("nav_styles");
		if(this.nav != "")
			nav_left.href = "http://web.uconn.edu/webtools/dwt/css/"+this.nav.substring(1)+".css";

		// Change primary color
		if(this.color != "blue" && this.color != "")
			document.getElementById("optional_styles2").href = "http://web.uconn.edu/webtools/global/css/"+this.color+".css";
		else
			document.getElementById("optional_styles2").href = "";
		
		
		// Change the layout
		if(this.layout == "centered")
			document.getElementById("optional_styles").href = "http://web.uconn.edu/webtools/global/css/fixed.css";
		else
			document.getElementById("optional_styles").href = "";
			
	}	

}

