// Check if jQuery is loaded
if (typeof jQuery == 'undefined') 
{
	document.writeln('<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>');
};

function makeFrame(id, width, height, src) 
{
   ifrm = document.createElement("IFRAME");
   ifrm.setAttribute("src", src);
   ifrm.setAttribute("id", id);
   ifrm.style.width = width+"px";
   ifrm.style.height = height+"px";
   document.body.appendChild(ifrm);
};

function makeDIV(id, cssText, targetDIV)
{	
	var divNode = document.createElement("div");
	divNode.setAttribute("id", id);
	divNode.style.cssText = cssText;
	//document.body.appendChild(divNode);
	jQuery(targetDIV).append(divNode);
};

function insertCSS(href)
{
	var headID = document.getElementsByTagName("head")[0];         
	var cssNode = document.createElement('link');
	cssNode.type = 'text/css';
	cssNode.rel = 'stylesheet';
	cssNode.href = href;
	//cssNode.media = 'screen';
	headID.appendChild(cssNode);	
};

function insertJS(src)
{
	var headID = document.getElementsByTagName("head")[0];         
	var newScript = document.createElement('script');
	newScript.type = 'text/javascript';
	newScript.src = src;
	newScript.readyState == 'complete';
	headID.appendChild(newScript);
};

// Init Micro Form	tampa.interplex.net
/*<!--[if IE]>
	<style type="text/css">html, body {border:0;overflow:visible;}</style>
<![endif]-->');*/
function init_micro_form(agentid, key, target, metro)
{	
  jQuery(document).ready(function(){
		makeDIV('_micro_form_', 'clear: both; height: 360px; width: 380px;', '#'+target);
		jQuery('#_micro_form_').html('<iframe class="microform2" src="http://tampa.interplex.net/microform2/microform2.php?agent='+agentid+'&key='+key+'&ma='+metro+'" height="100%" width="100%" scrolling="no" frameborder="0" marginheight="0" marginwidth="0" style="border-width:0px; margin-left:0px; margin-top:0px;"></iframe>');
		//jQuery('#_micro_form_').html('<object id="microform_object" type="text/html"  border="0" data="http://tampa.interplex.net/microform2/microform2.php?agent='+agentid+'&key='+key+'&ma='+metro+'" style="width:100%;height:100%;"></object>');
  });	// close document.ready classid="clsid:25336920-03F9-11CF-8FD0-00AA00686F13"
};
