﻿var d = new Date();
var attributes = { id: "playSoundSWF", name: "playSoundSWF" };
swfobject.embedSWF("/media/flash/play_sound.swf?" + d.getTime(), "flashContent", "1", "1", "8", "/Assets/flash/expressInstall", {}, {}, attributes);

function playSound(path) {
    var swf = document.getElementById('playSoundSWF');
    swf.playSound(path);
};

function onSoundComplete() {
    setTimeout("$('#utility-nav a#audio').removeClass('playing')", 750);
};

$(function() {
    // vyvanse pronunciation
    $('#utility-nav a#audio').click(function() {
        if ($('#playSoundSWF').length) {
            $('#utility-nav a#audio').addClass('playing');
            playSound('/media/mp3/vyvanse.mp3');
        }
    });
    
    $("div.symptoms li:nth-child(even)").addClass('even');
    $("div.symptoms li:first-child").addClass('first');
    $("table.guide input[type='radio']").click(function(){
		//dcsMultiTrack('DCS.dcsuri', 'http://vyvanseadult.com/adhd-symptoms-discussion-guide.aspx', 'WT.ti', 'Click_AnswerDiscussionGuide', 'WT.cg_n', 'Click', 'WT.si_p', 'Click_AnswerDiscussionGuide');
    });
    
    // confirm overlay
    var extHref = '';
    $.modal.close();
    $('a.modal').click(function(e) {
        extHref = $(this).attr('rel');
        $('#confirm-overlay').modal({
            overlayClose: true,
            overlayCss: { backgroundColor: "#000" }
        });

        return false;
    });

    $('#confirm-overlay .btn-continue-overlay').click(function() {
        $.modal.close();
        window.open(extHref);
        return false;
    });
    //$('#left-nav ul > li:has(ul)').not('.on').hover(navMouseIn, navMouseOut);
});
//function navMouseIn(){
//	if($(this).hasClass('open')){
//		return false;
//	}else{
//		$(this).addClass('open').children('ul').slideDown();
//	};
//};
//function navMouseOut(){
//	$(this).children('ul').delay(500).slideUp(400,function(){
//		$(this).removeClass('open');
//		$(this).parent().removeClass('open');
//	});
//};
