// JavaScript Document
function grayOut(vis) {
  var dark=document.getElementById('darkenScreenObject');
  if (!dark) {
    // The dark layer doesn't exist, it's never been created.  So we'll
    // create it here and apply some basic styles.
    // If you are getting errors in IE see: http://support.microsoft.com/default.aspx/kb/927917
    var tbody = document.getElementsByTagName("body")[0];
    var tnode = document.createElement('div');           // Create the layer.
        tnode.style.position='absolute';                 // Position absolutely
        tnode.style.top='0px';                           // In the top
        tnode.style.left='0px';                          // Left corner of the page
        tnode.style.overflow='hidden';                   // Try to avoid making scroll bars            
        tnode.style.display='none';                      // Start out Hidden
        tnode.id='darkenScreenObject';                   // Name it so we can find it later
    tbody.appendChild(tnode);                            // Add it to the web page
    dark=document.getElementById('darkenScreenObject');  // Get the object.
  }
  if (vis) {
    //set the shader to cover the entire page and make it visible.
    dark.style.opacity=.8;                      
    dark.style.MozOpacity=.8;                   
    dark.style.filter='alpha(opacity='+80+')'; 
    dark.style.zIndex=2001;        
    dark.style.backgroundColor='#FFFFFF';  
    dark.style.width= '1500px';
    dark.style.height= '1500px';
    dark.style.display='block';                          
  } else {
     dark.style.display='none';
  }
}
function showVideo(videoURL) {
	document.getElementById('ad1').className = 'hide';
	document.getElementById('ad2').className = 'hide';
	document.getElementById('frameA1Box2').className = 'hide';
	document.getElementById('msg_from_pub').className = 'hide';
	grayOut(true);
	document.getElementById('video').className = 'show';
	document.getElementById('video_close').className = 'show';
	document.getElementById('videoFrame').src = videoURL;
	//return false;
}
function hideVideo() {
	//alert(document.title);
	document.getElementById('ad1').className = 'show';
	document.getElementById('ad2').className = 'show';
	document.getElementById('frameA1Box2').className = 'show';
	document.getElementById('msg_from_pub').className = 'show';
	grayOut(false);
	document.getElementById('video').className = 'hide';
	document.getElementById('video_close').className = 'hide';
	document.getElementById('videoFrame').src = '/pcc/video/empty.htm';
	return false;
}
// for the podcast player to open a audio message

function windowOpen(url) {
	window.open(url,'playerwindow','status=0,toolbar=0,location=0,menubar=0,directories=0;resizable=0,scrollbars=0,height=200,width=300');
}



