


/*clears form values*/
function clearText(field){
if (field.defaultValue==field.value)
field.value = ""
} 


/*siFr start*/

var norton = { src: '/swf/norton.swf'};

var freestyle = { src: '/swf/freestyle.swf'};

sIFR.compatMode = true;

sIFR.activate(freestyle, norton);

sIFR.replace(norton, {
    selector: 'h1.general',
    css: '.sIFR-root {color: #ffffff; font-size : 36px;}',
    wmode: 'transparent'
});

sIFR.replace(norton, {
    selector: 'h1.homeheading',
    css: '.sIFR-root {color: #ffffff; font-size : 28px; line-height:10px;}',
    wmode: 'transparent'
});

sIFR.replace(norton, {
selector: 'h1.homeheadingF1DC8B',
css: '.sIFR-root {color: #F1DC8B; font-size : 28px; line-height:10px;}',
    wmode: 'transparent'
});

sIFR.replace(norton, {
    selector: 'h2.subtitle',
    css: '.sIFR-root {color: #ffffff; font-size : 22px;}',
    wmode: 'transparent'
});

sIFR.replace(norton, {
    selector: 'h2.brown',
    css: '.sIFR-root {color: #6f311c; font-size : 24px;}',
    wmode: 'transparent'
});

sIFR.replace(norton, {
    selector: 'h2.purple-small',
    css: '.sIFR-root {color: #451454; font-size : 24px;}',
    wmode: 'transparent'
});

sIFR.replace(norton, {
    selector: 'h1.purple-small',
    css: '.sIFR-root {color: #451454; font-size : 24px;}',
    wmode: 'transparent'
});

sIFR.replace(norton, {   
  selector: 'h1.purple',
  css: '.sIFR-root {color: #451454; font-size : 38px;}',
  wmode: 'transparent'
});

sIFR.replace(freestyle, {
    selector: 'h1.purpleItalic',
    css: '.sIFR-root {color: #451454; font-size : 68px;}',
    wmode: 'transparent'
});

sIFR.replace(freestyle, {
       selector: 'h1.purpleItalicCenter',
    css: '.sIFR-root {color: #451454; font-size : 68px;text-align:center}',
    wmode: 'transparent'
});

sIFR.replace(freestyle, {
    selector: 'h2.purpleItalic',
    css: '.sIFR-root {color: #451454; font-size : 40px;}',
    wmode: 'transparent'
});

sIFR.replace(norton, {   
  selector: 'h2.purple',
  css: '.sIFR-root {color: #451454; font-size : 22px;}',
  wmode: 'transparent'
});

sIFR.replace(norton, {
    selector: 'h2.about_curry',
    css: '.sIFR-root {color: #451454; font-size : 22px;}',
    wmode: 'transparent'
});

sIFR.replace(norton, {
    selector: 'h2.spice_guide',
    css: '.sIFR-root {color: #451454; font-size : 18px;}',
    wmode: 'transparent'
});


sIFR.replace(norton, {   
  selector: 'h2.news',
  css: '.sIFR-root {color: #451454; font-size : 18px;}',
  wmode: 'transparent'
});


sIFR.replace(norton, {   
  selector: 'h3.purple',
  css: '.sIFR-root {color: #451454; font-size : 16px;}',
  wmode: 'transparent'
});

sIFR.replace(norton, {   
  selector: 'h2.list',
  css: '.sIFR-root {color: #451454; font-size : 16px; }',
  wmode: 'transparent'
});

sIFR.replace(norton,
    {
        selector: 'h3.videoTitle',
        css: '.sIFR-root {color: #451454; font-size : 24px; text-align: center; }',
        wmode: 'transparent',
        selectable: false,
        filters:
        {
            Glow:
            {
                knockout: false,
                //distance: 1,
                color: '#ffffff',
                strength: 5
            }
        }
    });

sIFR.replace(freestyle, {   
  selector: 'h1.sub',
  css: '.sIFR-root {color: #ffffff; font-size : 48px;}',
  wmode: 'transparent'
});

sIFR.replace(freestyle, {   
  selector: 'h1.djspan span',
  css: '.sIFR-root {color: #ffffff; font-size : 42px; leading: -15;}',
  wmode: 'transparent'
});

sIFR.replace(freestyle, {   
  selector: 'h2.dj, h1.dj',
  css: '.sIFR-root {color: #ffffff; font-size : 48px; line-height : 1em}',
  wmode: 'transparent'
});

sIFR.replace(freestyle, {   
  selector: 'h2.dj',
  css: '.sIFR-root {color: #ffffff; font-size : 46px; line-height : 1em}',
  wmode: 'transparent'
});

sIFR.replace(freestyle, {   
  selector: 'h2.black',
  css: '.sIFR-root {color: #000000; font-size : 40px;}',
  wmode: 'transparent'
});

sIFR.replace(freestyle, {   
  selector: 'h1.red',
  css: '.sIFR-root {color: #b3105a; font-size : 42px;}',
  wmode: 'transparent'
});

sIFR.replace(freestyle, {   
  selector: 'h2.red',
  css: '.sIFR-root {color: #b3105a; font-size : 40px;}',
  wmode: 'transparent'
});
sIFR.replace(freestyle, {
    selector: 'h1.redCurryClub',
    css: '.sIFR-root {color: #b3105a; font-size : 30px;}',
    wmode: 'transparent'
});



var now = new Date();
$(function () {
    if ($(".flowpanes").length > 0)
        $(".flowpanes").scrollable({ size: 1, loop: true });
    if ($("ul.tabs").length > 0) {
        var mth = $.query.get('mth') ? $.query.get('mth') - 1 : now.getMonth();
        $("ul.tabs").tabs("div.seasonPanes > div", { initialIndex: mth });
        DD_belatedPNG.fix('ul.tabs li a.current');
    }
    if ($("#productInfoAccordion").length > 0) {
        jQuery(document).ready(function () {
            $('#productInfoAccordion h3').click(function () {
                var h = $(this)
                h.next().slideToggle(150, function () {
                    if ($(this).css('display') == 'none')
                        h.children('a').css('background-image', 'url(/images/ic_expand.png)');
                    else
                        h.children('a').css('background-image', 'url(/images/ic_collapse.png)');
                });
                return false;
            }).next().hide();
            $('#productInfoAccordion h3:first').click();
        });

        //$('#productInfoAccordion').ui.accordion({ active: 0, header: 'h3' });
    }
    if ($("select.contactList").length > 0) {
        $("select.contactList").change(function () {
            $("#distributorAddress").load("Distributor.aspx", { 'distributorguid': $("select.contactList").val() });
        });
    }

    if ($('.star input[type=radio]').length > 0) {
        $('.star input[type=radio]').rating({ callback: function (value, link) {
            if (parseInt(value) > 0) {
                $ctrl = $(this);
                $.ajax({
                    url: "/recipes/rate-recipe.aspx",
                    type: "POST",
                    data: 'id=' + $('#recipeGUID').html() + '&rating=' + value,
                    complete: function (req) {
                        if (req.status == 200) { //success
                            $('#ratingSuccess').html("Thank you for rating the recipe");
                            $ctrl.rating('readOnly');
                        } else { //failure
                            $('#ratingSuccess').html("Sorry a problem occured while rating");
                        }
                    }
                });
            }
        }
        });
    }

    //    if ($.cookie('CssImagesPreloaded' != 'true')) { // preloading routine is slow, so just do it once.
    //        $.preloadCssImages();  
    //        $.cookie('CssImagesPreloaded', 'true');
    //    }
});

function doJqueryNETPostBack(eventTarget, eventArgument)
{
    if (!theForm.onsubmit || (theForm.onsubmit() != false))
    {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}


/*SiFr End*/

function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
   var obj = document.layers ? document.layers[szDivID] :
   document.getElementById ?  document.getElementById(szDivID).style :
   document.all[szDivID].style;
   obj.display = document.layers ? (iState ? "show" : "hide") :
   (iState ? "block" : "none");
}
