﻿// JScript File
//Run Flash 
function RunFlashHeader(flash)
{
   document.write('<object type="application/x-shockwave-flash" data="../flash/' + flash + '" width="790" height="294">\n');
   document.write('<param name="movie" value="../flash/' + flash + '" />\n');
   document.write('<param name="quality" value="high" />\n');
   document.write('<param name="wmode" value="transparent" />\n');
   document.write('</object>\n');
} ;








/*** 
    Rss Feed
***/
function getRssFeed(rssUrl,targetUL){ 
        $.get(rssUrl, function(xml){ 
                var html = ''; 
                var even = true ;
                //find each 'item' in the file and parse it
                $("item", xml).each(function(){ 
         
	                //name the current found item this for this particular loop run
	                var $item = $(this);
	                // grab the post title
	               // var title = ( ($item.find('title').text())  ?  $item.find('title').text() :"(no title)") ;
	                var title = $item.find('title').text() ;
	                // grab the post's URL
	                var link = $item.find('link').text();
	                // next, the description
	                var description = $item.find('description').text();
	                //don't forget the pubdate
	                var pubDate = $item.find('pubDate').text();
                    even = ! even ; 
	                // now create a var 'html' to store the markup we're using to output the feed to the browser window
	                html += "<li "+ (even==true? "class=even " : "")+"><h6 ><a href=\"" + link + "\" target=\"_blank\">" + title + "<\/a><\/h6>";
	                html += "<em class=\"date\">" + pubDate + "</em>";
	                html += "<p class=\"description\"><a href=\"" + link + "\" target=\"_blank\">" + description + "<\/a></p><\/li>";
	                //html += "<a href=\"" + link + "\" target=\"_blank\">Read More >><\/a><\/li>";
                });
                $(targetUL).html(html).slideDown("slow"); 
          });
};

function RssFeed2(rssUrl,targetUL){ 
        $.get(rssUrl, function(xml){ 
                var html = ''; 
                var even = true ;
                //find each 'item' in the file and parse it
                $("item", xml).each(function(){ 
         
	                //name the current found item this for this particular loop run
	                var $item = $(this);
	                // grab the post title
	               // var title = ( ($item.find('title').text())  ?  $item.find('title').text() :"(no title)") ;
	                var title = $item.find('title').text() ;
	                // grab the post's URL
	                var link = $item.find('link').text();
	                // next, the description
	                var description = $item.find('description').text();
	                //don't forget the pubdate
	                var pubDate = $item.find('pubDate').text();
                    even = ! even ; 
	                // now create a var 'html' to store the markup we're using to output the feed to the browser window
	                html += "<li "+ (even==true? "class=even " : "")+"><h6 ><a href=\"" + link + "\" target=\"_blank\">" + title + "<\/a><\/h6>";
	                html += "<em class=\"date\">" + pubDate + "</em>";
	                html += "<p class=\"description\"><a href=\"" + link + "\" target=\"_blank\">" + description + "<\/a></p><\/li>";
	                //html += "<a href=\"" + link + "\" target=\"_blank\">Read More >><\/a><\/li>";
                });
                $(targetUL).html(html).slideDown("slow"); 
          });
};



/*** 
    Simple jQuery Slideshow Script
    Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc.  Please link out to me if you like it :)
***/

function slideSwitch(ActImg, lstImg, fstImg) {
    var $active = $(ActImg);
    if ( $active.length == 0 ) $active = $(lstImg);
    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $(fstImg);

    // uncomment the 3 lines below to pull the images in random order
     var $sibs  = $active.siblings();
     var rndNum = Math.floor(Math.random() * $sibs.length );
     var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

