
        
    	unrulyGeoUrl = function() {
		
    		function getQsParams(){
                var qsParams = {length:0, keys:new Array()};
                var usestr = document.location.href;
                if(usestr.split("?").length == 2) {
                    var paramInline = usestr.split("?")[1].split("&");
                    for(var i = 0; i < paramInline.length; i++){
                        qsParams.keys.push(paramInline[i].split("=")[0]);
                        qsParams[paramInline[i].split("=")[0]] = paramInline[i].split("=")[1];
                        qsParams.length++;
                    }
                } 
                return qsParams;
        	}
    		
    		function isBuggyChromium() {
    			if (navigator.userAgent == null) return false;
    			var userAgent = navigator.userAgent.toLowerCase();
    			var index = userAgent.indexOf('chrome');
    			if (index<0) return false;
    			if (userAgent.length > index+8) return (userAgent.substring(index+7, index+8) < 3);
    			return false;
    		}
    	
    		var href = document.location.href;
    		if (href.indexOf("unrulyCountry") != -1) {
    			var params = getQsParams();
        		if (params["unrulyCountry"] != null) {
        			unrulyGeoCountryCode = params["unrulyCountry"].toLowerCase();
        		}
    		}
			
        	var countryLookup = [];
    		var numTerritories = 0;
        	    		
        	var apid = "_default";
    		
    		if (typeof unrulyGeoCountryCode != "undefined") {
    			if (unrulyGeoCountryCode.toLowerCase()=="xx") {
    				    				apid = "";
    			} else { 
    				            		apid = countryLookup[unrulyGeoCountryCode.toLowerCase()];
                	if (typeof apid == "undefined") {
                		apid = "_default";
                	} else {
                		apid = "_" + apid;
                	}
    			}
    		}
    		
    		if ((numTerritories == 0 || apid == "_default") && 2 == 2) {
    			if (!isBuggyChromium()) {
        				
    			}
    		} else {
        			var iframe = document.getElementById("unruly1256649093068");
    			iframe.style.display="block";
				var url = "http://video.unrulymedia.com/iframe_1827139%s.html?d=1256649093068" +
            		(typeof wildfireAddParams != "undefined" ? wildfireAddParams : '') +
                	'&refurl=' + encodeURIComponent(document.location.href);
				document.getElementById("unruly1256649093068").src = url.replace("%s", apid);
			}
    	}
    	document.write('<iframe id="unruly1256649093068" style="display:none;" frameborder="0" scrolling="no" width="300" height="250"></iframe>');
    	document.write('<scr'+'ipt src="http://video.unrulymedia.com/country_code.js?version=5" type="text/javascr'+'ipt"></scr'+'ipt>');
    	
    
