function TextScroll(scrollname, div_name, up_name, down_name)
{
    this.div_name = div_name;
    this.name = scrollname;
    this.scrollCursor = 0;
    this.speed = 5;
    this.timeoutID = 0;
    this.div_obj = null;
    this.up_name = up_name;
    this.dn_name = down_name;

	if (document.getElementById) {
	    div_obj = document.getElementById(this.div_name);
	    
	    if (div_obj) {
	        this.div_obj = div_obj;
	        /* alert(this.div_obj.offsetHeight);*/
	        if (this.div_obj.offsetHeight > 180) {
	         var nObj =	document.getElementById("scrollLong");
	         nObj.style.display = 'block';
	        }
	        
	        this.div_obj.style.height = "128px";
	        this.div_obj.style.overflow = 'hidden'; 
	    }
	    
	    div_up_obj = document.getElementById(this.up_name);
	    div_dn_obj = document.getElementById(this.dn_name);
	    
	    if (div_up_obj && div_dn_obj) {
	        //div_up_obj.setAttribute("onmouseover", scrollname + ".scrollUp();")
	        //div_up_obj.setAttribute("onmouseout", scrollname + ".stopScroll();")
	
			//div_dn_obj.setAttribute("onmouseover", scrollname + ".scrollDown();")
	        //div_dn_obj.setAttribute("onmouseout", scrollname + ".stopScroll();")
	        div_up_obj.onmouseover = function() { eval(scrollname + ".scrollUp();") };
			div_up_obj.onmouseout = function() { eval(scrollname + ".stopScroll();") };
			div_dn_obj.onmouseover = function() { eval(scrollname + ".scrollDown();") };
			div_dn_obj.onmouseout = function() { eval(scrollname + ".stopScroll();") };
	    }
	}

	this.stopScroll = function() {
	        clearTimeout(this.timeoutID);
	    }
	
	this.scrollUp = function() {
	        if (this.div_obj) {
	            this.scrollCursor = (this.scrollCursor - this.speed) < 0 ? 0 : this.scrollCursor - this.speed;
	            this.div_obj.scrollTop = this.scrollCursor;
	            this.timeoutID = setTimeout(this.name + ".scrollUp()", 60);
	        }
	    }
	
	this.scrollDown = function() {
		if (this.div_obj) {
			this.scrollCursor += this.speed;
			this.div_obj.scrollTop = this.scrollCursor;
		   
		    if (this.div_obj.scrollTop == this.scrollCursor) {
				this.timeoutID = setTimeout(this.name + ".scrollDown()", 60);
			} 
			else {
				this.scrollCursor = this.div_obj.scrollTop;
			}
		}
	}

	this.resetScroll = function() {
        if (this.div_obj) {
            this.div_obj.scrollTop = 0;
            this.scrollCursor = 0;
        }
	}
}

function winPopAD(emailUrl) {
    var winP = window.open ("attorneys_disclaimer.aspx?emailUrl=" + emailUrl,"mywindow","top=400, left=600, width=340px, height=240px, scrollbars=1");
    winP.focus();
}

function fullScreen() 
{
   var player = eval("document.getElementById('myVideo')"); 
   var txtBB = document.getElementById("txtFF");
   var strV = new String();
   //if (player.DisplaySize!=3)  
  //{
   // for (proj in player)
      // strV += proj + "\n";
        
   // txtBB.value = strV;
    
     player.fullScreen = 'true';
     player.displaySize = 3;
     //alert(player.DisplaySize);
  // }
}

function getVideo(videoPath) {
    document.write('<OBJECT ID="myVideo" style="z-index:-1000;" width="335" height="320" type="application/x-mplayer2">\n');
    document.write('<PARAM NAME="FileName" VALUE="' + videoPath + '">\n');
    document.write('<PARAM NAME="ShowControls" VALUE="True">\n');
    document.write('<PARAM NAME="ShowStatusBar" VALUE="True">\n');
    document.write('<PARAM NAME="TransparentAtStart" Value="True">\n');
    document.write('<PARAM NAME="AutoStart" Value="True">\n');
    document.write('<PARAM NAME="SendPlayStateChangeEvents" VALUE=True>\n');
    document.write('<PARAM NAME="AnimationatStart" Value="True">\n');
    document.write('<PARAM NAME="autoSize" Value="false">\n');
    document.write('<PARAM NAME="Wmode" Value="transparent">\n');
    document.write('<PARAM NAME="displaySize" Value="True">\n');
    document.write('<PARAM NAME="enableContextMenu" Value="False">\n');
    document.write('<PARAM NAME="uiMode" Value="invisible">\n');
    document.write('</OBJECT>');
}

function winRefresh() {
    window.location.reload();
}

function playVideo(vidType, vidID) {
    if (vidType == "personal")  {
        window.location.href = "personal_vp.aspx?videoID=" + vidID;
    }
    else {
        window.location.href = "business_vp.aspx?videoID=" + vidID;
    }

   // var ovidID = eval("document.getElementById('videoID')");
    //var objFrm = eval("document.getElementById('form1')");
    
    //ovidID.value = vidID;
    
   // aspnetForm.submit();
}

function verifyEmail(cEmail) {
    var orgEmail = document.getElementById("email_address").value;
    
    if (orgEmail != cEmail) {
        alert("E-mail address does not match.");
        return false;
    }
    else {
        return true;
    }
}

function getRemainCharacters() {
    document.getElementById("qCnt").value = document.getElementById("Question").value.length
}

function getRemainCharactersDescription() {
    document.getElementById("qCnt").value = document.getElementById("Description").value.length
}

function loadDetails(aID) {
    var w = 520;
    var h = 400;
	var positionX = (screen.width-w)/2;
	var positionY = (screen.height-h)/2;	

    var winObj = window.open("/details.aspx?ID=" + aID,"Details","top=" + positionY + ", left=" + positionX + ", width=" + w + ", height=" + h + ", scrollbars=1, resizable=0");
    winObj.focus();

   // var winPop = window.open("/details.aspx?ID=" + aID,"Details","width=500px, height=600px");
    //winPop.focus();
}

function openNewWin(mypage)
{
w = 800;
h = 480;
scroll = '1';
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,'newsletter',settings);
win.focus();
}
