/*!	$Id: the-spark.min.js 8854 2010-03-04 13:17:04Z jagarwal $ */
/*global jQuery:false, callLevel04: false	*/

//noinspection BadExpressionStatementJS
"use strict";
/**
 * Lorem Ipsum!
 *
 * @author	www.ignitiongroupe.com
 * @version	0.1.0
 */
function setFlashParams(state, feature,	facebookData) {
    var swf = document.getElementById("prototype");

    /* setState(state:String=null, moduleId:String=null, backgroundId:String=null, deepLink:String=null, onComplete:String=null, facebookData:String):void
     state:String always "s001" for intro
     moduleId:String always "design"
     backgroundId: always "default"
     deepLink:String feature id here, starts with 0
     onComplete:String unused
     facebookData:String facebook data here
     */

    swf.setState(state, "design", "default", feature, null, facebookData);
}

function featureChangedBySwf(sHref)	{
    var jLinks = jQuery("#secondNavigation .lvl4 a");
    jLinks.removeClass();
    jLinks.filter("a[href='" + sHref + "']").addClass('active');
    callLevel04(sHref);
}

function featureChangedByHtml()	{
    var sHref = jQuery(this).attr("href");
    setFlashParams("s002", sHref, null);
}

function deleteFlashCookie(){
    var swf = document.getElementById("prototype");
    swf.deleteFlashCookie();
}

jQuery(document).ready(function() {
    jQuery("#secondNavigation .lvl4 a").click(featureChangedByHtml);
});
