function header(){
	document.write(
		'<div id="top-banner"></div>'+
		'<a href="http://www.xactware.com" id="foldover-link"></a>'
	);
	
	// Add Omniture and Eloqua tracking code
	document.write(
		'<!-- SiteCatalyst code version: H.9.\n' +
		'Copyright 1997-2007 Omniture, Inc. More info available at\n' +
		'http://www.omniture.com -->\n' +
		'<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="left-nav">'+
		'	<ul>'+
		'		<li id="menu-main"><a href="index.html">Main</a></li>'+
		'		<li id="menu-presentations"><a href="presentations.html">Presentations</a></li>'+
		'		<li id="menu-overview"><a href="overview.html">Overview</a></li>'+
		'		<li id="menu-agenda"><a href="agenda.html">Agenda</a></li>'+
		'		<li id="menu-general"><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-speakers"><a href="speakers.html">Speakers</a></li>'+
		'		<li id="menu-special-events"><a href="special-events.html">Special Events</a></li>'+
		'		<li id="menu-additional-training"><a href="additional-training.html">Additional Training</a></li>'+
		'		<li id="menu-ce-nfip"><a href="ce-nfip-info.html">CE Credits/NFIP Info</a></li>'+
		'		<li id="menu-sponsors"><a href="sponsors.html">Sponsors</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-info.html">Registration Info</a></li>'+
		'	</ul>'
	);
	if (highlight != 'main' && highlight != 'additional-details') document.write('	<a href="register.html"><img src="images/register-button-small.gif" width="105" height="105" alt="Register Here" id="register-button"/></a>');
	if (highlight == 'main') document.write('	<a href="register.html"><img src="images/register-button-large.gif" width="137" height="137" alt="Register Here" id="register-button"/></a>');
	document.write(
		'</div>'
	);
	$('#menu-'+highlight).addClass('here');
}

function quote(){
	document.write(
		'<div class="quote">'+
		'	<span class="larger2 blue bold italic"></span>'+
		'	<span style="margin-top:7px"></span>'+
		'	<span></span>'+
		'</div>'
	);
	randomQuote();
}

function connect(extra){
	document.write(
		'<div id="connect">'
	);
	
	randomSponsors();
	
	document.write(
		'	<form id="stay-connected" 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"/>'+
		'		<input type="text" name="C_EmailAddress" id="C_EmailAddress"/>'+
		'		<a href="http://www.linkedin.com/groups?trk=anet_ug_hm&gid=2856921&home" target="_blank"><img src="images/linkedin-icon.gif" width="19" height="19" alt="in"/></a>'+
		'		<a href="http://twitter.com/xactware" target="_blank"><img src="images/twitter-icon.gif" width="18" height="19" alt="t"/></a>'+
		'		<a href="http://www.xactware.com/rss.xml" target="_blank"><img src="images/rss-icon.gif" width="18" height="19" alt="rss"/></a><br/>'+
		'		email address<br/>'+
		'		<input type="submit" value="sign up"/>'+
		'	</form>'+
		'</div>'
	);
}

function footer(pageName){
	document.write(
		'<div id="bottom-banner"></div>'
	);
	
	s.channel="User Conference";
	s.pageName=pageName;
	
	// 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;
}

this.randomSponsors = function(){
	var sponsors = [
		[
			["CCA Global Partners","CCA-logo.jpg","134","91","http://www.ccaglobalpartners.com/"],
			["ClientRunner","ClientRunner-logo.jpg","130","36","http://www.clientrunner.com/"],
			["Amcat","Amcat-logo.jpg","112","48","http://www.amcatusa.com/"]
		],
		[
			["GeoEstimator","GeoEstimator-logo.jpg","186","41","http://www.geoestimator.com/"],
			["Contractor Connection","ContractorConnection-logo.jpg","144","38","http://www.contractorconnection.com/home.htm"],
			["Belfor","Belfor-logo.jpg","140","36","http://www.belfor.com/"],
			["Pilot","Pilot-logo.jpg","156","34","http://www.pilotcat.com"]
		],
		[
			["EBERL","EBERL-logo.jpg","105","58","https://www.eberls.com/"],
			["Interstate","Interstate-logo.jpg","141","44","http://www.interstaterestoration.com/"],
			["EagleView","EagleView-logo.jpg","105","87","http://www.eagleview.com/"]
		],
		[
			["Business Networks","BusinessNetworks-logo.jpg","74","114","http://www.businessnetworks.com/"],
			["Accurate Content Valuation Systems","ACVS-logo.jpg","116","79","http://www.acvsystems.com/"],
			["PSA/Luxor CRM","PSA-Luxor-logo.jpg","148","69","http://canamsys.com/uploads/affilates/"]
		],
		[
			["itel","itel-logo.jpg","146","59","http://www.itelinc.com/"],
			["RJMW","RJMW-logo.jpg","152","66","http://www.rjmw.com/"],
			["Restoration Manager","RestorationManager_logo.jpg","154","65","http://www.restorationmanager.net/"]
		],
		[
			["DKI","DKI-logo.jpg","127","36","http://www.disasterkleenup.com/"],
			["Restoration &amp; Remediation Magazine","RR-logo.jpg","113","61","http://www.randrmagonline.com/"],
			["Paul Davis Restoration","PD-logo.jpg","166","25","http://www.pdrestoration.com/"]
		]
	];
	var length = sponsors.length;
	// Randomly select the initial sponsor group
	var index = Math.floor(Math.random()*length);
	
	document.write('<div id="sponsor-bar"></div>');
	
	this.show = function(){
		if (index == length) index = 0;
		var group = sponsors[index++];
		var html = '';
		$(group).each(function(){
			html+='<a href="'+this[4]+'" target="_blank"><img alt="'+this[0]+'" src="images/sponsors/'+this[1]+'" width="'+this[2]+'" height="'+this[3]+'"/></a>';
		});
		$('#sponsor-bar').html(html);
	}
	
	show();
	setInterval(show,5000);
};

this.randomQuote = function(){
	var quotes = [
		["Excellent conference;<br/>I've been impressed.","Paul Gardner","Belfor"],
		["It's great. We'll be back for future conferences.","Mark Tucker","ServiceMaster Clean"],
		["The last two days have really exceeded my expectations. What I can take back to the company ... already paid for my trip here.","Raj Manickam","Steammaster Restoration and Cleaning"],
		["This is so worth coming here because every session we got a pearl. ... We came away with something that we could use or something that was new or something that really made it worth the while.","Allan Palmer","AmCat Adjusting Services"],
		["Xactware's a great team of professionals ... this is a great conference.","Tim Bowen","MetLife"],
		["It's like a one-stop shop that we get to meet everyone from all the departments ... and the best of all is to see how all the industry leaders are using the technology to make all their adjusters more efficient and more accurate in their claims handling.","Michael Oei","Farmers Insurance Group"]
	];
	var pause = 20000;
	var length = quotes.length;
	var temp = -1;

	this.getRan = function(){
		// get the random number
		var ran = Math.floor(Math.random()*length);
		return ran;
	};
	this.show = function(){
		var ran = getRan();
		// to avoid repeating
		while (ran == temp){
			ran = getRan();
		};
		temp = ran;
		
		if ($.browser.msie){
			$(".quote").hide();
			$(".quote span:nth-child(1)").html(quotes[ran][0]+'"');
			$(".quote span:nth-child(2)").html(quotes[ran][1]);
			$(".quote span:nth-child(3)").html(quotes[ran][2]);
			$(".quote").show();
		} else {
			$(".quote").fadeOut('slow',function(){
				$(".quote span:nth-child(1)").html(quotes[ran][0]+'"');
				$(".quote span:nth-child(2)").html(quotes[ran][1]);
				$(".quote span:nth-child(3)").html(quotes[ran][2]);
			}).fadeIn();
		}
	};
	
	show();
	setInterval(show,pause);
};

function video(id,video,image,width,height,duration){
	document.write("<div id='"+id+"' style='width:"+width+"px; height:"+height+"px'>Loading the player...<\/div>");
	jwplayer(id).setup({
		file: video,
		image: image,
		height: height,
		width: width,
		duration: duration,
		flashplayer: "/flash/jwplayer/player.swf",
		skin: "/flash/jwplayer/skins/xactware.zip",
		events: {
			onPlay: function(e){
				if(e.oldstate=="BUFFERING"){
					s.Media.open(this.config.file,this.config.duration,"JW Player");
				}
				s.Media.play(this.config.file,this.getPosition());
			},
			onPause: function(e){
				s.Media.stop(this.config.file,this.getPosition());
			},
			onComplete: function(e){
				s.Media.stop(this.config.file,this.config.duration);
				s.Media.close(this.config.file);
			}
		}
	});
}
