// Global DOM onload
document.observe("dom:loaded", function() {
	new PageTabs('col2');
	Cufon.set('fontFamily', 'HouseGothic').replace('h1')('.home h2')('#col1 h3')('#sub-nav h3 a');
	// Mark if we're in surf-to-edit
      if (location.href.match(/nterchange/g)) { 
        $$('body').first().addClassName('nterchange') 
        $$('body').first().insert('<div id="nterchange"></div>')
      }else{
        	Cufon.set('fontFamily', 'Arial').replace('#banner-text');
      }


	
	if($('flashintro') != null){
	  check_for_and_show_flash()    
	}
});

function check_for_and_show_flash(){
  
    flash_cookie = readCookie('seenflash');
    if(location.search && location.search.indexOf("replayflash")!=-1){
      if(location.search.split("=")[1] == "true"){
        flash_cookie = null;
      }
    }
    
    if(flash_cookie == null){
      createCookie('seenflash',true)
      $('flashintro').show();
      var so = new SWFObject("larry_talks.swf", "mymovie", "500", "400", "8", "#ffffff");
      so.write("flashintro");
      $('site').hide();
    }else{
      $('flashintro').hide();
      $('site').show();
    }
  
  
  function readCookie(name) {
  	var nameEQ = name + "=";
  	var ca = document.cookie.split(';');
  	for(var i=0;i < ca.length;i++) {
  		var c = ca[i];
  		while (c.charAt(0)==' ') c = c.substring(1,c.length);
  		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  	}
  	return null;
  }
  
  function createCookie(name,value) {
  	var expires = "";
  	document.cookie = name+"="+value+expires+"; path=/";
  }
  
  
}