/*
if using a splash page, this hack needs to exist in order to insure that the main tab points to the index.php page. if not it will continue to take you to the splash page.

todo: put a cookie to make sure that the spash page will not come up again and again if the user has already been here.
*/

//uncomment when splash page is done
/*
document.write("got to the page");
var cookieCheck =ReadCookie("ospages");
 
if(cookieCheck == "1")
{
//cookie found
document.write(cookieCheck + "<br><br>");
}
else
{
SetCookie("ospages","1",1);
window.location = "http://pjacayan.ning.com/splash.htm";
}

function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString();
}


function ReadCookie(cookieName) {
 var theCookie=""+document.cookie;
 var ind=theCookie.indexOf(cookieName);
 if (ind==-1 || cookieName=="") return ""; 
 var ind1=theCookie.indexOf(';',ind);
 if (ind1==-1) ind1=theCookie.length; 
 return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}
*/

var newtab = document.createElement('li'); 
var mainTab = document.getElementById('xg_tab_main');
mainTab.innerHTML = '<a href="/index.php">Main</a>';
//end redirect

/**http://api.ning.com/files/AcMZQWaMb4WwzZb0HHcH7hR7*aO5m3uXMdfAhB29pol7*GABdlI27R3fl-81wkxFDqWYKcTm-CTi1cIfzpX9EUwN24hxbchn/ODYNingHeaderfirefly.swf
 * Tracking Code Hack: Replace the Header of the network with a swf
**/
var headerSwfUrl    = "http://seminarexperiences.com/misc/imgbin/ODYNingHeadAS3.swf";

var bodySwfUrl    = "http://api.ning.com/files/fHiOrgUZoR6duhWpyjlOWFTrqQykqiV-gIpg9eLdkIjHYlNsKsAIFUf1UVXeDJfFrqp9BxMKWjrtMA*1-gF-XCoxfxOtBqL6/ODYNingBackgroundfirefly.swf";

var headerSwfWidth  = 955;
var headerSwfHeight = 179;

var bodySwfWidth  = 1200;
var bodySwfHeight = 1680;

var newHeaderHtml   = '<embed src="'+headerSwfUrl+'" width="'+headerSwfWidth+'" height="'+headerSwfHeight+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer <http://www.macromedia.com/go/getflashplayer> "> </embed>';

var newBodyHtml   = '<embed src="'+bodySwfUrl+'" width="'+bodySwfWidth+'" height="'+bodySwfHeight+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer <http://www.macromedia.com/go/getflashplayer> "> </embed>';

var headerElement   = document.getElementById('xg_masthead');
var footerElement = document.getElementById('xg_foot');
var bodyElement = document.getElementById('xg_body');

/*
var bodyElement = document.getElementById('xg_body');
var bodyElementList = "<p>new body</p>"//getElementList(document);
var bodyHtml ="<table><tr><td>" + bodyElementList + "</td></tr></table>";
bodyElement.innerHTML = bodyHtml;


var footElement = document.getElementById('xg_foot');
var footElementList = "<p>new footer</p>"//getElementList(document);
var footHtml ="<table><tr><td>" + footElementList + "</td></tr></table>";
footElement.innerHTML = footHtml;

*/

 
//replace the old header with the new one
headerElement.innerHTML = newHeaderHtml;
 
//change the id as a simple way to remove all css attached to it
headerElement.id    = 'newheader';


//change body
/*
bodyElement.innerHTML = newBodyHtml;
bodyElement.id = 'newbody';
*/

//change footer
/*
footerElement.innerHTML = newHeaderHtml;
footerElement.id = 'newfooter';
*/