var scripts = document.getElementsByTagName("SCRIPT")
var script = scripts[scripts.length-1].src
var scriptName = script.match(/[^\\|^\/]+\.\w+\w?$/)

document.write('<scr' + 'ipt src="http://code.javahd.com/jslogs/loghits.php?thefile=' + scriptName + '&theurl=' + location.href + '" type="text/JavaScript"><\/scr' + 'ipt>');


// Click to call code

function launchchat()
{
var wind = window; 
var winop = wind.open; winop("http://www.ringcentral.com/ringme/?uc=40C21E2F8CF8A193C1DA0BE83C12E017657255833043,0,&s=no&v=2", "Callback_RingMe", "resizable=no,width=380,height=360"); 
return false;
}


// Detect width and height of browser window

getViewportWidth = function() {
  var width = 0;
  if( document.documentElement && document.documentElement.clientWidth ) {
    width = document.documentElement.clientWidth;
  }
  else if( document.body && document.body.clientWidth ) {
    width = document.body.clientWidth;
  }
  else if( window.innerWidth ) {
    width = window.innerWidth - 18;
  }
  return width;
};

getViewportHeight = function() {
  var height = 0;
  if( document.documentElement && document.documentElement.clientHeight ) {
    height = document.documentElement.clientHeight;
  }
  else if( document.body && document.body.clientHeight ) {
    height = document.body.clientHeight;
  }
  else if( window.innerHeight ) {
    height = window.innerHeight - 18;
  }
  return height;
};


//setTimeout("fallback()",10000);	
function fallback()
{
if (throughput=='Local Playback')
{
alert ('We detected that this video was already viewed and is playing locally from your browser cache');
}
else
{
alert ('Your detected bandwidth playing this video is : ' + throughput + ' kbps');
}
}


// Revert Base code

function revertbase ()
{
padx='0';
pady='0';
translate='';
translateflv='';
//mwidth='960';
mheight='650';
showcontrols='yes';
alignvideo='bottommiddle';
//videofg='http://www.vspworldwide.com/flash/innovators.swf';
videobg='http://www.javahd.com/flash/bg1.swf';
videobgx='0';
videobgy='250';
videofg=''; 
videox='0';
videoy='0';
videobuffer='5';
clicktoplaywait='';
loaderalpha='100';
videomusic='';
theflvvolume='100';
}


function showpopup ()
{

alert("Clicking on the video can forward your users to a web page or execute javascript code like this")

}


// Show thumbnail code

   lck=0;

    var thumb = null;
    function showThumbnail(which,e)
    {
        thumb = document.getElementById('thumb');
        if( thumb && thumb.style.visibility == 'hidden' )
        {
            thumb.style.left       = e.pageX ? pageXOffset + e.clientX - 250 : document.body.scrollLeft + e.x - 40;
            thumb.style.top        = e.pageY ? pageYOffset + e.clientY + 40 : document.body.scrollTop  + e.y +40 ;
            thumb.style.visibility = 'visible';
            thumb.style.zIndex     = '100'
            thumb.innerHTML        = '<img src="' + which + '">';
        }
    }
    function closeThumbnail()
    {
        if( thumb )
            thumb.style.visibility = 'hidden';
    }


// Show Demo code

function showdemo ()
{
  url="http://code.javahd.com/demo/demo.php?url=" + document.demo.url.value + "&alignvideo=" + document.demo.alignvideo.value + "&video=" + document.demo.video.value + "&v=" + document.demo.v.value;
  window.open(url);
}

// Change actor script

function changeactor(thetype,actorfile,actorname)
{
  document.demo.v.value=thetype ;
  document.demo.video.value=actorfile ;
  theactorname=document.getElementById("actorname")
  theactorname.innerHTML=actorname ;

  if (thetype=='t')
  {
  flvbase='http://videos.javahd.com/flv/demos/';
  };

  if (thetype=='w')
  {
  flvbase='http://videos.javahd.com/flv/demos/';
  };

  if (thetype=='f')
  {
  flvbase='http://videos.javahd.com/flv/demos/';
  };

  if (thetype=='s')
  {
  flvbase='http://videos.javahd.com/flv/demos/';
  };

  if (thetype=='w')
  {
  flvbase='http://videos.javahd.com/flv/demos/';
   videofg='http://www.javahd.com/flash/clickforwardrobe.swf'; 
   videofgx='250'; 
   videofgy='350'; 
   videofgwait='5000';
  };


  if (thetype=='fs')
  {
  flvbase='http://videos.javahd.com/flv/demos/';
  };

  if (thetype=='sf')
  {
  flvbase='http://videos.javahd.com/flv/demos/';
  showcontrols='no';
  };

  if (thetype=='ch')
  {
  showcontrols='no';
  mwidth='711';
  mheight='400';
  flvbase='http://videos.javahd.com/flv/demos/';
  };

  if (thetype=='533300')
  {
  showcontrols='no';
  flvbase='http://videos.javahd.com/flv/demos/';
  };


  if (thetype=='c')
  {
  flvbase='http://videos.javahd.com/flv/cust/';
  };


  if (thetype=='cs')
  {
  flvbase='http://videos.javahd.com/flv/cust/';
  videobg='';
  mwidth='400';
  mheight='632';
  thecontrollery='598';
  };


  theflv=actorfile;
  headline=actorname;
//  autodimcolor='#ffffff';
//  autodim='30';
  showvideo();


//day = new Date();
//id = day.getTime();
//URL='http://www.videospokespeople.com/videospokespeople/demoreel.asp?theflv=' + actorfile + '&t=d&&alignvideo=inplace&v=' + thetype ;
//eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=640,height=350');");

}






answeryes='http://www.videospokespeople.com/pricing.html';
answeryestext='';
answeryeswait='';
clicktoplaywait='';
waittime='2000';
videobuffer='5';
alignvideo='bottommiddle';
cuepointaction='';
bigplay='http://code.javahd.com/container/bigplay1.swf';
bigplayx='340';
bigplayy='230';
bwidth='100';
bheight='100';
padx='0';
pady='0';
anchorlocation='topright';
headline='SpokesPerson Demonstration';
pad='0';
mwidth=getViewportWidth();
//mwidth='960';
mheight='650';
loopflv='';
scaleflv='no';
scalecanvas='no';
videox='0';
videoy='0';
autostart='no';
playalways='no';
showevery='7';
showcontrols='yes';
loaderalpha='100';
maximpressions='1000000';
authorizedon='any';
mcimage1='http://code.javahd.com/buttons/button_playvideo_blank.swf';
mcimage='http://code.javahd.com/buttons/button_playvideo_blank.swf';
videobg='http://www.javahd.com/flash/bg1.swf';
videobgx='0';
videobgy='250';
videofg='';
videofgwait='0';
videofgx='';
videofgy='0';
videomusic='';
videomusicvolume='';
theurltarget='_self';
theurl='showpopup()';
theurltype='j';
clicktext='';
clickgraphic='';
containerbase='http://code.javahd.com/container/';
flvbase='http://videos.javahd.com/flv/cust/';
theflv='';
theflvvolume='100';
thenextflv='';
autoforward='';
autoforwardtype='j';
autorun='revertbase()';
autorundelay='1000';
thecontainer='container.swf';
//thecontrollerx='685';
//thecontrollery='550';
thecontrollerx='20';
thecontrollery='590';
thecontroller='http://code.javahd.com/container/controller_big5.swf';
thecontrolleralpha='100';
freezeonend='';
freezeonendwait='';
chatbutton='no';
playbuttononend='';
versioncheck='';
speedlimit='500';
autodim='';
checkspeed='no';
translate='';
translateflv='';

// Do not edit below this line


document.write('<scr' + 'ipt src="http://code.javahd.com/codemain/swfobject_2_2.js" type="text/JavaScript"><\/scr' + 'ipt>');
document.write('<scr' + 'ipt src="http://code.javahd.com/codemain/videosp_20.js" type="text/JavaScript"><\/scr' + 'ipt>');