// Placed outside the frame

var baseURL = "http://www3.dodge.se/js/iframeresize/";

var currentFrame;

var FrameManager = {
	registerFrame: function(frame) {
		currentFrame = frame;
	},
	setHeight: function(height) {
		if(currentFrame) {
			currentFrame.style.height = height + "px";
		}
	}
};

// Load UFO
try {
	if(typeof UFO == "undefined") {
		var fileref=document.createElement('script');
		fileref.setAttribute("type","text/javascript");
		fileref.setAttribute("src", baseURL + "ufo.js");
		document.getElementsByTagName("head")[0].appendChild(fileref);
	}
} catch(e) { }

// ADD DIVS/HTML
var icload = setInterval(function() {
	if (document.getElementsByTagName("body")[0] != null || document.body != null) {
		clearInterval(icload);
		var icDiv=document.createElement("div");
		icDiv.style.position = "absolute";
		icDiv.style.top = "0";
		icDiv.style.left = "0";
		icDiv.id = "iframeconnect";
		document.body.appendChild(icDiv);

		var icfload = setInterval(function() {
			if ((document.getElementsByTagName("body")[0] != null || document.body != null) && document.getElementById("iframeconnect") != null) {
				clearInterval(icfload);
				var icFO = { movie: baseURL + "crossdomainLink.swf", width:"1", height:"1", majorversion:"8", build:"0", wmode: "transparent", flashvars: "thisId=reciever01&otherId=sender01", id: "icF", name: "icF", allowscriptaccess: "always" };
				try{
					UFO.create(icFO, "iframeconnect");
				} catch(e) { }
			}
		}, 1);
		
	}
}, 50);
