(function (adspec) {
	adspec = adspec || {};
   
	// This function escapes the value unless the value is undefined
	function e(x) {
		if (typeof x=="undefined") {
			return "";
		}
		else {
			return escape(x);
		}
	}

	// This function builds a full uri from the path x and the querystring q	
	// x - an array object containing the path parts
	// q - an object/assoc array with name/value pairs for the query string
	function p(x, q) {
		var tqs = "";
		for (var m in q) {
			if (q[m] != null && (!isNaN(q[m]) || q[m].length > 0)) {
				if (tqs.length > 0)
					tqs += "&";
				tqs += m + "=" + e(q[m]);
			}
		}		
		return x.join("/")+".html?" + tqs;
	}

    // Flatten the object into the query string format
    // s - the source object
    function parq(s) {
	    var qs = [];
	    for (var p in s) qs.push(encodeURIComponent(p)+'='+encodeURIComponent(s[p]));
	    return qs.join('&');
    }
    	
	// Builds an element (x) with the attributes in a.
	function ele(x, a) {		
		var z = "<" + x;
		for (var k in a) {
			z += " " + k + "=\"" + a[k] + "\"";
		}
		z += "><" + "/" + x + ">";
		return z;
	}

	var host = "onsite.mycareer.com.au";
	var el = adspec["el"] || null; // the destination element.  if null, then will be written to the document.
	if (el != null) el = document.getElementById(el);
	var q; // the querystring
	adspec["skin"] = adspec["skin"] || "mycareer"; // default partition
	adspec["style"] = adspec["style"] || "search"; // default style
	adspec["show"] = adspec["show"] || "keywords,locations"; // default search box style
	adspec["width"] = adspec["width"] || "468"; // default width
	adspec["height"] = adspec["height"] || "60"; // default width
	adspec["affiliate"] = adspec["affiliate"] || ""; // default affiliate. Use "clix" for ClixGalore.
    adspec["params"] = adspec["params"] || {}; // default params. Use {"BID": 59803, "AfID": 95} for ClixGalore affiliate.

	switch (adspec["style"]) {
	case "browse":
		adspec["show"] = adspec["show"] || "sectors"; // default browse box style
		break;

	case "search":
		adspec["show"] = adspec["show"] || "keywords,locations"; // default search box style
		break;

	case "jobroll":
		adspec["show"] = "jobs";
		break;
	}

	q = { "style": adspec["show"], "l": adspec["location"], "c": adspec["sector"], "sc": adspec["subsector"], "q": adspec["keyword"], "rnd": Math.random(), "s_cid": adspec["s_cid"] || "jos:unknown" , "affiliate": adspec["affiliate"]};

	if (adspec["ag"] != null) q["ag"] = adspec["ag"];
	if (adspec["title"] != null) q["title"] = adspec["title"];
	if (adspec["target"] != null) q["target"] = adspec["target"];
	if (adspec["disabled"] != null) q["disabled"] = adspec["disabled"];
	if (adspec["params"] != null) q["params"] = parq(adspec["params"]);
	
	var cr = ele("iframe", {"id": "syndFrame", "frameborder": 0, "marginheight": 0, "marginwidth": 0, "scrolling": "no", "width": parseInt(adspec["width"]), "height": parseInt(adspec["height"]), "src": p([ "http://" + host, adspec["style"], adspec["skin"], e(adspec["width"] + "x" + adspec["height"]) ], q)});	
	if (el == null)
		document.write(cr);	
	else
		el.innerHTML = cr;			    	    	
})(MyCareer_ad);
MyCareer_ad = null;

//
// Version: 10.21.0.0;
// Processed: 10:24:41 10/02/2010;
// Server: MYCAREERWEB4;
// IP: ;
// Country: ;
// ISP: ;
// User Agent: CCBot/1.0 (+http://www.commoncrawl.org/bot.html)
