//Random Image script for home page/

<!-- Begin
// Set up the image files to be used.
var theImages = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array.

theImages[0] = 'images/rotate/rotate_0017.jpg'
theImages[1] = 'images/rotate/rotate_barrette1.jpg'
theImages[2] = 'images/rotate/rotate_0057.jpg'
theImages[3] = 'images/rotate/rotate_0066.jpg'

// do not edit anything below this line

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}

//  End -->

/**************************
POP up Script for products
*************************/
<!-- Idea by:  Nic Wolfe (Nic@TimelapseProductions.com) -->
<!-- Web URL:  http://fineline.xs.mw -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=510,height=300,left = 321,top = 282');");
}
// End -->

/***************************************
Order Page
******************************************/

<!-- hide from old browsers...

/*     dynamic select menus -- written by Matt Reinfeldt
        feel free to use, modify, copy, distribute, and otherwise abuse this code!
        if you find any problems, let me know, and I will try to find a fix for it.
*/

var info = new Array(
    "Any*Barrettes|Broaches|Glass on Glass Broaches & Tie Tacks|Hair Sticks|Hair Combs|Alligator Clips|Hair Forks|Sea Glass Chronicles",
    "Athena*Barrettes|Broaches|Glass on Glass Broaches & Tie Tacks|Hair Sticks|Hair Combs|Alligator Clips|Hair Forks",
    "Venus*Barrettes|Broaches",
    "Pandora*Barrettes|Broaches|Hair Sticks|Hair Combs|Hair Forks"
);

/******************************************************************************************************/

function stringSplit ( string, delimiter ) { 
    if ( string == null || string == "" ) { 
        return null; 
    } else if ( string.split != null ) { 
        return string.split ( delimiter ); 
    } else { 
        var ar = new Array(); 
        var i = 0; 
        var start = 0; 
        while( start >= 0 && start < string.length ) { 
             var end = string.indexOf ( delimiter, start ) ; 
             if( end >= 0 ) { 
                 ar[i++] = string.substring ( start, end ); 
                 start = end+1; 
             } else { 
                 ar[i++] = string.substring ( start, string.length ); 
                 start = -1; 
             } 
        } 
        return ar; 
    } 
} 
/******************************************************************************************************/
var menu1 = new Array();
var menu2 = new Array();
/******************************************************************************************************/
function createMenus () {

    for ( var i=0; i < info.length; i++ ) {
        menu1[i] = stringSplit ( info[i], '*' );
        menu2[i] = stringSplit ( menu1[i][1], '|' );
    }

    var styles = document.myForm.stylesdd;
    var accessory = document.myForm.accessoriesdd;

    styles.length = menu1.length;
    accessory.length = menu2[0].length; 
    for ( var i=0; i < menu1.length; i++ ) {
         styles.options[i].value  = menu1[i][0];
         styles.options[i].text   = menu1[i][0];
    }
    document.myForm.stylesdd.selected = 0;
    for (var x=0; x < menu2[0].length; x++) {
         accessory.options[x].text = menu2[0][x];
         accessory.options[x].value = menu2[0][x];
    }         
    document.myForm.accessoriesdd.selected = 0;
}

/******************************************************************************************************/

function updateMenus ( what ) {
    var sel = what.selectedIndex;

    if ( sel >= 0 && sel < menu1.length ) 
        var temp = menu2[sel];
    else
        var temp = new Array ();
    
    what.form.accessoriesdd.length = temp.length;

    for ( var i = 0; i < temp.length; i++ ) {
        what.form.accessoriesdd.options[i].text  = temp[i];
        what.form.accessoriesdd.options[i].value = temp[i];
    }
    what.form.accessoriesdd.selected=0;
}
// end of hiding -->

