var intBull = 1
var fadeEffect
var appearEffect
var maxBullets = 4

var ready = false;
	
	function swfIsReady() {
		//alert('ready');
		ready = true;
	}
	function thisMovie(movieName) {
	    if (navigator.appName.indexOf("Microsoft") != -1) {
	        return window[movieName]
	    }
	    else {
	        return document[movieName]
	    }
	    
	    
	}	
	function isReady() {
		return ready;
	}

	function enable() {
		//alert('enable');
	}
	
	function disable() {
		//alert('disable');
	}
	
	function show(aID) {	
		if (isReady()) {
			thisMovie("movieID").show(aID);
			
		}
	}
	
	function hide() {			
		if (isReady()) {
			thisMovie("movieID").hide();
		}
	}



function fansInit(){


	//var so = new SWFObject("TechAni.swf", "movieID", "920", "288", "8", "#000000", true);
	//so.addVariable( "PLAY_BUTTON" , "Play the short film" );
	//so.addParam("allowscriptaccess","always");
	//so.addVariable("pagePath", window.location.href);
	//so.write("flashContent");


    var bullLinks = document.getElementById('panelLinks').getElementsByTagName("a");
        for (var i=0; i < bullLinks.length; i++) {
            if (bullLinks[i].rel.match("bullCol")) {
        
                bullLinks[i].onmouseover = function() {
                    
                    //$('testField').value = "mouseover"
                    
                    var bullID = this.id
                    
                    bullIDArray = bullID.split("_")
                    
                    currentBull = intBull;
                    show(bullIDArray[1])
                    
                    intBull = parseInt(bullIDArray[1])+1;
                    
                   // fadeEffect.cancel();
                    
                    
                    if (parseInt(currentBull) <= maxBullets){
                      //  Effect.Appear('bullPulse_'+currentBull, {duration: 0.2});
                       
                    }
                    if (parseInt(intBull) <= maxBullets){
                        fadeOut();
                    }
                    return false;
                }
                
                bullLinks[i].onmouseout = function() {
                    var bullID = this.id
                    bullIDArray = bullID.split("_")
                    if (parseInt(bullIDArray[1]) == maxBullets){
                        intBull = 1;
                        fadeOut();
                    }
                    hide(bullIDArray[1]);
                }
                
             }
        }

        if ($('bullPulse_1')){
            //Start Animation of current Bullet
            fadeOut()
        }
}
function fadeOut(){
/*
    fadeEffect = new Effect.Opacity('bullPulse_'+intBull, {
      duration: 1.5,from:1.0,to:0.1,afterFinish:fadeIn
    }); 
	*/
}
function fadeIn(){  
/*
    fadeEffect = new Effect.Opacity('bullPulse_'+intBull, {
      duration: 1.5,from:0.1,to:1.1,afterFinish:fadeOut
    });
	*/
}

document.observe("dom:loaded",function() {fansInit();});