﻿// To intialize the auto scroll Zco_VideoInit(); should be called in page laod.
 
var zco_VideoPanelID = "videoDiv";
var zco_VideoAutoScrollInterval = 15000;
var zco_VideoPlay = false; 
var zco_VideoPanelHeight = null;
var zco_VideoPanelDiv = null;
var zco_ArticleDivID = "newsDiv";

function createDiv(urlValue) 
{   
      
    if(document.getElementById('showVideoDiv') != null)
    {       
    
        var divContent = "";
        divContent = "<object width='340' height='204'>";
        divContent += "<param name='movie'/>";
        divContent += "<param value='transparent' name='wmode'/>";
        divContent +="<embed width='340' height='204' wmode='transparent' type='application/x-shockwave-flash' src='" + urlValue + "'/>";
        divContent += "</object>";
        document.getElementById('showVideoDiv').value = urlValue;
        document.getElementById('showVideoDiv').innerHTML =divContent; 
       
    } 
     
}
    
    function createAudioDiv(urlValue) 
    {
        if(document.getElementById('showVideoDiv') != null)
        {
            var divContent = "";
            divContent = "&nbsp;&nbsp;&nbsp;&nbsp;<embed src='" + urlValue + "' autostart=false loop=false type='audio/x-mp3'/>";
            //divContent = "<iframe width='345px' height='205px' name='audioFrame' id='audioFrame' frameborder='0' src='BMC-Doug_Meuller_2009-09-04-EDITFINAL.mp3' scrolling='auto'></iframe>";
            document.getElementById('showVideoDiv').innerHTML =divContent; 
        }
    } 
 
function Zco_VideoInit()
{
 zco_VideoPanelDiv = document.getElementById(zco_VideoPanelID);
 if(zco_VideoPanelHeight == null)zco_VideoPanelHeight = zco_VideoPanelDiv.offsetHeight;
 
}

/**Article scroll section starts**/
 
var i1 = 0;
var speed = 1;
var articleSpeed = 5;
var zco_ScrollTimer = null;
var zco_DownScrollTimer=null;
var zco_UpScrollTimer=null;
function scrollDown()
{
    clearTimeout(zco_UpScrollTimer);
    i1 = i1 + articleSpeed;
    var div1 = document.getElementById(zco_ArticleDivID);
    div1.scrollTop = i1;  
    if (i1 > div1.scrollHeight - 183) //201 = div height, scrollheight = 536
    {
        //i = 0;
        return;
    }
    zco_DownScrollTimer=setTimeout("scrollDown()",30);
}
 
function scrollUp()
{
 
    clearTimeout(zco_DownScrollTimer);
    i1 = i1 - articleSpeed;
    var div2 = document.getElementById(zco_ArticleDivID);
    div2.scrollTop = i1;  
    if (i1 == 0) //201 = div height, scrollheight = 536
    {
        //i = 0;
        return;
    }
    zco_UpScrollTimer=setTimeout("scrollUp()",30);
}
 
function ClearTimeout()
{
    clearTimeout(zco_UpScrollTimer);
    clearTimeout(zco_DownScrollTimer);
}
 
 
 
var zco_ArticleScrollTimer = null;
var ii = 0;
function scrollArticle()
{
    ii = ii + speed;
    var div = document.getElementById(zco_ArticleDivID);
    div.scrollTop = ii;
    if (ii > div.scrollHeight - 183) //200 = div height
    {     
        ii = 0;       
    }
    zco_ArticleScrollTimer=setTimeout("scrollArticle()",100);
}




var articleScrollTimer = null;
var initialValue = 0;
var articleScrollSpeed=5;
var articlescrolledArea = 0;
var articleincrementCount = 183;
function scrollArticles()
{
    initialValue = initialValue + articleScrollSpeed;
    var artDiv = document.getElementById(zco_ArticleDivID);
    artDiv.scrollTop = initialValue;    
            
    articlescrolledArea += articleScrollSpeed;
    if (articlescrolledArea >= articleincrementCount) //200 = div height
    {    
        articlescrolledArea = 0;                 
        //VideoStartScrollAfterDelay('onload');        
        return;
    }  
   
    if (initialValue > artDiv.scrollHeight - 183) //200 = div height
    {    
    
        initialValue = 0;
        //articlescrolledArea = 7;       
    }
    articleScrollTimer=setTimeout("scrollArticles()",30);
}



 
/**Article scroll section ends**/
 
/**Video scroll section starts**/

var videoTimer = null;
var initialvideoValue = 0;
var videoScrollSpeed=4;
var videoscrolledArea = 0;
var videoincrementCount = 216;
function scrollVideos()
{
    initialvideoValue = initialvideoValue + videoScrollSpeed;
    var vidDiv = document.getElementById(zco_VideoPanelID);
    vidDiv.scrollTop = initialvideoValue;    
            
    videoscrolledArea += videoScrollSpeed;
    if (videoscrolledArea >= videoincrementCount) //200 = div height
    {    
  
        videoscrolledArea = 0;                 
        //VideoStartScrollAfterDelay('onload');        
        return;
    }  
   
    if (initialvideoValue > vidDiv.scrollHeight - 216) //200 = div height
    {    
    
    initialvideoValue = 72 + videoScrollSpeed;
        //initialvideoValue = 0; 
        //videoscrolledArea=0;
    }
    videoTimer=setTimeout("scrollVideos()",30);
}











 
var zco_VideoScrollDownTimer = null;
var zco_VideoScrollUpTimer = null;
 
function Video_AutoScrolldownAfterDelay(from)
{
    VideoStartScrollAfterDelay(from);
}
 
function VideoStartScrollAfterDelay(fromurl)
{
    if(fromurl=="fancybox")
    {
        clearTimeout(zco_VideoScrollDownTimer); 
        zco_VideoScrollDownTimer=setTimeout("startVideoScroll()",1000);
    }
    else
    {
        clearTimeout(zco_VideoScrollDownTimer); 
        zco_VideoScrollDownTimer=setTimeout("startVideoScroll()",10000);
    }
}
 
function startVideoScroll()
{
    var videoPaneldiv = document.getElementById(zco_VideoPanelID);
    startValue = videoPaneldiv.scrollTop;   
    scrollVideo();
}
 
var videoScrollTimer = null;
var startValue = 0;
var videoSpeed=6;
var scrolledArea = 0;
var incrementCount = 144; //should be multiples of videoSpeed
function scrollVideo()
{
    startValue = startValue + videoSpeed;
    var videoDiv = document.getElementById(zco_VideoPanelID);
    videoDiv.scrollTop = startValue;    
            
    scrolledArea += videoSpeed;
    if (scrolledArea >= incrementCount) //200 = div height
    {    
        scrolledArea = 0;                 
        VideoStartScrollAfterDelay('onload');        
        return;
    }  
   
    if (startValue > videoDiv.scrollHeight - 216) //200 = div height
    {              
        startValue = 72 + videoSpeed;
        //scrolledArea = 0;       
    }
    zco_VideoScrollDownTimer=setTimeout("scrollVideo()",30);
}
function ClearVideoScrollTimer()
{
    clearTimeout(zco_VideoScrollDownTimer);    
}
/**Video scroll section ends**/

/**Tooltip**/
/***********************************************
* Cool DHTML tooltip script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var offsetxpoint=-60 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext){
tipobj=document.getElementById('dhtmltooltip');

tipobj.innerHTML=thetext;

enabletip=true;
return false;

}

function positiontip(e){
if (enabletip){
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20;
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20;

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000;

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px";
else if (curX<leftedge)
tipobj.style.left="5px";
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px";

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px";
else
tipobj.style.top=curY+offsetypoint+"px";
tipobj.style.visibility="visible";
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false;
tipobj.style.visibility="hidden";
tipobj.style.left="-1000px";
tipobj.style.backgroundColor='';
tipobj.style.width='';
}
}

document.onmousemove=positiontip;
 



var i11 = 0;
var vidspeed = 1;
var vidSpeed = 5;
var zco_newScrollTimer = null;
var zco_newDownScrollTimer=null;
var zco_newUpScrollTimer=null;
function scrollDownVideo()
{  

    document.getElementById("leftAngleBracket").href="#";
    document.getElementById("leftAngleBracket").onclick = (function(){return function(){scrollUpVideo();}})();
    document.getElementById("page1lnk").href="#";
    document.getElementById("page1lnk").onclick = (function(){return function(){scrollUpVideo();}})();
    
    //document.getElementById("leftAngleBracket").onclick="javascript:scrollUpVideo();";
    
    var div11 = document.getElementById(zco_VideoPanelID);    
    clearTimeout(zco_newUpScrollTimer);
    i11 = i11 + vidSpeed;    
    div11.scrollTop = i11;  
    if (i11 > div11.scrollHeight - 216) //201 = div height, scrollheight = 536
    {
        //i = 0;
        return;
    }
    zco_newDownScrollTimer=setTimeout("scrollDownVideo()",30);
}
 
function scrollUpVideo()
{    
    var div2 = document.getElementById(zco_VideoPanelID);    
    clearTimeout(zco_newDownScrollTimer);
    i11 = i11 - vidSpeed;    
    div2.scrollTop = i11;  
    if (i11 == 0) //201 = div height, scrollheight = 536
    {
        //i = 0;
        return;
    }
    zco_newUpScrollTimer=setTimeout("scrollUpVideo()",30);
}
 
function ClearTimeout()
{
    clearTimeout(zco_newUpScrollTimer);
    clearTimeout(zco_newDownScrollTimer);
}