// JavaScript Document

/****************************************************
*	        DOM Image rollover:
*		by Chris Poole
*		http://chrispoole.com
*               Script featured on http://www.dynamicdrive.com
*		Keep this notice intact to use it :-)
****************************************************/

function init() 
{
  if (!document.getElementById) return
  
  var imgOriginSrc;
  var imgTemp = new Array();
  var imgarr = document.getElementsByTagName('img');
  
  for (var i = 0; i < imgarr.length; i++) 
  {
    if (imgarr[i].getAttribute('hsrc')) 
	{
        imgTemp[i] = new Image();
        imgTemp[i].src = imgarr[i].getAttribute('hsrc');
        imgarr[i].onmouseover = function() 
		{
            imgOriginSrc = this.getAttribute('src');
            this.setAttribute('src',this.getAttribute('hsrc'));
        }
        imgarr[i].onmouseout = function() 
		{
            this.setAttribute('src',imgOriginSrc);
        }
    }
  }
}
onload=init;

function overlink(spanid,text)
{
	document.getElementById(spanid).setAttribute('class', 'over');
	document.getElementById(spanid + "_image").setAttribute('src', 'images/' + spanid + 'color173.jpg');
	document.getElementById("text").innerHTML = text;
}

function outlink(spanid)
{
	document.getElementById(spanid).setAttribute('class', 'out');
	document.getElementById(spanid + "_image").setAttribute('src', 'images/' + spanid + 'bw173.jpg');
	document.getElementById("text").innerHTML = '<h1>WELCOME</h1><p>Feel free to explore the stories, essays, sermons, and poems that are organized by theme and author. Simply roll your mouse over the photos for a description of the thematic category and then click your way through each subheading to locate the individual stories.  For a more immediate list of stories, click on the contributor’s link to review the contributions of each writer. You can always click on center for sacred story at the top of the page to get &ldquo;home.&rdquo;<br /><br />You are welcome to submit your own writing that we may consider for publication on this site. In time we will be offering selected stories as downloadable audio files. Guidelines for submissions may be found by clicking the submissions link at the bottom of this page.<br /><br />In the meantime start a forum, send us your suggestions, and register with us so we can keep you informed about new developments here at the center for sacred story. A warm welcome!<br /><br />John Capellaro, Founder</p>';
}

function switchimg(imgname, w, h)
{
	document.getElementById('cat_pic').setAttribute('src', imgname);
}



/* FLASH STUFF */
//v1.0

//Copyright 2006 Adobe Systems, Inc. All rights reserved.

function AC_AddExtension(src, ext)

{

  if (src.indexOf('?') != -1)

    return src.replace(/\?/, ext+'?'); 

  else

    return src + ext;

}

 

function AC_Generateobj(objAttrs, params, embedAttrs) 

{ 

  var str = '<object ';

  for (var i in objAttrs)

    str += i + '="' + objAttrs[i] + '" ';

  str += '>';

  for (var i in params)

    str += '<param name="' + i + '" value="' + params[i] + '" /> ';

  str += '<embed ';

  for (var i in embedAttrs)

    str += i + '="' + embedAttrs[i] + '" ';

  str += ' ></embed></object>';

 

  document.write(str);

}

 

function AC_FL_RunContent(){

  var ret = 

    AC_GetArgs

    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"

     , "application/x-shockwave-flash"

    );

  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);

}

 

function AC_SW_RunContent(){

  var ret = 

    AC_GetArgs

    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"

     , null

    );

  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);

}

 

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){

  var ret = new Object();

  ret.embedAttrs = new Object();

  ret.params = new Object();

  ret.objAttrs = new Object();

  for (var i=0; i < args.length; i=i+2){

    var currArg = args[i].toLowerCase();    

 

    switch (currArg){        

      case "classid":

        break;

      case "pluginspage":

        ret.embedAttrs[args[i]] = args[i+1];

        break;

      case "src":

      case "movie":          

        args[i+1] = AC_AddExtension(args[i+1], ext);

        ret.embedAttrs["src"] = args[i+1];

        ret.params[srcParamName] = args[i+1];

        break;

      case "onafterupdate":

      case "onbeforeupdate":

      case "onblur":

      case "oncellchange":

      case "onclick":

      case "ondblClick":

      case "ondrag":

      case "ondragend":

      case "ondragenter":

      case "ondragleave":

      case "ondragover":

      case "ondrop":

      case "onfinish":

      case "onfocus":

      case "onhelp":

      case "onmousedown":

      case "onmouseup":

      case "onmouseover":

      case "onmousemove":

      case "onmouseout":

      case "onkeypress":

      case "onkeydown":

      case "onkeyup":

      case "onload":

      case "onlosecapture":

      case "onpropertychange":

      case "onreadystatechange":

      case "onrowsdelete":

      case "onrowenter":

      case "onrowexit":

      case "onrowsinserted":

      case "onstart":

      case "onscroll":

      case "onbeforeeditfocus":

      case "onactivate":

      case "onbeforedeactivate":

      case "ondeactivate":

      case "type":

      case "codebase":

        ret.objAttrs[args[i]] = args[i+1];

        break;

      case "width":

      case "height":

      case "align":

      case "vspace": 

      case "hspace":

      case "class":

      case "title":

      case "accesskey":

      case "name":

      case "id":

      case "tabindex":

        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];

        break;

      default:

        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];

    }

  }

  ret.objAttrs["classid"] = classid;

  if (mimeType) ret.embedAttrs["type"] = mimeType;

  return ret;

}
