	/*
				Produces an iframe with a social security clock in it.  If variables for size/color have been set,
		those are sent to the frame via its src attribute.
		Currently can customize width, height, font size/color, row colors, and the text in the top box.
	1. Gets user parameters and makes an iFrame:  <iframe ... src='iG06sst.html'></iframe>
	1.b)Check for link in parent page
	2. Document.write the iFrame to spot in user pages where JS call was.
	3. Then iG06sst.html takes over and does this:
	4. iG06sst.html is a complete html document by itself with head and body.
	5. Head: unpack parameters an adopt defaults as necessary
	6. Head: document write some CSS styles into Head (this allows parameter controled CSS styles)
	7. Body: Make a table with the counters in it.
	8. Body: Load the gizmo JS
	9. Body: start the gizmo running
	*/

		// Preset/read in variables
	// If these variables have already been declared in a previous JS block they will not be overwritten.  Otherwise they will take value = null
	var zWidth;		// frame width
	var zHeight;		// frame height
	var zFontSize;	// font size in pixels
	var zFontColor;	// default font color, start all colors with #
	var zQuestion;		// question for top row
	var zColor1;	// background colors for rows 1, 2 and 3
	var zColor2;
	var zColor3;
	var zSpeed; // refresh rate
	var zFontFamily = "arial";	// we could pass this if we want
	var zFullFrame;
	
	// Check for link
	if (zFullFrame != 1)
	{
		var oops = 0;
		var linkus = window.document.getElementById('zF'); // if there is no zF, linkus = null
		var rpage="http://zfacts.com/p/784.html";
		if (linkus != null) 
		{	if (linkus.getAttribute("href") != rpage) oops = 1;
			if (linkus.firstChild == null) oops = 1;
			if (linkus.nodeName != 'A') oops = 1;
		}
		else	oops = 1;
	}
	
	var zQS = "?";
	
	
	// Base width off of style or tag
	var sbox = document.getElementById('zSocBox');
	if (sbox == null) 
	{
		if (zWidth == null || zWidth == "") zWidth = "180";
	}
	else
	{
		// Set the cellpadding, spacing, and border here so that the user doesn't have to in the html they copy from us
		sbox.cellPadding = "0";
		sbox.cellSpacing = "0";
		sbox.border = "0";
		// Check for a set width either by style or table attribute. IE uses "" and firefox sometimes uses null if value is not set...
		if (zWidth == "" || zWidth == null)
		{
			if ((sbox.getAttribute('width') == "" || sbox.getAttribute('width') == null)  && (sbox.style.width == "" || sbox.style.width == null))
			{
				zWidth = "180";
			}
			else
			{
				zWidth = sbox.getAttribute('width');
			}
		}
	}
	
	// Set defaults or use passed values for parameters.  Place all variables on the query string and escape them just in case
	if (zFontSize == null || zFontSize == "") zFontSize = 12;
	if (zFontColor == null || zFontColor == "") zFontColor = "black";
	
	// Check if this is likely to be on one line or 2 - needs tweaking!
	
	if (zHeight == null || zHeight == "") 
	{
		if (zWidth/zFontSize >= 25)
		{
			zHeight = zFontSize * 3 + 10;
			//alert ("fat");
		}
		else
			zHeight = zFontSize * 6 + 10;
	}
	
	if (sbox != null) 
	{
		// for some reason height seems a little short - maybe it is missing 2 pixels from border?
		sbox.style.height = (zHeight  + 2) + "px";
		var tim;
		if(tim == "?1") alert ("setting height:"+ (zHeight  + 2) + "px");
	}
	
	
	if (zHeight == null || zHeight == "") zHeight = zFontSize * 6 + 6;
	if (zColor1 == null || zColor1 == "") zColor1 = "#EEEEFF";
	if (zColor2 == null || zColor2 == "") zColor2 = "white"; 
	if (zColor3 == null || zColor3 == "") zColor3 = "#FFEEEE";
	if (zSpeed == null || zSpeed == "") zSpeed = 5;
	if (zFullFrame == null || zFullFrame == "") zFullFrame = 0;
	
	// Check if this will be a full iframe version. If so, pass some extra vars.
	if (zFullFrame == 1)
	{
		if (zWidth == null || zWidth == "") zWidth = "180";
		if (zQuestion == null || zQuestion == "") zQuestion = '<a id="zF" href="http://zfacts.com/p/784.html">Which One Has the Crisis ?!</a>';

		zQS = zQS + "zQuestion=" + escape(zQuestion) + "&";
		zQS = zQS + "zColor1=" + escape(zColor1) + "&";
		//alert("full frame");
	}
	
	zQS = zQS + "zFontSize=" + escape(zFontSize) + "&";
	zQS = zQS + "zFontColor=" + escape(zFontColor) + "&";
	zQS = zQS + "zHeight=" + escape(zHeight) + "&";
	zQS = zQS + "zColor2=" + escape(zColor2) + "&";
	zQS = zQS + "zColor3=" + escape(zColor3) + "&";
	zQS = zQS + "zSpeed=" + escape(zSpeed) + "&";
	zQS = zQS + "oops=" + escape(oops) + "&";
	zQS = zQS + "zFullFrame=" + escape(zFullFrame) + "&";
	zQS = zQS + "zWidth=" + zWidth + "&";	
	
	// write styles used in parent document
	if (zFullFrame == 0)
	{
		// not directly editable vars
		var pad = 4;
		var bdr = "";
		
		document.write("<style type='text/css'><!--");
		document.write(" #zSocBox { padding:0; font-weight:bold; font-family:" + zFontFamily +"; font-size: " + zFontSize + "px; color: " + zFontColor + ";border: 2px solid #CCCCCC;}");
		document.write(" #row1 { background-color: " + zColor1 + "; padding-left: " + (pad) + "px; padding-right: " + (pad) + "px;}");
		document.write(" #row1 a { text-decoration:none; color:" + zFontColor +";}");	// this style will only be applied to links in row1
		document.write(" --></style>");
	}
	//alert(zWidth);
	
	document.write('<iframe allowTransparency="true" width="' + zWidth + '" height="' + zHeight + 'px" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://metapager.com/giz/iframe/iG06sst2.html' + zQS + '"/></iframe>');
	
	// Reset vars in case there is another counter after this one.
	zWidth = "";	
	zHeight = "";		// frame height
	zFontSize = "";	// font size in pixels
	zFontColor = "";	// default font color, start all colors with #
	zQuestion = "";		// question for top row
	zColor1 = "";	// background colors for rows 1, 2 and 3
	zColor2 = "";
	zColor3 = "";
	zSpeed = "";
	zFullFrame = "";
