//
// Copyright Your Website Spokesperson, LLC
//
///////////////////////////////////////////////////////////////////////////
//                                                                       //
//  This file allows you to change how your website spokesperson         //
//  will display on your webpage without the need for any programming.   //
//  Just follow the directions below to change the parameters, and       //
//  then copy this file to the correct webserver folder.                 // 
//                                                                       //
///////////////////////////////////////////////////////////////////////////
//
//***********************************************
//                POSITIONING
//***********************************************

//Position type ( 0 - Static, 2 - Dynamic )
//Static means you specify where the video will play using x & y coordinates.
//The upper left corner of the screen is (0,0). 
//Dynamic means the position will be automatically calculated for you, based 
//on the position you select with the "preset position" option.
//
var position_type = 2;

//x offset (used for 0-Static).  Increase the x value to move the video to the right.  
//
offsetx = 0;

//y offset (used for 0-Static).  Increase the y value to move the video down.
//
offsety = 0;

//Preset position - used if Position Type=2 Dynamic(above).  Options are:
//  0 - Top Left,    1 - Top Middle     2 - Top Right
//  3 - Middle Left  4 - Middle         5 - Middle Right
//  6 - Bottom Left  7 - Bottom Middle  8 - Bottom Right
//
var preset_position = 8;

//Fixed on Page (0) or Fixed on Screen (1).  A value of 0 means the video will stay fixed on the web page (will scroll off the screen if the user scrolls down).  A value of 1 means the video will remain on the screen even if the person scrolls through the webpage.
//
var iScrolls = 1;

//***********************************************
//                TIMING OPTIONS
//***********************************************

//Time to delay showing video on page (0..n seconds)
//
var delay_time = 0;

//Time for video to remain on page after video is done (0..n seconds).
//A value of 0 means keep the video on the page forever.
//
var remain_time = 0;

//Frequency that video shows (0-every time, 1-once per session, 2-every x number of days)
//
var frequency = 0;

//Show video every (0..n) days.  Used if Frequency=2 (above).
//
var frequency_days = 1;

//Seconds to fade-in video (0..n seconds).  A value of 0 means no fade-in.
//
var fadein_seconds = 0;

//Seconds to fade video out for (0..n seconds).  A value of 0 means no fade-out.
//
var fadeout_seconds = 0;

//***********************************************
//                FLASH MOVIE OPTIONS
//***********************************************

//URL for flash movie.  If the .flv file is in the same directory as this file,
//you only need to identify the filename.
//
video_url = 'YWS-TCR-menopause.flv';

//Height of video (in pixels).  Be careful about changing this value.
//
video_height = 300;

//Width of video (in pixels).  Be careful about changing this value.
//
video_width = 345;

//Percent to buffer video before playing (0-100).  This lets you determine
//how much of the video will be downloaded before it starts playing.  Higher
//numbers mean less chance for video stuttering, but may delay the start of 
//the video.
//
var video_buffer = 30;

//Determines whether to start playing the video with sound or muted.
//Values are 0-start normally
//           1-start muted
//
var start_muted = 1;

//If starting muted, determine how video will display.
//Values are 1-start muted normal
//           2-start muted with large play button
//           3-start muted with large play button on mouseover
//
var start_muted_options = 2;

//Determines whether the user must press a large play button to start the video.
//Values are 0-don't show before video
//           1-show before video
//
var play_button_timing_before = 0;

//Determines whether a large play button appears after the video ends, in order to
//replay the video.  
//Values are 0-don't show after video
//           1-show after video
//
var play_button_timing_after = 0;

//Determines whether the video should automatically play if a large play button is
//not used.  
//Values are 0-don't autoplay
//           1-autoplay
//
var auto_play = 1;

//Determines whether the video will loop back to the beginning and begin playing
//again once it's done.  
//Values are 0-don't loop
//           1-loop
//
var loop = 0;

//Frame to show for Fade In/Fade Out/Mouseovers (0..n where n is last frame of video)
//If this is set to 0, the first frame is shown.
//
var frame_show_number = 0;

//Webpage to display if the user clicks the video.  If this is blank, clicking on 
//the video will not have any effect.
//
var clickable_url = '';

//Determines whether the webpage that is displayed if the user clicks on the video
//will open in a new browser window, or open in the current browser window.
//Values are 0-open in new browser window
//           1-open in same browser window.
//Note, this option is ignored if the "clickable_url" option is blank (above).
//
var clickable_window_option = 0;

//Determines when the player controls (play, pause, mute) should be shown
//Values are 0-show always
//           1-show only on mouseover
//
var player_controls_mouseover = 1;

//
//////////////////////////////////////////////////////////////////////////
//                                                                      //
//        DO NOT CHANGE OR MODIFY ANYTHING BELOW THIS LINE              //
//                                                                      //
//////////////////////////////////////////////////////////////////////////
//

delay_time=delay_time*1000;remain_time=remain_time*1000;var url_string=buildURLString();var style_string=buildStyleString();function buildURLString(){var sURL="?a="+video_url;if(delay_time>0)
sURL+="&b="+delay_time;if(remain_time>0)
sURL+="&c="+remain_time;sURL+="&d="+frequency;if(frequency_days>0)
sURL+="&e="+frequency_days;if(fadein_seconds>0)
sURL+="&f="+fadein_seconds;if(fadeout_seconds>0)
sURL+="&g="+fadeout_seconds;if(video_buffer>0)
sURL+="&h="+video_buffer;if(play_button_timing_before)
sURL+="&j="+play_button_timing_before;if(play_button_timing_after)
sURL+="&k="+play_button_timing_after;if(frame_show_number)
sURL+="&l="+frame_show_number;if(clickable_url.length>0){sURL+="&m="+clickable_url;sURL+="&n="+clickable_window_option;}
if(auto_play!=0)
sURL+="&s=1";if(loop!=0)
sURL+="&t=1";if(player_controls_mouseover!=0)
sURL+="&u=1";if(start_muted){sURL+="&v=1";if(start_muted_options=="2")
sURL+="&i=1";if(start_muted_options=="3"){sURL+="&i=1";sURL+="&w=1";}}
sURL+="&q=15384382";sURL+="&r=62345324";return sURL;}
function f_clientWidth(){return f_filterResults(window.innerWidth?window.innerWidth:0,document.documentElement?document.documentElement.clientWidth:0,document.body?document.body.clientWidth:0);}
function f_clientHeight(){return f_filterResults(window.innerHeight?window.innerHeight:0,document.documentElement?document.documentElement.clientHeight:0,document.body?document.body.clientHeight:0);}
function f_scrollLeft(){return f_filterResults(window.pageXOffset?window.pageXOffset:0,document.documentElement?document.documentElement.scrollLeft:0,document.body?document.body.scrollLeft:0);}
function f_scrollTop(){return f_filterResults(window.pageYOffset?window.pageYOffset:0,document.documentElement?document.documentElement.scrollTop:0,document.body?document.body.scrollTop:0);}
function f_filterResults(n_win,n_docel,n_body){var n_result=n_win?n_win:0;if(n_docel&&(!n_result||(n_result>n_docel)))
n_result=n_docel;return n_body&&(!n_result||(n_result>n_body))?n_body:n_result;}
function buildStyleString(){var bUseJSScroll=false;var browser=navigator.appName;if(browser=="Microsoft Internet Explorer")
bUseJSScroll=true;var sPosition="absolute";if(iScrolls==1&&!bUseJSScroll){sPosition="fixed";}
var style_string="style='width: "+video_width+"px; height: "+video_height+"px; position: "+sPosition+"; z-index: 1000; ";if(position_type==0)
style_string=style_string+"left: "+offsetx+"px; top: "+offsety+"px; display: none'";if(position_type==1)
style_string=style_string+"margin-left: "+offsetx+"px; margin-top: "+offsety+"px; display: none '";if(position_type==2){var ml=video_width/2*-1;var mt=video_height/2*-1;sW=f_clientWidth();sH=f_clientHeight();horizMiddle=sW/2;vertMiddle=sH/2;if(iScrolls==1&&bUseJSScroll){switch(preset_position){case 0:style_string=style_string+"top: 0; left: 0; display: none'";break;case 1:style_string=style_string+"top: 0; left: "+(horizMiddle+ml)+"; display: none'";break;case 2:style_string=style_string+"top: 0; left: "+(sW-video_width)+"; display: none;'";break;case 3:style_string=style_string+"top: "+(vertMiddle+mt)+"; left: 0; display: none'";break;case 4:style_string=style_string+"top: "+(vertMiddle+mt)+"; left: "+(horizMiddle+ml)+"; display: none'";break;case 5:style_string=style_string+"top: "+(vertMiddle+mt)+"; left: "+(sW-video_width)+"; display: none'";break;case 6:style_string=style_string+"top: "+(sH-video_height)+"; left: 0; display: none'";break;case 7:style_string=style_string+"top: "+(sH-video_height)+"; left: "+(horizMiddle+ml)+"; display: none'";break;case 8:default:style_string=style_string+"top: "+(sH-video_height)+"; left: "+(sW-video_width)+"; display: none'";break;}}else{switch(preset_position){case 0:style_string=style_string+"top: 0; left: 0; display: none'";break;case 1:style_string=style_string+"top: 0; left: 50%; margin-left: "+ml+"; display: none'";break;case 2:style_string=style_string+"top: 0; right: 0; display: none;'";break;case 3:style_string=style_string+"top: 50%; margin-top: "+mt+"; left: 0; display: none'";break;case 4:style_string=style_string+"top: 50%; left: 50%; margin-top: "+mt+"; margin-left: "+ml+"; display: none'";break;case 5:style_string=style_string+"top: 50%; margin-top: "+mt+"; right: 0; display: none'";break;case 6:style_string=style_string+"bottom: 0; left: 0; display: none'";break;case 7:style_string=style_string+"bottom: 0; left: 50%; margin-left: "+ml+"; display: none'";break;case 8:default:style_string=style_string+"bottom: 0; right: 0; display: none'";break;}}}
return style_string;}
function updatePosition(){var ml=video_width/2*-1;var mt=video_height/2*-1;sW=f_clientWidth();sH=f_clientHeight();scrollTop=f_scrollTop();scrollLeft=f_scrollLeft();horizMiddle=sW/2;vertMiddle=sH/2;var element=document.getElementById('playerDiv');if(position_type==2){switch(preset_position){case 0:element.style.top=scrollTop+'px';element.style.left=scrollLeft+'px';break;case 1:element.style.top=scrollTop+'px';element.style.left=(scrollLeft+horizMiddle+ml)+'px';break;case 2:element.style.top=scrollTop+'px';element.style.left=(scrollLeft+sw-video_width)+'px';break;case 3:element.style.top=(scrollTop+vertMiddle+mt)+'px';element.style.left=scrollLeft+'px';break;case 4:element.style.top=(scrollTop+vertMiddle+mt)+'px';element.style.left=(scrollLeft+horizMiddle+ml)+'px';break;case 5:element.style.top=(scrollTop+vertMiddle+mt)+'px';element.style.left=(scrollLeft+sW-video_width)+'px';break;case 6:element.style.top=(scrollTop+sH-video_height)+'px';element.style.left=scrollLeft+'px';break;case 7:element.style.top=(scrollTop+sH-video_height)+'px';element.style.left=(scrollLeft+horizMiddle+ml)+'px';break;case 8:default:element.style.top=(scrollTop+sH-video_height)+'px';element.style.left=(scrollLeft+sW-video_width)+'px';break;}}else{element.style.top=(scrollTop+offsety)+'px';element.style.left=(scrollLeft+offsetx)+'px';}}
function setCookie(name,value,expires,path,domain,secure){var today=new Date();today.setTime(today.getTime());if(expires){expires=expires*1000*60*60*24;}
var expires_date='';if(expires){expires_date=new Date(today.getTime()+(expires));expires_date=expires_date.toGMTString();}
document.cookie=name+"="+escape(value)+
((expires)?";expires="+expires_date:"")+
((path)?";path="+path:"")+
((domain)?";domain="+domain:"")+
((secure)?";secure":"");}
function getCookie(check_name){var a_all_cookies=document.cookie.split(';');var a_temp_cookie='';var cookie_name='';var cookie_value='';var b_cookie_found=false;for(i=0;i<a_all_cookies.length;i++){a_temp_cookie=a_all_cookies[i].split('=');cookie_name=a_temp_cookie[0].replace(/^\s+|\s+$/g,'');if(cookie_name==check_name){b_cookie_found=true;if(a_temp_cookie.length>1){cookie_value=unescape(a_temp_cookie[1].replace(/^\s+|\s+$/g,''));}
return cookie_value;break;}
a_temp_cookie=null;cookie_name='';}
if(!b_cookie_found){return null;}}
var show_video=getCookie('frequency')==null;switch(frequency){case 2:if(show_video){setTimeout("document.getElementById('playerDiv').style.display='block';",delay_time);setCookie('frequency',frequency,frequency_days,'/','','');}
break;case 1:if(show_video){setTimeout("document.getElementById('playerDiv').style.display='block';",delay_time);setCookie('frequency',frequency,'','/','','');}
break;case 0:default:setTimeout("document.getElementById('playerDiv').style.display='block';",delay_time);break;}
function setScrolling(){if(iScrolls==1&&navigator.appName=="Microsoft Internet Explorer"){window.setInterval('updatePosition',20);window.onscroll=updatePosition;window.onresize=updatePosition;}}
setScrolling();setTimeout("document.getElementById('playerDiv').style.display='block';",delay_time);function startRemainingTimer(){setTimeout("document.getElementById('playerDiv').style.display='none';",remain_time);}
var flashobj='<div id="playerDiv" '+style_string+'><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="'+video_width+'" height="'+video_height+'" id="player" align="middle">';flashobj+='<param name="allowScriptAccess" value="sameDomain" />';flashobj+='<param name="allowFullScreen" value="false" />';flashobj+='<param name="movie" value="player.swf'+url_string+'" />';flashobj+='<param name="wmode" value="transparent" />';flashobj+='<param name="quality" value="high" />';flashobj+='<param name="bgcolor" value="#000000" />';flashobj+='<embed src="player.swf'+url_string+'" wmode="transparent" scale="exactFit" quality="high" bgcolor="#000000" width="100%" height="100%" name="player" align="middle" allowscriptaccess="sameDomain" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"></embed>';flashobj+='</object></div>';if(show_video)
document.write(flashobj);