/* main.js */

////////////////////////////////////
// getE().
// This is used to mung an email address on a web page.
// Input
//      myU:    username
//      myD:    domain name.
//      color:  the color of the text to be displayed.
// e.g. gsherman@aol.com...
//      myU = gsherman
//      myD = aol.com
//      color = whatever.
//      getE("gsher","aol.com","00f");   // note: no # in color.
////////////////////////////////////
function getE(myU, myD, color)
{
    var e1 = "a href=";var e2 = "mai" + "lto";var e3 = "&#64;";
    document.write("<" + e1);document.write('"' + e2);document.write(':');document.write(myU + e3 + myD);
    
    document.write('"');
    document.write(' style="text-decoration:none;" ');
    document.write(">");
    document.write('<span style=\"color:#' + color + ';');
    // add more props here e.g. document.write('text-decoration:none;');
    //document.write('text-decoration:underline;');
    //document.write('font-weight:normal;');
    document.write('\">');
    //alert('<span style=\"color:#' + color + ';' + 'text-decoration:none;' + '\">');
    document.write(myU + e3 + myD);
    document.write('</span>');
    document.write("</a>");
}


function showTopsMenu()
{
    var obj = document.getElementById('tops-menu');
    obj.style.display = 'block';
}

function setImage(img)
{
    alert("setImage");
    if (img == "bodice-1")
    {
        obj = document.getElementById("main");
        obj.child(img).src.value ="images/bonedBodice2.jpg";
    }
    
}


// globals?
var $glblCategory = "something";
var $speed = 1500;
var $catImg = new Object;
var $bodice = new Object;
    $bodice.one     = "images/bonedBodice1.jpg";
    $bodice.two     = "images/bonedBodice2.jpg";
    $bodice.three   = "images/bonedBodice3.jpg";
var $cloak = new Object;
    $cloak.one      = "images/cloak1.jpg";
    $cloak.two      = "images/cloak2.jpg";
    $cloak.three    = "images/cloak3.jpg";
    $cloak.four     = "images/cloak4.jpg";
var $corset = new Object;
    $corset.one     = "images/corsetAndChemise1.jpg";
    $corset.two     = "images/corsetAndChemise2.jpg";
    $corset.three   = "images/corsetAndChemise3.jpg";
var $stay = new Object;
    $stay.one       = "images/stay1.jpg";
    $stay.two       = "images/stay2.jpg";
    $stay.three     = "images/stay3.jpg";    
    $stay.four      = "images/stay4.jpg";    
var $coat = new Object;
    $coat.one       = "images/doubleBreastedCoat1.jpg";
    $coat.two       = "images/doubleBreastedCoat2.jpg";
    $coat.three     = "images/doubleBreastedCoat3.jpg";
    $coat.four      = "images/doubleBreastedCoat4.jpg";
    $coat.five      = "images/doubleBreastedCoat5.jpg";
    $coat.six       = "images/doubleBreastedCoat6.jpg";
var $jacket = new Object;
    $jacket.one     = "images/militaryJacket1.jpg";
    $jacket.two     = "images/militaryJacket2.jpg";
    $jacket.three   = "images/militaryJacket3.jpg";
var $skirt = new Object;
    $skirt.one      = "images/miniskirt1.jpg";
    $skirt.two      = "images/miniskirt2.jpg";
var $cowl = new Object;
    $cowl.one       = "images/cowl1.jpg";
    $cowl.two       = "images/cowl2.jpg";
    $cowl.three     = "images/cowl3.jpg";    
    $cowl.four      = "images/cowl4.jpg"; 
    
var $gCat = ""; 

$(document).ready(function(){

    $(function()
    {   // lightbox
        $('#center-img a').lightBox({
            containerResizeSpeed: 1500,
            overlayBgColor: '#333',
            overlayOpacity: 0.8
        });
    } );


    $("#Bodice").click
    (
        function()
        {
            $catImg.one     = $bodice.one;
            $catImg.two     = $bodice.two;
            $catImg.three   = $bodice.three;
        }
    );
    
    $("#Cloak").click
    (
        function()
        {
            $catImg.one     = $cloak.one;
            $catImg.two     = $cloak.two;
            $catImg.three   = $cloak.three;
            $catImg.four    = $cloak.four;
        }
    );

    $("#Corset").click
    (
        function()
        {
            $catImg.one     = $corset.one;
            $catImg.two     = $corset.two;
            $catImg.three   = $corset.three;
        }
    );

    $("#Stays").click
    (
        function()
        {
            $catImg.one     = $stay.one;
            $catImg.two     = $stay.two;
            $catImg.three   = $stay.three;
            $catImg.four    = $stay.four;            
        }
    );


    $("#Coat").click
    (
        function()
        {
            $catImg.one     = $coat.one;
            $catImg.two     = $coat.two;
            $catImg.three   = $coat.three;
            $catImg.four    = $coat.four;
            $catImg.five    = $coat.five;
            $catImg.six     = $coat.six;
        }
    );

    $("#Jacket").click
    (
        function()
        {
            $catImg.one     = $jacket.one;
            $catImg.two     = $jacket.two;
            $catImg.three   = $jacket.three;
        }
    );

    $("#Skirt").click
    (
        function()
        {
            $catImg.one     = $skirt.one;
            $catImg.two     = $skirt.two;
        }
    );
    
     $("#Cowl").click
        (
            function()
            {
                $catImg.one     = $cowl.one;
                $catImg.two     = $cowl.two;
                $catImg.three   = $cowl.three;
                $catImg.four    = $cowl.four;
            }
    );


    
/************************** not doing the following anymore!
    $(".category").click
    (
        function(event)
        {
            var $cat = $(event.target).text();

            $catImg.cat = $cat;

            $catImg.cat = $gCat;
            
            $cat = $gCat;
            
            if ($cat == "Bodice")
            {
                $catImg.one     = $bodice.one;
                $catImg.two     = $bodice.two;
                $catImg.three   = $bodice.three;
            }
            if ($cat == "Cloak")
            {
                $catImg.one     = $cloak.one;
                $catImg.two     = $cloak.two;
                $catImg.three   = $cloak.three;
                $catImg.four    = $cloak.four;
            }
            if ($cat == "Corset")
            {
                $catImg.one     = $corset.one;
                $catImg.two     = $corset.two;
                $catImg.three   = $corset.three;
            }
            if ($cat == "Stays")
            {
                $catImg.one     = $stay.one;
                $catImg.two     = $stay.two;
                $catImg.three   = $stay.three;
                $catImg.four    = $stay.four;
            }
            if ($cat == "Coat")
            {
                $catImg.one     = $coat.one;
                $catImg.two     = $coat.two;
                $catImg.three   = $coat.three;
                $catImg.four    = $coat.four;
                $catImg.five    = $coat.five;
                $catImg.six     = $coat.six;
            }
            if ($cat == "Skirt")
            {
                $catImg.one     = $skirt.one;
                $catImg.two     = $skirt.two;
            }
            if ($cat == "Jacket")
            {
                $catImg.one     = $jacket.one;
                $catImg.two     = $jacket.two;
                $catImg.three   = $jacket.three;
            }
            if ($cat == "Cowl")
            {
                $catImg.one     = $cowl.one;
                $catImg.two     = $cowl.two;
                $catImg.three   = $cowl.three;
                $catImg.four    = $cowl.four;
            }
        }
    )

*******************/

    $(".one").click
    (
        function(event)
        {
            var $theImage = $catImg.one;
            $("#center-img").hide();
            $("#center-img").find("a").attr("href", $theImage);
            $("#center-img").find("img").attr("src", $theImage);
            $("#center-img").slideDown($speed);
        }
    );

    $(".two").click
    (
        function(event)
        {
            var $theImage = $catImg.two;
            $("#center-img").hide();
            $("#center-img").find("a").attr("href", $theImage);
            $("#center-img").find("img").attr("src", $theImage);
            $("#center-img").slideDown($speed);
        }
    );

    $(".three").click
    (
        function(event)
        {
            var $theImage = $catImg.three;
            $("#center-img").hide();
            $("#center-img").find("a").attr("href", $theImage);
            $("#center-img").find("img").attr("src", $theImage);
            $("#center-img").slideDown($speed);
        }
    );

    $(".four").click
    (
        function(event)
        {
            var $theImage = $catImg.four;
            $("#center-img").hide();
            $("#center-img").find("a").attr("href", $theImage);
            $("#center-img").find("img").attr("src", $theImage);
            $("#center-img").slideDown($speed);
        }
    );

    $(".five").click
    (
        function(event)
        {
            var $theImage = $catImg.five;
            $("#center-img").hide();
            $("#center-img").find("a").attr("href", $theImage);
            $("#center-img").find("img").attr("src", $theImage);
            $("#center-img").slideDown($speed);
        }
    );

    $(".six").click
    (
        function(event)
        {
            var $theImage = $catImg.six;
            $("#center-img").hide();
            $("#center-img").find("a").attr("href", $theImage);
            $("#center-img").find("img").attr("src", $theImage);
            $("#center-img").slideDown($speed);
        }
    );


            });     // end jquery
