//Pop Up Functions
var swfId = "mbc_mainSwf";

function getSwf( id ) 
{
  if ( navigator.appName.indexOf( "Microsoft" ) != -1 ) { return window[ id ]; }
  else { return document[ id ]; }
}

function launchPrivacy( ) 
{
  var name = Math.round( 9999*Math.random( ) ) + new Date( ).getTime( );
  var win = window.open( "http://www.millercoors.com/privacy-policy.aspx","FooterLinks" + name,"toolbar=0,menubar=0,width=640,height=500,status=0,resizable=1,scrollbars=1" );
  if( !win ) { getSwf(swfId).openWindowFromSwf( "http://www.millercoors.com/privacy-policy.aspx" ); }
  else { winNew.focus( ); }
}

function launchTerms( ) 
{
  var name = Math.round( 9999*Math.random( ) ) + new Date( ).getTime( );
  var win = window.open("http://www.millercoors.com/terms-conditions.aspx","FooterLinks" + name,"toolbar=0,menubar=0,width=640,height=500,status=0,resizable=1,scrollbars=1" );
  if( !win ) { getSwf(swfId).openWindowFromSwf( "http://www.millercoors.com/terms-conditions.aspx" ); }
  else { winNew.focus( ); }
}

function launchTalk( ) 
{
  var name = Math.round( 9999*Math.random( ) ) + new Date( ).getTime( );
  var win = window.open("https://www.millertalk.com/TalkToUs/default.aspx","FooterLinks" + name,"toolbar=0,menubar=0,width=420,height=400,status=0,resizable=1,scrollbars=1" );
  if( !win ) { getSwf(swfId).openWindowFromSwf( "https://www.millertalk.com/TalkToUs/default.aspx" ); }
  else { winNew.focus( ); }
}

function launchLive( ) 
{
  // removed mLink.action - as it is not currently working
  var name = Math.round( 9999*Math.random( ) ) + new Date( ).getTime( );
  var win = window.open( "http://www.millercoors.com/what-we-believe/true-responsibility.aspx","FooterLinks" + name,"toolbar=0,menubar=0,width=640,height=500,status=0,resizable=1,scrollbars=1" );
  if( !win ) { getSwf( swfId ).openWindowFromSwf( "http://www.millercoors.com/what-we-believe/true-responsibility.aspx" ); }
  else { winNew.focus( ); }
  
}
function launchGBGR( ) 
{
  window.location = "http://www.millercoors.com/what-we-believe/true-responsibility.aspx"; 
}

function launchPeelRules( ) 
{
  var name = Math.round( 9999*Math.random( ) ) + new Date( ).getTime( );
  var win = window.open("peel.html","FooterLinks" + name,"toolbar=0,menubar=0,width=640,height=500,status=0,resizable=1,scrollbars=1" );
  if( !win ) { getSwf(swfId).openWindowFromSwf( "peel.html" ); }
  else { winNew.focus( ); }
}

function launchRules( ) 
{
  var name = Math.round( 9999*Math.random( ) ) + new Date( ).getTime( );
  var win = window.open("rules.html","FooterLinks" + name,"toolbar=0,menubar=0,width=640,height=500,status=0,resizable=1,scrollbars=1" );
  if( !win ) { getSwf(swfId).openWindowFromSwf( "rules.html" ); }
  else { winNew.focus( ); }
}
function launchFootballRules( ) 
{
  var name = Math.round( 9999*Math.random( ) ) + new Date( ).getTime( );
  var win = window.open("football_rules.html","FooterLinks" + name,"toolbar=0,menubar=0,width=600,height=500,status=0,resizable=1,scrollbars=1" );
  if( !win ) { getSwf(swfId).openWindowFromSwf( "football_rules.html" ); }
  else { winNew.focus( ); }
}

function launchHolidayRules( ) 
{
  var name = Math.round( 9999*Math.random( ) ) + new Date( ).getTime( );
  var win = window.open("holiday_rules.html","FooterLinks" + name,"toolbar=0,menubar=0,width=600,height=500,status=0,resizable=1,scrollbars=1" );
  if( !win ) { getSwf(swfId).openWindowFromSwf( "holiday_rules.html" ); }
  else { winNew.focus( ); }
}

function launchTermsHolidayCA( ) 
{
  var name = Math.round( 9999*Math.random( ) ) + new Date( ).getTime( );
  var win = window.open("content/terms_holiday_ca.html","terms_holiday" + name,"toolbar=0,menubar=0,width=640,height=500,status=0,resizable=1,scrollbars=1" );
  if( !win ) { getSwf(swfId).openWindowFromSwf( "content/terms_holiday_ca.html" ); }
  else { winNew.focus( ); }
}

function launchSignUp( ) 
{
  var name = Math.round( 9999*Math.random( ) ) + new Date( ).getTime( );
  var win = window.open("sign_up.html","sign_up" + name,"toolbar=0,menubar=0,width=718,height=448,status=0,resizable=0,scrollbars=0" );
  if( !win ) { getSwf(swfId).openWindowFromSwf( "sign_up.html" ); }
  else { winNew.focus( ); }
}


function mgd_form( ) 
{
  var name = Math.round( 9999*Math.random( ) ) + new Date( ).getTime( );
  var win = window.open("form/index.jsp","form" + name,"toolbar=0,menubar=0,width=720,height=550,status=0,resizable=1,scrollbars=1" );
  if( !win ) { getSwf(swfId).openWindowFromSwf( "form/index.jsp" ); }
  else { winNew.focus( ); }
}

function launchPopUp( sURL, sParams )
{
  var name = Math.round( 9999*Math.random( ) ) + new Date( ).getTime( );
  var win = window.open( sURL,"PopUp" + name,'"' + sParams + '"' ) ;
  if( !win ) { getSwf( swfId ).openWindowFromSwf( sURL ); }
  else { winNew.focus( ); }
}

function launchAMOEForm( ) 
{
  var name = Math.round( 9999*Math.random( ) ) + new Date( ).getTime( );
  var win = window.open( "https://hoops.millerlite.com/ml-forms/amoe_form_mgd.html","amoe" + name,"toolbar=0,menubar=0,width=800,height=800,status=0,resizable=1,scrollbars=1" );
  if( !win ) { getSwf( swfId ).openWindowFromSwf( "http://rallyformda.stage.digitas.com/ml-forms/amoe_form_mgd.html" ); }
  else { winNew.focus( ); }
}

function launchFulfillmentForm( ) 
{
  var name = Math.round( 9999*Math.random( ) ) + new Date( ).getTime( );
  var win = window.open( "https://hoops.millerlite.com/ml-forms/fulfillment_form_mgd.html","fulfill" + name,"toolbar=0,menubar=0,width=800,height=800,status=0,resizable=1,scrollbars=1" );
  if( !win ) { getSwf( swfId ).openWindowFromSwf( "http://rallyformda.stage.digitas.com/ml-forms/fulfillment_form_mgd.html" ); }
  else { winNew.focus( ); }
}

function launchHoopsRules( ) 
{
  var name = Math.round( 9999*Math.random( ) ) + new Date( ).getTime( );
  var win = window.open( "http://millerlite.stage.digitas.com/hoops/rules_collect_and_win.html","hoopsrules" + name,"toolbar=0,menubar=0,width=800,height=800,status=0,resizable=1,scrollbars=1" );
  if( !win ) { getSwf( swfId ).openWindowFromSwf( "http://millerlite.stage.digitas.com/hoops/rules_collect_and_win.html" ); }
  else { winNew.focus( ); }
}
function launchMusicTerms( ) 
{
  var name = Math.round( 9999*Math.random( ) ) + new Date( ).getTime( );
  var win = window.open( "music_terms.html","musicterms" + name,"toolbar=0,menubar=0,width=800,height=800,status=0,resizable=1,scrollbars=1" );
  if( !win ) { getSwf( swfId ).openWindowFromSwf( "music_terms.html" ); }
  else { winNew.focus( ); }
}
function launchMusicSpecs( ) 
{
  var name = Math.round( 9999*Math.random( ) ) + new Date( ).getTime( );
  var win = window.open( "music_specs.html","musicspecs" + name,"toolbar=0,menubar=0,width=800,height=800,status=0,resizable=1,scrollbars=1" );
  if( !win ) { getSwf( swfId ).openWindowFromSwf( "music_specs.html" ); }
  else { winNew.focus( ); }
}
