﻿function flashPlayer(width, height, bottom){
    this.width = width;
    this.height = height;
    this.bottom = bottom;
    
    this.pics = new Array();
    this.links = new Array();
    this.texts = new Array();
    
    this.add = Add;
    this.play = Play;
    
    function Add(pic, link, text){
        var index = this.pics.length;
        this.pics[index] = pic;
        this.links[index] = link;
        this.texts[index] = text;
    }
    
    function Play(){
        var fsh_width = this.width;
        var fsh_height = this.height;
        var text_height = this.bottom;
		var swf_height = this.height + this.bottom;
		var fsh_pics = '';
		var fsh_links = '';
		var fsh_texts = '';
		
		var length = this.pics.length;
		for(i=0; i<length; i++){
		    fsh_pics += '|'+ this.pics[i];
		    fsh_links += '|'+ this.links[i];
		    fsh_texts += '|'+ this.texts[i];
		}
		if(fsh_pics.length > 0){
		    fsh_pics = fsh_pics.substring(1);
		    fsh_links = fsh_links.substring(1);
		    fsh_texts = fsh_texts.substring(1);
		}

	    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ fsh_width +'" height="'+ swf_height +'">');
	    document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="/images/demo/FlashPlayer.swf"><param name="quality" value="high"><param name="bgcolor" value="white">');
	    document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
	    document.write('<param name="FlashVars" value="pics='+ fsh_pics +'&links='+ fsh_links +'&texts='+ fsh_texts +'&borderwidth='+ fsh_width +'&borderheight='+ fsh_height +'&textheight='+ text_height +'">');
	    document.write('<embed src="/images/demo/FlashPlayer.swf" wmode="opaque" FlashVars="pics='+ fsh_pics +'&links='+ fsh_links +'&texts='+ fsh_texts +'&borderwidth='+ fsh_width +'&borderheight='+ fsh_height +'&textheight='+ text_height +'" menu="false" bgcolor="white" quality="high" width="'+ fsh_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	    document.write('</object>');
    }
}

function setFocus(id){
    document.getElementById("focusPic").src = pictures[id];
    document.getElementById("focusLnk").href = links[id];
    document.getElementById("focusTxt").innerHTML = "<a href=\""+links[id]+"\" target=_blank>"+titles[id]+"</a>"; 
    focusPic.style.visibility = "hidden";
    focusPic.filters[0].Apply();
    if (focusPic.style.visibility == "visible") {
        focusPic.style.visibility = "hidden";
        focusPic.filters.revealTrans.transition=12;
    }
    else {
        focusPic.style.visibility = "visible";focusPic.filters[0].transition=12;
    }
    focusPic.filters[0].Play();
    
}




