function MovTrailer(u) {
  window.open('movies/movplayer.php?mov=' + u,'2etrailer','width=640,height=500,resizable=yes,status=no,toolbar=no,scrollbars=yes');
}

function activateSWF(url, h, w, col, id) {
  document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ');
  document.write('codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ');
  document.write('width="' + w + '" ');
  document.write('height="' + h + '" ');
  document.write('id="' + id + '" align="middle">\n');
  document.write('<param name="allowScriptAccess" value="sameDomain" />');
  document.write('<param name="movie" value="' + url + '" />');
  document.write('<param name="quality" value="high" />');
  document.write('<param name="bgcolor" value="' + col + '" />');

  document.write('<embed src="' + url + '" quality="high" bgcolor="' + col + '" width="' + w + '" height="' + h + '" name="' + id + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
  document.write("</object>");
}

function activateFLVplayer(url, h, w, col, id) {

  var xtra = "brWidth=" + DOMWindowGetInnerWidth() + "&brHeight=" + DOMWindowGetInnerHeight();
  if (url.indexOf("?") > 1)
    xtra = "&" + xtra;
  else
    xtra = "?" + xtra;

  document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ');
  document.write('codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" ');
  document.write('width="' + w + '" ');
  document.write('height="' + h + '" ');
  document.write('id="' + id + '" align="middle">\n');
  document.write('<param name="allowScriptAccess" value="sameDomain" />');
  document.write('<param name="movie" value="' + url + xtra + '" />');
  document.write('<param name="quality" value="high" />');
  document.write('<param name="wmode" value="transparent" />'); 
  document.write('<param name="scale" value="noscale" />'); 
  document.write('<param name="salign" value="lt" />'); 
  document.write('<param name="bgcolor" value="' + col + '" />');


  document.write('<embed src="' + url + xtra + '" quality="high" wmode="transparent" bgcolor="' + col + '" width="' + w + '" height="' + h + '" name="' + id + '" align="middle" scale="noscale" salign="lt" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
  document.write("</object>");

}


function activateMOV(url, h, w) {
  document.write('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ');
  document.write('codebase="http://www.apple.com/qtactivex/qtplugin.cab" ');
  document.write('width="' + w + '" ');
  document.write('height="' + h + '">');
  document.write('<param name="src" value="' + url + '" />');
  document.write('<param name="autoplay" value="true" />');
  document.write('<param name="loop" value="false" />');
  document.write('<param name="controller" value="true" />');

  document.write('<embed src="' + url + '" width="' + w + '" height="' + h + '" controller="true" autoplay="true" loop="false" pluginspage="http://www.apple.com/quicktime/" />');
  document.write("</object>");
}

function activateVIDEO(url, h, w) {
 document.write('<OBJECT ID="VIDEO" WIDTH="' + w + '" HEIGHT="' + h + '" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" ');
 document.write('style="margin-top:-10px;margin-bottom:-10px;" TYPE="application/x-oleobject">');
 document.write('<PARAM NAME="URL" VALUE="' + url + '">');
 document.write('<PARAM NAME="SendPlayStateChangeEvents" VALUE="True">');
 document.write('<PARAM NAME="AutoStart" VALUE="True">');
 document.write('<PARAM name="PlayCount" value="1">');
 document.write('</OBJECT>');

}


function activateWMV(url, h, w) {
 document.write('<OBJECT ID="MediaPlayer" WIDTH="' + w + '" HEIGHT="' + h + '" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"');
 document.write('STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">');
 document.write('<PARAM NAME="FileName" VALUE="' + url + '">');
 document.write('<PARAM name="ShowControls" VALUE="true">');
 document.write('<param name="ShowStatusBar" value="false">');
 document.write('<PARAM name="ShowDisplay" VALUE="false">');
 document.write('<PARAM name="autostart" VALUE="true">');
 document.write('<EMBED TYPE="application/x-mplayer2" SRC="' + url + '" NAME="MediaPlayer"');
 document.write('WIDTH="' + w + '" HEIGHT="' + h + '" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="1"> </EMBED>');
 document.write('</OBJECT>');
}


/*=================================================
 *
 * Popup window
 *
 *=================================================*/ 
var oInterval = "";
var skn;

function popupInit() {

  var ns4=document.layers;
  var ns6=document.getElementById&&!document.all;
  var ie4=document.all;

  if (ns4) skn=document.dek;
  else if (ns6) skn=document.getElementById("dek");
  else if (ie4) skn=document.all.dek;

}

var Xoffset;
var Yoffset;
function popupInitMouse(xoff, yoff) {

  Xoffset = xoff;
  Yoffset = yoff;

  var ns4=document.layers;
  var ns6=document.getElementById&&!document.all;
  var ie4=document.all;

  if (ns4) skn=document.dek;
  else if (ns6) skn=document.getElementById("dek");
  else if (ie4) skn=document.all.dek;

  if(ns4)document.captureEvents(Event.MOUSEMOVE);
  document.onmousemove=popGet_mouse;
}

function popGet_mouse(e){
  var x=(document.layers||document.getElementById&&!document.all)? e.pageX : event.x+DOMWindowGetXOffset();
  var y=(document.layers||document.getElementById&&!document.all)? e.pageY : event.y+DOMWindowGetYOffset();

  var i = 0, j = 0, fixy, fixx;
  var fixy = DOMWindowGetInnerHeight() - (y - DOMWindowGetYOffset());
  var fixx = DOMWindowGetInnerWidth() - (x - DOMWindowGetXOffset());


  if (DOMElementGetHeight(skn)+Yoffset > fixy) {
    j = DOMElementGetHeight(skn) + (2 * Yoffset);
  }

  if (DOMElementGetWidth(skn)+Xoffset > fixx) {
    i = DOMElementGetWidth(skn) + Xoffset - fixx;
  }

  DOMElementSetTop(skn, y+Yoffset - j);
  DOMElementSetLeft(skn, x+Xoffset - i);

//  popup1 = "<p>y=" + y + "<br>DOMWindowGetInnerHeight()=" + DOMWindowGetInnerHeight() + "<br>DOMWindowGetYOffset()=" + DOMWindowGetYOffset();
}

function popupInit2(x, y, w, h) {
  oInterval = window.setInterval("popupHide()",30000);

  var ns4=document.layers;
  var ns6=document.getElementById&&!document.all;
  var ie4=document.all;

  if (ns4) skn=document.dek;
  else if (ns6) skn=document.getElementById("dek");
  else if (ie4) skn=document.all.dek;

  DOMElementSetLeft(skn, x);
  DOMElementSetTop(skn, y);
  DOMElementSetWidth(skn, w);
  DOMElementSetHeight(skn, h);

  popupShow();
}

function viewTrailer() {
  popupHide();
  window.navigate("trailer.php")
}

function popupShow(popupHTML) {
  DOMElementSetInnerHTML(skn, "<img src='" + popupHTML + "'>" );
  DOMElementShow(skn);
}

function popupShowXY(popupHTML, x ,y) {
  DOMElementSetInnerHTML(skn, popupHTML);

  DOMElementSetTop(skn, y);
  DOMElementSetLeft(skn, x);

  DOMElementShow(skn);
}



function popupHide(){
//  window.clearInterval(oInterval) ;
  DOMElementHide(skn);
}





/*=================================================
 *
 * Start of original dom.js 
 *
 *=================================================*/ 
var DOMObjects = new Object();

function DOMInitialize(type) {

  if (document.getElementById) DOMObjects = document.getElementsByTagName(type); // ns6?
  else if (document.all) DOMObjects = document.all.tags(type);  // ie
  else if (document.layers) DOMObjects = document.layers;  // ns4
  else DOMObjects = null;
}

function DOMElementHide(o) {
  if (document.getElementById || document.all) {
    o.style.visibility = 'hidden';
    o.style.display = 'none';
  }
  else if (document.layers)    o.visibility = 'hidden';
}

function DOMElementShow(o) {
  if (document.getElementById || document.all) {
    if (o !=null) {
      o.style.visibility = 'visible';
      o.style.display = 'block';
    }
  }
  else if (document.layers)    o.visibility = 'visible';
}

function DOMElementSetTop(o,val) {
  if (document.getElementById) {
      if (o !=null)
        o.style.top = val;
  }
  else if (document.all)       o.style.top = val;
  else if (document.layers)    o.top = val;
}

function DOMElementGetTop(o) {
  if (document.getElementById) return o.style.top;
  else if (document.all)       return o.style.top;
  else if (document.layers)    return o.top;
}

function DOMElementSetLeft(o,val) {
    if (document.getElementById)  {
      if (o !=null)
        o.style.left = val;
    }
    else if (document.all) o.style.left = val;
    else if (document.layers)    o.left = val;
}

function DOMElementGetLeft(o) {
  if (document.getElementById) return o.style.left;
  else if (document.all)       return o.style.posLeft;
  else if (document.layers)    return o.left;
}

function DOMElementGetHeight(o) {
  if (document.all)                 return o.clientHeight;
  else if (document.getElementById) return parseInt(o.offsetHeight);
  else if (document.layers)         return o.document.height;
}

function DOMElementSetHeight(o, val) {
    if (document.getElementById)  {
      if (o !=null)
        o.style.height = val;
    }
    else if (document.all) o.style.height = val;
    else if (document.layers)    o.height = val;
}

function DOMElementGetWidth(o) {
  if (document.all)                 return o.clientWidth;
  else if (document.getElementById) return parseInt(o.offsetWidth);
  else if (document.layers)         return o.document.width;
}

function DOMElementSetWidth(o, val) {
    if (document.getElementById)  {
      if (o !=null)
        o.style.width = val;
    }
    else if (document.all) o.style.width = val;
    else if (document.layers)    o.width = val;
}

function DOMWindowGetXOffset() {
  if (document.documentElement && document.documentElement.scrollLeft) return document.documentElement.scrollLeft;
  if (document.all)            return document.body.scrollLeft;
  else if (document.getElementById)  return window.pageXOffset;
  else if (document.layers)          return window.pageXOffset;
}

function DOMWindowGetYOffset() {

  if (document.documentElement && document.documentElement.scrollTop) return document.documentElement.scrollTop;
  else if (document.all)             return document.body.scrollTop;
  else if (document.getElementById)  return window.pageYOffset;
  else if (document.layers)          return window.pageYOffset;
}

function DOMWindowGetInnerWidth() {
//  if (document.all)           return document.body.clientWidth;
//  else if (document.getElementById)   return window.innerWidth;
//  else if (document.layers)           return window.innerWidth;

  if( typeof( window.innerWidth ) == 'number' ) {                                        //Non-IE
    return window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth) ) {     //IE 6+ in 'standards compliant mode'
    return document.documentElement.clientWidth; 
  } else if( document.body && ( document.body.clientWidth) ) {                           //IE 4 compatible
    return document.body.clientWidth;
  }
}

function DOMWindowGetInnerHeight() {
//  if (document.all)          return document.body.clientHeight;
//  else if (document.getElementById)  return window.innerHeight;
//  else if (document.layers)          return window.innerHeight;

  if( typeof( window.innerWidth ) == 'number' ) {                                          //Non-IE
    return window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientHeight ) ) {     //IE 6+ in 'standards compliant mode'
    return document.documentElement.clientHeight;   
  } else if( document.body && ( document.body.clientHeight ) ) {                           //IE 4 compatible
    return document.body.clientHeight;
  }
}

function DOMEventGetOffsetX(e) {
  if (document.all)                  return e.offsetX;
  else if (document.getElementById)  return e.clientX + window.pageXOffset;
  else if (document.layers)          return e.pageX;
}

function DOMEventGetOffsetY(e) {
  if (document.all)                  return e.offsetY;
  else if (document.getElementById)  return e.clientY + window.pageYOffset;
  else if (document.layers)          return e.pageY;
}

function DOMEventGetClientX(e) {
  if (document.all)                  return e.clientX;
  else if (document.getElementById)  return e.clientX;
  else if (document.layers)          return e.pageX;
}

function DOMEventGetClientY(e) {
  if (document.all)                  return e.clientY;
  else if (document.getElementById)  return e.clientY;
  else if (document.layers)          return e.pageY;
} 

function DOMEventGetX(e) {
  if (document.all)                  return event.x;
  else if (document.getElementById)  return e.pageX;
  else if (document.layers)          return e.pageX;
}

function DOMEventGetY(e) {
  if (document.all)                  return event.y;
  else if (document.getElementById)  return e.pageY;
  else if (document.layers)          return e.pageY;
}
function DOMElementGetOffsetTop(o) {
  if (document.getElementById)       return o.offsetTop;
  else if (document.all)             return o.offsetTop;
  else if (document.layers)          return o.top;
}

function DOMElementGetOffsetLeft(o) {
  if (document.getElementById)       return o.offsetLeft;
  else if (document.all)             return o.offsetLeft;
  else if (document.layers)          return o.left;
}

function DOMEventGetSrc(e) {
  if (document.all)                  return e.srcElement.href;
  else if (document.getElementById) {
    if (document.images[e.originalTarget.name])
      return document.images[e.originalTarget.name].src;
    else
      return null;
  }
  else if (document.layers)          return e.target.src;
}

function DOMEventGetName(e) {
  if (document.all)                  return e.srcElement.name;
  else if (document.getElementById)  return e.originalTarget.name;
  else if (document.layers)          return e.target.name;
}

// if (document.createRange && document.createRange().createContextualFragment)
//  HTMLElement.prototype.innerHTML = innerHTML;

function innerHTML(html) {
  while (this.hasChildNodes()) this.removeChild(this.lastChild);
  var range = document.createRange();
  range.setStartAfter(this);
  this.appendChild(range.createContextualFragment(html));
}

function DOMElementSetInnerHTML(o,html) {
  if (document.getElementById)       o.innerHTML = html;
  else if (document.all)             o.innerHTML = html;
  else if (document.layers) {
    o.document.open();
    o.document.write(html);
    o.document.close();
  }
}



