//required variables
//var svp_clip_id = "78";
is_ie = typeof(window.innerWidth)!='number';
svp_multiple_players = is_ie!="undefined";
svp_site_root = "http://play.streamingvideoprovider.com/";
if(typeof svp_player_color=="undefined") svp_player_color = "#9C9EA4";
if(typeof svp_player_color1=="undefined") svp_player_color1 = "#FCF6FC";
if(typeof svp_player_color_ratio=="undefined") svp_player_color_ratio = "0.6";
if(typeof svp_player_height=="undefined") svp_player_height = 341;
if(typeof svp_player_width=="undefined") svp_player_width = 400;
if(typeof svp_transparent=="undefined") svp_transparent = true;
if(svp_transparent=="false") svp_transparent = false;
if(typeof svp_alpha=="undefined") svp_alpha = false;
if(typeof svp_stretch_video=="undefined") svp_stretch_video = 0;
if(typeof svp_pause=="undefined"||svp_pause =='0') svp_pause=false;
if(typeof svp_repeat=="undefined"||svp_repeat =='0') svp_repeat=false;
if(typeof svp_auto_hide=="undefined"||svp_auto_hide =='') svp_auto_hide='0';
if(typeof svp_brand_new_window=="undefined"||svp_brand_new_window =='') svp_brand_new_window='1';
svp_player_controls_height=19;
if(typeof svp_bg_color=="undefined") svp_bg_color='#a0a0a0';
if(typeof svp_no_fullscreen=="undefined"||svp_no_fullscreen =='0') svp_no_fullscreen = false;
if(typeof svp_skin=="undefined") svp_skin = 0;
if(typeof svp_no_controls=="undefined") svp_no_controls = 0;
if(typeof svp_start_img=="undefined") svp_start_img = 0;
if(typeof svp_start_volume=="undefined") svp_start_volume = '';
svp_show_monitor = true;
svp_big_monitorW = 842;
svp_big_monitorH = 598;
svp_big_monitor_X = 21;
svp_big_monitor_Y = 26;
is_strict = is_ie && typeof(document.documentElement.clientWidth)!='undefined'&&document.documentElement.clientWidth!=0;
old_hscroll = 0;old_vscroll = 0;
svp_of_backup='';svp_of_backupS='';
if(typeof svp_use_div=="undefined") svp_use_div = false;
svp_true_fullscreen = (typeof svp_fs_mode=="undefined")?false:svp_fs_mode == '1';
svp_native_fullscreen = (typeof svp_fs_mode=="undefined")?false:svp_fs_mode == '2';
if(svp_true_fullscreen||svp_native_fullscreen){
   svp_show_monitor = false;
}
if(typeof svp_only_fs=="undefined") svp_only_fs = false;
if(svp_no_controls){
   svp_no_fullscreen = true;
   svp_only_fs = false;
   svp_show_monitor = false;
}

function MM_findObj(n, d){ //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length){
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for (i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers(){ //v3.0');
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null)
{ v=args[i+2];if (obj.style) { obj=obj.style; v=(v=="show")?"visible":(v="hide")?"hidden":v;}obj.visibility=v; }}
var LCuid = new Date().getTime();

function f_clientWidth(){return f_fRes(window.innerWidth?window.innerWidth:0,document.documentElement?document.documentElement.clientWidth:0,document.body?document.body.clientWidth:0);}
function f_clientHeight(){return f_fRes(window.innerHeight?window.innerHeight:0,document.documentElement?document.documentElement.clientHeight:0,document.body?document.body.clientHeight:0);}
function f_scrollLeft(){return f_fRes(window.pageXOffset?window.pageXOffset:0,document.documentElement?document.documentElement.scrollLeft:0,document.body?document.body.scrollLeft:0);}
function f_scrollTop(){return f_fRes(window.pageYOffset ? window.pageYOffset:0,document.documentElement?document.documentElement.scrollTop:0,document.body?document.body.scrollTop:0);}
function f_fRes(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 f_setScrollOffs(it,oX,oY){itm=MM_findObj(it);if(itm){itm.style.top=oY+f_scrollTop()+'px';itm.style.left=oX+f_scrollLeft()+'px';}}
function f_setFillScreen(it,itm){itm=itm?itm:MM_findObj(it);if(itm){itm.style.width=f_clientWidth();itm.style.height=f_clientHeight();itm.style.top=f_scrollTop()+'px';itm.style.left=f_scrollLeft()+'px';}}

if(!svp_no_fullscreen){
  document.writeln('<SCRIPT LANGUAGE=JavaScript>');
  document.writeln('function f_showIFCurtain(){document.all.curtain_IF.style.display="block";document.all.curtain_IF.style.width=f_clientWidth();document.all.curtain_IF.style.height=f_clientHeight();document.all.curtain_IF.style.top=f_scrollTop()+"px";document.all.curtain_IF.style.left=f_scrollLeft()+"px";}');
  document.writeln('function f_hideIFCurtain(){document.all.curtain_IF.style.display="none";document.all.curtain_IF.style.width=f_clientWidth()-20;document.all.curtain_IF.style.height=f_clientHeight()-20;}');
  document.writeln('function player_DoFSCommand(command, args){');
  document.writeln('if(command=="OpenFullScreen"){OpenFullScreen(clip_id,args)}');
  document.writeln('}');//done fscommand
  //document.writeln('function CloseFullscreenWindow(){beplayer.HardStop();MM_showHideLayers("svp_bigplayer","","hide");}');
  document.write('function ClosePlayer(){');
  document.writeln('document.body.style.overflow=svp_of_backup;');
  if(typeof svp_on_close_fs!="undefined") document.write('eval("'+svp_on_close_fs+'");');
  if(is_strict) document.writeln('document.documentElement.style.overflow=svp_of_backupS;');
  if(is_ie) document.write('f_hideIFCurtain();');
  if(svp_show_monitor && typeof svp_bg_color!="undefined"){
    document.write('MM_showHideLayers("svp_bigplayer_bg","","hide");');
    if(is_ie) document.write('f_setFillScreen("svp_bigplayer_bg");');
  }
  if(svp_show_monitor) document.write('MM_showHideLayers("svp_bigmonitor","","hide");');
  if(is_ie && svp_true_fullscreen) document.write('f_setFillScreen("svp_bigplayer");');
  document.writeln('MM_showHideLayers("svp_bigplayer","","hide");}');

  document.write('function OpenFullScreen(ps){');
  if(typeof svp_on_open_fs!="undefined") document.write('eval("'+svp_on_open_fs+'");');
  document.write('old_hscroll = f_scrollLeft();old_vscroll = f_scrollTop();');
  document.write('svp_of_backup=document.body.style.overflow;document.body.style.overflow="hidden";');
  if(is_strict) document.write('svp_of_backupS=document.documentElement.style.overflow;document.documentElement.style.overflow="hidden";');
  if(svp_show_monitor && typeof svp_bg_color!="undefined"){
    if(is_ie) document.write('f_setFillScreen("svp_bigplayer_bg");');
    document.write('MM_showHideLayers("svp_bigplayer_bg","","show");');
  }
  if(is_ie && svp_show_monitor) document.write('f_setScrollOffs("svp_bigmonitor",bX,bY);');
  if(svp_show_monitor) document.write('MM_showHideLayers("svp_bigmonitor","","show");');
  if(is_ie) document.write('f_showIFCurtain();');
  if(is_ie && !svp_true_fullscreen) document.write('f_setScrollOffs("svp_bigplayer",aX,aY);');
  if(is_ie && svp_true_fullscreen) document.write('f_setFillScreen("svp_bigplayer");');
  document.writeln('MM_showHideLayers("svp_bigplayer","","show");');
  document.writeln('setTimeout("playBig("+ps+")",250);}');
  document.write('function playBig(ps){');
  if(is_ie) document.write('if(document.readyState!="complete"){setTimeout("playBig("+ps+")",250);return;}');
  document.write('var flashProxy = new FlashProxy("beplayer"+LCuid, "'+svp_site_root+'/js/JavaScriptFlashGateway.swf");');
  document.writeln('flashProxy.call("PlayFromPos", ""+ps);}');
  document.writeln('</SCRIPT>');
  if(navigator.vendor!='Apple'){
    document.writeln('<script language="VBScript" type="text/vbscript">');
    document.writeln("Sub player_FSCommand(ByVal command, ByVal args) call player_DoFSCommand(command, args) end sub");
    document.writeln('</script>');
  }
}
if(!svp_only_fs){
  if(!svp_use_div) document.write('<div id="svp_player" style="height: '+svp_player_height+'px; width: '+svp_player_width+'px;">EMBEDED PLAYER</div>');
  document.writeln('<script type="text/javascript" DEFER="true">');
  document.writeln('var m = new SWFObject("'+svp_site_root+'player'+svp_skin+'.swf", "eplayer", "'+svp_player_width+'", "'+svp_player_height+'", "8", "", true);');
  document.writeln('m.addParam("quality", "high");');
  if(svp_transparent) document.writeln('m.addParam("wmode", "transparent");');
  else if(svp_native_fullscreen)document.writeln('m.addParam("wmode", "window");');
  else document.writeln('m.addParam("wmode", "opaque");');
  if(svp_alpha) document.writeln('m.addParam("alphaPlayer", "1");');
  if(svp_pause) document.writeln('m.addVariable("autoStart", "0");');
  if(svp_repeat) document.writeln('m.addVariable("repeatVideo", "1");');
  if(svp_no_fullscreen) document.writeln('m.addVariable("no_fs", "1");');
  if(svp_stretch_video) document.writeln('m.addVariable("stretch_video", "1");');
  document.writeln('m.addVariable("clip_id", "'+svp_clip_id+'");');
  document.writeln('m.addVariable("color1", "'+svp_player_color1+'");');
  document.writeln('m.addVariable("color", "'+svp_player_color+'");');
  document.writeln('m.addVariable("autoHide", "'+svp_auto_hide+'");');
  document.writeln('m.addVariable("rid", "'+LCuid+'");');
  if(svp_no_controls)document.writeln('m.addVariable("noControls", "'+svp_no_controls+'");');
  if(svp_start_img)document.writeln('m.addVariable("start_img", "'+svp_start_img+'");');
  if(svp_start_volume)document.writeln('m.addVariable("start_volume", "'+svp_start_volume+'");');
  document.writeln('m.addVariable("brandNW", "'+svp_brand_new_window+'");');
  document.writeln('m.addVariable("color_ratio", "'+svp_player_color_ratio+'");');
  document.writeln('m.addVariable("page", "'+encodeURIComponent(location.href)+'");');
  if(typeof svp_ext!="undefined") document.writeln('m.addVariable("ext", "'+svp_ext+'");');
  if(typeof svp_referer!="undefined") document.writeln('m.addVariable("referer", "'+encodeURIComponent(svp_referer)+'");');
  document.writeln('m.addParam("swLiveConnect", "true");');
  document.writeln('m.addParam("LOOP", "false");');
  document.writeln('m.addParam("allowScriptAccess", "always");');
  if(svp_native_fullscreen){
    document.writeln('m.addParam("allowFullScreen", "true");');
    document.writeln('m.addVariable("native_fs", "1");');
  }
  if(!svp_use_div) document.writeln('m.write("svp_player");');
  else document.writeln('m.write("'+svp_use_div+'");');
  document.writeln('</script>');
}

if(!svp_no_fullscreen){
var winW = 0, winH = 0;
if( typeof( window.innerWidth ) == 'number' ) {
  winW = window.innerWidth; winH = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
  winW = document.documentElement.clientWidth; winH = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
  winW = document.body.clientWidth; winH = document.body.clientHeight;
}

aH=awH=(winH>450)?450:winH;
aW=awW=(winW>800)?800:winW;

if(svp_show_monitor){aH=800;aH=450;}
/*else{ aspect correction
  if(awW/(awH-svp_player_controls_height) > 16/9){
    aH = awH; aW = Math.round((awH-svp_player_controls_height)*16/9);
  }else{
    aW = awW; aH = Math.round((awW)*9/16)+svp_player_controls_height;
  }
}*/
aX= Math.floor((winW-aW)/2);
aY= Math.floor((winH-aH)/2);
if(is_ie)document.write('<IFRAME id="curtain_IF" style="DISPLAY:none;LEFT:0px;POSITION:absolute;TOP:0px;filter:Alpha(Opacity=0);" src="javascript:false;" frameBorder="0" scrolling="no"></IFRAME>');
if(svp_show_monitor && typeof svp_bg_color!="undefined") document.writeln('<div id="svp_bigplayer_bg" style="position:absolute;width:'+winW+'px;height:'+winH+'px;z-index:100;left:0px;top:0px;background-color:'+svp_bg_color+';visibility: hidden;">&nbsp;</div>');
bX=0;bY=0;
if(svp_show_monitor){
  bX = aX-svp_big_monitor_X;
  bY = Math.floor((winH-aH-svp_big_monitor_Y*2)/2);
  document.writeln('<div id="svp_bigmonitor" style="position:absolute;left:'+bX+'px;top:'+bY+'px;width:'+svp_big_monitorW+'px; height:'+svp_big_monitorH+'px;z-index: 101; visibility: hidden; background-image: url('+svp_site_root+'img/monitor_big.png);background-repeat: no-repeat;">&nbsp;</div>');
}
if(svp_true_fullscreen){aX=0;aY=0;aW=winW;aH=winH;}
if(!svp_native_fullscreen){
document.writeln('<div id="svp_bigplayer" style="position:absolute;left:'+aX+'px;top:'+aY+'px;width:'+aW+'px;height:'+aH+'px; z-index: 102; visibility: hidden;">FULLSCREEN PLAYER LAYER<script type="text/javascript" DEFER="true">');
document.writeln('var bm = new SWFObject("'+svp_site_root+'player'+svp_skin+'.swf", "beplayer", "'+aW+'", "'+aH+'", "8", "", true);');
document.writeln('bm.addParam("quality", "high");');
if(svp_transparent) document.writeln('bm.addParam("wmode", "transparent");');
else document.writeln('bm.addParam("wmode", "opaque");');
document.writeln('bm.addVariable("autoStart", "0");');
document.writeln('bm.addVariable("fullscreen", "1");');
document.writeln('bm.addVariable("lcId", "beplayer"+LCuid);');
document.writeln('bm.addVariable("rid", "'+LCuid+'");');
document.writeln('bm.addVariable("clip_id", "'+svp_clip_id+'");');
document.writeln('bm.addVariable("color1", "'+svp_player_color1+'");');
document.writeln('bm.addVariable("color", "'+svp_player_color+'");');
document.writeln('bm.addVariable("autoHide", "'+svp_auto_hide+'");');
document.writeln('bm.addVariable("brandNW", "'+svp_brand_new_window+'");');
document.writeln('bm.addVariable("color_ratio", "'+svp_player_color_ratio+'");');
document.writeln('bm.addVariable("page", "'+encodeURIComponent(location.href)+'");');
if(typeof svp_ext!="undefined") document.writeln('bm.addVariable("ext", "'+svp_ext+'");');
if(typeof svp_referer!="undefined") document.writeln('bm.addVariable("referer", "'+encodeURIComponent(svp_referer)+'");');
document.writeln('bm.addParam("swLiveConnect", "true");');
document.writeln('bm.addParam("bgcolor", "'+svp_bg_color+'");');
document.writeln('bm.addParam("LOOP", "false");');
document.writeln('bm.addParam("allowScriptAccess", "always");');
document.writeln('bm.write("svp_bigplayer");');
document.writeln('</script></div>');
}

}

