
var spQStr = {"maxadnails": 20,"_st": 1,"link1url": "http://tomlinsonblack.com/","bannerid": "tomlinsonblack","tags": "tomlinson_black","pa": "spokanespotlights","vieweroffset": "150,100","layout": "leaderboard","link1text": "Visit our website","detaillinktarget": "_blank","brandingboximg1": "http://view.admission.net/abc/admanager/_ADMANAGER_64cfaaaada1965c97a1b4a88ccaef537/i-1.JPG","brandingboximg1url": "http://tomlinsonblack.com/","titletext": "Click Ads for Details"};

var now = new Date();
var uid = now.getTime();
var spotlightID = "spotlight" + uid;
var extParams;
var gDebugLevel = 0;

eval('function onError'+uid+'(msg) { if ("" == "1") alert("Error: "+msg); }');





























function PBObj(){
	ua = navigator.userAgent;
	this.bWin = !!ua.match(/win/i);
	this.bMac = !!ua.match(/mac/i);
	this.bIE4 = !!ua.match(/msie\s+4\./i);
	this.bIE5 = !!ua.match(/msie\s+5\./i);
	this.bIE6 = !!ua.match(/msie\s+6\./i);
	this.bIE7 = !!ua.match(/msie\s+7\./i);
	this.bIE4plus = (this.bIE4 || this.bIE5 || this.bIE6 || this.bIE7);
	this.bNS4 = !!document.layers;
	this.bNS7 = !!ua.match(/netscape\/7/i);
	this.bMOZ = (!!ua.match(/gecko/i) && !this.bNS7 && !this.bIE4plus);
	this.bSaf = !!ua.match(/safari/i);
}
gPB=new PBObj();

function getDOMBox(obj) {
	if (!obj) obj = this;
	var box = {
		l: obj.offsetLeft,
		t: obj.offsetTop,
		w: obj.width || obj.offsetWidth,
		h: obj.height || obj.offsetHeight
	};
	var p = obj.offsetParent;
	while (p) {
		box.l += p.offsetLeft;
		box.t += p.offsetTop;
		p = p.offsetParent;
	}
	return box;
}







function plusEncode(str) {
  return escape(str.replace(/\+/g,"%2B")).replace(/%25/g,"%");
}


if (typeof(gDebugLevel) == 'undefined')
	var gDebugLevel = "0";
try
{
	var m = top.document.location.href.match(/[\&\?]gdebuglevel\=(\d+)/);
	if (m && (typeof m[1] != 'undefined')) 
		gDebugLevel = m[1];
}
catch (e){}
function sizeDOMObj(obj, w, h) {
	if (typeof(obj.style) != 'undefined')
	{
		obj.style.width = w+"px";
		obj.style.height = h+"px";
		
		if (typeof(obj.style.pixelWidth) != 'undefined')
		{
			obj.style.pixelWidth = w;
			obj.style.pixelHeight = h;
		}
	}
}





function DivObj(id, box, bIE, visible)
{
	this.id = id;
	this.box = box;
	this.bIE = bIE;
	this.parentDoc = document;

	this.style = new Object();
	this.style.position 		= "absolute";

	this.style.visibility		= (typeof(visible) != 'undefined' && visible) ? "visible" : "hidden";
	this.style.backgroundColor	= "#FFFFFF";
	if (bIE)
		this.style["background-color"]	= "#FFFFFF";
}


DivObj.prototype.setStyle = function(name, value)
{
	this.style[name] = value;
}

DivObj.prototype.createRawHTML = function(content) {
	var html = 'style="';
	for (var s in this.style)
		html += s +':'+this.style[ s ]+'; ';
	html += 'left:'+this.box.l+'px; top:'+this.box.t+'px; width:'+this.box.w+'px; height:'+this.box.h+'px;';
	html += '"';
	
	html = '<div ' + html;
	html +=' id="'+this.id+'" name="'+this.id+'">';
	if (typeof(content) != 'undefined')
		html += content;
	html += '</div>';
	return html;
}

DivObj.prototype.createViaDocWrite = function(doc, content) {
	var html = "";
	if (typeof(content) != 'undefined')
		html = content;
	doc.write(this.createRawHTML(html));
	this.domObj = doc.getElementById(this.id);
	return this.domObj;
}

DivObj.prototype.create = function(doc, content)
{
	this.parentDoc = doc;
	var obj = null;
	var html = "";
	if (typeof(content) != 'undefined')
		html = content;
	if (this.bIE)
	{
		doc.body.insertAdjacentHTML('beforeEnd', this.createRawHTML(html));

		obj = eval("doc.all."+this.id);
	}
	else
	{
		obj = doc.createElement('div');
		obj.innerHTML = html;
		obj.id = this.id;
		doc.body.appendChild(obj);
		for (var s in this.style)
			eval('obj.style.'+ s +'="'+this.style[ s ]+'"');
		obj.style.top  = this.box.t+"px";
		obj.style.left = this.box.l+"px";
		obj.style.width = this.box.w+"px";
		obj.style.height = this.box.h+"px";
	}
	this.domObj = obj;

	return this.domObj;
}

DivObj.prototype.writeContent = function(content)
{
	if (typeof(this.domObj) != 'undefined' && (typeof(this.domObj.innerHTML) != 'undefined'))
		this.domObj.innerHTML = content;
}

function getFsByDocument(doc) {

	try 
	{
		if(top.document == doc) 
			return "top.";
		if(top.frames.length == 0) 
			return "window.";
		for(var i=0; i<top.frames.length; i++) 
		{
			try 
			{
				if(top.frames[i].document == doc) 
					return "top.frames['"+i+"'].";
			}			
			catch (e) {}
		}
		}
	catch (e) 
	{
	}
	return "";
}


function getAbsOffset(o) {
	var t=0, l=0;
	for (; ((o != undefined) && (typeof(o) != "undefined")); o = o.offsetParent) {
		if(!isNaN(o.offsetTop))
			t += o.offsetTop;
		if(!isNaN(o.offsetLeft))
			l += o.offsetLeft;
	}
	return {l:l, t:t};
}


function locateFrameByDocument(doc, wnd) {
	
	try	
	{
		if((wnd.document == doc) && (wnd == top)) 
			return {l:0,t:0};
		
		if(wnd.document.getElementsByTagName("frameset").length > 0)
			return locateFrameByDocumentRecur({l:0,t:0}, doc, wnd.document.getElementsByTagName("frameset")[0], wnd, 0);
		
		if(wnd.document.getElementsByTagName("iframe").length > 0) 
		{
			for(var i=0; i<top.frames.length; i++) 
			{
				try	
				{
					if(top.frames[i].document == doc) 
						return getAbsOffset(wnd.document.getElementsByTagName("iframe")[i]);
				}
				catch (e){}
			}
		}
	}
	catch (e) 
	{
	}
	return {l:0,t:0};
}




function locateFrameByDocumentRecur(newpos, doc, node, wnd, framecnt) {
	var pos = {l:newpos.l,t:newpos.t};
	var cols = null;
	var rows = null;
	var framespassed = 0;
	if (node.nodeName == "FRAME") 
	{
		if(wnd.frames[framecnt].document == doc) 
			return pos;
		else
			return 1;
	}
	else if(node.nodeName == "FRAMESET") 
	{
		function processColsOrRows(attr, pos, posProp)
		{
			var foundIt = false;
			var cOrR = null;
			if(node.getAttribute(attr) != null)
				cOrR = node.getAttribute(attr).split(',');
			if(cOrR != null && cOrR != "") 
			{
				var k = cOrR.length;
				for(var i=0; i<k; i++) 
				{
					if(node.childNodes[i].nodeName != "FRAMESET" && node.childNodes[i].nodeName != "FRAME") 
					{
						k++;
						continue;
					}
					var res = locateFrameByDocumentRecur(pos, doc, node.childNodes[i], wnd, framecnt);
					if(typeof(res) == "object") 
					{
						foundIt = true;
						pos.l = res.l;
						pos.t = res.t;
						break;
					}
					else 
					{
						framecnt += res;
						framespassed += res;
					}
					if(cOrR[i-(k-cOrR.length)] == "*") 
					{
						var tw = 0;
						for(var j=0; j<cOrR.length; j++) 
						{
							if(cOrR[j] != "*") 
								tw += Number(cOrR[j]);
						}
						if(wnd.innerWidth)
							pos[posProp] += (Number(wnd.innerWidth)-tw);
						else
							pos[posProp] += (Number(wnd.document.body.clientWidth)-tw);
					}
					else 
						pos[posProp] += Number(cOrR[i-(k-cOrR.length)]);
				}
			}
			return foundIt;
		}
		if (processColsOrRows("cols", pos, "l"))
			return pos;
		if (processColsOrRows("rows", pos, "t"))
			return pos;
	   return framespassed;
	}
	else
	   return framespassed;
}

function parseQS(qStr) {
	var qObj = new Object();
	qStr = qStr.replace(/^.*\?(.+)$/,'$1');
	
	while ((pair = qStr.match(/(\w+)=\'?([^\&\']*)\'?\&?/)) && pair[0].length) {
		qStr = qStr.substring( pair[0].length );
		var val = pair[2];
		if (/^\-?\d+$/.test(val)) 
		{
			var iVal = parseInt(val);
			if (iVal.toString().length == val.length)
				pair[2] = iVal;
		}
		qObj[pair[1]] = pair[2];
	}
	
	return qObj;
}


function VW(uid) {
  this.popupX = parseInt(150);
  this.popupY = parseInt(100);
  this.uid = uid;

  if ("1" != "1" && ("" != "1"))
  	this.fs = "";
  else
  	this.fs = getFsByDocument(document);

	if("1" == "0") 
	{
		try
		{
			if (top.frames[''] != top && top.frames[''].document == document)
				this.fs = "";
		}
		catch (e){}	// suppress cross-domain errors
	}
	this.vP = {};
	
	this.vP.pageDomain				= document.location.hostname;
	this.vP.onCloseHandler 			= "javascript:onClose"+this.uid;
	this.vP.sizeHandler 			= "javascript:onSize"+this.uid;
	this.vP.adserverurl 			= "http://apps.admission.net/rimfire/admission";
	this.vP.paypalurl 				= "https://www.paypal.com/cgi-bin/webscr";
	this.vP.preview					= 0;
	this.vP.ipixdomain 				= "view.admission.net";
	this.vP.classifiedMovieURI		= "http://view.admission.net/admission/classified";
	this.vP.vskin					= "clsmini";

	this.vP.bannerid            	= "";	 
	this.vP.pageurl             	= escape(document.URL);        	 
	this.vP.trackinginfo        	= this.uid;          
	this.vP.eventlog            	= 1;                           
	this.vP.banneraccount          	= "spokanespotlights";
	this.vP.gdebuglevel            	= "0";

	this.vWidth 					= 264;
	this.vHeight 					= 370;

	for (var key in spQStr)
		this.vP[key] = plusEncode(''+spQStr[key]);
	if (typeof(this.vP.trackingid) != 'undefined')
		this.vP.pageid = this.vP.trackingid;

	
	if (this.vP.bannerid) 
		this.vP.bannerid = this.vP.bannerid.substr(0, 128);
}

VW.prototype.init = function() {
	
	var w = 1;
	var h = 1;
	var fv = "uniqueid=" + this.uid + "&viewervars=" + this.buildFlashVars();
	if ("" != "")
		fv += "cmd="+escape("");

	if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) // netscape plugin architecture
	{
		this.divCode = ' \
		<EMBED src="http://view.admission.net/admission/spotlight/swf/viewerwrapper.swf" quality=high bgcolor=#FFFFFF \
			swLiveConnect=TRUE WIDTH="'+w+'" HEIGHT="'+h+'" name="vwrWrapper'+this.uid+'" ALIGN="" wmode="window" menu="false" AllowScriptAccess="always" \
		flashvars="'+fv+'"  \
		TYPE="application/x-shockwave-flash" PLUGINSPAGE="' + document.location.protocol + '//www.macromedia.com/go/getflashplayer" BASE="."> \
		</EMBED>';
	}	
	else
	{
		this.divCode = ' \
		<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" \
		codebase="' + document.location.protocol + '//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" \
			id="vwrWrapper'+this.uid+'" WIDTH="'+w+'" HEIGHT="'+h+'" ALIGN=""> \
		  <PARAM NAME=movie VALUE="http://view.admission.net/admission/spotlight/swf/viewerwrapper.swf"> \
		  <PARAM NAME=quality VALUE=high> \
		  <PARAM NAME=bgcolor VALUE=#ffffff> \
		  <PARAM NAME="AllowScriptAccess" VALUE="always" /> \
		  <PARAM NAME=wmode VALUE="window"> \
		  <PARAM NAME=menu VALUE=false> \
		  <PARAM NAME=flashvars VALUE="'+fv+'"> \
		  <PARAM NAME=BASE VALUE="."> \
		</OBJECT>';
	}
var x = -1000;
var y = -1000;


if("1" != "0")
{
	x = 2;
	y = 0;
}
	this.divObj= new DivObj("classifiedVwr"+this.uid+"div", {l:x,t:y,w:w,h:h}, gPB.bIE4plus, true);

	if((window != top || "1" == "0") && ("" != "1")) 
	{
		this.renderOnLoad();
 	}
	else
	{
		if ("" == "" && "" != "1")
		{
			this.render();
		}
		
		else
		{
			this.createDiv();
			setTimeout("vw"+this.uid+".writeContent()", 20);
		}
	}
}

VW.prototype.createDiv = function(content)
{
	this.setupViewerContainer();
	if(gPB.bIE4plus)
		this.divObj.setStyle("background-color","transparent");
	this.divObj.create(this.vwrDoc, content);
}

VW.prototype.render = function() {
	this.setupViewerContainer();
	if(gPB.bIE4plus) {

		document.write('<script>var vwr'+this.uid+'DocWrite = true;</script>');
		this.divObj.setStyle("background-color","transparent");
		this.divObj.createViaDocWrite(this.vwrDoc, this.divCode);
	}
	else {
		document.write('<script>var vwr'+this.uid+'DocWrite = false</script>');
		this.divObj.create(this.vwrDoc, this.divCode);
	}
	this.prepCallbacks();
}

VW.prototype.renderOnLoad = function() 
{
	var wO = window.onload;
	if(typeof(wO) != 'undefined' && wO)
	{
		var OL = window.onload.toString();
		OL = "vw"+this.uid+".renderNoDocWrite();\r"+OL.substring(OL.indexOf("{")+1,OL.lastIndexOf("}"))+"\r;";
		window.onload = new Function(OL);
	}
	else
	{
		window.onload = new Function("vw"+this.uid+".renderNoDocWrite();");
	}
}

VW.prototype.renderNoDocWrite = function() {
	this.createDiv(this.divCode);
	this.prepCallbacks();
}

VW.prototype.writeContent = function() {
	this.divObj.writeContent(this.divCode);
	this.prepCallbacks();
}


VW.prototype.setupViewerContainer = function() {
	try{
		
		this.vwrDoc = top.document;
		this.vwrWnd = top;
	
	}
	catch (e) {
	}
	this.inSpotlightDoc = (("" == "") && (this.vwrDoc == document));		// Viewer and Spotlight are in same document
}

VW.prototype.appendJS = function(doc, jsCode)
{
	var scr = doc.createElement("script");
	scr.setAttribute("type", "text/javascript");
	if (gPB.bSaf)
		scr.innerHTML = jsCode;
	else
		scr.text = jsCode;
	var el = doc.getElementsByTagName('head')[0];
	if (!el)
		el = doc.getElementsByTagName('body')[0];	// if no head section, append to body
	if (el)
		el.appendChild(scr);
}

VW.prototype.prepCallbacks = function()
{
	var scr = 'function onClose'+this.uid+'(){'+this.fs+'vw'+this.uid+'.onClose();}\
			   function onSize'+this.uid+'(w,h){'+this.fs+'vw'+this.uid+'.onSize(w,h);}';
	this.appendJS(this.vwrDoc, scr);
}

VW.prototype.onSize = function(w,h)
{
	if (isNaN(parseInt(w)) || isNaN(parseInt(h)))
		return;
	this.showViewer();
	sizeDOMObj(this.vwrDoc.getElementById("classifiedVwr"+this.uid+"div"), w, h);
	sizeDOMObj(this.vwrDoc["vwrWrapper"+ this.uid], w, h);
	this.vWidth = w;
	this.vHeight = h;
}
VW.prototype.onClose = function()
{
	var vwrdiv = this.vwrDoc.getElementById('classifiedVwr'+this.uid+'div'); 
	vwrdiv.style.top = "-1000px"; 
	vwrdiv.style.left = "-1000px"; 
}

VW.prototype.showViewer = function()
{
	var spos = ("" != "") ? "".split(",") : null;
	if (spos && spos.length > 0)
	{
		
		var divBox = {l:parseInt(spos[0]),t:parseInt(spos[1]),w:parseInt(spos[2]),h:parseInt(spos[3])};
		var sBoxData = getDOMBox(document.getElementById(spQStr['spotframe']));
		divBox.l += sBoxData.l;
		divBox.t += sBoxData.t;
	}
	else
	{
		
		var thediv = document.getElementById('spotlight'+this.uid+'div'); 
		var divBox = getDOMBox(thediv);
		
		
		if (gPB.bSaf) 
		{
			var el = thediv.parentElement; 
			while (el)
			{ 
				if (el.style && el.style.position == 'absolute')
				{
					divBox.l -= document.body.offsetLeft; 
					divBox.t -= document.body.offsetTop; 
					break;
				} 
				el = el.parentElement;
			} 
		}
		
		
		if(eval("typeof(vwr"+this.uid+"DocWrite) != 'undefined' && vwr"+this.uid+"DocWrite")) 
		{		
			var el = thediv.parentElement; 
			while (el && el.nodeName != "DOCUMENT" && el.nodeName != "BODY") 
			{
				var box = getDOMBox(el);
				if (el.style.position == 'absolute')
				{
					divBox.l -= Number(box.l);
					divBox.t -= Number(box.t);
					break; 
				} 
				el = el.parentElement;
				
			}
		}
	}
	var origDivBox = divBox;
	var vwrdiv = this.vwrDoc.getElementById('classifiedVwr'+this.uid+'div');
	var vwrPos, sptPos;
	
	
	if(typeof(window.innerHeight) != 'undefined' || typeof(document.body.clientHeight) != 'undefined') 
	{
		sptPos = locateFrameByDocument(document, top); 
		vwrPos = locateFrameByDocument(this.vwrDoc, top);
	}
	else 
	{
		
		sptPos = {l:window.screenLeft, t:window.screenTop}; 
		vwrPos = {l:this.vwrWnd.screenLeft, t:this.vwrWnd.screenTop};
	}
	var offsetX = this.popupX; 
	var offsetY = this.popupY;
	if ("0" == "1") 
	{
		var docHeight; 
		var docWidth;
		if (typeof(document.body.offsetWidth)!='undefined')
		{
			docWidth = document.body.offsetWidth; 
			docHeight = document.body.offsetHeight;
		}
		else
		{
			docWidth = document.width; 
			docHeight = document.height;
		}
		docWidth = Math.max(docWidth,(2*parseInt(this.vWidth)+2)); 
		docHeight = Math.max(docHeight,(2*parseInt(this.vHeight)+2));

		if (offsetX > offsetY)
		{
			offsetX = 0;
			offsetY = ((docHeight - sptPos.t - origDivBox.t) > this.vHeight) ? (offsetY + 2): -(parseInt(this.vHeight) + 2);
		}
		else
		{
			offsetX = ((docWidth - sptPos.l - origDivBox.l) > (parseInt(this.vWidth)+offsetX)) ? (offsetX + 2) : -(parseInt(this.vWidth) + 2);
			offsetY = 0;
		}
	}
	
	
	if("" != "") 
	{
		if(this.inSpotlightDoc) 
		{
			vwrdiv.style.left = divBox.l+sptPos.l-vwrPos.l+offsetX+'px';
			vwrdiv.style.top = divBox.t+sptPos.t-vwrPos.t+offsetY+'px';
			
		} 
		else if(this.vwrDoc.documentElement.scrollTop) 
		{
			vwrdiv.style.left = divBox.l+sptPos.l-vwrPos.l+offsetX+this.vwrDoc.documentElement.scrollLeft+'px';
			vwrdiv.style.top = divBox.t+sptPos.t-vwrPos.t+offsetY+this.vwrDoc.documentElement.scrollTop+'px';
		} 
		else 
		{
			vwrdiv.style.left = divBox.l+sptPos.l-vwrPos.l+offsetX+this.vwrDoc.body.scrollLeft+'px';
			vwrdiv.style.top = divBox.t+sptPos.t-vwrPos.t+offsetY+this.vwrDoc.body.scrollTop+'px';
		}
	} 
	else
	{
		vwrdiv.style.left = divBox.l+sptPos.l-vwrPos.l+offsetX+'px';
		vwrdiv.style.top = divBox.t+sptPos.t-vwrPos.t+offsetY+'px';
	}

	vwrdiv.style.visibility='visible';
}


VW.prototype.buildFlashVars = function()
{
	var fv = "";
	for (prop in this.vP)
	{
		if (prop != null && typeof(this.vP[prop]) != 'function')
			fv += prop.toLowerCase()+"="+this.vP[prop];
		fv += "^";
	}
	if (fv.lastIndexOf("&") == fv.length-1)
		fv = fv.substring(0,fv.length-1);
	
	return fv;
}

eval('var vw'+uid+' = new VW(uid)');
eval('vw'+uid+'.init();');
eval('var showViewer'+uid+' = new Function("vw'+uid+'.showViewer();")');




if ("" != "")
	setTimeout("showViewer"+uid+"()",20);



	

var spVars = 'uniqueid='+uid;
if (gDebugLevel > 0)
	spVars += '&gdebuglevel='+gDebugLevel;

try
{
	var m = top.document.location.href.match(/[\&\?]gdebuglevel\=(\d+)/);
	if (m && (typeof m[1] != 'undefined')) 
	{
		gDebugLevel = m[1];
		spVars += '&gdebuglevel=' + gDebugLevel;
	}
}
catch (e){}

spVars += '&adserverurl=http://apps.admission.net&adservercacheurl=http://appcache.admission.net&ipixdomain=view.admission.net&pagedomain=apps.admission.net&pageurl=' +
	plusEncode(document.URL)+'&moviebaseuri=http://view.admission.net/admission/spotlight/&spotlightparams=';

var spotparms = "";
for (var key in spQStr) {
	if ((typeof extParams == 'undefined') || (typeof extParams[key] == 'undefined'))
		spotparms += key + "=" + spQStr[key] + "^";
}

if(typeof extParams != 'undefined') {
	for (key in extParams) {
		if(extParams[key] != "")
			spotparms += key+"="+extParams[key]+"^";
	}
}

spotparms += 'videoplayer=http://view.admission.net/admission/spotlight/simplevideoplayer.swf^spotlight=1';
spVars += plusEncode(escape(spotparms));

document.write(
	'<div style="width: 728px; height: 90px; background: #FFFFFF;" id="'+spotlightID+'div">' + 
	'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="728" height="90" id="'+spotlightID+'" align="middle">' + 
	'<param name="AllowScriptAccess" value="always" />' + 
	'<param name="movie" value="http://view.admission.net/admission/spotlight/spotlight.swf" />' + 
	'<param name="quality" value="high" />' + 
	'<param name="menu" value="false" /> <param name="wmode" value="opaque" />' + 
	'<param name="bgcolor" value="#ffffff" />' + 
	'<param name="flashvars" value="'+spVars+'" />' + 
	'<param name="BASE" value="." />' + 
	'<embed src="http://view.admission.net/admission/spotlight/spotlight.swf" quality="high" menu="false" wmode="opaque" bgcolor="#ffffff" width="728" height="90" name="'+spotlightID+'" align="middle" AllowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" FlashVars="'+spVars+'" swLiveConnect=true base="." />' + 
	'</object></div>'
);



delete spQStr;