﻿var funcInterval;



// JScript File
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function showDriveColour(e,p)
{ 
document.getElementById(e).setAttribute('src','../images/content/'+p+'.png')
}


function swapImg(e,p)
{ 
document.getElementById(e).setAttribute('src','../images/content/'+p+'.png')
}

function swapImgRestore(e,p) 
{
document.getElementById(e).setAttribute('src','../images/content/'+p+'.png') 
} 



function preloadGoImages()
{
  MM_preloadImages('../images/content/seagate_product_go_black.png','../images/content/seagate_product_go_silver.png','../images/content/seagate_product_go_red.png','../images/content/seagate_product_go_blue.png');
}


function popup(url) 
{
	newwindow=window.open(url,'name','height=500,width=350,left=300,top=50,scrollbars=1');
	if (window.focus) {newwindow.focus()}
	return false;
}

function autotab(original,destination){
if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
destination.focus()
}

function jShowHideTags(tagParent, tagShow, tagDefaultClass, tagOriginalClass)
{
  $(tagParent).children().hide();
  $(tagShow).show();
  $('.' + tagDefaultClass).addClass(tagOriginalClass);
  $('.' + tagDefaultClass).removeClass(tagDefaultClass); 
}

function jTheaterScale(tagParent, tagShow, tagDefaultClass, tagOriginalClass)
{
  $(tagParent).children().hide();
  $(tagShow).show();
  $('.' + tagDefaultClass).addClass(tagOriginalClass);
  $('.' + tagDefaultClass).removeClass(tagDefaultClass);
  
  $('.innerContentTheaterLeft').addClass('.innerContentTheaterScaleLeft');
  $('.innerContentTheaterLeft').removeClass('.innerContentTheaterLeft');
  
  $('.innerContentTheaterRight').addClass('.innerContentTheaterScaleRight');
  $('.innerContentTheaterRight').removeClass('.innerContentTheaterRight');     
}

function showDownloadWindow(culture, genreID, titleArray, xmlUrl, closeBtnText, version)
{
  var swfPath = "../flash/dl_presenter.swf?culture=" + culture + "&genreID=" + genreID + "&titleArray=" + titleArray + "&xmlUrl=" + xmlUrl + "&closeBtnText=" + closeBtnText + "&wmode=opaque" + "&version=" + version; 
    
  Shadowbox.init({
      skipSetup: true
  });

  Shadowbox.open({type: 'swf', player: 'swf', content: swfPath, width: 775, height: 447, wmode: 'opaque'});
}

function showFutureShortsWindow(culture, videoUrlFS, closeBtnText, headerText, copyText)
{
  var swfPath = "../flash/dl_future_shorts.swf?culture=" + culture + "&videoUrlFS=" + videoUrlFS + "&closeBtnText=" + closeBtnText + "&headerText=" + headerText + "&copyText=" + copyText; 

  Shadowbox.init({
      skipSetup: true
  });
  
  Shadowbox.open({type: 'swf', player: 'swf', content: swfPath, width: 775, height: 447, bgcolor: '#000000'});
  
  clearInterval(funcInterval); 
}

function showFreeagentWindow(culture, videoUrlFA, videoUrlFS, closeBtnText, headerText, copyText)
{
  var swfPath = "../flash/dl_about_freeagent_go.swf?culture=" + culture + "&videoUrlFA=" + videoUrlFA + "&videoUrlFS=" + videoUrlFS + "&closeBtnText=" + closeBtnText + "&headerText=" + headerText + "&copyText=" + copyText; 

  Shadowbox.init({
      skipSetup: true
  });
  
  Shadowbox.open({type: 'swf', player: 'swf', content: swfPath, width: 775, height: 447, bgcolor: '#000000'});
}

function closeDownloadWindow()
{
  Shadowbox.close();
}

function closeLotteryWindow()
{
  Shadowbox.close();
}

function closeFreeAgentShowFutureShortsWindow(culture, videoUrlFS, closeBtnText, headerText, copyText)
{
  //Shadowbox.close();
  
  showFutureShortsWindow(culture, videoUrlFS, closeBtnText, headerText, copyText);
}


function showTheaterWindow(type, culture)
{
  //type:1 = pack 
  //type:2 = man
  
  Shadowbox.loadLanguage('tr', '../client_scripts/lang');

  Shadowbox.init({skipSetup: true});
  Shadowbox.open({type: 'swf', player: 'swf', title: title, content: url, width: 776, height: 449});
}

function showLotteryWindow(pageID)
{
    //1 Terms Conditions
    //2 Campaign Contacts
    //3 Tell a friend - 450W / 300H
    var pagePath;
    
    Shadowbox.init({
        skipSetup: true
    });

    switch(pageID)
    {
      case 1:
      pagePath = "../../promotion-zone/tr/the-lottery-terms.aspx?c=tr";
      Shadowbox.open({type: 'iframe', player: 'iframe', content: pagePath, width: 600, height: 400, bgcolor: '#000000'}); 
      break;
      case 2:
      pagePath = "../../promotion-zone/tr/the-lottery-campaign-contacts.aspx?c=tr"; 
      Shadowbox.open({type: 'iframe', player: 'iframe', content: pagePath, width: 520, height: 490, bgcolor: '#000000'});
      break; 
      case 3:
      pagePath = "../../promotion-zone/tr/the-lottery-tell-friend.aspx?c=tr";
      Shadowbox.open({type: 'iframe', player: 'iframe', content: pagePath, width: 520, height: 510, bgcolor: '#000000'});
      break;     
      //default:
      //pagePath = "../../promotion-zone/tr/the-lottery-terms.aspx?c=tr";  
    }  
   
}


function showDownloadTermsWindow()
{
  Shadowbox.init({
        skipSetup: true
    });
    
  Shadowbox.open({type: 'iframe', player: 'iframe', content: "../promotion-zone/tc_download.aspx", width: 775, height: 447, bgcolor: '#000000'});
}











