
if (document.images) {
   reception      = new Image;
   directions     = new Image;
   accommodation  = new Image;
   rsvpCard       = new Image;
   giftRegistry   = new Image;
   website        = new Image;
   
   receptionHover      = new Image;
   directionsHover     = new Image;
   accommodationHover  = new Image;
   rsvpCardHover       = new Image;
   giftRegistryHover   = new Image;
   websiteHover        = new Image;
   
   pictureBackground1  = new Image;
   pictureBackground2  = new Image;
   pictureBackground3  = new Image;
   pictureBackground4  = new Image;
   
   reception.src     = "./images/reception.png";
   directions.src    = "./images/directions.png";
   accommodation.src = "./images/accommodation.png";
   rsvpCard.src      = "./images/rsvpCard.png";
   giftRegistry.src  = "./images/giftRegistry.png";
   website.src       = "./images/website.png";

   receptionHover.src     = "./images/receptionHover.png";
   directionsHover.src    = "./images/directionsHover.png";
   accommodationHover.src = "./images/accommodationHover.png";
   rsvpCardHover.src      = "./images/rsvpCardHover.png";
   giftRegistryHover.src  = "./images/giftRegistryHover.png";
   websiteHover.src       = "./images/websiteHover.png";


   pictureBackground1.src = "./images/pictureBackground1.png";
   pictureBackground2.src = "./images/pictureBackground2.png";
   pictureBackground3.src = "./images/pictureBackground3.png";
   pictureBackground4.src = "./images/pictureBackground4.png";
   
   //window.onload = function() {
  // getRandomPicture("left_Bottom_Right_Picture");
  // }
}



var bodyBackground = "./images/myBody_Top_Background.png";
var firstParagraphTitle = '<p id="ourStoryFirstParagraphTitle"> How we met - Andrew </p>';
var otherParagraphTitle = '<p id="ourStoryOtherParagraphTitle"> How he Proposed - Dami </p>';

var firstParagraph =
        '<p id="ourStoryFirstParagraph"> ' +
        'People always ask us how we met, but the truth is that we never really ' +
        'met. We just started talking to each other. We both attended the same ' +
        'college and were members of the same organizations. I remember seeing ' +
        'her and thinking to myself \"that\'s the kind of girl I\'d like to date, ' +
        'and she walks like a cat!\" I later ' +
        'found out that her nickname is \"Ayomeye\" - one who sneaks to catch a ' +
        'bird. We remained friends and didn\'t start dating until october 23rd ' +
        '2001. We\'ve been together so long now that it seems like I have known ' +
        'her forever and I cannot imagine going ' +
        'through life without her by my side. ' +
        '</p> ' ;
var otherParagraph =
        '<p id="ourStoryOtherParagraph"> ' +
        'So after about 4 years of dating, we both knew we would be getting ' +
        'married. all that was unknown to me was when i would be proposed to. i ' +
        'was to spend christmas 2005 with my sisters in texas. we spoke on ' +
        'boxing day and he told me he was out having lunch with one of his ' +
        'brothers. well, i was going to a restaurant to get some ribs with my ' +
        'girls, so there! we got to the restaurant and i walked over to the ' +
        'table they picked out. on my chair, i found a stuffed monkey i was ' +
        'supposed to get from andrew for christmas. my youngest sister said she ' +
        'brought it with her from maryland and hid it from me. i bought her ' +
        'story and settled down to eat. my attention was suddenly grabbed by ' +
        'andrew\'s brother who was holding a camcorder. i\'m like "what the hell ' +
        'are you doing here? you are meant to be having lunch with andrew in ' +
        'maryland!" then i looked to my right and there he was, out of nowhere, ' +
        'on one knee asking me to marry him. the whole place burst into ' +
        'applause. it was unbelieveable. especially the fact that my sisters ' +
        'were in on it all this while and did not spill the beans. even my ' +
        'parents too because my mom called from lagos to see how it went! i was ' +
        'too excited to eat. my newly minted fiance and his brother had to fly ' +
        'back home in less than 2 hours. talk about a fly-by proposal!' +
        '</p> ' ;














//window.moveTo(0,0);
//window.resizeTo(screen.width,screen.height);
maximize();

var arVersion = navigator.appVersion.split("MSIE");

var version = parseFloat(arVersion[1]); 

var useIEHack = false;

if ((version >= 5.5) && (version <= 6) ) {

   useIEHack = true;
   
}


  

/*

function PNGswap(myID, fileName)
{
   var strOver  = "_on"
   var strOff = "_off"
      var currentAlphaImg = oSpan.filters(0).src
   if (currentAlphaImg.indexOf(strOver) != -1)
      oSpan.filters(0).src = currentAlphaImg.replace(strOver,strOff)
   else
      oSpan.filters(0).src = currentAlphaImg.replace(strOff,strOver)
}
*/
function swapImage(imageName, fileName) {
   if(useIEHack == true) {
      var oSpan = document.getElementById(imageName);
      oSpan.filters(0).src = fileName;
   }
   else {
      document[imageName].src = fileName;
   }
}

/***********************************************
* Auto Maximize Window Script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for this script and 100's more.
***********************************************/
function maximize() {
   top.window.moveTo(0,0);
   if (document.all) {
     top.window.resizeTo(screen.availWidth,screen.availHeight);
   }
   else if (document.layers||document.getElementById) {
      if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
         top.window.outerHeight = screen.availHeight;
         top.window.outerWidth = screen.availWidth;
      }
   }
}


function clickClear(thisField, defaultText) {
   if (thisField.value == defaultText) {
      thisField.value = "";
   }
}

function clickRecall(thisField, defaultText) {
   if (thisField.value == "") {
      thisField.value = defaultText;
   }
}

function getRandomPicture(mainElementName) {

   //alert("ahahaha: " + mainElementName);
   images = new Array(4);
   images[0] = "./images/pictureBackground1.png";
   images[1] = "./images/pictureBackground2.png";
   images[2] = "./images/pictureBackground3.png";
   images[3] = "./images/pictureBackground4.png";
   
   var mainElement = document.getElementById(mainElementName);


   index = Math.floor(Math.random() * images.length);
   
   mainElement.style.backgroundImage = "url(" + images[index] +")";

}

var newwindow;
function launchNewWindow(urlOfNewWindow)
{
	newwindow=window.open(urlOfNewWindow,'myNewWindow','width=700,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');
	if (window.focus) {newwindow.focus()}
}

