var so = new SWFObject("home_hero.swf", "home_hero", "984", "210", "8", "#000000");
so.addParam("quality", "high");
so.addParam("scale", "noscale");
so.addParam("wmode", "transparent");
so.write("ap2Header");
so = new SWFObject("navigation.swf", "ap2navigation", "984", "28", "8", "#000000");
so.addParam("quality", "high");
so.addParam("scale", "noscale");
so.addParam("wmode", "transparent");
so.write("ap2nav");
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])
function fixPNG(myImage)
{
if ((version >= 5.5) && (version < 7) && (document.body.filters))
{
var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
var imgTitle = (myImage.title) ?
"title='" + myImage.title + "' " : "title='" + myImage.alt + "' "
var imgStyle = "display:inline-block;" + myImage.style.cssText
var strNewHTML = ""
myImage.outerHTML = strNewHTML
}
}
function ap2_show(id) {
var rightContent=document.getElementById('rightContent');
rightContent.style.background="#efddea";
switch(id+'Page') {
case '#aboutPage':
rightContent.innerHTML=ajaxinclude("about.php");
document.getElementById('om').src='om/about_show.html'
setPage(id);
break;
case '#blogsPage':
rightContent.innerHTML=ajaxinclude("diaries.php?page=Diary");
document.getElementById('om').src='om/blogs.html';
setPage(id);
break;
case '#tipsPage':
var page=document.getElementById(id.replace('#','')+'Page');
document.getElementById('om').src='om/expert_tips.html';
rightContent.innerHTML=page.value;
setPage(id);
break;
case '#talkPage':
location.href='http://community.we.tv/category.jspa?categoryID=63';
break;
case '#homePage':
var homePage=document.getElementById('homePage');
rightContent.innerHTML=homePage.value;
rightContent.style.background="#fff";
rightContent.style.width="684px";
var box1=document.getElementById('ap2recap').innerHTML='
';
var box3=document.getElementById('ap2standing').innerHTML='
';
var box2=document.getElementById('ap2saying').innerHTML='
';
var box4=document.getElementById('ap2downloads').innerHTML='
';
var box4=document.getElementById('ap2reminder').innerHTML='
';
break;
default:
var t=true;
if (id.indexOf('contestants')>0 && id!='#contestants' && t) {
rightContent.innerHTML=ajaxinclude("contestants.php?page="+id.replace('#',''));
document.getElementById('om').src='om/contestant_'+id.toLowerCase()+'polls.html'
setPage(id);
t=false;
}
if (id.indexOf('polls')>0 && t) {
rightContent.innerHTML=ajaxinclude("polls.php");
document.getElementById('om').src='om/polls.html'
setPage(id);
t=false;
}
if (id.indexOf('recap')>0 && t) {
rightContent.innerHTML=ajaxinclude("episodes.php?page="+id.replace('#',''));
document.getElementById('om').src='om/episodes.html'
setPage(id);
t=false;
}
if (id.indexOf('Diary')>0 && t) {
rightContent.innerHTML=ajaxinclude("diaries.php?page="+id.replace('#',''));
setPage(id);
t=false;
}
if (id.indexOf('Tip')>0 && t) {
rightContent.innerHTML=ajaxinclude("tips.php?page="+id.replace('#',''));
document.getElementById('om').src='om/expert_tips.html'
setPage(id);
t=false;
}
if (t) {
try {
var page=document.getElementById(id.replace('#','')+'Page');
rightContent.innerHTML=page.value;
setPage(id);
}
catch (e) { //********* default to home page ***********
ap2_show('#home')
}
}
break;
}
}
function getURLSubpage() {
if (location.hash.length==0)
location.hash='home';
ap2_show(location.hash);
}
function spawnWindow(id) {
var x="height=400,width=437";
var scroll="scrollbars=yes";
if (id=='brightcove1')
window.open('http://link.brightcove.com/services/link/bcpid296756391/bclid1131891918/bctid1126081094','WEtv','scrollbars=no,resizable=no,status=no,width=988,height=550');
if (id=='brightcove')
window.open('http://link.brightcove.com/services/link/bcpid296756391/bclid1131891918','WEtv','scrollbars=no,resizable=no,status=no,width=988,height=550');
else {
if (id=='rules') page='rules.html';
if (id=='poll') page='poll.php';
if (id=='email') {
page='reminder.html';
x="height=346,width=437";
scroll="scrollbars=no";
}
if (id=='friend') {
page='friend.html';
x="height=799,width=437";
scroll="scrollbars=no";
}
if (id=='download') page='downloadinstructions.html';
window.open(page,null,x+",status=yes,toolbar=no,menubar=no,location=no,"+scroll+",resizable=yes");
}
}
var rootdomain="http://"+window.location.hostname
function ajaxinclude(url) {
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.open('GET', url, false) //get page synchronously
page_request.send(null)
return page_request.responseText;
}
function getPollAnswer(form) {
for (var i=0; i < form.poll.length; i++)
{
if (form.poll[i].checked)
{
showPollResults(form.poll[i].value)
}
}
return false;
}
function showPollResults(name) {
var rightContent=document.getElementById('rightContent');
rightContent.style.background="#efddea";
rightContent.innerHTML=ajaxinclude("recordvote.php?vote="+name);
}
function setPage(id) {
if (typeof document.body.style.maxHeight != "undefined") {
location.hash=id;
}
//else {
// location.href='index.php?page='+id
//}
}
getURLSubpage();