
var g_resxStrings={};g_resxStrings["RemoveProjectAreYouSure"]='Really? Are you sure you want to remove your project? You won\'t be able to change your mind after you click \"yes\".';g_resxStrings["RestoreSubmissionAreYouSure"]='Are you sure you want to restore this submission?  It will be included with your project if you select OK.';g_resxStrings["NoBlankFeedback"]='You cannot leave blank feedback';g_resxStrings["DeleteCommentAreYouSure"]='Are you sure you want to delete this comment??';g_resxStrings["UIDirection"]='LTR';g_resxStrings["CancelFeedbackAreYouSure"]='If you cancel now, none of the feedback elements that you worked on will be saved. Are you sure that you want to cancel?';g_resxStrings["NoSavedTips"]='You have not saved any tips yet.';g_resxStrings["EnterASubject"]='Please enter a subject.';g_resxStrings["EnterAMessage"]='Please enter a message.';g_resxStrings["Sending"]='sending...';g_resxStrings["SpecifyEmailAddress"]='You must specify the recipient\'s email address';g_resxStrings["Searching"]='Searching...';g_resxStrings["SelectAFriend"]='You must select at least one friend.';g_resxStrings["Adding"]='adding...';g_resxStrings["SearchBarTerms"]='Find project, member or group';g_resxStrings["SavingAndClosing"]='Saving and Closing';g_resxStrings["NoMoreThanXCharacters"]='Please enter no more than {0} characters';g_resxStrings["Chosen"]='Chosen';g_resxStrings["Rejected"]='Rejected';g_resxStrings["Spotlighted"]='Spotlighted';g_resxStrings["Underdogged"]='Underdogged';g_resxStrings["SpotlightUnderdogOff"]='off';g_resxStrings["RejectProjConfirmMsg"]='This will reject the project from publication and un-freeze it.  Continue?';g_resxStrings["PublicationProjConfirmMsg"]='You are selecting this project for publication.  Continue?';g_resxStrings["SpotlightProjConfirmMsg"]='You are putting this project in the spotlight.  Continue?';g_resxStrings["UnderdogProjConfirmMsg"]='You are setting this project as underdog.  Continue?';g_resxStrings["Poll_Suspend"]='Suspend';g_resxStrings["Poll_Reactivate"]='Reactivate';g_resxStrings["Not_Number_Alert"]='Please enter only numbers.';g_resxStrings["ApprovePageDelete"]='The deletion of a marketing page is irreversible and will cause links to this page to be broken. Are you sure?';g_resxStrings["ApprovePromoDelete"]='The deletion of a marketing promo is irreversible. Are you sure?';g_resxStrings["ApplyMarketingConfirmMsg"]='Apply this version?';g_resxStrings["Processing"]='Processing';g_resxStrings["OneWord"]='1 word';g_resxStrings["NWords"]='{0} words';g_resxStrings["Reviews_SubmitReviewConfirm"]='Are you sure you want to submit your final review?  You cannot edit your review after clicking OK.';g_resxStrings["ConfirmCloseWizardNewSubmission"]='Please note that your submission will not be saved if you cancel now. Are you sure you want to Cancel?';g_resxStrings["ConfirmCloseWizardExistingSubmission"]='Please note that if you cancel now, changes/updates to your submission will not be saved. Are you sure you want to cancel? ';g_resxStrings["ConfirmResubmitToQualityControl"]='Warning: your submission will be updated and given another \"flight check\" by WEbook before being forwarded to the agent(s) you selected. Are you sure you want to Submit Now?';g_resxStrings["ManuscriptSample"]='Manuscript Sample';g_resxStrings["BookProposal"]='Book Proposal';g_resxStrings["ManuscriptSampleTip_1"]='Add your Manuscript Sample below.';g_resxStrings["ManuscriptSampleTip_2"]='(Note: Agents may want anything from a single chapter to 50 pages of your manuscript, so be sure to check each agent’s submission requirements. ';g_resxStrings["ManuscriptSampleTip_3"]='Read a tutorial.';g_resxStrings["ManuscriptSampleTip_4"]=')';g_resxStrings["BookProposalSampleTip_1"]='Insert your Non-Fiction Proposal below.';g_resxStrings["BookProposalSampleTip_2"]='(Note: Most agents expect non-fiction proposals to follow a basic format. ';g_resxStrings["BookProposalSampleTip_3"]='Read a tutorial.';g_resxStrings["BookProposalSampleTip_4"]=')';g_resxStrings["noAgentSelectedWarning"]='You haven’t selected an agent yet. Click “Back” to select agents now. If you want to save your work and revise it later, click \'Save & Close.\'';g_resxStrings["selectAgents_explanation"]='Select agents to receive your submission. Note: Only agents who represent your category and genre appear below.';g_resxStrings["selectAgents_noAgentForGenre"]='No agents currently match the category/genre of your submission.';g_resxStrings["CreateProjectOverviewTooLong"]='We\'re sorry, the brief overview may be no more than 15000 characters in length.';g_resxStrings["CreateProjectConfirmationMessage"]='You are about to create a new WEbook Project. Super! Please take a sec to be sure your settings are just the way you want them.';g_resxStrings["InvalidTitleLength"]='Please pick a Title between 1 and 100 characters long';g_resxStrings["Project_MissingGenre"]='You must choose a genre';g_resxStrings["PollWizard_TeaserMaxChars"]='The teaser must have no more than {0} characters.';g_resxStrings["PollWizard_FirstPageMaxChars"]='The first page must have no more than {0} characters.';g_resxStrings["PollWizard_AboutMeMaxChars"]='About Me must have no more than {0} characters.';g_resxStrings["Poll_DeleteAreYouSure"]='Are you sure you want to delete your submission?';g_resxStrings["PollWizard_InvalidCoupon"]='The coupon code is no longer valid';function SetupTop()
{if(navigator.vendor=="Apple Computer, Inc."||navigator.vendor=="KDE"){(function(c){for(var i in c)
window["HTML"+i+"Element"]=document.createElement(c[i]).constructor;})({Html:"html",Head:"head",Link:"link",Title:"title",Meta:"meta",Base:"base",IsIndex:"isindex",Style:"style",Body:"body",Form:"form",Select:"select",OptGroup:"optgroup",Option:"option",Input:"input",TextArea:"textarea",Button:"button",Label:"label",FieldSet:"fieldset",Legend:"legend",UList:"ul",OList:"ol",DList:"dl",Directory:"dir",Menu:"menu",LI:"li",Div:"div",Paragraph:"p",Heading:"h1",Quote:"q",Pre:"pre",BR:"br",BaseFont:"basefont",Font:"font",HR:"hr",Mod:"ins",Anchor:"a",Image:"img",Object:"object",Param:"param",Applet:"applet",Map:"map",Area:"area",Script:"script",Table:"table",TableCaption:"caption",TableCol:"col",TableSection:"tbody",TableRow:"tr",TableCell:"td",FrameSet:"frameset",Frame:"frame",IFrame:"iframe"});function HTMLElement(){}
HTMLElement.prototype=HTMLHtmlElement.__proto__.__proto__;var HTMLDocument=document.constructor;var HTMLCollection=document.links.constructor;var HTMLOptionsCollection=document.createElement("select").options.constructor;var Text=document.createTextNode("").constructor;var Node=Text;}
if(window.HTMLElement&&!IsContainsSupported())
{HTMLElement.prototype.contains=function(child)
{if(typeof(child)=='string'){child=document.getElementById(child);}
if(!child){return false;}
if(child.parentNode===this){return true;}
if(child===document.body){return false;}
return this.contains(child.parentNode);}}}
function IsContainsSupported()
{var oTopInit1=document.getElementById("TopInit1");var oTopInit2=document.getElementById("TopInit2");try
{return oTopInit1.contains(oTopInit2);}
catch(e)
{return false;}}
String.prototype.trim=function()
{var str=this;var str=str.replace(/^\s\s*/,''),ws=/\s/,i=str.length;while(ws.test(str.charAt(--i)));return str.slice(0,i+1);};String.prototype.endsWith=function(s)
{var reg=new RegExp(s+"$");return reg.test(this);}
String.prototype.startsWith=function(s)
{var reg=new RegExp("^"+s);return reg.test(this);}
Array.prototype.contains=function(obj)
{var i=this.length;while(i--)
{if(this[i]===obj)
{return true;}}
return false;}
function GetEvent(e)
{if(!e)
{e=window.event;}
return e;}
function GetEventSrcElement(e)
{e=GetEvent(e);var srcElement=e.srcElement;if(!srcElement)
{srcElement=e.target;}
return srcElement;}
function GetDocumentSize()
{var docSize={};var htmlHeight=(document.body.scrollHeight>document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight;var htmlWidth=(document.body.scrollWidth>document.body.offsetWidth)?document.body.scrollWidth:document.body.offsetWidth;var visibleHeight=GetVisibleArea().height;if(htmlHeight>=visibleHeight)
{docSize.height=htmlHeight;docSize.width=htmlWidth;docSize.visibleHeight=visibleHeight;}
else
{docSize.height=visibleHeight;docSize.width=htmlWidth;docSize.visibleHeight=visibleHeight;}
return docSize;}
function GetVisibleArea()
{var visibleArea={};var intH=0,intW=0;if(self.innerHeight)
{intH=window.innerHeight;intW=window.innerWidth;}
else
{if(document.documentElement&&document.documentElement.clientHeight)
{intH=document.documentElement.clientHeight;intW=document.documentElement.clientWidth;}
else
{if(document.body)
{intH=document.body.clientHeight;intW=document.body.clientWidth;}}}
visibleArea.height=parseInt(intH,10);visibleArea.width=parseInt(intW,10);return visibleArea;}
function GetVerticalScrollOffset()
{var bodyScrollTop=document.body.scrollTop;var documentElementScrollTop=document.documentElement.scrollTop;var windowPageYOffset=window.pageYOffset;if(bodyScrollTop===undefined){bodyScrollTop=-1;}
if(documentElementScrollTop===undefined){documentElementScrollTop=-1;}
if(windowPageYOffset===undefined){windowPageYOffset=-1;}
return Math.max(Math.max(bodyScrollTop,documentElementScrollTop),windowPageYOffset);}
function ajaxCall(strUrl,callbackFunction,postArray)
{strUrl=AddUrlParam(strUrl,"rand",Math.random());var req;var processReqChange=function()
{if(req.readyState==4)
{var status;try
{status=req.status;}
catch(e)
{return;}
if(status==200)
{var strResponseText=req.responseText.trim();if(strResponseText.indexOf('<reporterror>')==0)
{alert(ExtractContents(strResponseText,'<reporterror>','</reporterror>'));return;}
else if(strResponseText.indexOf('<js>')==0)
{var js=ExtractContents(strResponseText,'<js>','</js>');eval(js);}
else if(strResponseText.indexOf('<json>')==0)
{var strJson=ExtractContents(strResponseText,'<json>','</json>');callbackFunction(ConvertStringToJson(strJson));}
else if(strResponseText.indexOf('<htmlandjson-29529387298>')==0)
{var html=strResponseText.substring(strResponseText.indexOf('<html-29529387298>')+18,strResponseText.indexOf('</html-29529387298>'));var strJson=strResponseText.substring(strResponseText.indexOf('<json-29529387298>')+18,strResponseText.indexOf('</json-29529387298>'));callbackFunction(html,ConvertStringToJson(strJson));}
else
{callbackFunction(strResponseText);}}
else
{if(g_bDebugMode)
{var strReason;if(req.responseText.indexOf('Compilation Error')>=0)
{strReason="Compilation Error";}
else if(req.statusText.toLowerCase()=="unknown")
{strReason="Unknown.  Check your network connection.";}
else
{strReason=req.statusText;alert(req.responseText);}
alert("There was a problem retrieving the response:\n"+strReason);}}}}
if(window.XMLHttpRequest)
{req=new XMLHttpRequest();}
else if(window.ActiveXObject)
{req=new ActiveXObject("Microsoft.XMLHTTP");}
if(req)
{req.onreadystatechange=processReqChange;if(postArray!==undefined)
{req.open("POST",strUrl,true);req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');req.send(FormatQueryNameValuePairs(postArray));}
else
{req.open("GET",strUrl,true);if(window.XMLHttpRequest)
{req.send(null);}
else if(window.ActiveXObject)
{req.send();}}}}
function ConvertStringToJson(strJson)
{strJson=strJson.replace(/\t/g,'');strJson=strJson.replace(/\r/g,'');strJson=strJson.replace(/\n/g,'');return eval('x='+(strJson||'null'));}
function ExtractContents(strVal,strStartTag,strEndTag)
{var strContents=strVal.substr(strStartTag.length);strContents=strContents.substr(0,strContents.length-strEndTag.length);return strContents;}
function Link(strPath,queryArray)
{return BuildLink("http",strPath,queryArray);}
function LinkSecure(strPath,queryArray)
{if(g_bUseHttps)
{return BuildLink("https",strPath,queryArray);}
else
{return BuildLink("http",strPath,queryArray);}}
function LinkSmart(strPath,queryArray)
{if(g_bUseHttps&&window.location.protocol=="https:")
{return LinkSecure(strPath,queryArray);}
else
{return Link(strPath,queryArray);}}
function BuildLink(strPrefix,strPath,queryArray)
{strLink=strPrefix+"://"+g_strHostName;if(strPath!="")
{strLink+="/"+strPath;}
if(queryArray&&queryArray.length>0)
{strLink+="?"+FormatQueryNameValuePairs(queryArray);}
return strLink;}
function FormatQueryNameValuePairs(queryArray)
{if(queryArray&&queryArray.length%2!=0)
{throw"error!";}
var strQuery="";if(queryArray&&queryArray.length>0)
{for(var i=0;i<queryArray.length;i+=2)
{strQuery+=FormatQueryNameValuePair(queryArray[i],queryArray[i+1]);if(i<queryArray.length-2)
{strQuery+="&";}}}
return strQuery;}
function FormatQueryNameValuePair(strName,strValue)
{return encodeURIComponent(strName)+"="+encodeURIComponent(strValue);}
function AddDestinationUrlParam(strUrl,strName,strValue)
{if(strValue!=null&&strValue!="")
{strUrl=AddUrlParam(strUrl,strName,strValue);}
return strUrl;}
function AddUrlParam(strUrl,strName,strValue)
{if(strUrl.indexOf("?")>0)
{return strUrl+"&"+FormatQueryNameValuePair(strName,strValue);}
else
{return strUrl+"?"+FormatQueryNameValuePair(strName,strValue);}}
function SetCookie(sName,sValue)
{date=new Date();document.cookie=sName+"="+escape(sValue)+"; expires=Fri, 31 Dec 2099 23:59:59 GMT;";}
function GetCookie(sName)
{var aCookie=document.cookie.split("; ");for(var i=0;i<aCookie.length;i++)
{var aCrumb=aCookie[i].split("=");if(sName==aCrumb[0])
return unescape(aCrumb[1]);}
return null;}
function DelCookie(sName)
{document.cookie=sName+"=; expires=Fri, 21 Dec 1976 04:31:24 GMT;";}
function RequestStr(strName)
{var query=window.location.search.substring(1);var vars=query.split("&");for(var i=0;i<vars.length;i++)
{var pair=vars[i].split("=");if(pair[0]==strName)
{return decodeURIComponent(pair[1]);}}
return null;}
function AttachEvent(oElement,strEventName,strFunction)
{if(oElement.addEventListener)
{oElement.addEventListener(strEventName,strFunction,false);}
else if(oElement.attachEvent)
{oElement.attachEvent("on"+strEventName,strFunction);}}
var g_bIsIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var g_bIsIE6=(navigator.appVersion.indexOf("MSIE 6.0")!=-1)?true:false;function ConvertHTMLStringToDomNode(strHTML)
{var oParentDiv=document.createElement("div");oParentDiv.innerHTML=strHTML;return oParentDiv.firstChild;}
function IsRealMouseOut(e,oItem)
{if(e.type!='mouseout')
{return false;}
var oTarget;if(e.relatedTarget)
{oTarget=e.relatedTarget;}
else
{oTarget=e.toElement;}
return(!oItem.contains(oTarget));}
function StringFormat(strString)
{for(var i=1;i<arguments.length;i++)
{strString=strString.replace("{"+(i-1)+"}",arguments[i]);}
return strString;}
function SelectTab(strTabRowId,oTabToSelect)
{var strSelectedTabId='selectedTab_'+strTabRowId;var selectedTab=document.getElementById(strSelectedTabId);if(selectedTab!=null)
{selectedTab.className='tabRowLi unSelectedTab';selectedTab.id='';}
oTabToSelect.className='tabRowLi selectedTab';oTabToSelect.id=strSelectedTabId;}
function ShowTabMenu(strMenuId)
{var oMenu=document.getElementById(strMenuId);oMenu.style.display="";}
function HideTabMenu(e,oMenu)
{if(IsRealMouseOut(e,oMenu))
{oMenu.style.display="none";}}
var g_splashScreen=null;function SplashScreen(strLink,strWidth,successCallbackFn,failureCallbackFn,onLoadCallbackFn,strHtml)
{var _this=this;g_splashScreen=_this;_this.m_successCallbackFn=successCallbackFn;_this.m_failureCallbackFn=failureCallbackFn;_this.splash=document.createElement("div");_this.splash.className="splashScreen";var docSize=GetDocumentSize();_this.splash.style.height=docSize.height+"px";document.body.appendChild(_this.splash);var iMinPxFromTopOfScreen=70;var iMaxPopupHeightForScreen=docSize.visibleHeight-iMinPxFromTopOfScreen;var fnLoadPopup=function(strHtml,json)
{_this.popupWrapper=document.createElement("div");_this.popupWrapper.className="splashScreenPopupWrapper";var popup=document.createElement("div");popup.className="splashScreenPopup";popup.style.width=strWidth;_this.popupWrapper.appendChild(popup);var popupLCorner=document.createElement("div");popupLCorner.className="splashScreenLCorner";popup.appendChild(popupLCorner);var popupRCorner=document.createElement("div");popupRCorner.className="splashScreenRCorner";popupLCorner.appendChild(popupRCorner);var popupBorder=document.createElement("div");popupBorder.className="splashScreenBorder";popupRCorner.appendChild(popupBorder);var popupBG=document.createElement("div");popupBG.innerHTML=strHtml;popupBG.className="splashScreenBackground";popupBorder.appendChild(popupBG);document.body.appendChild(_this.popupWrapper);var iPopupHeight=popup.clientHeight;var iCenterScreen=GetVerticalScrollOffset()+(docSize.visibleHeight/2);var iPopupTop=iCenterScreen-(iPopupHeight/2);if(iPopupTop<iMinPxFromTopOfScreen)
{iPopupTop=iMinPxFromTopOfScreen;}
_this.popupWrapper.style.top=iPopupTop+"px";if(onLoadCallbackFn)
{onLoadCallbackFn(json);}}
if(strLink!=null)
{ajaxCall(strLink,fnLoadPopup,["max_popup_height_for_screen",iMaxPopupHeightForScreen,"popup_width",strWidth]);}
else
{fnLoadPopup(strHtml,null);}}
SplashScreen.prototype.Close=function()
{var _this=this;document.body.removeChild(_this.splash);document.body.removeChild(_this.popupWrapper);g_splashScreen=null;}
SplashScreen.prototype.OnSuccess=function()
{var _this=this;if(_this.m_successCallbackFn)
{_this.m_successCallbackFn();}
_this.Close();}
SplashScreen.prototype.OnFailure=function()
{var _this=this;if(_this.m_failureCallbackFn)
{_this.m_failureCallbackFn();}
_this.Close();}
function LoadHTMLContent(strId,strHTML)
{document.getElementById(strId).innerHTML=strHTML;}
function PopupConfirm(strCallbackFn,strActionFn,strTitle,strText,strId,strDivId)
{new SplashScreen(LinkSmart("ajax.aspx",["fn","popup_confirm_display","actionFn",strActionFn,"title",strTitle,"text",strText,"id",strId,"divId",strDivId]),"300px",strCallbackFn,strCallbackFn);}
function PopupConfirmAction(strActionFn,strId,strDivId)
{if(strActionFn=="none")
{return;}
var fn=function(strResult){LoadHTMLContent(strDivId,strResult);}
var strLink=Link("ajax.aspx",["fn",strActionFn,"id",strId]);ajaxCall(strLink,fn);}
function WEbookConfirm(strConfirmText,strCallbackSuccess,strCallbackCancel)
{new SplashScreen(LinkSmart("ajax.aspx",["fn","popup_confirm_display","actionFn","none","title","","text",strConfirmText,"id",null,"divId",null]),"300px",strCallbackSuccess,strCallbackCancel);}
var g_bIsSendingMessage=false;function ComposeMessage_Send(strId,strToMemberId,strFrom,bPopup,bIsAgent,strProjectId)
{if(!g_bIsSendingMessage)
{var strMsgSubjectText=document.getElementById('msgSubjectText'+strId).value;var strMessageText=document.getElementById('messageText'+strId).value;if(strMsgSubjectText==""){alert(g_resxStrings.EnterASubject);return;}
else if(strMessageText==""){alert(g_resxStrings.EnterAMessage);return;}
g_bIsSendingMessage=true;document.getElementById("sendButton_"+strId).innerHTML=g_resxStrings.Sending;var fnComposeMessageResult=function(strResult)
{document.getElementById("compose_message_control").innerHTML=strResult;g_bIsSendingMessage=false;}
var strLink=Link("ajax.aspx",["fn","compose_message_send"]);var postInputArray=['to',strToMemberId,'subject',strMsgSubjectText,'message',strMessageText,'from',strFrom,'popup',bPopup,'isAgent',bIsAgent,'p',strProjectId];ajaxCall(strLink,fnComposeMessageResult,postInputArray);}}
function ShowComposeMessageSplashScreen(strToMemberId,callbackFn)
{new SplashScreen(Link("ajax.aspx",["fn","compose_message_display","popup","true","to",strToMemberId]),"550px",callbackFn,callbackFn);}
function AgentComposeMessageSplash(strToMemberId,strProjectId){new SplashScreen(Link("ajax.aspx",["fn","agent_compose_message_display","popup","true","to",strToMemberId,"isAgent",true,"p",strProjectId]),"550px",null,null);}
function ConfirmMsgDelete(strMsgId,iStart)
{new SplashScreen(Link("ajax.aspx",["fn","message_panel_delete_splash","popup","true","message_id",strMsgId,"start",iStart]),"250px",null,null);}
var g_inviteAFriend=null;var g_bIsSendingInvite=false;var g_strFirstLoginRefLink=null;function InitOverrideDestinationUrl()
{g_inviteAFriend=new OverrideDestinationUrl();}
function OverrideDestinationUrl()
{;}
OverrideDestinationUrl.prototype.GetDestinationUrl=function()
{return Link("");}
function LoadJs(filename)
{var fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript")
fileref.setAttribute("src",filename)
if(typeof fileref!="undefined")
document.getElementsByTagName("head")[0].appendChild(fileref)}
function LoadPlaxoJs()
{LoadJs('http://www.plaxo.com/css/m/js/util.js');LoadJs('http://www.plaxo.com/css/m/js/basic.js');LoadJs('http://www.plaxo.com/css/m/js/abc_launcher.js');}
function ShowInviteAFriendSplashScreen(callbackFn)
{LoadPlaxoJs();new SplashScreen(Link("ajax.aspx",["fn","invite_a_friend_display","popup","true"]),"400px",callbackFn,callbackFn);}
function ShowInviteAFriendSplashScreenForWinAKindle()
{LoadPlaxoJs();new SplashScreen(Link("ajax.aspx",["fn","invite_a_friend_display","popup","true","bWinAKindle","true"]),"400px",null,null);}
function ShowInviteAFriendSplashScreenForProject(strProjectId)
{LoadPlaxoJs();new SplashScreen(Link("ajax.aspx",["fn","invite_a_friend_display","popup","true","bProject","true","strId",strProjectId]),"400px",null,null);}
function ShowInviteNewFriendsSplashScreen(to,callbackFn)
{LoadPlaxoJs();new SplashScreen(Link("ajax.aspx",["fn","invite_new_friends_display","popup","true","to",to]),"400px",InviteAFriend_Redirect,callbackFn);}
function ShowFindFriendsSplashScreen(callbackFn)
{LoadPlaxoJs();new SplashScreen(Link("ajax.aspx",["fn","invite_a_friend_display","popup","true","bConnectFriends","true"]),"435px",callbackFn,callbackFn);}
function ShowFoundFriendsSplashScreen(strTo,callbackFn)
{LoadPlaxoJs();new SplashScreen(Link("ajax.aspx",["fn","invite_a_friend_found_friends_display","popup","true","to",strTo]),"400px",InviteAFriend_Redirect,callbackFn);}
function ShowAddFriendsSuccessSplashScreen(bInviteMore,callbackFn)
{LoadPlaxoJs();new SplashScreen(Link("ajax.aspx",["fn","invite_a_friend_add_friends_success_display","popup","true","bInviteMore",bInviteMore]),"400px",InviteAFriend_Redirect,callbackFn);}
function InviteAFriend_Redirect()
{if(g_strFirstLoginRefLink!=null)
window.location=g_strFirstLoginRefLink;}
function InviteAFriend_FindFriends(strId)
{var strTo=document.getElementById("inviteTo"+strId).value;if(strTo=="")
{alert(g_resxStrings.SpecifyEmailAddress);return;}
document.getElementById("resultMsg"+strId).innerHTML=g_resxStrings.Searching;var fnInviteAFriendResult=function(jsonResult)
{document.getElementById("resultMsg"+strId).innerHTML=jsonResult.resultHtml;if(jsonResult.bSuccess)
{g_splashScreen.OnSuccess();ShowFoundFriendsSplashScreen(strTo,null);}}
var strLink=Link("ajax.aspx",["fn","invite_a_friend_find_friends"]);var postInputArray=['to',strTo];ajaxCall(strLink,fnInviteAFriendResult,postInputArray);}
function InviteAFriend_SendMail(strId,bPopup)
{if(!g_bIsSendingInvite)
{var strTo=document.getElementById("inviteTo"+strId).value;if(strTo=="")
{alert(g_resxStrings.SpecifyEmailAddress);return;}
g_bIsSendingInvite=true;document.getElementById("resultMsg"+strId).innerHTML=g_resxStrings.Sending;var strFrom=document.getElementById("inviteFrom"+strId).value;var strMessage=document.getElementById("inviteMessage"+strId).value;var fnInviteAFriendResult=function(jsonResult)
{document.getElementById("resultMsg"+strId).innerHTML=jsonResult.resultHtml;g_bIsSendingInvite=false;if(bPopup&&jsonResult.bSuccess)
{g_splashScreen.OnSuccess();}}
var strLink=Link("ajax.aspx",["fn","invite_a_friend_send"]);var postInputArray=['to',strTo,'from',strFrom,'message',strMessage,'location',window.location];postInputArray.push("destination_url");if(g_inviteAFriend!=null)
{postInputArray.push(g_inviteAFriend.GetDestinationUrl());}
else
{postInputArray.push(window.location);}
ajaxCall(strLink,fnInviteAFriendResult,postInputArray);}}
function InviteAFriend_Clear(strId)
{document.getElementById("inviteTo"+strId).value="";document.getElementById("inviteFrom"+strId).value="";document.getElementById("inviteMessage"+strId).value="";document.getElementById("resultMsg"+strId).innerHTML="";}
function InviteAFriend_CheckAll()
{var e=document.getElementsByName("friendsToInvite");for(i=0;i<e.length;i++)
{e[i].checked=true;}}
function InviteAFriend_UnCheckAll()
{var e=document.getElementsByName("friendsToInvite");for(i=0;i<e.length;i++)
{e[i].checked=false;}}
function InviteAFriend_AddFriends(strId)
{var e=document.getElementsByName("friendsToInvite");var selected=new Array();for(i=0;i<e.length;i++)
{if(e[i].checked)
{selected.push(e[i].value);}}
if(selected.length==0)
{alert(g_resxStrings.SelectAFriend);return;}
document.getElementById("resultMsg"+strId).innerHTML=g_resxStrings.Adding;var fnInviteAFriendResult=function(jsonResult)
{document.getElementById("resultMsg"+strId).innerHTML=jsonResult.resultHtml;if(jsonResult.bSuccess)
{g_splashScreen.OnSuccess();if(g_strFirstLoginRefLink)
{ShowAddFriendsSuccessSplashScreen("true",null);}
else
{ShowAddFriendsSuccessSplashScreen("false",null);}}}
var strLink=Link("ajax.aspx",["fn","invite_a_friend_add_friends"]);var postInputArray=['selected',selected];ajaxCall(strLink,fnInviteAFriendResult,postInputArray);}
function Show(section)
{ReplaceAllButOne("show","hidden",section,"show");}
function ReplaceAllButOne(classId,normalClass,elementId,specialClass){var elementList=getElementsByClass(classId);for(var i=0;i<elementList.length;i++){elementList[i].className=normalClass;}
var uniqueElement=document.getElementById(elementId);if(uniqueElement){uniqueElement.className=specialClass;}}
function getElementsByClass(searchClass)
{var classElements=new Array();var node=document;var tag='*';var els=node.getElementsByTagName(tag);var elsLen=els.length;var pattern=new RegExp('(^|\\s)'+searchClass+'(\\s|$)');for(i=0,j=0;i<elsLen;i++)
{if(pattern.test(els[i].className))
{classElements[j]=els[i];j++;}}
return classElements;}
function toggleDisplay(elementId)
{if(document.getElementById(elementId).style.display=="block")
{document.getElementById(elementId).style.display="none";}
else
{document.getElementById(elementId).style.display="block";}}
var g_clickedPromoElement;function editPromoInWindow(promoElement,promoId)
{g_clickedPromoElement=promoElement;var editPromoUrl=Link("controlPanel/marketingPromo.aspx",["promo",promoId,"popup","true"]);var win=window.open(editPromoUrl,"EditPromo","resizable=yes,scrollbars=yes,width=1000,height=700,status=yes");if(win!=null)
win.focus();}
function OnHoverGenreCategory(categoryIndex,numOfCategories)
{document.getElementById('genreSelectorBG').className='genreSelectorBG'+categoryIndex.toString();for(var i=0;i<numOfCategories;i++)
{var theDiv=document.getElementById("genreCategoryDiv_"+i.toString());if(categoryIndex==i)
{theDiv.style.display='block';}
else
{theDiv.style.display='none';}}}
function Paginate(formName,paginationStart)
{document.getElementById("paginationStart").value=paginationStart;document.getElementById(formName).submit();}
function searchInput(submit){var searchValue=document.getElementById('searchInput');if(searchValue.value==g_resxStrings.SearchBarTerms){searchValue.value="";}else if(!submit&&searchValue.value==""){searchValue.value=g_resxStrings.SearchBarTerms;}
if(submit==true){document.getElementById('searchForm').submit();return false;}}