var Plavix = Plavix || {};

Plavix.Utils = Plavix.Utils || {};

Plavix.Utils.noPrint = function(id_value) {
   if ($('#'+id_value+':checked').attr('checked')) {
      $('#group_'+id_value).removeClass("noPrint");          
   }
   else{
     $('#group_'+id_value).addClass("noPrint");
   }   
}

Plavix.Utils.Text = function() {

    //Private variables
    var that = this;
    var size = 13;
    var Hsize = 18;
    var COOKIE_NAME = 'text_size';
    var COOKIE_LH = 'line_height';

    //Public methods
    this.setText = function() {
	var imcPage = ($('#heart-medications-chart').length > 0) ? true : false;

	if (!imcPage) {
        if (jQuery.cookie) {
            if ($.cookie(COOKIE_NAME)) {
                var mainContP = $('.subPage #mainContent p');
                var mainContLi = $('.subPage #mainContent li');
                var mainContStrong = $('.subPage #mainContent strong');
                var mainContH = $('.subPage #mainContent h3');
                var textSizeP = $('.subPage #contentCol #mainContent .textResize p');
                var xlineHeight;

                if ($.cookie(COOKIE_NAME)) {
                    var csize = $.cookie(COOKIE_NAME) - 13;
                    mainContP.css('font-size', $.cookie(COOKIE_NAME) + "px");
                    mainContLi.css('font-size', $.cookie(COOKIE_NAME) + "px");
                    mainContStrong.css('font-size', $.cookie(COOKIE_NAME) + "px");
                    var hcsize = csize + 18;
                    mainContH.css('font-size', hcsize + "px");
                }
                //alert(clineHeight);
                if ($.cookie(COOKIE_LH)) {
                    clineHeight = $.cookie(COOKIE_LH);
                    mainContP.css('line-height', clineHeight + 'px');
                    mainContLi.css('line-height', clineHeight + 'px');
                }
                textSizeP.css('font-size', '9px');
                textSizeP.css('line-height', '18px');
                $('.subPage #contentCol #mainContent p.note').css('font-size', '11px');
            }
            else {
                //No cookie exists, create new cookie
                that.createCookie('13');
            }
        }
	}
    };

    this.textSize = function(value) {
	var imcPage = ($('#heart-medications-chart').length > 0) ? true : false;
	if (!imcPage) {
        var mainContP = $('.subPage #mainContent p');
        var mainContLi = $('.subPage #mainContent li');
        var mainContStrong = $('.subPage #mainContent strong');
        var mainContH = $('.subPage #mainContent h3');
        var mainContH4 = $('.subPage #mainContent h4');
        var textSizeP = $('.subPage #contentCol #mainContent .textResize p');
        var nlineHeight = "";
        size = parseInt(mainContP.css("font-size").replace("px", ""), 10);
        if (mainContH.css("font-size") !== undefined) {
            Hsize = parseInt(mainContH.css("font-size").replace("px", ""), 10);
        }
        if (mainContH4.css("font-size") !== undefined) {
            Hsize4 = parseInt(mainContH4.css("font-size").replace("px", ""), 10);
        }
        var lineHeight = parseInt(mainContP.css("line-height").replace("px", ""), 10);

        if (size == 13 && value == "less") {
            //alert("test");
            //do nothing
        } else if (size > 13 && value == "less") {
            //alert(size);
            textSizeP.css('font-size', '9px');
            //console.log(size);
            mainContP.css('font-size', size - 1 + "px");
            mainContLi.css('font-size', size - 1 + "px");
            mainContStrong.css('font-size', size - 1 + "px");
            mainContH.css('font-size', Hsize - 1 + "px");
            if (mainContH4.css("font-size") !== undefined) {
                mainContH4.css('font-size', Hsize4 - 1 + "px");
            }
            nlineHeight = lineHeight - 1 + "px";
            mainContP.css('line-height', nlineHeight);
            mainContLi.css('line-height', nlineHeight);
            textSizeP.css('font-size', '9px');
            textSizeP.css('line-height', '18px');
            $('.subPage #contentCol #mainContent p.note').css('font-size', '11px');
            $.cookie(COOKIE_NAME, size - 1, { path: '/', expires: 365 });
            $.cookie(COOKIE_LH, lineHeight - 1, { path: '/', expires: 365 });

        } else if ((size <= 13 || size < 16) && value == "more") {
            mainContP.css('font-size', size + 1 + "px");
            mainContLi.css('font-size', size + 1 + "px");
            mainContStrong.css('font-size', size + 1 + "px");
            mainContH.css('font-size', Hsize + 1 + "px");
            if (mainContH4.css("font-size") !== undefined) {
                mainContH4.css('font-size', Hsize4 + 1 + "px");
            }
            nlineHeight = lineHeight + 1 + "px";
            mainContP.css('line-height', nlineHeight);
            mainContLi.css('line-height', nlineHeight);
            textSizeP.css('font-size', '9px');
            textSizeP.css('line-height', '18px');
            $('.subPage #contentCol #mainContent p.note').css('font-size', '11px');
            $.cookie(COOKIE_NAME, size + 1, { path: '/', expires: 365 });
            $.cookie(COOKIE_LH, lineHeight + 1, { path: '/', expires: 365 });
        }
	}
    };

    this.textBind = function() {
        $('.less').click(function() {
            that.textSize('less');
        });

        $('.more').click(function() {
            that.textSize('more');
        });
    };

    this.createCookie = function(which) {
        $.cookie(COOKIE_NAME, which, { path: '/', expires: 365 });
    };
}; //End Plavix.Utils.Text Module


Plavix.Utils.checkAll = function() {
    $("#checkboxall").click(function() {
        var checked_status = this.checked;
        $("input[@type=checkbox]").each(function() {
            this.checked = checked_status;
            
        });       
        Plavix.Utils.noPrint('q0');
        Plavix.Utils.noPrint('q1');
        Plavix.Utils.noPrint('q2');
        Plavix.Utils.noPrint('q3');
        Plavix.Utils.noPrint('q4');
        Plavix.Utils.noPrint('q5');
        Plavix.Utils.noPrint('q7');
        Plavix.Utils.noPrint('q8');
        Plavix.Utils.noPrint('q9');
        Plavix.Utils.noPrint('q10');
        Plavix.Utils.noPrint('q11');
        Plavix.Utils.noPrint('q12');
        Plavix.Utils.noPrint('q13');
        Plavix.Utils.noPrint('q14');
        Plavix.Utils.noPrint('q15');
        Plavix.Utils.noPrint('q16');
    });
};

Plavix.Utils.toggleCheckBoxes = function(state) {
    if (state == 'on') {
        $("input[@type=checkbox]").each(function() {
            this.style.display = '';
        });
    }
    else { //off
        $("input[@type=checkbox]").each(function() {
            this.style.display = 'none';
        });
    }
};

Plavix.Utils.print = function(){
    window.print(); 
};

Plavix.Utils.listPrint = function() {
    $("#listPrint").click(function() {
        /* doesn't work
        $("input[@type=checkbox]").each(function() {
            if (!$(this).is(":checked")) {
                $(this).parent("li").addClass("noPrint");
            }
        });
        */
        window.print(); 
    });
};

Plavix.Utils.moveObject = function (toplink, div) {
    var width = 532;
    if (navigator) {
        if (navigator.appVersion.indexOf('MSIE 6') != -1) {
            document.getElementById('interstitial2').style.left = '50%';
            if (toplink == 3) {
                document.getElementById('interstitial2').style.top = '0';
                document.getElementById('interstitial2').style.marginTop = '700px';
            } else {
                document.getElementById('interstitial2').style.top = 'auto';
                document.getElementById('interstitial2').style.marginTop = '-300px';
            }
            document.getElementById('interstitial3').style.left = 484;
            if (document.getElementById('interstitial4') != null) {
                document.getElementById('interstitial4').style.left = 484;
            }
            if (document.getElementById('interstitial5') != null) {                
                document.getElementById('interstitial5').style.left = '50%';
		/* New Added*/
                document.getElementById('interstitial5').style.height = '245px';
               //document.getElementById('interstitial5').style.marginLeft = "-" + width / 2 + "px";
	       /* End of New Added*/
	       /* In Latest Version */
	       /*
	         document.getElementById('interstitial5').style.marginLeft = "-" + width / 2 + "px";
	       */
                
            }
        }
    }
    document.getElementById('interstitial2').style.marginLeft = "-" + width / 2 + "px";
    document.getElementById('interstitial3').style.marginLeft = "-" + width / 2 + "px";
    if (document.getElementById('interstitial4') != null) {
        document.getElementById('interstitial4').style.marginLeft = "-" + width / 2 + "px";
    }
    var interstitialClass = "";
    if (toplink == 3) {
        interstitialClass = "midlink";
    } else if (toplink) {
        interstitialClass = "toplink"
    } else {
        interstitialClass = "btmlink";
    }
    document.getElementById('interstitial2').className = interstitialClass;
    document.getElementById('interstitial3').className = interstitialClass;
    if (document.getElementById('interstitial4') != null) {
        document.getElementById('interstitial4').className = interstitialClass;
    }
};
Plavix.Utils.position = function(value) {
    if(navigator){
		if(navigator.appVersion.indexOf('MSIE 6') != -1) {
		    //IE6 hack - reset the popup
		    document.getElementById('interstitial2').style.marginTop = "-"+value+"px";
		    document.getElementById('interstitial3').style.marginTop = "-"+value+"px";
		    if (document.getElementById('interstitial4') != null) {
                document.getElementById('interstitial4').style.marginTop = "-" + value + "px";
            }
	    /*Code already exist*/
		    if (document.getElementById('interstitial5') != null) {
                document.getElementById('interstitial5').style.marginTop = "-" + value + "px";
            }
	    /*End of Code already exist*/            
		}
	}
    
}
Plavix.Utils.toggleInterstitial = function(top, url, type, e) {
    var toplink = (top == "top") ? 1 : 0;
    toplink = (top == "aa") ? 2 : toplink;
    toplink = (top == "mid") ? 3 : toplink;
    var interstitial = (type == "hcp") ? document.getElementById('interstitial3') : document.getElementById('interstitial2');
	interstitial = (type == "bms") ? document.getElementById('interstitial5') : interstitial;
    if (url == 'close') {
        interstitial.style.display = "none";
        return false;
    }
	else if(url == 'downloadHeart') {
		$('#downloadHeart').show();
	}
	else {
        Plavix.Utils.moveObject(toplink, interstitial);
        if ($('#abiVideo')) {
            $('#abiVideo').hide();
        }
        if ($('#moaVideo')) {
            //call flash to reset the scrubber
            try {
                document.getElementById('moa_video').closeVideoPlayer();
            }
            catch (exception) { }
        }
        if ($('#downloadHeart')) {
            $('#downloadHeart').hide();
        }
        if ($('#downloadStroke')) {
            $('#downloadStroke').hide();
        }
        if ($('#downloadPAD')) {
            $('#downloadPAD').hide();
        }
        if ($('#downloadHRG')) {
            $('#downloadHRG').hide();
        }
        if ($('#downloadSRG')) {
            $('#downloadSRG').hide();
        }
	if ($('#interstitial2')) {
            $('#interstitial2').hide();
        }
        if ($('#interstitial3')) {
            $('#interstitial3').hide();
        }
        if ($('#interstitial5')) {
            $('#interstitial5').hide();
        }
        if (type != "hcp") {
		if (type == "bms") {
                document.getElementById('go5').href = url;
                $('#interstitial5').hide();
            } else {
            document.getElementById('go').href = url;
            $('#interstitial3').hide();
            }
	}
        else {

            document.getElementById('go2').href = url;
            document.getElementById('go2').onclick = function() {
                if ($('#interstitial3')) {
                    $('#interstitial3').hide();
                }
            };
            $('#interstitial2').hide();

        }
        interstitial.style.display = "block";
    }
    return false;
};

Plavix.Utils.toggleDownload = function(top, url, e) {

	$(".download").hide();

    var download;
    var toplink = (top == "top") ? 1 : 0;
    if (url == "downloadHeart") {
        download = document.getElementById('downloadHeart');
    }
    else if (url == "downloadStroke") {
        download = document.getElementById('downloadStroke');
    }
    else if (url == "downloadPAD") {
        download = document.getElementById('downloadPAD');
    }
    else if (url == "downloadHRG") {
        download = document.getElementById('downloadHRG');
    }
    else if (url == "downloadSRG") {
        download = document.getElementById('downloadSRG');
    }
    
    if (url == 'close') {
        $(".download").hide();
        return false;
    } else {
        Plavix.Utils.moveObject(toplink, download);
        if ($('#abiVideo')) {
            $('#abiVideo').hide();
        }
        if ($('#moaVideo')) {
            $('#moaVideo').hide();
        }
        if ($('#downloadHeart')) {
            $('#downloadHeart').hide();
        }
        if ($('#downloadStroke')) {
            $('#downloadStroke').hide();
        }
        if ($('#downloadPAD')) {
            $('#downloadPAD').hide();
        }
        if ($('#downloadHRG')) {
            $('#downloadHRG').hide();
        }
        if ($('#downloadSRG')) {
            $('#downloadSRG').hide();
        }
        if ($('#interstitial2')) {
            $('#interstitial2').hide();
        }
        if ($('#interstitial3')) {
            $('#interstitial3').hide();
        }
        if ($('#interstitial4')) {
            $('#interstitial4').hide();
        }
        if ($('#interstitial5')) {
            $('#interstitial5').hide();
        }
        download.style.display = "block";
    }

    return false;
};

Plavix.Utils.toggleMOA = function() {

    /*
    if (navigator) {
    if (navigator.appVersion.indexOf('MSIE 6') != -1) {
    Plavix.Utils.toggleCheckBoxes('on');
    }
    }
    */

    //document.getElementById('moaVideo').style.left = "-10000px";
    $('#moaVideo').hide();

    if (PlavixVideo) {
        PlavixVideo.counter++;
        PlavixVideo.videoState = "pause";
    }
};

//Plavix VideoPlayer Module
Plavix.VideoPlayer = function() {
    this.counter = 0;
    this.videoState = "pause";
};

Plavix.VideoPlayer.trackEvent = function(id, e) {
    //unica tracking for videos
    ntptEventTag("ev=" + id + "_" + e);
};

Plavix.VideoPlayer.prototype = {

    displaySWF: function () {
        $('#moaVideo').show();
	/* New Version Code*/
        //$('#moaVideo').playMoa();
    },

    displayPlaySWF: function () {
        /*(if (navigator.appVersion.indexOf('MSIE 6') != -1) {
        //document.getElementById('moaVideo').style.left = "0px";
        $('#moaVideo').show();
        }
        else {
        //document.getElementById('moaVideo').style.left = "50%";
        $('#moaVideo').show();
        }*/
        $('#moaVideo').show();
        if ($('#moa_video').length > 0) {
            //document.getElementById("moa_video").playVideoPlayer();
            //document.getElementById("moa_video").playVideo();
        }
	/*Code Already exist*/
        //document.getElementById("moa_video").playVideoPlayer();
    },

    stopHideSWF: function () {
        if ($('#moa_video').length > 0) { document.getElementById("moa_video").closeVideoPlayer(); }
        //document.getElementById('moaVideo').style.left = "-10000px";
        $('#moaVideo').hide();
    },

    hide: function() {
        $('#moaVideo').hide();
        this.videoState = "pause";
    },

    displayPlayHideSWF: function() {

        if ($('#downloadHeart')) {
            $('#downloadHeart').hide();
        }

        if ($('#downloadStroke')) {
            $('#downloadStroke').hide();
        }

        if ($('#downloadPAD')) {
            $('#downloadPAD').hide();
        }

        if ($('#downloadHRG')) {
            $('#downloadHRG').hide();
        }

        if ($('#downloadSRG')) {
            $('#downloadSRG').hide();
        }

        if ($('#interstitial2')) {
            $('#interstitial2').hide();
        }

        if (this.counter === 0) {
            if (navigator) {
                if (navigator.appVersion.indexOf('MSIE 6') != -1) {
                    //Plavix.Utils.toggleCheckBoxes('off');
                }
            }
            this.displaySWF();
            this.counter++;
            this.videoState = "play";
        }
        else {
            if (this.videoState == "play") {
                this.stopHideSWF();
                this.videoState = "pause";
            }
            else {
                this.displayPlaySWF();
                this.videoState = "play";
            }
        }
    },

    playFLV: function(id) {
        var vidThumb = document.getElementById('thumb' + id);

        if (vidThumb.src.indexOf('_active') == -1) {
            vidThumb.src = vidThumb.src.replace('.jpg', '_active.jpg');
        }
        var flvArray = ["heartAttack.flv", "father_daughterNew.flv", "stroke.flv"];
        //var flvArray = ["coming_soon.flv", "coming_soon.flv", "coming_soon.flv"];
        var titleArray = ["Heart Attack (caused by a <br />clot) Video", "P.A.D. Video: Father/Daughter", "Stroke Video"];
        $(".vidTitle").empty();
        $(".vidTitle").append(titleArray[id]);
        var playerDiv = $('#player');
        playerDiv.innerHTML = "<div id=\"flvHolder\"></div>";
        var flashvars = { flvPath: flvArray[id] };
        var params = { wmode: "transparent" };
        var attributes = {};
	/* New version code */
        swfobject.embedSWF('../media/videos.swf', 'flvHolder', '334', '290', '8.0.0', '../media/expressInstall.swf', flashvars, params, attributes);
    }

};

Plavix.Utils.showAnnouncement = function() {
if($(".article").length < 0) {
	var articles = $("#newsHeadlines .article"); //get all the article DOM elements
	
	//get the last news article the user saw from their cookies
	var lastHeadline = $.cookie("plavixHeadline");
	var currentHeadline = 0; //init variable
	
	//if first time visitor, they wont have that cookie
	if(lastHeadline == null) {
		currentHeadline = 0;
	}
	//otherwise set the next article in sequence
	else {
		currentHeadline = parseInt(lastHeadline);
		//if at the end of the sequence, return to the beginning
		if(currentHeadline == articles.length-1) {
			currentHeadline = 0;
		}
		else {
			currentHeadline = currentHeadline + 1;
		}
	}
	
	//show an article
	articles.eq(currentHeadline).show();
	
	//save to cookie when leaving the page
	$(window).unbind("unload").unload(function() {
		$.cookie("plavixHeadline", currentHeadline, { expires: 10 });
	});
}			
};


Plavix.Utils.cycleAnnouncements = function() {
	//-- Rotating version of showAnnouncement
	
	
	//config
	var speed = 10000; //set speed in milliseconds you want article to display for
	var clearHistory = 10; //set how many days you want the browser to remember the news story cycle position
	
	var timer;
	var articles = $("#newsHeadlines .article"); //get all the article DOM elements
	
	//get the last news article the user saw from their cookies
	var lastHeadline = $.cookie("plavixHeadline");
	var currentHeadline = 0; //init variable
	
	//if first time visitor, they wont have that cookie
	if(lastHeadline == null) {
		currentHeadline = 0;
	}
	//otherwise set the next article in sequence
	else {
		currentHeadline = parseInt(lastHeadline);
		setHeadline();
	}
	
	//show the first article
	articles.eq(currentHeadline).fadeIn("normal", function() {
		setHistory();
		//Start the timer when it finishs fading in
		timer = setInterval(cycle, speed);
	});
	
	function cycle() {
		//fade out the current headline
		articles.eq(currentHeadline).fadeOut("normal", function() {
			//when finished, set the next headline and fade it in.
			setHeadline();
			articles.eq(currentHeadline).fadeIn("normal", function() {
				//when complete set reset the page unload event to write the cookie
				setHistory();
			});
		});
	}
	
	function setHeadline() {
		//gets the next headline in sequence
		//if at the end of the sequence, return to the beginning
		if(currentHeadline == articles.length-1) {
			currentHeadline = 0;
		}
		else {
			currentHeadline = currentHeadline + 1;
		}
	}
	
	function setHistory() {
		//remembers the last viewed article
		//sets the event when you leave the page to write a cookie for the last article seen
		$(window).unbind("unload").unload(function() {
			$.cookie("plavixHeadline", currentHeadline, { expires: 10 });
		});
	}

};


// original mega menu hover
Plavix.Utils.DropDowns = function () {
    $('#nav li').hover(function () {
        $(this).children('.dropdown').css('display', 'block');
    }, function () {
        $(this).children('.dropdown').css('display', 'none');
    });
    $('.dropdown').append("<div class=\"ddcover\"></div>"); // Add a background div for ie6
}
/*
// New Version Code
// mega menu now includes hoverintent
// dependent on scripts/jquery.hoverintent.js
Plavix.Utils.DropDowns = function () {

	$("#nav li").hoverIntent(mmShow, mmHide);

	$('.dropdown').append("<div class=\"ddcover\"></div>"); // Add a background div for ie6

	function mmShow() { $(this).children('.dropdown').css('display', 'block'); }
	function mmHide() { $(this).children('.dropdown').css('display', 'none'); }

}
*/


Plavix.unicaTracking = function(command, args) {
    if (null == args) {
        return;
    }
    var tmpargs = args.split(",");
    if (command == "ntptEventTag") {
        (0 == tmpargs[0].length) ? ntptEventTag() : ntptEventTag(tmpargs[0]);
    }
    else if (command == "ntptAddPair") {
        if (2 != tmpargs.length) {
            return;
        }
        else {
            ntptAddPair(tmpargs[0], tmpargs[1]);
        }
    }

    else if (command == "ntptDropPair") {
        if (1 != tmpargs.length) {
            return;
        }
        else {
            ntptDropPair(tmpargs[0]);
        }
    }
};


Plavix.Utils.formDefaultText = function () {
    $(".defaultText").focus(function (srcc) {
        if ($(this).val() == $(this)[0].title) {
            $(this).removeClass("defaultTextActive");
            $(this).val("");
        }
    });

    $(".defaultText").blur(function () {
        if ($(this).val() == "") {
            $(this).addClass("defaultTextActive");
            $(this).val($(this)[0].title);
        }
    });

    $(".defaultText").blur();
};


Plavix.Utils.faqs = function () {

    //Public methods
    this.faqSetup = function () {
        var i = 1;
        // Disabled expand/collapse of Glossary content
        /*
        $('.faq h3').siblings().css({ display: 'none' });
        $('.faq h3').addClass('faqClosed');

        $('.faq h3').click(function () {
            // alert($('.faq h3').index($(this)));
            // PlavixFAQ.toggleSection();
            var faqElement = $(this);
            var ansElement = faqElement.siblings();
            if (ansElement.css('display') == 'none') {
                faqElement.removeClass('faqClosed').addClass('faqOpened');
                ansElement.css({ display: 'block' })
            } else {
                faqElement.removeClass('faqOpened').addClass('faqClosed');
                ansElement.css({ display: 'none' })
            }
        });
        */
        $('.faq:last').css({'padding-bottom': '20px'});



        /* while (document.getElementById("ans" + i) != null) {
        var element = document.getElementById("ans" + i);
        element.style.display = "none";
        var element = document.getElementById("q" + i);
        element.className = "faqClosed";
        i++;
        }*/

    }

    /*this.toggleSection = function (id) {
        var faqElement = $('#q' + id); //document.getElementById("q" + id);
        var ansElement = faqElement.next(); //document.getElementById("ans" + id);
        */
        /*if (ansElement.style.display == "none") {
        faqElement.className = "faqOpened";
        ansElement.style.display = "block";
        } else {
        faqElement.className = "faqClosed";
        ansElement.style.display = "none";
        }*/
        /*if (ansElement.css('display') == "none") {
            faqElement.removeClass('faqClosed').addClass('faqOpened');
            ansElement.css({ display: 'block' })
        } else {
            faqElement.removeClass('faqOpened').addClass('faqClosed');
            ansElement.css({ display: 'none' })
        }
    }*/
    /*
    this.openAll = function () {
        var i = 1;
        while (document.getElementById("ans" + i) != null) {
            var faqElement = document.getElementById("q" + i);
            var ansElement = document.getElementById("ans" + i);
            faqElement.className = "faqOpened";
            ansElement.style.display = "block";
            i++;
        }
    }

    this.closeAll = function () {
        var i = 1;
        while (document.getElementById("ans" + i) != null) {
            var faqElement = document.getElementById("q" + i);
            var ansElement = document.getElementById("ans" + i);
            faqElement.className = "faqClosed";
            ansElement.style.display = "none";
            i++;
        }
    }*/

};


var PlavixText;
$(document).ready(function () {
    PlavixText = new Plavix.Utils.Text();
    PlavixText.textBind();
    Plavix.Utils.checkAll();
    Plavix.Utils.listPrint();
    PlavixText.setText();

    Plavix.Utils.DropDowns();
    $("#next").click(function() { window.location = $("#next").find("a").attr("href") });
    /* New Version Code */
    //Plavix.Utils.formDefaultText();

 /* New Version Code */
 /*
    //Enter to submit search box
    $('#search').bind('keypress', function (e) {
        var code = (e.keyCode ? e.keyCode : e.which);
        if (code == 13) { //Enter keycode
            window.location = "/searchResults.html"
        }
    });
      
*/
    PlavixFAQ = new Plavix.Utils.faqs();
    PlavixFAQ.faqSetup();


    // close button for install flash player popup
    $('#moaFlash .closeX a').click(function () {
        //alert(6);
        PlavixVideo.videoState = "pause";
        //document.getElementById('moaVideo').style.left = "-10000px";
        $('#moaVideo').hide();
        $('#moaWrapper').hide();
        return false;
    });

});

function validateSearch(searchbox) {
    //var val = document.forms[0].rslt_search.value;
    var val = document.getElementById(searchbox).value;
    //var val=searchbox.value
    if (val == "" || val == null) {
        alert("Please type the word or words you wish to search for in the search box.");
    }
    else {
        location.href = "/searchresults.aspx?q=" + val;
    }
}





// background image cache bug for ie6. www.mister-pixel.com/#Content__state=

/*@cc_on@if (@_win32){ document.execCommand("BackgroundImageCache", false, true) } @end@*/
