// --- Live Dynamite --- www.LiveDynamite.com --
// --- Common JS functions --------------------
// --- Created by ideapark -- January 2007! ------
// Functions in this file are meant to run (or at least be accessible) on every page of the site


// addLoadEvent() is a method of running multiple functions at window.onload
// To avoid onload conflicts, run all such functions using this method

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

// Call site-wide window.onload functions here

addLoadEvent(formTextboxDefault);
addLoadEvent(navTabs);
addLoadEvent(refills);
addLoadEvent(rss);
addLoadEvent(staf);
addLoadEvent(news);
addLoadEvent(ggal);
//addLoadEvent(flipImg);




// ------ functions meant to run at window.onload on every page ------


// formTextboxDefault() looks for input fields with class 'textBox' and clears their default value when the field is clicked on
// It also swithes the input's class, so that the default value can be styled differently than the user's input
// If the user empties the field, the default value and style are restored

function formTextboxDefault() {
  var inputs = document.getElementsByTagName('input');
  for (i=0; i<inputs.length; i++) {
    if (inputs[i].className == 'textBox' && inputs[i].value != null) {
      inputs[i].className = 'textBoxDefault';
      inputs[i].defaultValue = inputs[i].value;
      
      inputs[i].onclick = function() {
        if (this.value == this.defaultValue) {
          this.value = '';
          this.className = 'textBox';
        }
      }
      
      inputs[i].onblur = function() {
        if (this.value == '') {
          this.className = 'textBoxDefault';
          this.value = this.defaultValue;
          
         if(document.getElementById(this.id + '_required')){
         	document.getElementById(this.id + '_required').style.display = 'none';
         };
          
        }
      }
      
      inputs[i].onfocus = function() {
      	 if(document.getElementById(this.id + '_required')){
	         if(document.getElementById(this.id + '_required').style.display == 'block'){
    	     	document.getElementById(this.id + '_required').style.display = 'none';
        	 };
      	 };
      }
    }
      
    if (inputs[i].className == 'textBoxSelector') {
      inputs[i].onclick = function() {
        this.select();
      }
    }
  }
  
  var textareas = document.getElementsByTagName('textarea');
  for (i=0; i<textareas.length; i++) {
    if (textareas[i].className == 'textBox' && textareas[i].innerHTML != null) {
      textareas[i].className = 'textBoxDefault';
      textareas[i].defaultValue = textareas[i].innerHTML;
      
      textareas[i].onclick = function() {
        if (this.value == this.defaultValue) {
          this.value = '';
          this.className = 'textBox';
        }
      }
      
      textareas[i].onblur = function() {
        if (this.value == '') {
          this.className = 'textBoxDefault';
          this.value = this.defaultValue;
        }
      }
      
    }
  }
  
}


function navTabs(navBase) {
  if (document.getElementById('Map')) {
    var tabNav = document.getElementById('Map');
    var tabLinks = tabNav.getElementsByTagName('area');
    var urlInternal = window.location + '';
    var contentIDs = new Array();
    var navImage = document.getElementById('navImage');
    var imgPath = 'http://www.livedynamite.com/images/';
    imgPath = navImage.src.replace(/(.*images\/).+/,'$1'); // grab the image path from the existing image, rather than hard-coding it
    navImage.defaultSrc = navImage.src;
    
    for (i=0; i<tabLinks.length; i++) {
      tabLinks[i].onmouseover = function() {
        navImage.src = imgPath + 'nav-' + this.id + '.png';
      }
      tabLinks[i].onmouseout = function() {
        navImage.src = navImage.defaultSrc;
      }
    }
  }
  
}



function refills() {
  if (document.getElementById('refills')) {
    var refills = document.getElementById('refills');
    var imgPath = refills.src.replace(/(.*images\/).+/,'$1'); // grab the image path from the existing image, rather than hard-coding it
    refills.defaultSrc = refills.src;
    
    refills.onmouseover = function() {
      refills.src = imgPath + 'buy-upside-refills-over.png';
    }
    refills.onmouseout = function() {
      refills.src = refills.defaultSrc;
    }
  }
}

function rss() {
  if (document.getElementById('rssPopup')) {
    var rssPopup = document.getElementById('rssPopup');
    var overlay = document.getElementById('overlay');
    var rssPopupOpen = document.getElementById('rssPopupOpen');
    var rssPopupClose = document.getElementById('rssPopupClose');
    var theHash = document.location.hash + '';
    /*
    rssPopupOpen.onclick = function() {
      window.scroll(0,0);
      rssPopup.style.display = 'block';
      overlay.style.display = 'block';
      return false;
    }*/
    for (i=0; i<document.links.length; i++) {
      if (document.links[i].className == 'podListen') {
        document.links[i].onclick = function() {
          window.scroll(0,0);
          rssPopup.style.display = 'block';
          overlay.style.display = 'block';
          return false;
        }
      }
    }
    if (theHash.indexOf('rss') != '-1') {
      window.scroll(0,0);
      rssPopup.style.display = 'block';
      overlay.style.display = 'block';
    }
    rssPopupClose.onclick = function() {
      rssPopup.style.display = 'none';
      overlay.style.display = 'none';
      return false;
    }
  }
}



function staf() {
  if (document.getElementById('stafSubmit')) {
    var stafSubmit = document.getElementById('stafSubmit');
    var overlay = document.getElementById('overlay');
    var stafClose = document.getElementById('stafClose');
    var stafOrigin = document.getElementById('stafOrigin');
    var stafEmail_required = document.getElementById('stafEmail_required');
    var theHash = document.location.hash + '';
    
    var staf = document.getElementById('staf');
    
    if (window.location.search.substring(1) == 'friend') {
     window.scroll(0,0);
     staf.style.display = 'block';
	 overlay.style.display = 'block';
     document.getElementById('msg').value = 'FOP';
    }
    stafSubmit.onclick = function() {
      if (document.getElementById('stafEmail').value != 'your friend\'s email address') {
	      window.scroll(0,0);
    	  staf.style.display = 'block';
	      overlay.style.display = 'block';
    	  document.getElementById('stafFirstEmail').value = document.getElementById('stafEmail').value;
    	  document.getElementById('stafEmail').value = 'your friend\'s email address';
      } else {
		  stafEmail_required.style.display = 'block';
      };
      return false;
    }
    stafOrigin.onsubmit = function() {
      window.scroll(0,0);
      staf.style.display = 'block';
      overlay.style.display = 'block';
      if (document.getElementById('stafEmail').value != 'your friend\'s email address') {
        document.getElementById('stafFirstEmail').value = document.getElementById('stafEmail').value;
        document.getElementById('stafFirstEmail').value = document.getElementById('stafEmail').value;
        document.getElementById('stafEmail').value = 'your friend\'s email address';
      };
	      
      return false;
    }
    stafClose.onclick = function() {
      staf.style.display = 'none';
      overlay.style.display = 'none';
      return false;
    }
    stafThanks();
  }
  if (document.getElementById('headerStaf')) {
    var headerStaf = document.getElementById('headerStaf');
    var overlay = document.getElementById('overlay');
    var stafClose = document.getElementById('stafClose');
    var staf = document.getElementById('staf');
    
    headerStaf.onclick = function() {
      if (document.getElementById('home_flash')) {
        document.getElementById('home_flash').style.visibility = 'hidden';
      }
      if (document.getElementById('audioPlayer')) {
        document.getElementById('audioPlayer').style.visibility = 'hidden';
      }
      window.scroll(0,0);
      staf.style.display = 'block';
      overlay.style.display = 'block';
      return false;
    }
    stafClose.onclick = function() {
      staf.style.display = 'none';
      overlay.style.display = 'none';
      if (document.getElementById('home_flash')) {
        document.getElementById('home_flash').style.visibility = 'visible';
      }
      if (document.getElementById('audioPlayer')) {
        document.getElementById('audioPlayer').style.visibility = 'visible';
      }
      return false;
    }
    stafThanks();
  }
}



function staf_submit(form,action) {
	var staf = document.getElementById('staf');
	var stafThanks = document.getElementById('stafThanks');
	var submitting = document.getElementById('submitting');
	var full_nm_required = document.getElementById('full_nm_required');
	var email_addr_required = document.getElementById('email_addr_required');
	var stafFirstEmail_required = document.getElementById('stafFirstEmail_required');
	var msg_required = document.getElementById('msg_required');
	
	
	
	if (document.getElementById('full_nm').value != 'Your name' &&
		document.getElementById('email_addr').value != 'Your email address' &&
		document.getElementById('stafFirstEmail').value != '1st friend\'s email address' &&
		document.getElementById('msg').value != 'Type your message here' ) {
		window.scroll(0,0);
		
    	new Ajax.Request(action, {asynchronous:true, method:'post', parameters:Form.serialize(form.id)});
		
		staf.style.display = 'none';
		if (document.getElementById('submitting')) {
			submitting.style.display = 'block';
			setTimeout("document.getElementById('submitting').style.display = 'none';document.getElementById('stafThanks').style.display = 'block';",3000);
		} else {
			stafThanks.style.display = 'block';
		}
		
    } else {
    	
   	
    	if(document.getElementById('full_nm').value == 'Your name'){
			full_nm_required.style.display = 'block';	
    	};
    	if(document.getElementById('email_addr').value == 'Your email address'){
			email_addr_required.style.display = 'block';	
    	};
    	if(document.getElementById('stafFirstEmail').value == '1st friend\'s email address'){
			stafFirstEmail_required.style.display = 'block';	
    	};
    	if(document.getElementById('msg').value == 'Type your message here'){
			msg_required.style.display = 'block';	
    	};
    	
    	return false;
    };

};

function stafThanks() {
  var stafThanksClose = document.getElementById('stafThanksClose');
  var overlay = document.getElementById('overlay');
  var stafThanks = document.getElementById('stafThanks');
  stafThanksClose.onclick = function() {
    stafThanks.style.display = 'none';
    overlay.style.display = 'none';
    if (document.getElementById('home_flash')) {
      document.getElementById('home_flash').style.visibility = 'visible';
    }
    return false;
  }
}

function news() {
  if (document.getElementById('newsSubmit')) {
    var newsSubmit = document.getElementById('newsSubmit');
    var overlay = document.getElementById('overlay');
    var newsClose = document.getElementById('newsClose');
    var newsOrigin = document.getElementById('newsOrigin');
    
    var news = document.getElementById('news');
    newsSubmit.onclick = function() {
      window.scroll(0,0);
      news.style.display = 'block';
      overlay.style.display = 'block';
      if (document.getElementById('newsEmail').value != 'enter email address') {
        document.getElementById('email_addr').value = document.getElementById('newsEmail').value;
        document.getElementById('email_addr_conf').value = document.getElementById('newsEmail').value;
        document.getElementById('newsEmail').value = 'enter email address';
      }
      return false;
    }
    newsOrigin.onsubmit = function() {
      window.scroll(0,0);
      news.style.display = 'block';
      overlay.style.display = 'block';
      if (document.getElementById('newsEmail').value != 'enter email address') {
        document.getElementById('email_addr').value = document.getElementById('newsEmail').value;
        document.getElementById('email_addr_conf').value = document.getElementById('newsEmail').value;
        document.getElementById('newsEmail').value = 'enter email address';
      }
      return false;
    }
    newsClose.onclick = function() {
      news.style.display = 'none';
      overlay.style.display = 'none';
      return false;
    }
    newsThanks();
  }
  if (document.getElementById('footerNews')) {
    var footerNews = document.getElementById('footerNews');
    var overlay = document.getElementById('overlay');
    var newsClose = document.getElementById('newsClose');
    var news = document.getElementById('news');
    
    footerNews.onclick = function() {
      if (document.getElementById('home_flash')) {
        document.getElementById('home_flash').style.visibility = 'hidden';
      }
      window.scroll(0,0);
      news.style.display = 'block';
      overlay.style.display = 'block';
      return false;
    }
    newsClose.onclick = function() {
      news.style.display = 'none';
      overlay.style.display = 'none';
      if (document.getElementById('home_flash')) {
        document.getElementById('home_flash').style.visibility = 'visible';
      }
      return false;
    }
    newsThanks();
  }
  if (document.getElementById('playerNews')) {
    var playerNews = document.getElementById('playerNews');
    var overlay = document.getElementById('overlay');
    var newsClose = document.getElementById('newsClose');
    var news = document.getElementById('news');
    
    playerNews.onclick = function() {
      if (document.getElementById('home_flash')) {
        document.getElementById('home_flash').style.visibility = 'hidden';
      }
      window.scroll(0,0);
      news.style.display = 'block';
      overlay.style.display = 'block';
      return false;
    }
    newsClose.onclick = function() {
      news.style.display = 'none';
      overlay.style.display = 'none';
      if (document.getElementById('home_flash')) {
        document.getElementById('home_flash').style.visibility = 'visible';
      }
      return false;
    }
    newsThanks();
  }
}

function ggal() {
  if (document.getElementById('ggalSubmit')) {
    var ggalSubmit = document.getElementById('ggalSubmit');
    var overlay = document.getElementById('overlay');
    var ggalClose = document.getElementById('ggalClose');
    var ggalOrigin = document.getElementById('ggalOrigin');
    
    var ggal = document.getElementById('ggal');
    ggalSubmit.onclick = function() {
      window.scroll(0,0);
      ggal.style.display = 'block';
      overlay.style.display = 'block';
	  if (document.getElementById('home_flash')) {
        document.getElementById('home_flash').style.visibility = 'hidden';
      }
      if (document.getElementById('ggalEmail').value != 'enter email address') {
        document.getElementById('email_addr').value = document.getElementById('ggalEmail').value;
        document.getElementById('email_addr_conf').value = document.getElementById('ggalEmail').value;
        document.getElementById('ggalEmail').value = 'enter email address';
      }
      return false;
    }
    ggalOrigin.onsubmit = function() {
      window.scroll(0,0);
      ggal.style.display = 'block';
      overlay.style.display = 'block';
      if (document.getElementById('ggalEmail').value != 'enter email address') {
        document.getElementById('email_addr').value = document.getElementById('ggalEmail').value;
        document.getElementById('email_addr_conf').value = document.getElementById('ggalEmail').value;
        document.getElementById('ggalEmail').value = 'enter email address';
      }
      return false;
    }
    ggalClose.onclick = function() {
      ggal.style.display = 'none';
      overlay.style.display = 'none';
	  if (document.getElementById('home_flash')) {
        document.getElementById('home_flash').style.visibility = 'visible';
      }
      return false;
    }
    ggalThanks();
  }
  if (document.getElementById('footerGgal')) {
    var footerGgal = document.getElementById('footerGgal');
    var overlay = document.getElementById('overlay');
    var ggalClose = document.getElementById('ggalClose');
    var ggal = document.getElementById('ggal');
    
    footerGgal.onclick = function() {
      if (document.getElementById('home_flash')) {
        document.getElementById('home_flash').style.visibility = 'hidden';
      }
      window.scroll(0,0);
      ggal.style.display = 'block';
      overlay.style.display = 'block';
      return false;
    }
    ggalClose.onclick = function() {
      ggal.style.display = 'none';
      overlay.style.display = 'none';
      if (document.getElementById('home_flash')) {
        document.getElementById('home_flash').style.visibility = 'visible';
      }
      return false;
    }
    ggalThanks();
  }
  if (document.getElementById('playerGgal')) {
    var playerGgal = document.getElementById('playerGgal');
    var overlay = document.getElementById('overlay');
    var ggalClose = document.getElementById('ggalClose');
    var ggal = document.getElementById('ggal');
    
    playerGgal.onclick = function() {
      if (document.getElementById('home_flash')) {
        document.getElementById('home_flash').style.visibility = 'hidden';
      }
      window.scroll(0,0);
      ggal.style.display = 'block';
      overlay.style.display = 'block';
      return false;
    }
    ggalClose.onclick = function() {
      ggal.style.display = 'none';
      overlay.style.display = 'none';
      if (document.getElementById('home_flash')) {
        document.getElementById('home_flash').style.visibility = 'visible';
      }
      return false;
    }
    ggalThanks();
  }
}
			
function newsletter_submit(form,action) {
	var news = document.getElementById('news');
	var newsThanks = document.getElementById('newsThanks');
	var submitting = document.getElementById('submitting');
	var first_nm_required = document.getElementById('first_nm_required');
	var last_nm_required = document.getElementById('last_nm_required');
	var email_addr_required = document.getElementById('email_addr_required');
	var email_addr_conf_required = document.getElementById('email_addr_conf_required');
	var email_addr_match = document.getElementById('email_addr_match');
	var optin_required = document.getElementById('optin_required');



	if (document.getElementById('first_nm').value != 'First name (required)' &&
		document.getElementById('last_nm').value != 'Last name (required)' &&
		document.getElementById('email_addr').value != 'Email address (required)' &&
		document.getElementById('email_addr_conf').value != 'Confirm email address' &&
		document.getElementById('optin').checked == true &&
		document.getElementById('email_addr').value == document.getElementById('email_addr_conf').value ) {
		window.scroll(0,0);
		
    	new Ajax.Request(action, {asynchronous:true, method:'post', parameters:Form.serialize(form.id)});
		
		news.style.display = 'none';
		if (document.getElementById('submitting')) {
			submitting.style.display = 'block';
			setTimeout("document.getElementById('submitting').style.display = 'none';document.getElementById('newsThanks').style.display = 'block';",3000);
		} else {
			newsThanks.style.display = 'block';
		}
		
    } else {
    	
   	
    	if(document.getElementById('first_nm').value == 'First name (required)'){
			first_nm_required.style.display = 'block';	
    	};
    	if(document.getElementById('last_nm').value == 'Last name (required)'){
			last_nm_required.style.display = 'block';	
    	};
    	if(document.getElementById('email_addr').value == 'Email address (required)'){
			email_addr_required.style.display = 'block';	
    	};
    	if(document.getElementById('email_addr_conf').value == 'Confirm email address'){
			email_addr_conf_required.style.display = 'block';	
    	};
    	
    	if(document.getElementById('optin').checked == false){
			optin_required.style.display = 'block';	
    	};
    	
    	if(document.getElementById('email_addr').value != 'Email address (required)' || document.getElementById('email_addr_conf').value != 'Confirm email address'){
	    	if(document.getElementById('email_addr').value != document.getElementById('email_addr_conf').value ) {
	    		email_addr_match.style.display = 'block';	
	    	};
    	};
    	return false;
    };





	
};

function ggal_submit(form,action) {
	var ggal = document.getElementById('ggal');
	var ggalThanks = document.getElementById('ggalThanks');
	var submitting = document.getElementById('submitting');
	var first_nm_required = document.getElementById('first_nm_required');
	var last_nm_required = document.getElementById('last_nm_required');
	var email_addr_required = document.getElementById('email_addr_required');
	var email_addr_conf_required = document.getElementById('email_addr_conf_required');
	var email_addr_match = document.getElementById('email_addr_match');
	var optin_required = document.getElementById('optin_required');



	if (document.getElementById('first_nm').value != 'First name (required)' &&
		document.getElementById('last_nm').value != 'Last name (required)' &&
		document.getElementById('email_addr').value != 'Email address (required)' &&
		document.getElementById('email_addr_conf').value != 'Confirm email address' &&
		document.getElementById('optin').checked == true &&
		document.getElementById('email_addr').value == document.getElementById('email_addr_conf').value ) {
		window.scroll(0,0);
		
    	new Ajax.Request(action, {asynchronous:true, method:'post', parameters:Form.serialize(form.id)});
		
		ggal.style.display = 'none';
		if (document.getElementById('submitting')) {
			submitting.style.display = 'block';
			setTimeout("document.getElementById('submitting').style.display = 'none';document.getElementById('ggalThanks').style.display = 'block';",3000);
		} else {
			ggalThanks.style.display = 'block';
		}
		
    } else {
    	
   	
    	if(document.getElementById('first_nm').value == 'First name (required)'){
			first_nm_required.style.display = 'block';	
    	};
    	if(document.getElementById('last_nm').value == 'Last name (required)'){
			last_nm_required.style.display = 'block';	
    	};
    	if(document.getElementById('email_addr').value == 'Email address (required)'){
			email_addr_required.style.display = 'block';	
    	};
    	if(document.getElementById('email_addr_conf').value == 'Confirm email address'){
			email_addr_conf_required.style.display = 'block';	
    	};
    	
    	if(document.getElementById('optin').checked == false){
			optin_required.style.display = 'block';	
    	};
    	
    	if(document.getElementById('email_addr').value != 'Email address (required)' || document.getElementById('email_addr_conf').value != 'Confirm email address'){
	    	if(document.getElementById('email_addr').value != document.getElementById('email_addr_conf').value ) {
	    		email_addr_match.style.display = 'block';	
	    	};
    	};
    	return false;
    };





	
};


			
function newsThanks() {
  var newsThanksClose = document.getElementById('newsThanksClose');
  var overlay = document.getElementById('overlay');
  var newsThanks = document.getElementById('newsThanks');
  newsThanksClose.onclick = function() {
    newsThanks.style.display = 'none';
    overlay.style.display = 'none';
    if (document.getElementById('home_flash')) {
      document.getElementById('home_flash').style.visibility = 'visible';
    }
    return false;
  }
}

function ggalThanks() {
  var ggalThanksClose = document.getElementById('ggalThanksClose');
  var overlay = document.getElementById('overlay');
  var ggalThanks = document.getElementById('ggalThanks');
  ggalThanksClose.onclick = function() {
    ggalThanks.style.display = 'none';
    overlay.style.display = 'none';
    if (document.getElementById('home_flash')) {
      document.getElementById('home_flash').style.visibility = 'visible';
    }
    return false;
  }
}



function flipImg() {
  for (i=0; i<document.links.length; i++) {
    if (document.links[i].className == 'flip') {
      document.links[i].onclick = function() {
        var theImg = this.getElementsByTagName('img')[0];
          this.blur();
          theImg.blur();
        theImg.srcDefault = theImg.src;
        theImg.src = this.href;
        this.onclick = function() {
          this.blur();
          theImg.blur();
          theImg.src = theImg.srcDefault;
          flip();
          return false;
        }
        return false;
      }
    }
  }
}


// ------ other functions ------


// This redirects an old Inspiration entry to the main inspiration page, because some people linked to it before the site went live
/*
if (window.location.indexof('suzy-from-st-paul-mn-wrote') != -1) {
  window.location = '/blog/index.php/inspire/';
}
*/


// This selects a random quote image
var imgs = new Array('quote-alexander.png','quote-angelou.png','quote-angelou2.png','quote-angelou3.png','quote-anoynmous.png','quote-arbus.png','quote-aristotle.png','quote-bach.png','quote-bradley.png','quote-broude.png','quote-brown.png','quote-brown2.png','quote-browning.png','quote-buddha.png','quote-caddy.png','quote-carnegie.png','quote-cash.png','quote-churchill.png','quote-clark.png','quote-collins.png','quote-davinci.png','quote-dean.png','quote-dewitt.png','quote-dillard.png','quote-drabble.png','quote-dryden.png','quote-earhart.png','quote-earhart2.png','quote-edison.png','quote-einstein.png','quote-eliot.png','quote-elliot2.png','quote-ellerbee.png','quote-emerson.png','quote-ford.png','quote-france.png','quote-franklin1.png','quote-franklin2.png','quote-franklin3.png','quote-franklin4.png','quote-franklin5.png','quote-frenchproverb.png','quote-fuller.png','quote-gandhi.png','quote-gandi.png','quote-goethe.png','quote-goethe1.png','quote-guri.png','quote-hanh.png','quote-hanh1.png','quote-hepburn.png','quote-hill.png','quote-hill2.png','quote-hill3.png','quote-hill4.png','quote-holmes.png','quote-holtz.png','quote-holtz2.png','quote-hubbard.png','quote-jackson.png','quote-james.png','quote-jefferson.png','quote-king.png','quote-krause.png','quote-lewis.png','quote-lincoln.png','quote-locke.png','quote-melville.png','quote-newcomber.png','quote-newcomber2.png','quote-nightingale.png','quote-nightingale2.png','quote-nightingale3.png','quote-nightingale4.png','quote-oprah.png','quote-oprah2.png','quote-oprah3.png','quote-oprah4.png','quote-peale.png','quote-peale1.png','quote-peale2.png','quote-penny.png','quote-proverb.png','quote-proverb2.png','quote-rhon.png','quote-rohn1.png','quote-rohn2.png','quote-rohn3.png','quote-riley.png','quote-roddick.png','quote-roosevelt.png','quote-roosevelt2.png','quote-roosevelt3.png','quote-sandburg.png','quote-scott.png','quote-seneca.png','quote-seneca1.png','quote-seneca2.png','quote-seneca3.png','quote-seneca4.png','quote-shaq.png','quote-sikking.png','quote-sills.png','quote-spanishproverb.png','quote-stone.png','quote-stone2.png','quote-tolstoy.png','quote-tolstoy1.png','quote-tomlin.png','quote-tomlin1.png','quote-tomlin2.png','quote-tzu.png','quote-walker.png','quote-welty.png','quote-williamson.png','quote-winfrey.png','quote-wright.png','quote-yoda.png','quote-Zadra.png');
// quote-williamson.png

function randomImage(imageID) {
  var theImage = document.getElementById(imageID);
  var i = 0;
  i = Math.round((imgs.length-1)*Math.random());
  theImage.src = theImage.src.replace(/(.*images\/).+/,'$1') + imgs[i];
}



function AC_FL_RunContent(){

  var ret = 

    AC_GetArgs

    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"

     , "application/x-shockwave-flash"

    );

  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);

}


