// JavaScript Document

function showPDF(zeURL,name,features) {
	var ppdf=window.open(zeURL,'zePDF','width=850,height=550,scrollbars=1,resizable=1'); 
	
	try { ppdf.focus(); } catch(e) {}
	
}

function showPres(zeURL,name,features) {
	var ppdf=window.open(zeURL,'zePDF','width=1000,height=620,scrollbars=0,resizable=1'); 
	
	try { ppdf.focus(); } catch(e) {}
	
}



function showDetails (divID) {
	document.getElementById(divID).style.display="block";
}

function hideDetails (divID) {
	document.getElementById(divID).style.display="none";
}




function trigger_effect(src_element,div_id, effect){
		Effect.toggle(div_id, effect, {duration: .15, afterFinish:function(){
		image = src_element.getElementsByTagName('img')[0];
		image.src = image.src.match('/_img/icon.more.gif') ? '/_img/icon.less.gif' : '/_img/icon.more.gif';
		}});
		return true;
	}



//popups for Virtual Paper
function openFull(p,n) {

        var r   = null;

        r = window.open(p,n,'width='+screen.width+',height='+screen.height+',top='+0+',left='+0+','+'scrollbars=no,toolbar=no,location=no,status=no,menubar=no,resizable=yes,dependent=no');

        if(r!=null && window.focus) r.window.focus();

};






// code from Dreamweaver
function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}














// here are the functions for the tv spots
function showSlide (divID) {
	document.getElementById(divID).className="slideShow";
}

function hideSlide (divID) {
	document.getElementById(divID).className="slideHide";
}





// Use a variable to reference the embedded SWF.
var flashVideoPlayer = null;

var ns4 = (document.layers)? true:false;         //NS 4
var ie4 = (document.all)? true:false;         //IE 4
var dom = (document.getElementById)? true:false;   //NS 6 ou IE 5
var ie = navigator.appName.indexOf("Microsoft") != -1;
var timeoutTempVar = null;

function createVideoLayer(url, ztime) {


}

function callFlashPlayVideo(url, ztime) {

	var so = new SWFObject("/_flash/VideoShell.swf", "theFlvVideo", "335", "328", "8", "#ffffff");
	so.addParam("quality", "high");
	so.addParam("wmode", "transparent");
	so.addParam("allowScriptAccess", "sameDomain");
	so.write("zvideo");

	flashVideoPlayer = (ie) ? window['theFlvVideo'] : document['theFlvVideo'];

	document.getElementById("loading").style.visibility="visible";
	document.getElementById("loading").style.zIndex="99";
	window.clearTimeout(timeoutTempVar);
	timeoutTempVar = setTimeout('ReallyStardVid("'+url+'", "'+ztime+'")',500);
}

function ReallyStardVid(url, ztime) {
    window.clearTimeout(timeoutTempVar);
	if (flashVideoPlayer!=undefined) {
		flashVideoPlayer.playVideo(url, ztime);
	}else{
		timeoutTempVar = setTimeout('ReallyStardVid("'+url+'", "'+ztime+'")',500);
	}
}
function callFlashStopVideo() {
	if (flashVideoPlayer!=undefined) {
		flashVideoPlayer.stopVideo();
	}
}

function unLoadFlashVideo() {

  if (dom) {
      document.getElementById("zvideo").innerHTML = " ";
         return;
      }
      if (ie4) {
          document.all["zvideo"].innerHTML = " ";
         return;
      }
      if (ns4) {
          with (eval('document.'+zvideo+'.document')) {
             open();
             write(" ");
             close();
         }
         return;
      }
}

function hideWaitText() {
	document.getElementById("loading").style.visibility="hidden";
}

function videoStopped() {
	showSlide('slide_1');
	hideSlide('tvspot');
	document.getElementById('vid01Playing').style.display='none';
	document.getElementById('vid02Playing').style.display='none';
	document.getElementById('vid03Playing').style.display='none';
	document.getElementById('vid01Showme').style.display='block';
	document.getElementById('vid02Showme').style.display='block';
	document.getElementById('vid03Showme').style.display='block';
}

function videoCompleted() {
	showSlide('slide_1');
	hideSlide('tvspot');
	document.getElementById('vid01Playing').style.display='none';
	document.getElementById('vid02Playing').style.display='none';
	document.getElementById('vid03Playing').style.display='none';
	document.getElementById('vid01Showme').style.display='block';
	document.getElementById('vid02Showme').style.display='block';
	document.getElementById('vid03Showme').style.display='block';
}

