


/******************************************************************************************
         iframeLib.js
 ******************************************************************************************/


	// return a reference to an object
	function iframe_getObj(objName) {
		return document.getElementById(objName);
	}

	// toggle if element is visible or not
	function iframe_toggle(n) {
		var sty = iframe_getObj(n).style;
		if(sty.display=='')
			iframe_hide(n);
		else
			iframe_show(n);
	}

	// make element visible
	function iframe_show(n) {
		iframe_getObj(n).style.display='';
	}

	// hide element
	function iframe_hide(n) {
		iframe_getObj(n).style.display='none';
	}

	// resize element
	function iframe_resize(n,w,h) {
		var sty = iframe_getObj(n).style;
		sty.width = w;
		sty.height = h;
	}

	// move element
	function iframe_move(n,x,y) {
		var sty = iframe_getObj(n).style;
		sty.left = x;
		sty.top = y;
	}

	// set url of an iframe
	function iframe_setURL(n, url) {
		var frm = iframe_getObj(n);
		frm.src = url;
	}

	// create an iframe
	function iframe_create(n, url, x, y, w, h, vis) {
		var tempIFrame = document.createElement('iframe');
		tempIFrame.setAttribute('id',n);
		tempIFrame.style.position = 'absolute';
		tempIFrame.style.border = '0px';
		tempIFrame.style.width = '0px';
		tempIFrame.style.height = '0px';
		iframe = document.body.appendChild(tempIFrame);

		// passing args as string, otherwise doesn't work in IE?
		var a = '"'+n+'", "'+url+'", '+x+', '+y+', '+w+', '+h+', '+vis;
		// add a delay, otherwise doesn't work correctly when vis=false
		setTimeout("iframe_create2("+a+")", 100); 
	}

	// finish creating iframe
	function iframe_create2(n, url, x, y, w, h, vis) {
		if(x != 0 && y != 0)
			iframe_move(n, x, y);
		if(w != 0 && h != 0)
			iframe_resize(n, w, h);
		if(url != null)
			iframe_setURL(n, url);
		if(vis)
			iframe_show(n);
		else
			iframe_hide(n);
	}


	function iframe_destroy() {
		// TODO
	}

