// JavaScript Document

<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function fn_forgotpw(){
	// User has forgotten their password
	document.f_login.user_action.value = 'forgotpw';
	document.f_login.action = 'index.php';
	document.f_login.submit();
}

function fn_forgotpwproc(){
	// User is requesting password to be sent
	if(document.f_forgotpw.vt_Email.value != ''){
		//document.f_forgotpw.user_action.value = 'forgotpw';
		document.f_forgotpw.action = '/index.php/Welcome/forgotpw';
		document.f_forgotpw.submit();
	}else{
		// No email provided
		alert("Please enter your email address");
	}
}

function fn_contactus(){
	// User wants to go to the Contact us page
	document.f_main.user_action.value = 'contactus';
	document.f_main.action = 'index.php';
	document.f_main.submit();
}

function fn_EmailHost(){
	// User wants to email the show host
	document.f_main.action = '/index.php/Welcome/contacthost/'+document.f_browse.selected_collection.value;
	document.f_main.submit();
}

function fn_contactusproc(){
	// User has clicked SEND button on Contact Us form
	if(document.f_contact.vt_Name.value != ''){
		if(document.f_contact.vt_Email1.value != ''){
			if(document.f_contact.vt_Email2.value != ''){
				if(document.f_contact.vt_Email1.value == document.f_contact.vt_Email2.value){
					if(document.f_contact.vt_Subject.value != ''){
						if(document.f_contact.vt_Message.value != ''){
							// All looks ok here - submit it
							document.f_contact.user_action.value = 'contactusproc';
							document.f_contact.action = '/index.php/Welcome/contactus';
							document.f_contact.submit();
						}else{
							// No message body provided
							alert("Please enter your message")
						}
					}else{
						// No subject entered
						alert("Please enter the subject of your message");
					}
				}else{
					// Email addresses don't match
					alert("The email addresses you have entered don't match");
				}
			}else{
				// No 2nd email address provided
				alert("Please enter the email address twice.");
			}
		}else{
			// No email provided
			alert("Please enter your email address");
		}
	}else{
		// No name provided
		alert("Please enter your name");
	}
}

function fn_contacthostproc(){
	// User has clicked SEND button on Contact Us form
	if(document.f_contact.vt_Name.value != ''){
		if(document.f_contact.vt_Email1.value != ''){
			if(document.f_contact.vt_Email2.value != ''){
				if(document.f_contact.vt_Email1.value == document.f_contact.vt_Email2.value){
					if(document.f_contact.vt_Subject.value != ''){
						if(document.f_contact.vt_Message.value != ''){
							// All looks ok here - submit it
							document.f_contact.user_action.value = 'contacthostproc';
							document.f_contact.action = '/index.php/Welcome/contacthost/'+document.f_browse.selected_collection.value;
							document.f_contact.submit();
						}else{
							// No message body provided
							alert("Please enter your message")
						}
					}else{
						// No subject entered
						alert("Please enter the subject of your message");
					}
				}else{
					// Email addresses don't match
					alert("The email addresses you have entered don't match");
				}
			}else{
				// No 2nd email address provided
				alert("Please enter the email address twice.");
			}
		}else{
			// No email provided
			alert("Please enter your email address");
		}
	}else{
		// No name provided
		alert("Please enter your name");
	}
}

function fn_Login(){
	// User wishes to login to the system
	if(document.f_login.vt_LoginID.value != ''){
		if(document.f_login.vt_Password.value != ''){
			// We have some values to submit
			document.f_login.user_action.value = 'login';
			document.f_login.action = '/index.php/Welcome/login';
			document.f_login.submit();
		}else{
			alert("Please enter your password");
		}
	}else{
		alert("Please enter your Login ID");
	}
}

function fn_AlesisLogin(){
	// User wishes to login to the system
	if(document.f_login.vt_LoginID.value != ''){
		if(document.f_login.vt_Password.value != ''){
			// We have some values to submit
			// Encyrpt the password with MD5
			var vt_OrigPW = document.f_login.vt_Password.value;
			var vt_NewPW = encodeBase64(vt_OrigPW);
			
			document.f_login.vt_Password.value = '';
			document.f_login.vt_Password.value = vt_NewPW;
			document.f_login.user_action.value = 'login';
			document.f_login.action = '/index.php/Welcome/alesislogin';
			document.f_login.submit();
		}else{
			alert("Please enter your password");
		}
	}else{
		alert("Please enter your Login ID");
	}
}

function fn_Logout(){
	// User wishes to Logout of the system
	document.f_login.user_action.value = 'logout';
	document.f_login.action = '/index.php';
	document.f_login.submit();
}

function fn_PrivacyPolicy(){
	// User wishes to view the Privacy Policy
	document.f_main.user_action.value = 'privacy';
	document.f_main.action = '/index.php/Welcome/privacy';
	document.f_main.submit();
}

function fn_FreeTrial(){
	// User wishes to view the Free Trial page
	document.f_main.user_action.value = 'freetrialintro';
	document.f_main.action = '/index.php/Welcome/trial';
	document.f_main.submit();
}

function fn_BrowseCategory(CatalogNo, CategoryNo){
	// User wishes to browse a category
	document.f_browse.user_action.value = 'browse_category';
	document.f_browse.selected_catalog.value = CatalogNo;
	document.f_browse.selected_category.value = CategoryNo;
	document.f_browse.action = '/index.php';
	document.f_browse.submit();
}

function fn_DisplayCollection(CollectionNo){
	// User wishes to view the detail on a collection
	document.f_browse.user_action.value = 'collection_detail';
	document.f_browse.selected_collection.value = CollectionNo;
	document.f_browse.action = '/index.php';
	document.f_browse.submit();
}

function fn_ManageFans(){
	// User wishes to manage their fanbase
	document.f_main.user_action.value = 'managefans';
	document.f_main.action = '/index.php';
	document.f_main.submit();
}

function fn_ManageStats(){
	// User wishes to manage their fanbase
	document.f_main.user_action.value = 'managestats';
	document.f_main.action = '/index.php';
	document.f_main.submit();
}

function fn_ManageSales(){
	// User wishes to manage their fanbase
	document.f_main.user_action.value = 'managesales';
	document.f_main.action = '/index.php';
	document.f_main.submit();
}

function fn_ManageAccount(){
	// User wishes to manage their fanbase
	document.f_main.user_action.value = 'manageaccount';
	document.f_main.action = '/index.php';
	document.f_main.submit();
}

function fn_ManageAudio(){
	// User wishes to manage their fanbase
	document.f_main.user_action.value = 'manageaudio';
	document.f_main.action = '/index.php';
	document.f_main.submit();
}

function fn_AboutUs(){
	// User wishes to view the About Us page
	document.f_main.user_action.value = 'aboutus';
	document.f_main.action = '/index.php';
	document.f_main.submit();
}

function fn_GetTechie(){
	// User wants to view the techie details
	document.f_main.user_action.value = 'letsgettechie';
	document.f_main.action = '/index.php';
	document.f_main.submit();
}

function fn_faq(){
	// User wants to view FAQs
	document.f_main.user_action.value = 'faq';
	document.f_main.action = '/index.php';
	document.f_main.submit();
}

function fn_GoHome(){
	// User wants to return to My Audio
	fn_ManageAudio();
}

function fn_Signup(){
	// User wants to sign up for a free account
	document.f_main.user_action.value = 'createaccount';
	document.f_main.action = '/index.php';
	document.f_main.submit();
}

function fn_ValidateCreateAccount(){
	// Validates the form for account creation
	if(document.f_createaccount.vt_FirstName.value != ''){
		if(document.f_createaccount.vt_LastName.value != ''){
			if(document.f_createaccount.vt_PrefName.value != ''){
				if(document.f_createaccount.vt_Address1.value != ''){
					if(document.f_createaccount.vt_City.value != ''){
						if(document.f_createaccount.vt_State.value != ''){
							if(document.f_createaccount.vt_Zip.value != ''){
								if(document.f_createaccount.vt_Country.value != ''){
									if(document.f_createaccount.vt_Email1.value != ''){
										if(document.f_createaccount.vt_Email2.value != ''){
											if(document.f_createaccount.vt_Email1.value == document.f_createaccount.vt_Email2.value){
												if(document.f_createaccount.vt_Phone.value != ''){
													if(document.f_createaccount.vt_LoginID.value != ''){
														if(document.f_createaccount.vt_Password1.value != ''){
															if(document.f_createaccount.vt_Password2.value != ''){
																if(document.f_createaccount.vt_Password1.value == document.f_createaccount.vt_Password2.value){
																	// All looks good...Submit it
																	document.f_createaccount.user_action.value = 'checklogin';
																	document.f_createaccount.action = '/index.php/Welcome/checklogin';
																	document.f_createaccount.submit();
																}else{
																	// Passwords don't match
																	alert("The passwords you have entered do not match");
																}
															}else{
																// Password 2
																alert("Please enter your password again");
															}
														}else{
															// Password 1
															alert("Please choose a password for your account");
														}
													}else{
														// Login ID
														alert("Please choose a Login ID for your account");
													}
												}else{
													// Phone No
													alert("Please enter your phone number");
												}
											}else{
												// Email addresses don't match
												alert("The email addresses you have entered do not match");
											}
										}else{
											// Email 2
											alert("Please re-enter your email address");
										}
									}else{
										// Email 
										alert("Please enter your email address");
									}
								}else{
									// Country
									alert("Please enter your country");
								}
							}else{
								// Zip
								alert("Please enter your Zip or Postal Code");
							}
						}else{
							// State
							alert("Please enter your state or province");
						}
					}else{
						// No city
						alert("Please enter your City");
					}
				}else{
					// No Address1
					alert("Please enter a value for line 1 of your Address");
				}
			}else{
				// No Preferred Name
				alert("Please enter a Preferred Name");
			}
		}else{
			// No Last Name
			alert("Please enter your Last Name");
		}
	}else{
		// No first name entered
		alert("Please enter your First name");
	}
}

function fn_ValidateCreateAccountAlesis(){
	// Validates the form for account creation
	if(document.f_createaccount.vt_FirstName.value != ''){
		if(document.f_createaccount.vt_LastName.value != ''){
			if(document.f_createaccount.vt_PrefName.value != ''){
				if(document.f_createaccount.vt_Address1.value != ''){
					if(document.f_createaccount.vt_City.value != ''){
						if(document.f_createaccount.vt_State.value != ''){
							if(document.f_createaccount.vt_Zip.value != ''){
								if(document.f_createaccount.vt_Country.value != ''){
									if(document.f_createaccount.vt_Email1.value != ''){
										if(document.f_createaccount.vt_Email2.value != ''){
											if(document.f_createaccount.vt_Email1.value == document.f_createaccount.vt_Email2.value){
												if(document.f_createaccount.vt_Phone.value != ''){
													if(document.f_createaccount.vt_LoginID.value != ''){
														if(document.f_createaccount.vt_Password1.value != ''){
															if(document.f_createaccount.vt_Password2.value != ''){
																if(document.f_createaccount.vt_Password1.value == document.f_createaccount.vt_Password2.value){
																	if(document.f_createaccount.vt_Product.value != 'Select'){
																		if(document.f_createaccount.vt_SerialNo.value != ''){
																				// All looks good...Submit it
																				document.f_createaccount.user_action.value = 'checklogin';
																				document.f_createaccount.action = '/index.php/Welcome/checklogin';
																				document.f_createaccount.submit();
																		}else{
																			// No serial no entered
																			alert("Please enter the serial number of your product");
																		}
																	}else{
																		// No product chosen
																		alert("Please choose an Alesis Product that you have purchased");
																	}
																}else{
																	// Passwords don't match
																	alert("The passwords you have entered do not match");
																}
															}else{
																// Password 2
																alert("Please enter your password again");
															}
														}else{
															// Password 1
															alert("Please choose a password for your account");
														}
													}else{
														// Login ID
														alert("Please choose a Login ID for your account");
													}
												}else{
													// Phone No
													alert("Please enter your phone number");
												}
											}else{
												// Email addresses don't match
												alert("The email addresses you have entered do not match");
											}
										}else{
											// Email 2
											alert("Please re-enter your email address");
										}
									}else{
										// Email 
										alert("Please enter your email address");
									}
								}else{
									// Country
									alert("Please enter your country");
								}
							}else{
								// Zip
								alert("Please enter your Zip or Postal Code");
							}
						}else{
							// State
							alert("Please enter your state or province");
						}
					}else{
						// No city
						alert("Please enter your City");
					}
				}else{
					// No Address1
					alert("Please enter a value for line 1 of your Address");
				}
			}else{
				// No Preferred Name
				alert("Please enter a Preferred Name");
			}
		}else{
			// No Last Name
			alert("Please enter your Last Name");
		}
	}else{
		// No first name entered
		alert("Please enter your First name");
	}
}

function fn_TermsAgree(){
	// User wants to proceed after the terms
	if(document.f_terms.vt_TermsAgree.checked){
		// User has agreed to the terms
		document.f_main.user_action.value = 'termsagree';
		document.f_main.action = '/index.php/Welcome/termsagree';
		document.f_main.submit();
	}else{
		alert("You may not proceed and create an account without first agreeing to the terms of service.");
	}
}

function fn_GoToTOS(){
	// User wants to proceed to the Terms of Service acceptance
	//document.f_main.user_action.value = 'termsofservice';
	document.f_main.action = '/index.php/Welcome/tos';
	document.f_main.submit();
}

function fn_redirect_to_prodhome(){
	// Redirect the user to the Producer Home page
	top.location.href = '/index.php/Producer/MyAudio';
}

function fn_UploadType(){
	// User wants to upload a file and hase chosen the type
	var checkvalue = '';
	
	for (i=0, n=document.f_type.bUploadType.length; i<n; i++) {
	   if (document.f_type.bUploadType[i].checked) {
	      var checkvalue = document.f_type.bUploadType[i].value;
	      break;
	   }
	}
	
	// Make sure that the user has chosen a radio button
	if(checkvalue != ''){
		if(checkvalue == 'podcast'){
			// Podcast
			document.f_type.action = '/index.php/Producer/upload_podcast';
		}else{
			if(checkvalue == 'music'){
				document.f_type.action = '/index.php/Producer/upload_music';
			}else{
				if(checkvalue == 'other'){
					document.f_type.action = '/index.php/Producer/upload_other';	
				}else{
					alert("Invalid type selected - "+document.f_type.bUploadType.value);
				}
			}
		}
	
	}else{
		// No value has been checked
		alert("Please click on one of the options by checking the radio button on the left side of the photo.");
	}
	
	document.f_type.submit();
}

function fn_ValidatePodcastCreate(){
	// Checks form entry for Podcast Creation
	if(document.f_createpodcast.vt_Title.value != ''){
		if(document.f_createpodcast.vt_Desc.value != ''){
			if(document.f_createpodcast.vt_Host.value != ''){
				if(document.f_createpodcast.vt_Language.value != ''){
					if(document.f_createpodcast.vt_Explicit.value != ''){
						// All looks good at this point
						if(document.f_createpodcast.vt_InListing.checked){
							// The user wants to request to add this to the listing
							document.f_createpodcast.vt_col_list.value = 'Y';
						}else{
							// Don't add to the listing
							document.f_createpodcast.vt_col_list.value = 'N';
						}
						document.f_createpodcast.action = '/index.php/Producer/createpodcastprocess';
						document.f_createpodcast.submit();
					}else{
						// No explicit check chosen
						alert("Please choose whether this Podcast has explicit or Adult content");
					}
				}else{
					// No language chosen
					alert("Please choose a language for your Podcast");
				}
			}else{
				// No host defined
				alert("Please enter a Host name for your Podcast");
			}
		}else{
			// No Description provided
			alert("Please enter a description of your Podcast");
		}
	}else{
		// No title provided
		alert("Please enter a title for your Podcast");
	}
}

function fn_ValidateMusicColCreate(){
	// Checks form entry for Music Collection creation
	if(document.f_createmusiccol.vt_col_name.value != ''){
		if(document.f_createmusiccol.vt_col_desc.value != ''){
			if(document.f_createmusiccol.vt_col_hostname.value != ''){
				if(document.f_createmusiccol.vt_Language.value != ''){
					if(document.f_createmusiccol.vt_Explicit.value != ''){
						// All looks good here
						if(document.f_createmusiccol.vt_InListing.checked){
							// The user wants to request to add this to the listing
							document.f_createmusiccol.vt_col_list.value = 'Y';
						}else{
							// Don't add to the listing
							document.f_createmusiccol.vt_col_list.value = 'N';
						}						
						document.f_createmusiccol.action = '/index.php/Producer/reviewmusiccollection';
						document.f_createmusiccol.submit();
					}else{
						// No explicit check chosen
						alert("Please choose whether this collection contains explicit or adult content");
					}
				}else{
					// No Language selected
					alert("Please choose the language of this collection");
				}
			}else{
				// No artist name provided
				alert("Please enter the name of the artist for this collection");
			}
		}else{
			// No description provided
			alert("Please enter a description of this collection");
		}
	}else{
		// No Name provided
		alert("Please enter a title for your collection");
	}
}

function fn_UpdatePodcast(){
	document.f_createpodcast.action = '/index.php/Producer/podcast_create/e';
	document.f_createpodcast.submit();
}

function fn_Cat1Change(){
	// Podcast Category 1 Pulldown has been changed
	fn_UpdatePodcast();
}

function fn_SavePodcast(){
	// Submits the form for saving
	document.f_createpodcast.action = '/index.php/Producer/podcast_save';
	document.f_createpodcast.submit();
}

function fn_SaveCollection(){
	// Submits the form for saving
	document.f_reviewcollection.action = '/index.php/Producer/collection_save';
	document.f_reviewcollection.submit();
}

function fn_UpdateCollection(){
	document.f_reviewcollection.action = '/index.php/Producer/createMusicCollection';
	document.f_reviewcollection.submit();	
}

function fn_SaveSound(){
	// Validates the sound entry form and then submits
	if(document.f_sound.vt_snd_name.value != ''){
		if(document.f_sound.vt_snd_desc.value != ''){
			if(document.f_sound.vt_snd_author.value != ''){
				// All ok to submit
				document.f_sound.sound_store_no.value = document.f_main.sound_store_no.value;
				document.f_sound.col_no.value = document.f_main.col_no.value;
				document.f_sound.action = '/index.php/Producer/savesound';
				document.f_sound.submit();
			}else{
				// No author
				alert("You must enter the name of the author of this audio");
			}
		}else{
			// No description
			alert("You must enter a description for this audio");
		}
	}else{
		// No name of file provided
		alert("You must enter a name for this audio");
	}
}

function fn_DoThisOnLoad(){
	// Executes this function automatically when a page is loaded
	if(document.f_main.do_this.value != ''){
		// Execute whatever Do This is
		execute(document.f_main.do_this.value);
	}
}

function keepalive(){
if (secs30++ > 6){
  var Image1= new Image(1,1);
  Image1.src = "/index.php/Welcome/dummy";
  secs30 = 0;
  }
setTimeout("keepalive()",30000);
} 

function fn_Back(){
	// Handles the equivalent of the Back button 
	top.history.back();
}

function fn_Paynow($a_from_welcome){
	// Validates the subscribe form contents
	if(document.f_subscribe.subscribeoption.value != 'Choose'){
		if(document.f_subscribe.cardname.value != ''){
			if(document.f_subscribe.cardno.value != ''){
				if(document.f_subscribe.expmonth.value != ''){
					if(document.f_subscribe.expyear.value != ''){
						if(document.f_subscribe.ccid.value != ''){
							if(document.f_subscribe.billaddress1.value != ''){
								if(document.f_subscribe.billcity.value != ''){
									if(document.f_subscribe.billstate.value != ''){
										if(document.f_subscribe.billzip.value != ''){
											if(document.f_subscribe.billcountry.value != 'select'){
												// Check if the user has checked the agreement checkbox
												if(document.f_subscribe.agreecharge.checked){
													// We're good to go here... Process this
													if($a_from_welcome == 1){
														document.f_subscribe.action = '/index.php/Welcome/subscribeprocess/'+document.f_subscribe.userno.value+'/1';	
													}else{
														document.f_subscribe.action = '/index.php/Account/subscribeprocess/'+document.f_subscribe.userno.value;
													}
													document.f_subscribe.submit();
												}else{
													alert("You haven't checked that you agreement with the terms of this transaction");
												}
											}else{
												alert("Please choose the country for the credit card billing address");
											}
										}else{
											alert("Please enter the Zip/Postal code of your credit card billing address");
										}
									}else{
										alert("Please enter the state or province of your credit card billing address");
									}
								}else{
									alert("Please enter the city of your credit card billing address");
								}
							}else{
								alert("Please enter your credit card billing address");
							}
						}else{
							alert("Please enter the CCID on your credit card");
						}
					}else{
						alert("Please choose the year for the expiration date of your credit card");
					}
				}else{
					alert("Please choose a month for the expiration date of your credit card");
				}
			}else{
				alert("Please enter your credit card number");
			}
		}else{
			alert("Please enter the name on your credit card");
		}
	}else{
		alert("Please choose a subscription option");
	}
}

function fn_CCIDExplain(){
	// Opens popup window to explain what CCID is all about
	window.open('/CCIDExplain.html','win',"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=400,height=375");
}

function fn_UpdateContact(){
	// Submits the update contact form
	if(document.f_contact.yourname.value != ''){
		if(document.f_contact.emailaddress.value != ''){
			document.f_contact.action = '/index.php/Account/updatecontactprocess/'+document.f_contact.user_no.value;
			document.f_contact.submit();
		}else{
			alert("Please enter a valid email address");
		}
	}else{
		alert("Please enter your name");
	}
}

function fn_Chgpw(){
	// Checks and submits the change password form
	if(document.f_chgpwd.pw1.value != ''){
		if(document.f_chgpwd.pw2.value != ''){
			if(document.f_chgpwd.pw1.value == document.f_chgpwd.pw2.value){
				// Passwords match - update
				document.f_chgpwd.action = '/index.php/Account/changepasswordproc';
				document.f_chgpwd.submit();
			}else{
				alert("Your passwords don't match.  Please re-enter them.");
			}
		}else{
			alert("Please retype your password");
		}
	}else{
		alert("Please enter your new password");
	}
}


function fn_UpdateUserStatus(){
	// Updates a user status
	document.f_update.action = '/index.php/Admin/saveuser/'+document.f_update.user_no.value+'/'+document.f_update.user_status.value;
	document.f_update.submit();
}

function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}

function fn_FanValidate(){
	// Validates the Fan signup form
	if(document.f_fan.vt_FanName.value != ''){
		if(document.f_fan.vt_FanEmail.value != ''){
			if(document.f_fan.vt_FanCountry.value != ''){
				// We have enough to submit
				if(document.f_fan.cbHost.checked){
					document.f_fan.bEmailHost.value = 'Y';
				}else{
					document.f_fan.bEmailHost.value = 'N';
				}
				if(document.f_fan.cbCyberEars.checked){
					document.f_fan.bEmailCyb.value = 'Y';
				}else{
					document.f_fan.bEmailCyb.value = 'N';
				}
				document.f_fan.action = '/index.php/Show/fan_create/'+document.f_fan.col_no.value;
				document.f_fan.submit();
			}else{
				// No country entered
				alert("Please select your country");
			}
		}else{
			// No email entered
			alert("Please enter your email address");
		}
	}else{
		// No name entered
		alert("Please enter your name");
	}
}

function fn_FanSignUp(col_no){
	// User wants to signup to be a fan
	document.f_browse.action = '/index.php/Show/fan_signup/'+document.f_browse.selected_collection.value;
	document.f_browse.submit();
}

function fn_SetPopupContent(comment_id){
	// Sets the popup content to this value
	ADPcontent1="<iframe src=\"http://www.cyberears.com/index.php/Producer/show_fan_comment/"+comment_id+"\" name=\"adpiframe\" id=\"adpiframe\" width=100% height=100% align=\"center\" Frameborder=\"0\" Scrolling=\"yes\" marginheight=\"0\" marginwidth=\"0\"></iframe>";
}

function fn_FEValidate(){
	if(document.f_fe.vt_FESubject.value != ''){
		if(document.f_fe.vt_FEBody.value != ''){
			if(document.f_fe.vt_ColFans.value != ''){
				// All looks good - do it
				document.f_fe.action = '/index.php/Producer/sendfanemail/'+document.f_fe.vt_ColFans.value;
				document.f_fe.submit();
			}else{
				alert("Please select a collection to notify fans about");
			}
		}else{
			alert("Please enter something for the email body");
		}
	}else{
		alert("Please enter a subject");
	}
}

function fn_Authorize(){
	// Function to authorize a play of a protected audio file
	if(document.f_secure.vt_AudioPassword.value != ''){
		document.f_secure.action = '/index.php/Browse/playaudio/'+document.f_secure.vt_AudioSoundNo.value;
		document.f_secure.submit();
	}else{
		alert("Please enter the password");
	}
}

function fn_SendCybEmail(){
	// Sends email to CyberEars users
	document.f_email.action = '/index.php/Admin/sendcybemail';
	document.f_email.submit();
}


function fn_BrowseCat1Change(){
	// User has chosen a category from the Cat PD in the Browse screen for Podcasts
	var $url = '/index.php/Browse/category/1/';
	
	$url = $url + document.f_browse_content.vt_Cat1.options[document.f_browse_content.vt_Cat1.selectedIndex].value;
	$url = $url + '/' + document.f_browse_content.vt_browsetype.value;
	$url = $url + '/' + document.f_browse_content.vt_Order.options[document.f_browse_content.vt_Order.selectedIndex].value;
	
	document.f_browse_content.action = $url;
	document.f_browse_content.submit();
}

function fn_SubmitLinkApplication(){
	// User wants to submit a link application to us
	if(document.f_application.vt_LAName.value != ''){
		if(document.f_application.vt_LAEmail.value != ''){
			if(document.f_application.vt_LASiteTitle.value != ''){
				if(document.f_application.vt_LASiteURL.value != ''){
					if(document.f_application.vt_LAImageURL.value != ''){
						if(document.f_application.vt_LASiteText.value != ''){
							// All Looks good
							document.f_application.action = '/index.php/Welcome/processlinkapplication';
							document.f_application.submit();
						}else{
							// No Text for the site
							alert("Please enter some text to describe your site");
						}
					}else{
						// No Image URL
						alert("Please enter the URL to a graphic image to display for your site");
					}
				}else{
					// No Site URL
					alert("Please enter your website's URL address");
				}
			}else{
				// No Site Title
				alert("Please enter your web site Title");
			}
		}else{
			// No email provided
			alert("Please enter your email address");
		}
	}else{
		// No name provided
		alert("Please enter your name");
	}
}
//-->
