function UploadImage(id)
{     
  window.open ('image_upload.php?id='+id+'', 'upload_window', config='height=230, width=450, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no')
}
// ***********************
// Used to write width of
// City textbox in form
// Netscape displays much
// wider than IE and therefore
// must be shorter for page
// to format properly
function fcnWriteWidth()
{
var strOut = '<input value="" type="text" comment="this.form.addr_city.focus()" onFocus="this.form.addr_city.select()" name="addr_city" size=';
if (navigator.appName == "Netscape")
  document.write(strOut + "10" + '">');
else
  document.write(strOut + "20" + '">');
}

function fcnWriteWidthtd()
{
var strOuttd = '<td width=';      
if (navigator.appName == "Netscape")
  document.write(strOuttd + "185" + '">');
else
  document.write(strOuttd + "192" + '">');
}

// **********************
// code by Michael Gonzales
// changes values for select



var stateArray =  new Array("('Select State','',true,true)",
"('Alabama', 'AL')",
"('Alaska', 'AK')",
"('Arizona', 'AZ')",
"('Arkansas', 'AR')",
"('California', 'CA')",
"('Colorado', 'CO')",
"('Connecticut', 'CT')",
"('Delaware', 'DE')",
"('District of Columbia', 'DC')",
"('Florida', 'FL')",
"('Georgia', 'GA')",
"('Hawaii', 'HI')",
"('Idaho', 'ID')",
"('Illinois', 'IL')",
"('Indiana', 'IN')",
"('Iowa', 'IA')",
"('Kansas', 'KS')",
"('Kentucky', 'KY')",
"('Louisiana', 'LA')",
"('Maine', 'ME')",
"('Maryland', 'MD')",
"('Massachusetts', 'MA')",
"('Michigan', 'MI')",
"('Minnesota', 'MN')",
"('Mississippi', 'MS')",
"('Missouri', 'MO')",
"('Montana', 'MT')",
"('Nebraska', 'NE')",
"('Nevada', 'NV')",
"('New Hampshire', 'NH')",
"('New Jersey', 'NJ')",
"('New Mexico', 'NM')",
"('New York', 'NY')",
"('North Carolina', 'NC')",
"('North Dakota', 'ND')",
"('Ohio', 'OH')",
"('Oklahoma', 'OK')",
"('Oregon', 'OR')",
"('Pennsylvania', 'PA')",
"('Rhode Island', 'RI')",
"('South Carolina', 'SC')",
"('South Dakota', 'SD')",
"('Tennessee', 'TN')",
"('Texas', 'TX')",
"('Utah', 'UT')",
"('Vermont', 'VT')",
"('Virginia', 'VA')",
"('Washington', 'WA')",
"('West Virginia', 'WV')",
"('Wisconsin', 'WI')",
"('Wyoming', 'WY')",
"('Puerto Rico', 'PR')");

var provinceArray =  new Array("('Select Province','',true,true)",
"('Alberta', 'AB')",
"('British Columbia', 'BC')",
"('Manitoba', 'MB')",
"('New Brunswick', 'NB')",
"('Newfoundland', 'NL')",
"('Nova Scotia', 'NS')",
"('Ontario', 'ON')",
"('Prince Edward Island', 'PE')",
"('Quebec', 'QC')",
"('Saskatchewan', 'SK')");


function populateUSstate(inForm,selected) {  
if (selected == 'USA') {
   for (var i=0; i < stateArray.length; i++) {
      eval("inForm.addr_state.options[i]=" + "new Option" + stateArray[i]);
   }
   if ( navigator.appName == 'Netscape') {
      if (parseInt(navigator.appVersion) < 4) {
        //window.history.go(0)
      }
      else {    	
         if (navigator.platform == 'Win32' || navigator.platform == 'Win16') {
           //window.history.go(0)
         }
      }
   }
}
else if (selected == 'Canada'){
   while (provinceArray.length < inForm.addr_state.options.length) {
      inForm.addr_state.options[(inForm.addr_state.options.length - 1)] = null;
   }
   for (var i=0; i < provinceArray.length; i++) {
      eval("inForm.addr_state.options[i]=" + "new Option" + provinceArray[i]);
   }
   if ( navigator.appName == 'Netscape') {
      if (parseInt(navigator.appVersion) < 4) {
         //window.history.go(0)
      }
      else{    	
         if (navigator.platform == 'Win32' || navigator.platform == 'Win16') {
            //window.history.go(0)
         }
      }
   }
}  
else {
}

if (selected == 'Other') {
   newCountry = "";
   while (newCountry == ""){
      newCountry=prompt ("Please enter the name of your country.", "");
   }
   if (newCountry != null) {
      inForm.addr_state.options[(inForm.addr_state.options.length-1)]=new Option(newCountry,newCountry,true,true);
      inForm.addr_state.options[inForm.addr_state.options.length]=new Option('Other, not listed','Other');
   }
}
if(inForm.addr_state.options[0].text == 'Select country') {
   inForm.addr_state.options[0]= null;
}
}


function bookmark(){
   if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
      var url="http://www.flowershopnetwork.com";
      var title="Flowershopnetwork.com";
      window.external.AddFavorite(url,title);
   }
}



   NewImg = new Array
   (
     "images/flipper/01.gif",
     "images/flipper/02.gif",
     "images/flipper/03.gif",
		 "images/flipper/04.gif",
		 "images/flipper/05.gif",
		 "images/flipper/06.gif"
   );

     // Variables To Make It Work
   var ImgNum = 0;
   var ImgLength = NewImg.length - 1;
   var delay = 3000;
   var lock = false;
   var run;

   function chgImg(direction)
   {
     if (document.images)
	   {
       // Image Stuff
		   ImgNum = ImgNum + direction;
       if (ImgNum > ImgLength)
	     {
         ImgNum = 0;
       }

       if (ImgNum < 0)
		   {
         ImgNum = ImgLength;
       }

       document.slideshow.src = NewImg[ImgNum];
     }
   }

   function auto()
   {
     if (lock == true)
	   {
       lock = false;
       window.clearInterval(run);
     }
	
     else if (lock == false)
	   {
       lock = true;
       run = setInterval("chgImg(1)", delay);
     }
   }


	 

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000;
// Duration of crossfade (seconds)
var crossFadeDuration = 3;
// Specify the image files
var Pic = new Array();
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = '/images/virtual/smallpic.jpg'
Pic[1] = '/images/virtual/smallpic2.jpg'
Pic[2] = '/images/virtual/smallpic3.jpg'
Pic[3] = '/images/virtual/smallpic4.jpg'

// do not edit anything below this line
var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++) {
preLoad[i] = new Image();
preLoad[i].src = Pic[i];
}
function runSlideShow() {
j = j + 1;
if (j > (p - 1)) j = 0;
t = setTimeout('runSlideShow()', slideShowSpeed);
}


function OpenMeaningPicture(image)
{
  window.open('view_image.php?image='+ image +'', 'image','height=375, width=275');
}

function formHandler(form)
{
  var URL = document.form.site.options[document.form.site.selectedIndex].value;

  window.location.href = URL;
}

function OpenMedia(page)
{
  window.open(''+ page +'','media','height=320, width=400');
}

function DisplayFlowerWinner()
{
  document.write('<table bgcolor="#FFFFCC"><tr><td><font class="small">Kim of Plymouth, MA is the winner of the December 20th drawing!!</font></td></tr></table>');
}


function DisplayRandomTip()
{
  var rand1 = Math.round(Math.random()*5);   
  quotes = new Array
	quotes[0] = 'Place the flower order early.'
  quotes[1] = 'Supply detailed information when ordering flowers.'
  quotes[2] = 'Keep your flower order simple.'
  quotes[3] = 'Ask your florist for suggestions.'
  quotes[4] = 'Deliver flowers early.'
	quotes[5] = 'Order flowers direct from the delivering florist.'
	
  var quote = quotes[rand1]
  document.write('<center><font class="small">'+quote+'</font></center>');
}

function DisplayRandomMeaning()
{
  var rand1 = Math.round(Math.random()*19);   
  quotes = new Array
  quotes[0] = "Acacia-<br>Concealed love, chaste love.";
  quotes[1] = "Ambrosia-<br>Your love is reciprocated.<br>";
  quotes[2] = "Amaryllis-<br>Pride, pastoral poetry.";
  quotes[3] = "Daisy-<br>Innocence, loyal love, purity.";
  quotes[4] = "Aster-<br>Love, daintiness.";
  quotes[5] = "Azalea-<br>Take care of yourself for me, temperance.";
  quotes[6] = "Bachelor Button-<br>Single blessedness";
  quotes[7] = "Forget-Me-Not-<br>True love, memories.";
  quotes[8] = "Bittersweet-<br>Truth.";
  quotes[9] = "Bluebell-<br>Humility.";
  quotes[10] = "Cactus-<br>Endurance.";
  quotes[11] = "Gloxinia-<br>Love at first sight!";
  quotes[12] = "Lily (Calla)-<br>Beauty.";
  quotes[13] = "Cattail-<br>Peace, prosperity.";
  quotes[14] = "Chrysanthemum-<br>You're a wonderful friend. ";
  quotes[15] = "Magnolia-<br>Nobility";
  quotes[16] = "Primrose-<br>I can't live without you.";
  quotes[17] = "Rose (Red)-<br>Love, I love you.";
  quotes[18] = "Rose (White)-<br>Innocence and purity. ";
  quotes[19] = "Violet-<br>Modesty.";
	
  var quote = quotes[rand1]
  document.write('<center><font class="small">'+quote+'</font></center>');
}

function GalleryLarge(image)
{
  window.open('large_view.php?image='+ image +'', 'gallery_image', 'height=375, width=275');
}

function GalleryLarge640x480(image)
{
  window.open('large640x480_view.php?image='+ image +'', 'gallery_image', 'height=580, width=740');
}

function popUp(URL)
{
			day = new Date();
			id = day.getTime();
		
			eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=300,left = 100,top = 100');");
}

