//P2
//var serverroot = "http://localhost/rhizomesites/P2/test/"
//var serverroot = "http://www.patientpower.info/test/"
var serverroot = "http://www.patientpower.info/"
//var serverroot = "http://localhost/rhizomesites/P2/"
/* Slide Switcher for Video Module */
function SwitchSlide(obj, pID){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("video").getElementsByTagName("div");
	var sign = document.getElementById(pID);
	var sign_ar = ['sign0','sign1', 'sign2', 'sign3', 'sign4'];
		if(el.style.display == "none"){
			for (var i=0; i<ar.length; i++){
				ar[i].style.display = "none";
			}
			el.style.display = "block";
			for (var j=0; j<sign_ar.length; j++){
				document.getElementById(sign_ar[j]).src = "/images/community/btn_plus.gif";
			}
			sign.src = "/images/community/btn_minus.gif";
		}else{
			el.style.display = "none";
			sign.src = "/images/community/btn_plus.gif";
		}
	}
}


var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();
//alert (BrowserDetect.version);


//Check the form before submitting
function CheckForm () {

	//Check for a word to search
	if (document.frmSiteSearch.zoom_searchbox.value==""){
		alert("Please enter at least one keyword to search");
		document.frmSiteSearch.zoom_searchbox.focus();
		return false;
	}
	
	return true
}

//this javascript code makes sure that important elements are filled out before submission to the database
function ValidateSE () {
   //txt1 refers to the form element id
	//Check for a word to search
	if (document.formInfo.txtName.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter your name");
		document.formInfo.txtName.focus();
		return false;
	}
	if (document.formInfo.txtHomeCity.value==""){
		alert("Please enter your home city");
		document.formInfo.txtHomeCity.focus();
		return false;
	}
	if (document.formInfo.txtMailFrom.value==""){
		alert("Please enter your email address");
		document.formInfo.txtMailFrom.focus();
		return false;
	}
	if (document.formInfo.Message.value==""){
		alert("Please enter your question");
		document.formInfo.Message.focus();
		return false;
	}
	if (document.formInfo.Message.value.match(/href/))
	{
		alert("Sorry. To prevent spam you cannot place a URL in your message.");
		document.formInfo.Message.focus();
		return false;
   }	
   if (document.formInfo.Message.value.match(/http/))
	{
		alert("Sorry. To prevent spam you cannot place a URL in your message.");
		document.formInfo.Message.focus();
		return false;
   }	
	return true
}

//this javascript code makes sure that important elements are filled out before submission to the database
function ValidateI () {
   //txt1 refers to the form element id
	//Check for a word to search
	if (document.formSignUp.txt1.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter your name");
		document.formSignUp.txt1.focus();
		return false;
	}
	if (document.formSignUp.txt2.value==""){
		alert("Please enter your email address");
		document.formSignUp.txt2.focus();
		return false;
	}
	if (document.formSignUp.txt3.value==""){
		alert("Please enter your ZIP code");
		document.formSignUp.txt3.focus();
		return false;
	}
	if (document.formSignUp.txt5.value==""){
		alert("Please enter your Primary Health Concern");
		document.formSignUp.txt5.focus();
		return false;
	}
	if (document.formSignUp.txt5.value.match(/href/))
	{
		alert("Sorry. To prevent spam you cannot place a URL in your message.");
		document.formSignUp.txt5.focus();
		return false;
   }	
   if (document.formSignUp.txt5.value.match(/http/))
	{
		alert("Sorry. To prevent spam you cannot place a URL in your message.");
		document.formSignUp.txt5.focus();
		return false;
   }	
	return true
}

//this javascript code makes sure that important elements are filled out before submission to the database
function Validate () {
   //txt1 refers to the form element id
	//Check for a word to search
	if (document.formInfo.txtName.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter your name");
		document.formInfo.txtName.focus();
		return false;
	}
	if (document.formInfo.txtMailFrom.value==""){
		alert("Please enter your email address");
		document.formInfo.txtMailFrom.focus();
		return false;
	}
	if (document.formInfo.Message.value==""){
		alert("Please enter your question");
		document.formInfo.Message.focus();
		return false;
	}
	if (document.formInfo.Message.value.match(/href/))
	{
		alert("Sorry. To prevent spam you cannot place a URL in your message.");
		document.formInfo.Message.focus();
		return false;
   }	
   if (document.formInfo.Message.value.match(/http/))
	{
		alert("Sorry. To prevent spam you cannot place a URL in your message.");
		document.formInfo.Message.focus();
		return false;
   }	
	return true
}

function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos<1||dotpos-apos<2) 
  {alert("Please enter a valid email address.");return false;}
//else {return true;}
}
}

function ValidateCommStory () {
   //txt1 refers to the form element id
	//Check for a word to search
   if (document.communityStory.txtFirstName.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter your first name");
		document.communityStory.txtFirstName.focus();
		return false;
	}
	if (document.communityStory.txtLastName.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter your Last name");
		document.communityStory.txtLastName.focus();
		return false;
	}	
	if (validate_email(document.communityStory.txtMailFrom,"Please enter a valid email address.")==false)
   {document.communityStory.txtMailFrom.focus();return false;}
   if (document.communityStory.txtCity.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter your city");
		document.communityStory.txtCity.focus();
		return false;
	}
	if (document.communityStory.txtState.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter your state");
		document.communityStory.txtState.focus();
		return false;
	}
	if (document.communityStory.txtZip.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter your ZIP Code");
		document.communityStory.txtZip.focus();
		return false;
	}
	if (document.communityStory.txtTitle.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter a title for your submission");
		document.communityStory.txtTitle.focus();
		return false;
	}
	if (document.communityStory.commText.value.match(/href/))
	{
		alert("Sorry. To prevent spam you cannot place a URL in your story text.");
		document.communityStory.commText.focus();
		return false;
   }	
   if (document.communityStory.commText.value.match(/http/))
	{
		alert("Sorry. To prevent spam you cannot place a URL in story text.");
		document.communityStory.commText.focus();
		return false;
   }	
	if (document.communityStory.chkAgree.checked == false)
		{
		alert ("You have not agreed to the submission terms and conditions");
		document.communityStory.chkAgree.focus();
		return false;
		}
		
	if (document.communityStory.ddAreYou.value == "Other")
		{
		chkAreYouIs = document.communityStory.txtOther.value
		}
	else
		{
		chkAreYouIs = document.communityStory.ddAreYou.value
		}
		
	if (document.communityStory.chkStory.checked == false)
		{
		chkStoryIs = "No"
		}
	else
		{
		chkStoryIs = "Yes" + "\n Story: " + document.communityStory.commText.value
		}	
		
	if (document.communityStory.chkNewsletter.checked == false)
		{
		chkNewsletterIs = "No"
		}
	else
		{
		chkNewsletterIs = "Yes"
		}		
		
	 msg = "Please Verify the Information you Entered: \n\n First Name: " + document.communityStory.txtFirstName.value + "\n Last Name: " + document.communityStory.txtLastName.value + "\n Email Address: " + document.communityStory.txtMailFrom.value + "\n City: " + document.communityStory.txtCity.value + "\n State: " + document.communityStory.txtState.value + "\n Zip Code: " + document.communityStory.txtZip.value + "\n You are a " + chkAreYouIs + "\n Title of Submission: " + document.communityStory.txtTitle.value + "\n Are you submitting a story: " + chkStoryIs + "\n Sign me up for the newsletter: " + chkNewsletterIs + "\n I have agreed to the terms and conditions: " + document.communityStory.chkAgree.value + "\n\n If this information is correct, click 'OK'. \n\n If you need to make changes, click 'Cancel' to be returned to the form."
   input_box=confirm(msg);
   if (input_box==true)   
   { 
   // Output when OK is clicked
   //alert ("You clicked OK"); 
   return true;
   }      
   else
   {
   // Output when Cancel is clicked
   //alert ("You clicked cancel");
   return false;
   }
}


function ValidateHallofFame () {
   //txt1 refers to the form element id
	//Check for a word to search
   if (document.halloffame.txtFirstName.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter your first name");
		document.halloffame.txtFirstName.focus();
		return false;
	}
	if (document.halloffame.txtLastName.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter your Last name");
		document.halloffame.txtLastName.focus();
		return false;
	}	
	if (validate_email(document.halloffame.txtMailFrom,"Please enter a valid email address.")==false)
   {document.halloffame.txtMailFrom.focus();return false;}
   if (document.halloffame.txtCity.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter your city");
		document.halloffame.txtCity.focus();
		return false;
	}
	if (document.halloffame.txtState.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter your state");
		document.halloffame.txtState.focus();
		return false;
	}
	if (document.halloffame.txtZip.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter your ZIP Code");
		document.halloffame.txtZip.focus();
		return false;
	}
	if (document.halloffame.txtTitle.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter a title for your submission");
		document.halloffame.txtTitle.focus();
		return false;
	}
	if (document.halloffame.txtNomineeName.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter the nominee's name");
		document.halloffame.txtNomineeName.focus();
		return false;
	}
	if (document.halloffame.commText.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please let us know why you are nominating this person");
		document.halloffame.commText.focus();
		return false;
	}
	if (document.halloffame.commText.value.match(/href/))
	{
		alert("Sorry. To prevent spam you cannot place a URL in your story text.");
		document.halloffame.commText.focus();
		return false;
   }	
   if (document.halloffame.commText.value.match(/http/))
	{
		alert("Sorry. To prevent spam you cannot place a URL in story text.");
		document.halloffame.commText.focus();
		return false;
   }	
	if (document.halloffame.chkAgree.checked == false)
		{
		alert ("You have not agreed to the submission terms and conditions");
		document.halloffame.chkAgree.focus();
		return false;
		}
		
	if (document.halloffame.txtNomineePhone.value == "")
		{
		txtNomineePhoneIs = "Phone number not entered"
		}
	else
		{
		txtNomineePhoneIs = document.halloffame.txtNomineePhone.value
		}		
		
	if (document.halloffame.txtNomineeEmail.value == "")
		{
		txtNomineeEmailIs = "Email address not entered"
		}
	else
		{
		txtNomineeEmailIs = document.halloffame.txtNomineeEmail.value
		}			
		
	if (document.halloffame.ddAreYou.value == "Other")
		{
		chkAreYouIs = document.halloffame.txtOther.value
		}
	else
		{
		chkAreYouIs = document.halloffame.ddAreYou.value
		}	
		
	if (document.halloffame.chkNomineeContact.checked == false)
		{
		chkContactIs = "No"
		}
	else
		{
		chkContactIs = "Yes"
		}			
		
	if (document.halloffame.chkNewsletter.checked == false)
		{
		chkNewsletterIs = "No"
		}
	else
		{
		chkNewsletterIs = "Yes"
		}		
		
	msg = "Please Verify the Information you Entered: \n\n First Name: " + document.halloffame.txtFirstName.value + "\n Last Name: " + document.halloffame.txtLastName.value + "\n Email Address: " + document.halloffame.txtMailFrom.value + "\n City: " + document.halloffame.txtCity.value + "\n State: " + document.halloffame.txtState.value + "\n Zip Code: " + document.halloffame.txtZip.value + "\n You are a " + chkAreYouIs + "\n Title of Submission: " + document.halloffame.txtTitle.value + "\n Name of Nominee: " + document.halloffame.txtNomineeName.value + "\n Nominee's Email: " + txtNomineeEmailIs + "\n Nominee's Phone: " + txtNomineePhoneIs + "\n Should Patient Power contact them directly?: " + chkContactIs + "\n Nominee's Story: " + document.halloffame.commText.value + "\n Sign me up for the newsletter: " + chkNewsletterIs + "\n I have agreed to the terms and conditions: " + document.halloffame.chkAgree.value + "\n\n If this information is correct, click 'OK'. \n\n If you need to make changes, click 'Cancel' to be returned to the form."
   input_box=confirm(msg);
   if (input_box==true)   
   { 
   // Output when OK is clicked
   //alert ("You clicked OK"); 
   return true;
   }      
   else
   {
   // Output when Cancel is clicked
   //alert ("You clicked cancel");
   return false;
   }
}



function ValidateQuestions () {
   //txt1 refers to the form element id
	//Check for a word to search
   if (document.andrewQuestions.txtFirstName.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter your first name");
		document.andrewQuestions.txtFirstName.focus();
		return false;
	}
	if (document.andrewQuestions.txtLastName.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter your Last name");
		document.andrewQuestions.txtLastName.focus();
		return false;
	}	
	if (document.andrewQuestions.txtMailFrom.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter your email address");
		document.andrewQuestions.txtMailFrom.focus();
		return false;
	}		
	if (validate_email(document.andrewQuestions.txtMailFrom,"Please enter a valid email address.")==false){
      document.andrewQuestions.txtMailFrom.focus();
      return false;
   }
   if (document.andrewQuestions.txtCity.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter your city");
		document.andrewQuestions.txtCity.focus();
		return false;
	}
	if (document.andrewQuestions.txtState.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter your state");
		document.andrewQuestions.txtState.focus();
		return false;
	}
	if (document.andrewQuestions.txtZip.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter your ZIP Code");
		document.andrewQuestions.txtZip.focus();
		return false;
	}
	if (document.andrewQuestions.txtTitle.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter a title for your submission");
		document.andrewQuestions.txtTitle.focus();
		return false;
	}
	if (document.andrewQuestions.commText.value==""){
   	//change alert text to correspond to the form elements purpose
		alert("Please enter a question");
		document.andrewQuestions.commText.focus();
		return false;
	}
	if (document.andrewQuestions.commText.value.match(/href/))
	{
		alert("Sorry. To prevent spam you cannot place a URL in your story text.");
		document.andrewQuestions.commText.focus();
		return false;
   }	
   if (document.andrewQuestions.commText.value.match(/http/))
	{
		alert("Sorry. To prevent spam you cannot place a URL in story text.");
		document.andrewQuestions.commText.focus();
		return false;
   }	
	if (document.andrewQuestions.chkAgree.checked == false)
		{
		alert ("You have not agreed to the submission terms and conditions");
		document.andrewQuestions.chkAgree.focus();
		return false;
		}
		
	if (document.andrewQuestions.ddAreYou.value == "Other")
		{
		chkAreYouIs = document.andrewQuestions.txtOther.value
		}
	else
		{
		chkAreYouIs = document.andrewQuestions.ddAreYou.value
		}		
		
	if (document.andrewQuestions.chkNewsletter.checked == false)
		{
		chkNewsletterIs = "No"
		}
	else
		{
		chkNewsletterIs = "Yes"
		}			
		
	 msg = "Please Verify the Information you Entered: \n\n First Name: " + document.andrewQuestions.txtFirstName.value + "\n Last Name: " + document.andrewQuestions.txtLastName.value + "\n Email Address: " + document.andrewQuestions.txtMailFrom.value + "\n City: " + document.andrewQuestions.txtCity.value + "\n State: " + document.andrewQuestions.txtState.value + "\n Zip Code: " + document.andrewQuestions.txtZip.value + "\n You are a " + chkAreYouIs + "\n Question Title: " + document.andrewQuestions.txtTitle.value + "\n Question: " + document.andrewQuestions.commText.value + "\n Sign me up for the newsletter: " + chkNewsletterIs + "\n I have agreed to the terms and conditions: " + document.andrewQuestions.chkAgree.value + "\n\n If this information is correct, click 'OK'. \n\n If you need to make changes, click 'Cancel' to be returned to the form."
   input_box=confirm(msg);
   if (input_box==true)   
   { 
   // Output when OK is clicked
   //alert ("You clicked OK"); 
   return true;
   }      
   else
   {
   // Output when Cancel is clicked
   //alert ("You clicked cancel");
   return false;
   }
}


function refresh() 
{ 
    window.location.reload(); 
} 

//Rollover images preload

//FOOTER BUTTONS
//SIGN UP
footer1n = new Image(265,36);
footer1n.src = "/images/btn_ftr_1_n.jpg";
footer1r = new Image(265,36);
footer1r.src = "/images/btn_ftr_1_r.jpg";

//STORY
footer2n = new Image(265,36);
footer2n.src = "/images/btn_ftr_2_n.jpg";
footer2r = new Image(265,36);
footer2r.src = "/images/btn_ftr_2_r.jpg";

//PODCAST
footer3n = new Image(265,36);
footer3n.src = "/images/btn_ftr_3_n.jpg";
footer3r = new Image(265,36);
footer3r.src = "/images/btn_ftr_3_r.jpg";

//PODCAST
join1n = new Image(265,32);
join1n.src = "/images/btn_joincommunity_n.jpg";
join1r = new Image(265,32);
join1r.src = "/images/btn_joincommunity_r.jpg";


//PROMO
promo1n = new Image(78,29);
promo1n.src = "/images/btn_weeklypreview_n.jpg";
promo1r = new Image(78,29);
promo1r.src = "/images/btn_weeklypreview_r.jpg";

//AD BUTTONS
//SPECIAL EDITION AD 
adspeced1n = new Image(112,30);
adspeced1n.src = "/images/adbtn_specialed_n.gif";
adspeced1r = new Image(112,30);
adspeced1r.src = "/images/adbtn_specialed_r.gif";

//HIGHLIGHT AD 
adhighlight1n = new Image(112,30);
adhighlight1n.src = "/images/adbtn_highlight_n.gif";
adhighlight1r = new Image(112,30);
adhighlight1r.src = "/images/adbtn_highlight_r.gif";

//TOO GOOD TO MISS AD 
adtoogood1n = new Image(112,30);
adtoogood1n.src = "/images/adbtn_toogood_n.gif";
adtoogood1r = new Image(112,30);
adtoogood1r.src = "/images/adbtn_toogood_r.gif";

//WEBCAST AD 
adwebcast1n = new Image(112,30);
adwebcast1n.src = "/images/adbtn_webcast_n.gif";
adwebcast1r = new Image(112,30);
adwebcast1r.src = "/images/adbtn_webcast_r.gif";

tabReplay1n = new Image(203,25);
tabReplay1n.src = "/images/tabchooseby_1_n.gif";
tabReplay1r = new Image(203,25);
tabReplay1r.src = "/images/tabchooseby_1_s.gif";

tabReplay2n = new Image(136,25);
tabReplay2n.src = "/images/tabchooseby_2_n.gif";
tabReplay2r = new Image(136,25);
tabReplay2r.src = "/images/tabchooseby_2_s.gif";

tabReplay3n = new Image(135,25);
tabReplay3n.src = "/images/tabchooseby_3_n.gif";
tabReplay3r = new Image(135,25);
tabReplay3r.src = "/images/tabchooseby_3_s.gif";

tabReplay4n = new Image(135,25);
tabReplay4n.src = "/images/tabchooseby_4_n.gif";
tabReplay4r = new Image(135,25);
tabReplay4r.src = "/images/tabchooseby_4_s.gif";


tab1n = new Image(203, 25);
tab1n.src = "/images/tabprograms_1_n.gif";
tab1r = new Image(203, 25);
tab1r.src = "/images/tabprograms_1_s.gif";

tab2n = new Image(203, 25);
tab2n.src = "/images/tabprograms_2_n.gif";
tab2r = new Image(203, 25);
tab2r.src = "/images/tabprograms_2_s.gif";

tab3n = new Image(203, 25);
tab3n.src = "/images/tabprograms_3_n.gif";
tab3r = new Image(203, 25);
tab3r.src = "/images/tabprograms_3_s.gif";

tabME1n = new Image(139, 25);
tabME1n.src = "/images/tabmedexp_1_n.gif";
tabME1r = new Image(139, 25);
tabME1r.src = "/images/tabmedexp_1_s.gif";

tabME2n = new Image(228, 25);
tabME2n.src = "/images/tabmedexp_2_n.gif";
tabME2r = new Image(228, 25);
tabME2r.src = "/images/tabmedexp_2_s.gif";

tabME3n = new Image(175, 25);
tabME3n.src = "/images/tabmedexp_3_n.gif";
tabME3r = new Image(175, 25);
tabME3r.src = "/images/tabmedexp_3_s.gif";

//Listen Now 1
btnListen1n = new Image(74, 16);
btnListen1n.src = "/images/btn_listennow_n.jpg";
btnListen1r = new Image(74, 16);
btnListen1r.src = "/images/btn_listennow_r.jpg";

//Listen Now 2
btnListen2n = new Image(74, 16);
btnListen2n.src = "/images/btn_listennow_n.jpg";
btnListen2r = new Image(74, 16);
btnListen2r.src = "/images/btn_listennow_r.jpg";

//Listen Now 2
btnPreview1n = new Image(78, 29);
btnPreview1n.src = "/images/btn_weeklypreview_n.jpg";
btnPreview1r = new Image(78, 29);
btnPreview1r.src = "/images/btn_weeklypreview_r.jpg";

//Listen Now 2
btnPreview2n = new Image(78, 29);
btnPreview2n.src = "/images/btn_weeklypreview_n.jpg";
btnPreview2r = new Image(78, 29);
btnPreview2r.src = "/images/btn_weeklypreview_r.jpg";


//Listen Now 2
btnPreview3n = new Image(78, 29);
btnPreview3n.src = "/images/btn_weeklypreview_n.jpg";
btnPreview3r = new Image(78, 29);
btnPreview3r.src = "/images/btn_weeklypreview_r.jpg";

//P2 Minis Bars
btnP2Mn = new Image(495, 32);
btnP2Mn.src = "/images/p2_minis_bar_n.jpg";
btnP2Mr = new Image(495, 32);
btnP2Mr.src = "/images/p2_minis_bar_r.jpg";

//P2 Minis Bars
//btnP2Minisn = new Image(495, 32);
//btnP2Minisn.src = "p2minis/p2_minis_bar_n.jpg";
//btnP2Minisr = new Image(495, 32);
//btnP2Minisr.src = "p2minis/p2_minis_bar_r.jpg";


//PKU CLINIC LOCATOR
btnPKUn = new Image(112, 101);
btnPKUn.src = "pku/images/ad_pku-clinic-locator_n.jpg";
btnPKUr = new Image(112, 101);
btnPKUr.src = "pku/images/ad_pku-clinic-locator_r.jpg";

//p2tv1n = new Image(122, 70);
//p2tv1n.src = "/images/community/com_face_Karla.jpg";
//p2tv1r = new Image(122, 70);
//p2tv1r.src = "/images/community/com_face_Karla.jpg";

//p2tv2n = new Image(122, 70);
//p2tv2n.src = "/images/community/video_th_patriciabeck.jpg";
//p2tv2r = new Image(122, 70);
//p2tv2r.src = "/images/community/video_th_patriciabeck.jpg";


//p2tv3n = new Image(122, 70);
//p2tv3n.src = "/images/community/video_th_janellesabol.jpg";
//p2tv3r = new Image(122, 70);
//p2tv3r.src = "/images/community/video_th_janellesabol.jpg";

// Set up the image files to be used.
var theImages = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array.

theImages[0] = "radio/images/header_radio-people1.jpg"
theImages[1] = "radio/images/header_radio-people2.jpg"

// do not edit anything below this line

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}


/***********************************************
* Ultimate Fade-In Slideshow (v1.51): © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
 
var fadeimages1=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages1[0]=["/images/header/set0/hd_art1.jpg", "http://www.patientpower.info/programreplays.asp", ""] //plain image no text or link
fadeimages1[1]=["/images/header/set1/hd_anette-lusher.jpg", "/viewexpertsdetails.asp?Guest=1133Lusher&fn=Anette&ln=Lusher", ""]
fadeimages1[2]=["/images/header/set1/hd_drs-mulligan-chapman.jpg", "/listendatedetails.asp?showid=PP111509i&Date=11&Yr=2009", ""]
fadeimages1[3]=["/images/header/set1/hd_eric-rothenberg.jpg", "http://blog.patientpower.info/2009/09/28/a-lifesaving-zapper", ""]
fadeimages1[4]=["/images/header/set1/hd_gina-milano.jpg", "/viewexpertsdetails.asp?Guest=306&fn=Gina&ln=Milano", ""]
fadeimages1[5]=["/images/header/set1/hd_3women.jpg", "/andrewsstory.asp", ""]
 
var fadeimages2=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages2[0]=["/images/header/set0/hd_art2.jpg", "http://www.patientpower.info/programreplays.asp", ""] //plain image no text or link
fadeimages2[1]=["/images/header/set2/hd_hollis-guill-ryan.jpg", "/transcript.asp?docid=PP111509#Patient%20Power%20Awards", ""]
fadeimages2[2]=["/images/header/set2/hd_jamek_jackh.jpg", "/p2tv.asp?video=8104200&autoplay=1", ""]
fadeimages2[3]=["/images/header/set2/hd_jill-peterson.jpg", "/listendatedetails.asp?showid=UW021209&Date=2&Yr=2009", ""]
fadeimages2[4]=["/images/header/set2/hd_leslie-chui.jpg", "", ""]
fadeimages2[5]=["/images/header/set2/hd_andrew-ruthie-schorr.jpg", "/viewexpertsdetails.asp?Guest=342&fn=Lorie%20Rietman&ln=Wild,%20Ph.D.,%20R.N.,%20C.N.A.A.,%20B.C.", ""]

var fadeimages3=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages3[0]=["/images/header/set0/hd_art3.jpg", "http://www.patientpower.info/programreplays.asp", ""] //plain image no text or link
fadeimages3[1]=["/images/header/set3/hd_anette-lusher.jpg", "/viewexpertsdetails.asp?Guest=1133Lusher&fn=Anette&ln=Lusher", ""]
fadeimages3[2]=["/images/header/set3/hd_nancy-key.jpg", "/transcript.asp?docid=PP111509#Patient%20Power%20Awards", ""]
fadeimages3[3]=["/images/header/set3/hd_stephen-zieniewicz.jpg", "", ""]
fadeimages3[4]=["/images/header/set3/hd_una-wilson.jpg", "/listensponsordetails.asp?showid=SCCA012308&sponsor=Seattle%20Cancer%20Care%20Alliance", ""]
fadeimages2[5]=["/images/header/set3/hd_sunil-hingorani_hhs.jpg", "/viewexpertsdetails.asp?Guest=944Hingorani, M.D., PhD&fn=Sunil&ln=Hingorani, M.D., Ph.D.", ""]


var fadeimages4=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages4[0]=["/images/header/set0/hd_art4.jpg", "http://www.patientpower.info/programreplays.asp", ""] //plain image no text or link
fadeimages4[1]=["/images/header/set4/hd_anette-lusher.jpg", "/viewexpertsdetails.asp?Guest=1133Lusher&fn=Anette&ln=Lusher", ""]
fadeimages4[2]=["/images/header/set4/hd_jamek_jackh.jpg", "/p2tv.asp?video=8104200&autoplay=1", ""]
fadeimages4[3]=["/images/header/set4/hd_leslie-chui.jpg", "http://www.patientpower.info/listenreplaydetails.asp?showid=kvi101407", ""]
fadeimages4[4]=["/images/header/set4/hd_una-wilson.jpg", "/listensponsordetails.asp?showid=SCCA012308&sponsor=Seattle%20Cancer%20Care%20Alliance", ""]
fadeimages2[5]=["/images/header/set3/hd_sunil-hingorani_hhs.jpg", "/viewexpertsdetails.asp?Guest=944Hingorani, M.D., PhD&fn=Sunil&ln=Hingorani, M.D., Ph.D.", ""]


var fadeimagesvfth=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimagesvfth[0]=["/images/community/pix_pphilite_vfth1.jpg", "voicesfromtheheart.asp?story=kristen", ""] //plain image no text or link
fadeimagesvfth[1]=["/images/community/pix_pphilite_vfth2.jpg", "voicesfromtheheart.asp?story=jen", ""]
fadeimagesvfth[2]=["/images/community/pix_pphilite_vfth3.jpg", "voicesfromtheheart.asp?story=rebecca", ""]

var fadeimagespl08=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimagespl08[0]=["/images/community/potluck08/rgp_081019_7770.jpg", "", ""]
fadeimagespl08[1]=["/images/community/potluck08/rgp_081019_7774.jpg", "", ""]
fadeimagespl08[2]=["/images/community/potluck08/rgp_081019_7778.jpg", "", ""]
fadeimagespl08[3]=["/images/community/potluck08/rgp_081019_7779.jpg", "", ""]
fadeimagespl08[4]=["/images/community/potluck08/rgp_081019_7784.jpg", "", ""]
fadeimagespl08[5]=["/images/community/potluck08/rgp_081019_7786.jpg", "", ""]
fadeimagespl08[6]=["/images/community/potluck08/rgp_081019_7787.jpg", "", ""]
fadeimagespl08[7]=["/images/community/potluck08/rgp_081019_7830.jpg", "", ""]
fadeimagespl08[8]=["/images/community/potluck08/rgp_081019_7832.jpg", "", ""]
fadeimagespl08[9]=["/images/community/potluck08/rgp_081019_7834.jpg", "", ""]
fadeimagespl08[10]=["/images/community/potluck08/rgp_081019_7837.jpg", "", ""]

var fadeimagesponsors=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimagesponsors[0]=["/images/sponsors/logo_harborview.jpg", "sponsors.asp#harborview", ""]
fadeimagesponsors[1]=["/images/sponsors/logo_mdanderson.jpg", "sponsors.asp#mdanderson", ""]
fadeimagesponsors[2]=["/images/sponsors/logo_nmh.jpg", "sponsors.asp#nmh", ""]
fadeimagesponsors[3]=["/images/sponsors/logo_ohsu.jpg", "sponsors.asp#ohsu", ""]
fadeimagesponsors[4]=["/images/sponsors/logo_scca.jpg", "sponsors.asp#scca", ""]
//fadeimagesponsors[5]=["/images/sponsors/logo_ucla.jpg", "sponsors.asp#ucla", ""]
fadeimagesponsors[5]=["/images/sponsors/logo_ucsd.jpg", "sponsors.asp#ucsd", ""]
fadeimagesponsors[6]=["/images/sponsors/logo_ucsf.jpg", "sponsors.asp#ucsf", ""]
//fadeimagesponsors[8]=["/images/sponsors/logo_ummc.jpg", "sponsors.asp#ummc", ""]
fadeimagesponsors[7]=["/images/sponsors/logo_uwmedicine.jpg", "sponsors.asp#uw", ""]
fadeimagesponsors[8]=["/images/sponsors/logo_vmc.jpg", "sponsors.asp#vmc", ""]
//fadeimagesponsors[11]=["/images/sponsors/logo_sgb.jpg", "sponsors.asp#seniorguidebook", ""]
//var fadeimagesradio=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
//fadeimagesradio[0]=["radio/images/header_radio-people1.jpg", "http://www.patientpowerradio.com", ""] //plain image no text or link
//fadeimagesradio[1]=["radio/images/header_radio-people2.jpg", "http://www.patientpowerradio.com", ""]


 
var fadebgcolor="white"

////NO need to edit beyond here/////////////
var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
 
function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")
theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}
 
var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;float:right;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}

function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
else if (obj.tempobj.style.opacity&&!obj.tempobj.filters)
obj.tempobj.style.opacity=obj.degree/101
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}
 
fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}
 
 
fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}
 
fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=this.degree/100
else if (crossobj.style.opacity&&!crossobj.filters)
crossobj.style.opacity=this.degree/101
}
 
 
fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}

function popUp(url,name,width,height,left,top) {
	pWindow = window.open(url,name,'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
	pWindow.focus();
}









