﻿<!--//--><![CDATA[//><!--
 

 
 
 function ShowContent(divOn, numDivs, arrName){
  //get chosen message index (to show it):
  selindex = divOn - 1;
  for (p=0;p<numDivs;p++)
  {
    if (p == selindex) {
      arrName[p].style.display="block" //show current message
    } else {
      arrName[p].style.display="none" //hide previous message
    }
 
  }
 }
 
function getCookie1(Name) {   
  var search = Name + "=";
 if (document.cookie.length > 0) { //if there are any cookies      
    offset = document.cookie.indexOf(search);     
    if (offset != -1) { // if cookie exists          
      offset += search.length;    //set index of beginning of value         
      end = document.cookie.indexOf(";", offset);  // set index of end of cookie value         
      if (end == -1) end = document.cookie.length;
      return unescape(document.cookie.substring(offset,end))
    }
  }
}
 
 
 
function bucketTypeTabOnClick(bucketType)
{
 var searchField = document.getElementById('SearchText');
 
 switch (searchField.value)
 {
  case "":
  case "Enter Keywords":
   window.alert("Please enter a search term.");
   searchField.focus();
   return false;
 }
 
 var form = document.getElementById('SearchForm');
 
 window.location.href = '/search/' + bucketType + '?q=' + escape(searchField.value);
}
 
function searchFieldSetFocus()
{
 var searchField = document.getElementById('SearchText');
 if (searchField != null)
 {
  searchField.focus();
 }
}
 
function ss(w, id)
{
 window.status = w;
 return true;
}
 
function cs()
{
 window.status = "";
}
 
function jump(url,linktype)
{
 if (document.images && url)
 {
  new Image().src = '/contents/images/_jump.gif?url=' + escape(url).replace(/\+/g, '%2B') + '&type=' + linktype;
 }
 
 return true;
}
 
function toggleLayer(sourceElement, elementId)
{
 var element;
 
 if (document.getElementById)
 {
  // this is the way the standards work
  element = document.getElementById(elementId);
 }
 else if (document.all)
 {
  // this is the way old msie versions work
  element = document.all[elementId];
 }
 else if (document.layers)
 {
  // this is the way nn4 works
  element = document.layers[elementId];
 }
 
 element.style.display = element.style.display ? '' : 'inline';
 
 sourceElement.innerHTML = element.style.display ? '&lt; <strong style="text-decoration:none;">less</strong>' : '<strong style="text-decoration:none;">more</strong> &gt;';
}
 

function stripQts2(name) {
  var newName = "";
  var test = name.split(unescape("%27%27")); //split the field on ascii code for double ''
  for (i=0;i<test.length;i++) {
    if (i != (test.length - 1) ) newName = newName + test[i] + "'";  // put it back together with an "'"
    else newName = newName + test[i]; // make sure end of string has no "'"
  }
  userQuery = newName;
}
 
//Review_Feedback
function ValidEmailFeedback(email) {
 invalidChars = " /:,;"
 if (email == "") {
   return false
 }
  for (i=0; i<invalidChars.length; i++) {
    badChar = invalidChars.charAt(i)
   if (email.indexOf(badChar,0) != -1) {
      return false
   }
  }
  atPos = email.indexOf("@",1)
 if (atPos == -1) {
   return false
 }
  if (email.indexOf("@",atPos+1) != -1) {
    return false
 }
  periodPos = email.indexOf(".",atPos)
 if (periodPos == -1) {
   return false
 }
  if (periodPos+3 > email.length) {
    return false
 }
  return true
}
 
function ValidateInputFeedback(form){
    if (form.email.value == "" ) {
  alert("Please enter your Email Address.");
  form.email.focus();
  return false;
 }
 
 if (form.email.value != "" ) {
  if (!ValidEmailFeedback(form.email.value)) {
   AlertMsg = "Please enter your full email address, including the @ sign and the domain.\r\n\r\nFor example:\r\n\r\nfsmith@xyz.com\r\nsally@aol.com\r\n";
   alert(AlertMsg);
   form.email.focus();
   form.email.select();
   return false;
  }
 }
return true;
}
 
function FeaturedStory(linkUrl, imageUrl, altAttribute, headline, nutgraph)
{
 this.LinkUrl = linkUrl;
 this.ImageUrl = imageUrl;
 this.AltAttribute = altAttribute;
 this.Headline = headline;
 this.Nutgraph = nutgraph;
 
 this.PreloadedImage = new Image();
 this.PreloadedImage.src = imageUrl;
}
function FeaturedStoryb(linkUrl, imageUrl, altAttribute, headline, nutgraph)
{
 this.LinkUrl = linkUrl;
 this.ImageUrl = imageUrl;
 this.AltAttribute = altAttribute;
 this.Headline = headline;
 this.Nutgraph = nutgraph;
 
 this.PreloadedImage = new Image();
 this.PreloadedImage.src = imageUrl;
}
function FeaturedStoryc(linkUrl, imageUrl, altAttribute, headline, nutgraph)
{
 this.LinkUrl = linkUrl;
 this.ImageUrl = imageUrl;
 this.AltAttribute = altAttribute;
 this.Headline = headline;
 this.Nutgraph = nutgraph;
 
 this.PreloadedImage = new Image();
 this.PreloadedImage.src = imageUrl;
}



 
function Switch(featuredStoryIndex)
{
 FeaturedClick = 1;
 RotateStop();
 FeaturedStoryCurrentIndex = featuredStoryIndex;
 UpdateFeaturedStoryDisplay(featuredStoryIndex);
}
function Switchb(featuredStoryIndex)
{
 FeaturedClickb = 1;
 RotateStopb();
 FeaturedStoryCurrentIndexb = featuredStoryIndex;
 UpdateFeaturedStoryDisplayb(featuredStoryIndex);
}
function Switchc(featuredStoryIndex)
{
 FeaturedClickc = 1;
 RotateStopc();
 FeaturedStoryCurrentIndexc = featuredStoryIndex;
 UpdateFeaturedStoryDisplayc(featuredStoryIndex);
}


 
function SwitchPrevious()
{
 FeaturedClick = 1;
 RotateStop();
 RotatePrevious();
}
function SwitchPreviousb()
{
 FeaturedClickb = 1;
 RotateStopb();
 RotatePreviousb();
}
function SwitchPreviousc()
{
 FeaturedClickc = 1;
 RotateStopc();
 RotatePreviousc();
}
 
 
 
function SwitchNext()
{
 FeaturedClick = 1;
 RotateStop();
 RotateNext();
}
function SwitchNextb()
{
 FeaturedClickb = 1;
 RotateStopb();
 RotateNextb();
}
function SwitchNextc()
{
 FeaturedClickc = 1;
 RotateStopc();
 RotateNextc();
} 



function RotatePlay()
{
 if (FeaturedClick == 0) {
  FeaturedStoryTimerId = window.setInterval('RotateNext()', FEATURED_STORY_ROTATE_INTERVAL);
 }
}
function RotatePlayb()
{
 if (FeaturedClickb == 0) {
  FeaturedStoryTimerId = window.setInterval('RotateNextb()', FEATURED_STORY_ROTATE_INTERVALb);
 }
}
function RotatePlayc()
{
 if (FeaturedClickc == 0) {
  FeaturedStoryTimerId = window.setInterval('RotateNextc()', FEATURED_STORY_ROTATE_INTERVALc);
 }
}
 
 
 
 
function RotateStop()
{
 if (FeaturedStoryTimerId != null)
 {
  window.clearInterval(FeaturedStoryTimerId);
 
  FeaturedStoryTimerId = null;
 }
}
function RotateStopb()
{
 if (FeaturedStoryTimerIdb != null)
 {
  window.clearInterval(FeaturedStoryTimerIdb);
 
  FeaturedStoryTimerIdb = null;
 }
}
function RotateStopc()
{
 if (FeaturedStoryTimerIdc != null)
 {
  window.clearInterval(FeaturedStoryTimerIdc);
 
  FeaturedStoryTimerIdc = null;
 }
}




function RotatePrevious()
{
 FeaturedStoryCurrentIndex--;
 
 if (FeaturedStoryCurrentIndex < 0)
 {
  FeaturedStoryCurrentIndex = FEATURED_STORY_COUNT - 1;
 }
 
 UpdateFeaturedStoryDisplay(FeaturedStoryCurrentIndex);
}
function RotatePreviousb()
{
 FeaturedStoryCurrentIndexb--;
 
 if (FeaturedStoryCurrentIndexb < 0)
 {
  FeaturedStoryCurrentIndexb = FEATURED_STORY_COUNTb - 1;
 }
 
 UpdateFeaturedStoryDisplayb(FeaturedStoryCurrentIndexb);
}
function RotatePreviousc()
{
 FeaturedStoryCurrentIndexc--;
 
 if (FeaturedStoryCurrentIndexc < 0)
 {
  FeaturedStoryCurrentIndexc = FEATURED_STORY_COUNTc - 1;
 }
 
 UpdateFeaturedStoryDisplayc(FeaturedStoryCurrentIndexc);
}




function RotateNext()
{
 FeaturedStoryCurrentIndex++;
 
 if (FeaturedStoryCurrentIndex == FEATURED_STORY_COUNT)
 {
  FeaturedStoryCurrentIndex = 0;
 }
 
 UpdateFeaturedStoryDisplay(FeaturedStoryCurrentIndex);
}
function RotateNextb()
{
 FeaturedStoryCurrentIndexb++;
 
 if (FeaturedStoryCurrentIndexb == FEATURED_STORY_COUNTb)
 {
  FeaturedStoryCurrentIndexb = 0;
 }
 
 UpdateFeaturedStoryDisplayb(FeaturedStoryCurrentIndexb);
}
function RotateNextc()
{
 FeaturedStoryCurrentIndexc++;
 
 if (FeaturedStoryCurrentIndexc == FEATURED_STORY_COUNTc)
 {
  FeaturedStoryCurrentIndexc = 0;
 }
 
 UpdateFeaturedStoryDisplayc(FeaturedStoryCurrentIndexc);
}




function UpdateFeaturedStoryDisplay(featuredStoryIndex)
{
 var headlineAnchor1 = document.getElementById('featuredstorylinkurl1');
 var headlineAnchor2 = document.getElementById('featuredstorylinkurl2');
 var slideshow = document.getElementById('featuredstoriesslideshownav');
 var featuredImage = document.getElementById('featuredstoryimageurl');
 var nutgraph = document.getElementById('featuredstorynutgraph');
 var slideshowAnchors = slideshow.getElementsByTagName('a');
 var highlightIndex = 0;
 var featuredStory = FeaturedStories[featuredStoryIndex];
 
 headlineAnchor1.href = featuredStory.LinkUrl;
 headlineAnchor2.href = featuredStory.LinkUrl;
 headlineAnchor2.innerHTML = featuredStory.Headline;
 featuredImage.src = featuredStory.ImageUrl;
 featuredImage.alt = featuredStory.AltAttribute;
 nutgraph.innerHTML = featuredStory.Nutgraph;
 
 for (var anchorIndex = 0; anchorIndex < slideshowAnchors.length; anchorIndex++)
 {
  switch (slideshowAnchors[anchorIndex].className)
  {
   case 'sequenceoff':
   case 'sequenceon':
    if (highlightIndex == featuredStoryIndex)
    {
     slideshowAnchors[anchorIndex].className = 'sequenceon';
    }
    else
    {
     slideshowAnchors[anchorIndex].className = 'sequenceoff';
    }
 
    highlightIndex++;
 
    break;
  }
 }
}

function UpdateFeaturedStoryDisplayb(featuredStoryIndex)
{
 var headlineAnchor1 = document.getElementById('featuredstorylinkurl1b');
 var headlineAnchor2 = document.getElementById('featuredstorylinkurl2b');
 var slideshow = document.getElementById('featuredstoriesslideshownavb');
 var featuredImage = document.getElementById('featuredstoryimageurlb');
 var nutgraph = document.getElementById('featuredstorynutgraphb');
 var slideshowAnchors = slideshow.getElementsByTagName('a');
 var highlightIndex = 0;
 var featuredStoryb = FeaturedStories[featuredStoryIndex];
 
 headlineAnchor1.href = featuredStoryb.LinkUrl;
 headlineAnchor2.href = featuredStoryb.LinkUrl;
 headlineAnchor2.innerHTML = featuredStoryb.Headline;
 featuredImage.src = featuredStoryb.ImageUrl;
 featuredImage.alt = featuredStoryb.AltAttribute;
 nutgraph.innerHTML = featuredStoryb.Nutgraph;
 
 for (var anchorIndex = 0; anchorIndex < slideshowAnchors.length; anchorIndex++)
 {
  switch (slideshowAnchors[anchorIndex].className)
  {
   case 'sequenceoff':
   case 'sequenceon':
    if (highlightIndex == featuredStoryIndex)
    {
     slideshowAnchors[anchorIndex].className = 'sequenceon';
    }
    else
    {
     slideshowAnchors[anchorIndex].className = 'sequenceoff';
    }
 
    highlightIndex++;
 
    break;
  }
 }
}
function UpdateFeaturedStoryDisplayc(featuredStoryIndex)
{
 var headlineAnchor1 = document.getElementById('featuredstorylinkurl1c');
 var headlineAnchor2 = document.getElementById('featuredstorylinkurl2c');
 var slideshow = document.getElementById('featuredstoriesslideshownavc');
 var featuredImage = document.getElementById('featuredstoryimageurlc');
 var nutgraph = document.getElementById('featuredstorynutgraphc');
 var slideshowAnchors = slideshow.getElementsByTagName('a');
 var highlightIndex = 0;
 var featuredStoryc = FeaturedStories[featuredStoryIndex];
 
 headlineAnchor1.href = featuredStoryc.LinkUrl;
 headlineAnchor2.href = featuredStoryc.LinkUrl;
 headlineAnchor2.innerHTML = featuredStoryc.Headline;
 featuredImage.src = featuredStoryc.ImageUrl;
 featuredImage.alt = featuredStoryc.AltAttribute;
 nutgraph.innerHTML = featuredStoryc.Nutgraph;
 
 for (var anchorIndex = 0; anchorIndex < slideshowAnchors.length; anchorIndex++)
 {
  switch (slideshowAnchors[anchorIndex].className)
  {
   case 'sequenceoff':
   case 'sequenceon':
    if (highlightIndex == featuredStoryIndex)
    {
     slideshowAnchors[anchorIndex].className = 'sequenceon';
    }
    else
    {
     slideshowAnchors[anchorIndex].className = 'sequenceoff';
    }
 
    highlightIndex++;
 
    break;
  }
 }
}




 
//Article, Review Upsell
 if (document.images)
 {
  LOGINON=new Image(69,21)
  LOGINON.src="http://variety.elogic.com/graphics/upsell/upsell_login_buttonRO.gif";
 
  LOGINOFF=new Image(69,21)
  LOGINOFF.src="http://variety.elogic.com/graphics/upsell/upsell_login_button.gif";
 }
 
 function on(pic)
 {
  if (document.images)
  {
   document.images[pic].src=eval(pic + "ON.src");
  }
 }
 
 function off(pic)
 {
  if (document.images)
  {
   document.images[pic].src=eval(pic + "OFF.src");
  }
 }
 
 function submitForm()
 {
  document.frmLogin.submit();
 }
 

 function popVert(URL) {
      day = new Date();
      id = day.getTime();
      window.open(URL, null, "top=150,left=300,height=550,width=550,status=yes,toolbar=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes,titlebar=yes");
 }
 
 
 
//Featured Stories Slideshow on homepage
var FEATURED_STORY_ROTATE_INTERVAL = 2.0 * 1000; // milliseconds
var FEATURED_STORY_ROTATE_INTERVALb = 2.0 * 1000; // milliseconds
var FEATURED_STORY_ROTATE_INTERVALc = 2.0 * 1000; // milliseconds
var FEATURED_STORY_COUNT = 4;
var FEATURED_STORY_COUNTb = 4;
var FEATURED_STORY_COUNTc = 4;
var FeaturedStoryCurrentIndex = 0;
var FeaturedStoryCurrentIndexb = 0;
var FeaturedStoryCurrentIndexc = 0;
var FeaturedStoryTimerId = null;
var FeaturedStoryTimerIdb = null;
var FeaturedStoryTimerIdc = null;
var FeaturedClick = 0;
var FeaturedClickb = 0;
var FeaturedClickc = 0;
var FeaturedStories = new Array(FEATURED_STORY_COUNT);
var FeaturedStoriesb = new Array(FEATURED_STORY_COUNTb);
var FeaturedStoriesc = new Array(FEATURED_STORY_COUNTc);
var storyCount = 0;
var storyCountb = 0;
var storyCountc = 0;
 
//Film Search?
function ValidateInputSearch(search){
if (search.filmQuery.value == "" ) {
  alert("Please enter the name of the film you are searching for.");
  search.filmQuery.focus();
  return false;
 }
return true;
}
 
function bo_submit() {
var sel;
  sel = document.bo.boxyear;
  var yr = sel.options[sel.options.selectedIndex].value;
  sel = document.bo.boxmonth;
  var mo = sel.options[sel.options.selectedIndex].value;
  sel = document.bo.boxday;
  var da = sel.options[sel.options.selectedIndex].value;
  var dateStr = mo+'/'+da+'/'+yr;
 
if (document.bo.country.value == 'v1'){
 document.bo.layout.value = 'b_o_weekend';
}
else
{
document.bo.sort.value = 'BOTHISWEEK';
 document.bo.layout.value = 'b_o_foreign';
}
 
 
 
document.bo.date.value = dateStr;
document.bo.submit();
}
 
// On subscribe.asp, hovering over the topnav will make the select lists disappear.
function hideShowRegistrationSelect(tag)
{
 var element = document.getElementsByTagName(tag);
 var i;
 
//  if(element)
//  {
//   if (element[0].style.display == 'none' ) 
//   {
//    element[0].style.display = '';
//   } else 
//   {
//    element[0].style.display = 'none'; 
//   }
//  }
}
 
function trim(value) {
  var agt=navigator.userAgent.toLowerCase();
  if(agt.indexOf("safari")!=-1)
    return safariTrim(value)
  else
    return standardTrim(value);
}
 
function safariTrim(str)
// simpler trim needed because Safari is buggy
{
   return RTrim(LTrim(str));
}
 
function LTrim(str)
// part of Safari trim
{
   var whitespace = new String(" \t\n\r");
 
   var s = new String(str);
 
   if (whitespace.indexOf(s.charAt(0)) != -1) {
      // We have a string with leading blank(s)...
 
      var j=0, i = s.length;
 
      // Iterate from the far left of string until we
      // don't have any more whitespace...
      while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
         j++;
 
      // Get the substring from the first non-whitespace
      // character to the end of the string...
      s = s.substring(j, i);
   }
   return s;
}
 
function RTrim(str)
// part of Safari trim
{
   // We don't want to trip JUST spaces, but also tabs,
   // line feeds, etc.  Add anything else you want to
   // "trim" here in Whitespace
   var whitespace = new String(" \t\n\r");
 
   var s = new String(str);
 
   if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
      // We have a string with trailing blank(s)...
 
      var i = s.length - 1;       // Get length of string
 
      // Iterate from the far right of string until we
      // don't have any more whitespace...
      while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
         i--;
 

      // Get the substring from the front of the string to
      // where the last non-whitespace character is...
      s = s.substring(0, i+1);
   }
 
   return s;
}
 
function standardTrim(value) {
// original trim function, does not work on Safari
   var temp = value;
   var obj = /^(\s*)([\W\w]*)(\b\s*$)/;
   if (obj.test(temp)) { temp = temp.replace(obj, '$2'); }
   var obj = /  /g;
   while (temp.match(obj)) { temp = temp.replace(obj, " "); }
   return temp;
}
 
//--><!]]>
