//OAS config

OAS_url='http://gcirm.tucson.gcion.com/RealMedia/ads/';
OAS_target='_top';

OAS_version = 10;
OAS_rn=new String(Math.random());
OAS_rns=OAS_rn.substring(2,11);


// Start of Helios IQ integration

// NOTE:  Internet Explorer loads new scripts AFTER the current script finishes executing.  Firefox/Safari run scripts IMMEDIATELY.
document.write('<script type="text/javascript" src="http://tucson.ur.gcion.com/global/AD/AdtechGlobalSettings.js"></script>');
document.write('<script type="text/javascript" src="http://tucson.ur.gcion.com/AD/AdtechSiteSettings.js"></script>');
document.write('<script type="text/javascript" src="http://tucson.ur.gcion.com/Scripts/AD/Adtechscript.js"></script>');

// End of Helios IQ integration


var __IFrameList = new Array();

function OAS_IFRAME_AD(pos, width, height)
{
	__IFrameList.push('OAS_POS_' + pos);
	document.write('<iframe id="OAS_POS_' + pos + '" src="http://www.azstarnet.com/includes2/iframe_ads.php?page=' + escape(OAS_sitepage) + '&pos=' + pos + '" width="' + width + '" height="' + height + '" frameborder="0" scrolling="no"></iframe>\n');
}

document.write('<script type="text/javascript" src="http://www.azstarnet.com/js/adrewrite.js"></script>');

// ZAG code.
function ZAG_GetCookie(name)
{
	var start = document.cookie.indexOf(name + "=");
	var length = start + name.length + 1;

	if ((!start) && (name != document.cookie.substring(0, name.length)))  return null;

	if (start == -1)  return null;

	var end = document.cookie.indexOf(';', length);

	if (end == -1)  end = document.cookie.length;

	return document.cookie.substring(length, end);
}

function ZAG_IsNullOrEmpty(object)
{
	if (object == null || object == "" || object.Length == 0 || object == "null" || object == "undefined")  return true;
	else  return false;
}

if (ZAG_IsNullOrEmpty(ZAG_GetCookie("GCIONID")))
{
	// Gets a local GCIONID.
	document.write('<script type="text/javascript" src="http://tucson.app.ur.gcion.com/gcion.ashx?q=1"></script>');
}

function ZAG_User()
{
	if (registration.user.loggedin && ZAG_IsNullOrEmpty(ZAG_GetCookie("ZAG_UID")) && !ZAG_IsNullOrEmpty(ZAG_GetCookie("GCIONID")))
	{
		// ZAG.  Uses the local GCIONID.
		var country;
		if (registration.user.country == "Canada")  country = "CA";
		else if (registration.user.country == "Mexico")  country = "MX";
		else  country = "US";
		document.write('<script type="text/javascript" src="http://tucson.app.ur.gcion.com/gcion.ashx?q=2&GCIONID=' + ZAG_GetCookie("GCIONID") +  '&Zip=' + escape(registration.user.zip) + '&YOB=' + escape(registration.user.yob) + '&Gender=' + (registration.user.gender == "M" ? 2 : (registration.user.gender == "F" ? 1 : 3)) + '&Country=' + country + '&OriginatingSite=gpaper199"></script>');

		var today = new Date();
		today.setTime(today.getTime());
		document.cookie = 'ZAG_UID=' + registration.user.uid + ';path=/';
	}
}

if (window.Registration)  ZAG_User(registration);
