/* Agency.com 2005 */ 

// The label that is coming from the css.conf.js, is being used to complete the URL for the 
// correction-stylesheet. (for example: gecko -> gecko.css, safari -> safari.css)

// If you remove the // of line 48 and you view the HTML-page in a browswer, you will get a 
// pop-up alert with the label of the browser and which extra stylesheet is being used.
// If you want to know a label of a new browser you want to add to css_conf.js you can 
// use this line.



var css_conf = [
	{ re: /./, label: "default"}
];

function css(param) {
	// Define default properties, undefined values not allowed:
	var def = {
		prefix: ""
	}
	
	// Warn for the use of unused properties in the call:
	if (typeof param == 'undefined') {
		param = {};
	}
	for (var prop in param) {
		eval(
			"if (typeof def." + prop + "== 'undefined') " +
			"alert('Warning: \"" + prop + "\" is an unused property.')"
		);
	}
		
	// Generate local variable based on the properties used for this function:
	var p = {};
	for (prop in def) {
		p[prop] = (typeof param[prop] == 'undefined') ? def[prop] : param[prop];
	}

	var out = "";
	var ua = navigator.userAgent;
	for (var i = 0; i < css_conf.length; i++) {
		if (css_conf[i].re.test(ua)) {
			out += "<link href='styles/correction-styles/" + p.prefix + css_conf[i].label + ".css' rel=\"stylesheet\" type='text/css'>";
			if (css_conf[i].label != "") {
				document.write(out);
			}
			// alert(ua + " -> " + out);
			return true;
		}
	}
}

