// Things to do when after the page loads
$(function(){
	$('.print-button').click(function(e){
		e.preventDefault();
		window.print();
		return false;
	});
});

// Google Analytics
document.write(
	'<script type="text/javascript">'+
	'  var _gaq = _gaq || [];'+
	'  _gaq.push(["_setAccount", "UA-91199-1"]);'+
	'  _gaq.push(["_trackPageview"]);'+
	'  (function() {'+
	'    var ga = document.createElement("script"); ga.type = "text/javascript"; ga.async = true;'+
	'    ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";'+
	'    var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ga, s);'+
	'  })();'+
	'</script>'
);

function header(){
	document.write(
		'<div id="banner"><a href="http://www.xactware.com"><img src="images/return-arrow.png" width="22" height="20" alt="Return to Xactware.com" /> xactware.com</a></div>'
	);
	
	// Add Omniture, Eloqua, and GA tracking code
	document.write('<script type="text/javascript" src="http://www.xactware.com/scripts/us/s_code.js"></script>\n');
	document.write('<script type="text/javascript" src="http://www.xactware.com/scripts/elqNow/elqCfg.js"></script>\n');
}

function menu(highlight){
	document.write('<div id="main-nav">');
	
	document.write(
		'	<ul id="menu">'+
		'		<li id="menu-main"><a href="index.html">Main</a></li>'+
		'		<li id="menu-agenda"><a href="agenda.html">Agenda</a></li>'+
		'		<li id="menu-general-sessions"><a href="general-sessions.html">General Sessions</a></li>'+
		'		<li id="menu-breakout"><a href="breakout-sessions.html">Breakout Sessions</a></li>'+
		'		<li id="menu-presenters"><a href="presenters.html">Presenters</a></li>'+
		'		<li id="menu-pre-conference-training"><a href="pre-conference-training.html">Pre-conference Training</a></li>'+
		'		<li id="menu-special-events"><a href="special-events.html">Special Events</a></li>'+
		'		<li id="menu-reasons-to-attend"><a href="reasons-to-attend.html">Top 10 Reasons to Attend</a></li>'+
		'		<li id="menu-accommodations"><a href="accommodations.html">Accommodations</a></li>'+
		'		<li id="menu-area-info"><a href="area-information.html">Area Info</a></li>'+
		'		<li id="menu-registration-info"><a href="registration-information.html">Registration Info</a></li>'+
		'		<li id="menu-ce-credits"><a href="ce-credits-nfip-information.html">CE Credits/NFIP Info</a></li>'+
		'		<li id="menu-sponsor-info"><a href="sponsor-information.html">Be a Sponsor</a></li>'+
		'		<li id="menu-sponsors"><a href="sponsors.html">Sponsors</a></li>'+
		'	</ul>'
	);
	$('#menu-'+highlight).addClass('highlight');
	
	// document.write('<div class="v-connector" style="height: 30px; left: 90px;"></div>');
	// document.write('<a href="http://www.xactware.com/store/SelectCat.do?catId=199" class="button-register"></a>');
	document.write('<div class="v-connector" style="height: 30px; left: 90px;"></div>');
	document.write('<a href="http://www.grandamerica.com/" target="_blank" class="button-hotel"></a>');
	
	document.write(
		'<div class="v-connector" style="height: 30px; left: 90px"></div>' +
		'<div class="info-box" id="sponsors">' +
		'	<h4>Sponsors</h4>' +
		'	<div class="sponsors">' +
		'		<div class="sponsor-group">' +
		'			<a href="sponsors.html#eagleview"><img src="images/sponsors/eagleview-logo.png" width="103" height="81" alt="EagleView Technologies"/></a>' +
		'			<a href="sponsors.html#psa-luxor"><img src="images/sponsors/psa-logo.png" width="138" height="62" alt="PSA/Luxor"/></a>' +
		'			<a href="sponsors.html#amcat"><img src="images/sponsors/amcat-logo.png" width="132" height="44" alt="Amcat"/></a>' +
		'		</div>' +
		'		<div class="sponsor-group">' +
		'			<a href="sponsors.html#atlantic-claims"><img src="images/sponsors/aci-logo.png" width="120" height="71" alt="Atlantic Claims, Inc."/></a>' +
		'			<a href="sponsors.html#pilot-catastrophe-services"><img src="images/sponsors/pilot-logo.png" width="158" height="37" alt="Pilot Catastrophe Services"/></a>' +
		'			<a href="sponsors.html#acvs"><img src="images/sponsors/acvs-logo.png" width="119" height="90" alt="ACV Systems, Inc."/></a>' +
		'		</div>' +
		'		<div class="sponsor-group">' +
		'			<a href="sponsors.html#ics-magazine"><img src="images/sponsors/cleaning-specialist-logo.png" width="131" height="57" alt="ICS Cleaning Specialist"/></a>' +
		'			<a href="sponsors.html#r-r-magazine"><img src="images/sponsors/rr-logo.png" width="113" height="61" alt="R&amp;R Magazine"/></a>' +
		'			<a href="sponsors.html#interstate"><img src="images/sponsors/interstate-logo.png" width="141" height="44" alt="Interstate"/></a>' +
		'		</div>' +
		'		<div class="sponsor-group">' +
		'			<a href="sponsors.html#wardlaw-claims-service"><img src="images/sponsors/wardlaw-logo.png" width="132" height="44" alt="Wardlaw Claims Service"/></a>' +
		'			<a href="sponsors.html#claims-magazine"><img src="images/sponsors/claims-logo.png" width="150" height="57" alt="Claims Magazine"/></a>' +
		'			<a href="sponsors.html#eberl"><img src="images/sponsors/eberl-logo.png" width="135" height="73" alt="Eberl Claims Service"/></a>' +
		'		</div>' +
		'		<div class="sponsor-group">' +
		'			<a href="sponsors.html#business-networks"><img src="images/sponsors/business-networks-logo.png" width="93" height="129" alt="Business Networks"/></a>' +
		'			<a href="sponsors.html#cleaning-restoration-magazine"><img src="images/sponsors/cleaning-restoration-logo.png" width="137" height="30" alt="Cleaning &amp; Restoration Magazine"/></a>' +
		'			<a href="sponsors.html#belfor"><img src="images/sponsors/belfor-logo.png" width="118" height="25" alt="BELFOR USA"/></a>' +
		'		</div>' +
		'		<div class="sponsor-group">' +
		'			<a href="sponsors.html#restoration-industry-association"><img src="images/sponsors/ria-logo.png" width="132" height="64" alt="Restoration Industry Association"/></a>' +
		'			<a href="sponsors.html#national-restoration"><img src="images/sponsors/national-restoration-logo.png" width="139" height="55" alt="National Restoration"/></a>' +
		'			<a href="sponsors.html#aerialogics"><img src="images/sponsors/aerialogics-logo.png" width="125" height="57" alt="Aerialogics"/></a>' +
		'		</div>' +
		'		<div class="sponsor-group">' +
		'			<a href="sponsors.html#pods"><img src="images/sponsors/pods-logo.png" width="125" height="34" alt="PODS"/></a>' +
		'			<a href="sponsors.html#bradley-stinson-associates"><img src="images/sponsors/bsa-logo.png" width="135" height="36" alt="Bradley Stinson &amp; Associates"/></a>' +
		'			<a href="sponsors.html#first-general-services"><img src="images/sponsors/first-general-logo.jpg" width="86" height="105" alt="First General Services"/></a>' +
		'		</div>' +
		'		<div class="sponsor-group">' +
		'			<a href="sponsors.html#integrity-adjusters"><img src="images/sponsors/integrity-adjusters-logo.png" width="115" height="91" alt="Integrity Adjusters"/></a>' +
		'			<a href="sponsors.html#accurence"><img src="images/sponsors/accurence-logo.png" width="134" height="31" alt="Accurence"/></a>' +
		'			<a href="sponsors.html#paul-davis-restoration"><img src="images/sponsors/paul-davis-logo.png" width="143" height="22" alt="Paul Davis Restoration, Inc."/></a>' +
		'		</div>' +
		'		<div class="sponsor-group">' +
		'			<a href="sponsors.html#worley-catastrophe-response"><img src="images/sponsors/worley-logo.png" width="135" height="20" alt="Worley Catastrophe Response"/></a>' +
		'			<a href="sponsors.html#cca-global-partners"><img src="images/sponsors/cca-logo.png" width="136" height="88" alt="CCA Global Partners"/></a>' +
		'			<a href="sponsors.html#itel"><img src="images/sponsors/itel-logo.png" width="130" height="50" alt="ITEL"/></a>' +
		'		</div>' +
		'		<div class="sponsor-group">' +
		'			<a href="sponsors.html#rainbow-international"><img src="images/sponsors/rainbow-logo.png" width="127" height="84" alt="Rainbow International"/></a>' +
		'			<a href="sponsors.html#rjmw"><img src="images/sponsors/rjmw-logo.png" width="127" height="54" alt="RJWM"/></a>' +
		'			<a href="sponsors.html#pictometry"><img src="images/sponsors/pictometry-logo.png" width="138" height="20" alt="Pictometry"/></a>' +
		'		</div>' +
		'		<div class="sponsor-group">' +
		'			<a href="sponsors.html#crawford-contractor-connection"><img src="images/sponsors/contractor-connection-logo.png" width="140" height="37" alt="Crawford Contractor Connection"/></a>' +
		'			<a href="sponsors.html#clientrunner"><img src="images/sponsors/clientrunner-logo.png" width="144" height="35" alt="ClientRunner"/></a>' +
		'		</div>' +
		'	</div>' +
		'</div>'
	);
	
	document.write(
		'<div class="v-connector" style="height: 30px; left: 90px"></div>' +
		'<div class="info-box" id="stay-connected">' +
		'	<h4 class="info-box-header">Stay Connected <a href="http://www.linkedin.com/groups?trk=anet_ug_hm&gid=2856921&home" target="_blank"><img src="images/icon-linkedin.gif" width="17" height="17" alt="in"/></a><a href="http://twitter.com/xactware" target="_blank"><img src="images/icon-twitter.gif" width="17" height="17" alt="t"/></a><a href="http://www.xactware.com/rss.xml" target="_blank"><img src="images/icon-rss.gif" width="17" height="17" alt="rss"/></a></h4>' +
		'	<form name="conferencemailinglist" action="http://now.eloqua.com/e/f2.aspx" method="post">' +
		'		<input type="hidden" name="elqFormName" value="conferencemailinglist"/>' +
		'		<input type="hidden" name="elqSiteID" value="1120"/>' +
		'		<p>Sign up for Conference News</p>' +
		'		<p>' +
		'			<input type="text" name="C_EmailAddress" id="C_EmailAddress"/>' +
		'			<button type="submit">Sign up</button><br/>' +
		'			email address<br/>' +
		'		</p>' +
		'	</form>' +
		'</div>'
	);
	
	document.write('</div>');
	
	// Rotate the sponsors
	var groups = $('.sponsor-group');
	var random = Math.floor(Math.random()*groups.length);
	groups.hide().eq(random).show();
	setInterval(function(){
		$('.sponsor-group:visible').fadeOut(function(){
			var nextGroup = $(this).next('.sponsor-group');
			if (nextGroup.length === 0) {
				nextGroup = $('.sponsor-group:first');
			}
			nextGroup.fadeIn();
		});
	}, 5000);
}

// Moved into the menu
function stayConnected(){}

function footer(){
	//document.write('<div id="footer"><img src="images/footer.jpg" width="980" height="581" alt="2012 Xactware User Conference Footer" /></div>');
	
	s.channel="User Conference";
	s.pageName='2012 - '+document.title.split(' | ')[0];
	
	// Eloqua and Omniture tracking scripts
	document.write('<div id="web_track_footer" style="display:none">\n');
	document.write('<script type="text/javascript"><!--\n' +
	'/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/\n' +
	'var s_code=s.t();if(s_code)document.write(s_code)//--></script>\n' +
	'<script type="text/javascript"><!--\n' +
	'if(navigator.appVersion.indexOf(\'MSIE\')>=0)document.write(unescape(\'%3C\')+\'\!-\'+\'-\')\n' +
	'//--></script><!--/DO NOT REMOVE/-->\n' +
	'<!-- End SiteCatalyst code version: H.9. -->');
	document.write('<script type="text/javascript" src="http://www.xactware.com/scripts/elqNow/elqImg.js"></script>\n');
	document.write('</div>\n');
}

// e = xactware email address
// s = subject of the email
function email(e,s){
	window.location = "mailto:" + e + "@" + "xactware.com?subject=" + s;
}
