


/*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.purple',
  css: '.sIFR-root {color: #451454; font-size : 38px;}',
  wmode: 'transparent'
});

sIFR.replace(norton, {   
  selector: 'h2.purple',
  css: '.sIFR-root {color: #451454; font-size : 22px;}',
  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'
});

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)
            {
                $.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");
                    } 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");
}