// Copyright 2010 Website Talking Heads
// JavaScript Document
if (typeof spokesperson == "undefined") {
	spokesperson = new Object();
}
spokesperson.params = {
	width:256,
	height:384,
	position:"fixed",
	doctype:"strict",
	left:"auto",
	right:"0px",
	top:"auto",
	bottom:"0px",
	centeroffset:"auto",
	color:0xCCCCCC,
	volume:70,
	autostart:"yes",
	fadein:0,
	fadeout:2,
	flip:"no",
	delay:0,
	delayclose:0,
	buffertime:3,
	controlbar:"mouse",
	exitbtn:"yes",
	playbtn:"PlayVideo.png",
	playposition:"center",
	playtop:"center",
	exitoncomplete:"yes",
	oncepersession:"no",
	vidlink:"no",
	openin:"_blank",
	path:"spokesperson",
	actorpic:"julia0904.png",
	flv:"julia0904.flv"};
	
var topPx = parseFloat(spokesperson.params.top);
var bottomPx = parseFloat(spokesperson.params.bottom);

spokesperson.hideDiv = function(){
	document.getElementById('spokesperson').style.visibility = 'hidden';	
}
function onlyOnce() {
if (document.cookie.indexOf("hasSeen=true") == -1) {
var later = new Date();
later.setFullYear(later.getFullYear()+10);
document.cookie = 'hasSeen=true;path=/;';
spokesperson.drawVideo();
}
}

spokesperson.drawVideo= function(){
	var markUp = '';
	markUp += '<style type="text/css">';
	markUp += '#spokesperson {position:'+spokesperson.params.position+';width:'+spokesperson.params.width+'px;height:'+spokesperson.params.height+'px;margin-left:'+spokesperson.params.centeroffset+';left:'+spokesperson.params.left+';right:'+spokesperson.params.right+';top:'+spokesperson.params.top+';bottom:'+spokesperson.params.bottom+';z-index:99999;}';
	markUp += '</style>';
	markUp += '<div id="spokesperson">';
	markUp += '  <object id="objvideo" style="outline:none;" type="application/x-shockwave-flash" width="'+spokesperson.params.width+'" height="'+spokesperson.params.height+'" data="'+spokesperson.params.path+'/spokesperson.swf">';
	markUp += '    <param name="movie" value="'+spokesperson.params.path+'/spokesperson.swf" />';
	markUp += '    <param name="quality" value="high" />';
	markUp += '    <param name="flashvars" value="vurl='+spokesperson.params.flv+'&amp;vwidth='+spokesperson.params.width+'&amp;vheight='+spokesperson.params.height+'&amp;actorpic='+spokesperson.params.path+'/'+spokesperson.params.actorpic+'&amp;autostart='+spokesperson.params.autostart+'&amp;exitoncomplete='+spokesperson.params.exitoncomplete+'&amp;vbuff='+spokesperson.params.buffertime+'&amp;vdelay='+spokesperson.params.delay+'&amp;vcolor='+spokesperson.params.color+'&amp;vlink='+spokesperson.params.vidlink+'&amp;openin='+spokesperson.params.openin+'&amp;delayclose='+spokesperson.params.delayclose+'&amp;fadein='+spokesperson.params.fadein+'&amp;fadeout='+spokesperson.params.fadeout+'&amp;vvol='+spokesperson.params.volume+'&amp;playbtn='+spokesperson.params.path+'/'+spokesperson.params.playbtn+'&amp;playpos='+spokesperson.params.playposition+'&amp;playtop='+spokesperson.params.playtop+'&amp;hflip='+spokesperson.params.flip+'&amp;controlbar='+spokesperson.params.controlbar+'&amp;exitbtn='+spokesperson.params.exitbtn+'" />';
	markUp += '    <param name="wmode" value="transparent" />';
	markUp += '    <param name="allowscriptaccess" value="always" />';
	markUp += '    <param name="swfversion" value="9.0.45.0" />';
	markUp += '  </object>';
	markUp += '</div>';
	if (spokesperson.params.position == "fixed") {
		if (spokesperson.params.doctype == "quirks") {
			if (spokesperson.params.top == "auto") {
						markUp += '<!--[if IE]>';
						markUp += '<style type="text/css">';
						markUp += '#spokesperson {position:absolute; top: expression(offsetParent.scrollTop - 1 + (offsetParent.clientHeight-this.clientHeight) + '+bottomPx+' + "px")}';
						markUp += '</style>';
						markUp += '<![endif]-->';}
					else {
							markUp += '<!--[if IE]>';
							markUp += '<style type="text/css">';
							markUp += '#spokesperson {position: absolute !important;top: expression(((document.documentElement.scrollTop || document.body.scrollTop) + (!this.offsetHeight && 0)) + '+topPx+' + "px")';
							markUp += '</style>';
							markUp += '<![endif]-->';}
					}
				else {
						markUp += '<!--[if lte IE 6]>';
						markUp += '<style type="text/css">';
						markUp += 'html, body{height: 100%;overflow: auto;}#spokesperson {position: absolute;}';
						markUp += '</style>';
						markUp += '<![endif]-->';
			}
		}		
	document.write(markUp);
}
function hideDiv() {
	spokesperson.hideDiv();
}

if (spokesperson.params.autostart=="oncethenpic") {
	if (document.cookie.indexOf("hasSeen=true") == -1) {
		var later = new Date();
		later.setFullYear(later.getFullYear()+10);
		document.cookie = 'hasSeen=true;path=/;';
		spokesperson.params.autostart = "yes";
		}
	else {
		spokesperson.params.autostart = "no";

	}
}

if (spokesperson.params.autostart=="oncethenmute") {
	if (document.cookie.indexOf("hasSeen=true") == -1) {
		var later = new Date();
		later.setFullYear(later.getFullYear()+10);
		document.cookie = 'hasSeen=true;path=/;';
		spokesperson.params.autostart = "yes";
		}
	else {
		spokesperson.params.autostart = "mute";
	}
}

if (spokesperson.params.oncepersession == "yes") {
	onlyOnce();}
	else {
		spokesperson.drawVideo();
	}

function thisMovie(movieName) {
         if (navigator.appName.indexOf("Microsoft") != -1) {
             return window[movieName];
         } else {
             return document[movieName];
         }
     }