var cont = 1; var IE = document.all?true:false; function youtube(q){ var resultado_xml = document.getElementById('play-list'); var preloader_xml = document.getElementById('tv'); var alltv = document.getElementById('all-tv'); var erro, testErro; alltv.style.display = 'block'; alltv.style.width='218px'; /*var objBody = document.getElementsByTagName("body").item(0); var objOverlay = document.createElement("div"); objOverlay.setAttribute('id','overlay'); objBody.appendChild(objOverlay); document.getElementById('overlay').style.display = 'block';*/ preloader_xml.innerHTML= '
Carregando vídeo...
';
}
if(tipo=='menor')
{
obj.width= '214';
obj.height= '179';
nav.width= '218px';
tit_v.width= '212px';
document.getElementById('all-tv').className='tv_all_tv_menor';
all_tv.width='218px';
//document.getElementById('publicidade').className='tv_publicidade_menor';
document.getElementById('size_maior').innerHTML='
';
}
}
function tvDesabilitada(){
alert('Nenhum vídeo encontrado até o momento, tendo outro dia.');
}
function opacity(id, opacStart, opacEnd) {
var speed = Math.round(1500 / 150);
var timer = 0;
if(opacStart > opacEnd) {
for(i = opacStart; i >= opacEnd; i--) {
setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
timer++;
}
}else if(opacStart < opacEnd) {
for(i = opacStart; i <= opacEnd; i++)
{
setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
timer++;
}
}
}
function changeOpac(opacity, id) {
var object = document.getElementById(id).style;
object.opacity = (opacity / 100);
object.MozOpacity = (opacity / 100);
object.KhtmlOpacity = (opacity / 100);
object.filter = "alpha(opacity=" + opacity + ")";
}
var zz=0;
var dragOK=false;
var man=null;
function cleanup(e) {
document.onmousemove=null;
document.onmouseup=null;
dragOK=false;
DragHandler._oElem = null;
}
var DragHandler = {
// private property.
_oElem : null,
// public method. Attach drag handler to an element.
attach : function(oElem,manipulador) {
man=manipulador;
if(man=="man" || man=="box_cifra")
{
oElem.onmousedown = DragHandler._dragBegin;
dragOK=true;
// callbacks
oElem.dragBegin = new Function();
oElem.drag = new Function();
oElem.dragEnd = new Function();
return oElem;
}
},
_cleanup : function(e) {
document.onmousemove=null;
document.onmouseup=null;
dragOK=false;
DragHandler._oElem = null;
},
// private method. Begin drag process.
_dragBegin : function(e) {
var oElem = DragHandler._oElem = this;
if (isNaN(parseInt(oElem.style.left))) { oElem.style.left = '0px'; }
if (isNaN(parseInt(oElem.style.top))) { oElem.style.top = '0px'; }
var x = parseInt(oElem.style.left);
var y = parseInt(oElem.style.top);
e = e ? e : window.event;
oElem.mouseX = e.clientX;
oElem.mouseY = e.clientY;
//on top
zz++;
if(oElem.id!='inline') oElem.style.zIndex=zz;
//
oElem.dragBegin(oElem, x, y);
document.onmousemove = DragHandler._drag;
document.onmouseup = DragHandler._dragEnd;
document.onmouseup = DragHandler._cleanup;
return false;
},
// private method. Drag (move) element.
_drag : function(e) {
if(dragOK==true){
var oElem = DragHandler._oElem;
var x = parseInt(oElem.style.left);
var y = parseInt(oElem.style.top);
e = e ? e : window.event;
oElem.style.left = x + (e.clientX - oElem.mouseX) + 'px';
oElem.style.top = y + (e.clientY - oElem.mouseY) + 'px';
oElem.mouseX = e.clientX;
oElem.mouseY = e.clientY;
oElem.drag(oElem, x, y);
return false;
}
},
// private method. Stop drag process.
_dragEnd : function() {
var oElem = DragHandler._oElem;
var x = parseInt(oElem.style.left);
var y = parseInt(oElem.style.top);
oElem.dragEnd(oElem, x, y);
try{
document.onmousemove = getMouseXY;
}
catch(e){
document.onmousemove = null;
}
document.onmouseup = DragHandler._cleanup;
DragHandler._oElem = null;
}
}
function drag(elemento,manipulador){
DragHandler.attach(document.getElementById(elemento),manipulador);
}
var posLeft = 0
var videoY = 0
var videoMaxY = 200000
function acom(){
if (xScrollTop() > videoY && xScrollTop() < videoMaxY) xMoveTo("all-tv",posLeft, xScrollTop()+ -60)
}
window.onscroll=acom