window.onload = function (){
  var swfWidth, swfHeight;
  swfWidth="810";
  swfHeight="352";
  swfFile="/flash/hp_intro/home.swf";
  configFile = "/flash/hp_intro/xml/config.xml";
  textFile = "/docs/intro_text.xml";

  var hasProductInstall = DetectFlashVer(6, 0, 65);
  if ( hasProductInstall && !Get_Cookie('bmlcookie')){
  var so = new SWFObject(swfFile,'bml_flash', swfWidth, swfHeight, '9', '#ffffff');
  so.addVariable('text_path', textFile);
  so.addVariable('xml_path', configFile);
  so.addParam("wmode", "transparent");
  so.addParam("quality", "best");
  so.useExpressInstall('/flash/hp_intro/scripts/expressinstall.swf');
  so.write("bml");
  document.getElementById("skip").innerHTML="<a href='http://billmelater.com' onClick='javascript:skipIntro();return false'>Skip Intro</a>";
}
		Set_Cookie( 'bmlcookie', 'visited before', '', '/', '', '' );
	}
	
	function Set_Cookie( name, value, expires, path, domain, secure ) {
		// set time, it's in milliseconds
		var today = new Date();
		today.setTime( today.getTime() );
		
		if ( expires ){
			expires = expires * 1000 * 60 * 60 * 24;
		}
		var expires_date = new Date( today.getTime() + (expires) );
		
		document.cookie = name + "=" +escape( value ) +
		( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
		( ( path ) ? ";path=" + path : "" ) + 
		( ( domain ) ? ";domain=" + domain : "" ) +
		( ( secure ) ? ";secure" : "" );
	}
	
	function Get_Cookie( check_name ) {
		var a_all_cookies = document.cookie.split( ';' );
		var a_temp_cookie = '';
		var cookie_name = '';
		var cookie_value = '';
		var b_cookie_found = false; // set boolean t/f default f
	
		for ( i = 0; i < a_all_cookies.length; i++ ){
			// now we'll split apart each name=value pair
			a_temp_cookie = a_all_cookies[i].split( '=' );
			
			
			// and trim left/right whitespace while we're at it
			cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
		
			// if the extracted name matches passed check_name
			if ( cookie_name == check_name ){
				b_cookie_found = true;
				// we need to handle case where cookie has no value but exists (no = sign, that is):
				if ( a_temp_cookie.length > 1 ){
					cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
				}
				// note that in cases where cookie is initialized but no value, null is returned
				return cookie_value;
				break;
			}
			a_temp_cookie = null;
			cookie_name = '';
		}
		if ( !b_cookie_found ){
			return null;
		}
	}
	
  function skipIntro(){
    document.getElementById("bml").innerHTML="<div id='alternate_flash'><div id='hp_image'><div id='hp_intro_area'><div id='hp_header'>Perfect Your Experience</div><div id='hp_content'><p>Welcome to the ease, convenience and luxury of buying on account.  Use Bill Me Later's effortless, pay-later experience as a tool to increase sales, conversions and average order values.</p></div><div id='hp_nav'><ul id='hp_intro_navigation'><li><a href='/solutions-services/bill-me-later'>Bill Me Later&reg;</a></li><li><a href='/solutions-services/private-label-credit'>Private Label Credit</a></li><li><a href='/solutions-services/partnership-marketing'>Partnership Marketing</a></li><li><a href='/solutions-services/deferred-billing'>Deferred Billing</a></li></ul></div>"
    if (document.getElementById("skip")) {
      document.getElementById("skip").innerHTML="";
    }
  }


