﻿/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
these are generic functions that pass data to
the swfobject library to write flash modules
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
generic write flash to div id=flashcontent
*/
function displayFlash(swfType, swfSrc, swfName, swfW, swfH, swfVer, swfBg) {
	var so = new SWFObject("media/" + swfSrc, swfName, swfW, swfH, swfVer, swfBg);
    so.addParam("allowScriptAccess", "always");
    if (isFlash) {
        so.write("flashcontent");
    }
}
/*
generic write flash to any div using swfLocation
*/
function displayFlash2(swfLocation, swfSrc, swfName, swfW, swfH, swfVer, swfBg) {
	var so = new SWFObject(swfSrc, swfName, swfW, swfH, swfVer, swfBg);
    so.addParam("allowScriptAccess", "always");
    if (isFlash) {
        so.write(swfLocation);
    }
}
/*
generic write flash to div any div using swfLocation + pass variable name=value for addVariable
*/
function displayFlash3(swfLocation, swfSrc, swfName, swfW, swfH, swfVer, swfBg, swfVarName, swfVarValue) {
	var so = new SWFObject(swfSrc, swfName, swfW, swfH, swfVer, swfBg);
    so.addParam("allowScriptAccess", "always");
    so.addVariable(swfVarName, swfVarValue);
    if (isFlash) {
        so.write(swfLocation);
    }
}
/* 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
these are more specific functions to write either
specific flash modules or in special display states
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
write flash to div id=homeflashcontent for home page only
*/
function displayHomeFlash(swfType, swfSrc, swfName, swfW, swfH, swfVer, swfBg) {
	var so = new SWFObject("media/" + swfSrc, swfName, swfW, swfH, swfVer, swfBg);
    so.addParam("allowScriptAccess", "always");
    if (isFlash) {
        so.write("homeflashcontent");
    }
}
/*
generic write flash to div id=flashcontentPrint for printer friendly version of page
*/
function displayFlashPrint(swfType, swfSrc, swfName, swfW, swfH, swfVer, swfBg) {
	var so = new SWFObject("media/" + swfSrc, swfName, swfW, swfH, swfVer, swfBg);
    so.addParam("allowScriptAccess", "always");
    if (isFlash) {
        so.write("flashcontentPrint");
    }
}
/*
write flash to div id=storyFlash for patient stories
*/
function displayStory(swfType, swfSrc, swfName, swfW, swfH, swfVer, swfBg) {
	var so = new SWFObject("media/" + swfSrc, swfName, swfW, swfH, swfVer, swfBg);
    so.addParam("allowScriptAccess", "always");
    if (isFlash) {
        so.write("storyFlash");
    }
}
/*
write flash to div id=calloutFlash for callouts
*/
function displayCallout(swfType, swfSrc, swfName, swfW, swfH, swfVer, swfBg) {
	var so = new SWFObject("media/" + swfSrc, swfName, swfW, swfH, swfVer, swfBg);
    so.addParam("allowScriptAccess", "always");
    if (isFlash) {
        so.write("calloutFlash");
    }
}