function fnTestCookieAccept(){if(document.cookie.length==0){document.cookie="test=test";cookieEnabled=(document.cookie=="test=test");document.cookie="";return cookieEnabled;}else{return true;}}function fnGetCurBaseURL(){var strLocation=location.href;var n=strLocation.indexOf("?");if(n>-1){strLocation=strLocation.substring(0,n);}return strLocation;}function fnGetCurrentURLForPassport(){var strLocation=top.location.href;var strParams="";var strMID="";var strTID="";var nPos=strLocation.indexOf("?");if(nPos!=-1){strLocation=strLocation.substring(0,nPos);if(arguments.length>1){strParams=fnSplitQueryString(location.search.substring(1),1);}else{strParams=fnSplitQueryString(location.search.substring(1));}}strParams="baseurl="+strLocation+";"+strParams;if(arguments.length>0){strMID=arguments[0];if(arguments.length>1){strTID=arguments[1];}}if(strMID!=""){strParams=strParams+"mid="+strMID+";";}if(strTID!=""){strParams=strParams+"tid="+strTID+";";}return(strParams);}function fnSplitQueryString(strQuery){var strNewParams="";var bNoThreadID=false;if(arguments.length>1){bNoThreadID=true;}var aQuery=strQuery.split("&");for(i=0; i<aQuery.length; i++){nPos=aQuery[i].indexOf("=");if(nPos!=-1){arg=aQuery[i].substring(0,nPos);if(arg!="mid"){if(!bNoThreadID ||(bNoThreadID&&arg!="tid")){strNewParams+=aQuery[i]+";";}}}}return(strNewParams);}function fnCallPassport(){if(fnTestCookieAccept()==false){location.href=strResourceRoot+"aspx/err.aspx?sloc="+strSiteLocale+"&stgxml="+strSettingXML+"&id=2";return;}var strProfileReturnURL=fnGetCookie("wnpecu");if(strProfileReturnURL!=""){fnSetCookie("WN3","baseurl="+strProfileReturnURL,"","/");}else{if((bUpLevel==true)&&(fWelcome==false)&&(typeof(strMessageID)!="undefined")){fnSetCookie("WN3",fnGetCurrentURLForPassport(strMessageID),"","/");} else {fnSetCookie("WN3",fnGetCurrentURLForPassport(),"","/");}}location.href=strPassportHref;}function fnGetExpDate(days,hours,minutes){var expDate=new Date();if(typeof days=="number"&&typeof hours=="number"&&typeof minutes=="number"){expDate.setDate(expDate.getDate()+parseInt(days));expDate.setHours(expDate.getHours()+parseInt(hours));expDate.setMinutes(expDate.getMinutes()+parseInt(minutes));return expDate.toGMTString();}}function fnGetCookieVal(offset){var endstr=document.cookie.indexOf(";",offset);if(endstr==-1){endstr=document.cookie.length;}return unescape(document.cookie.substring(offset,endstr));}function fnGetCookie(name){var arg=name+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;while(i<clen){var j=i+alen;if(document.cookie.substring(i,j)==arg){return fnGetCookieVal(j);}i=document.cookie.indexOf(" ",i)+1;if(i==0){break;}}return "";}function fnSetCookie(name,value,expires,path,domain,secure){document.cookie=name+"="+escape(value)+((expires)?"; expires="+expires:"")+((path)?"; path="+path:"")+((domain)?"; domain="+domain:"")+((secure)?"; secure="+secure:"");}function fnProfileEdit(uid){if(strPassportHref!=""){if(fControlIsAuth==true||fRedirectIsAuth==true){fnSetCookie("WN3R","","","/");fnSetCookie("wnpecu",location.href,"","/");location.href=strCommProfileEdit+"?sloc="+strSiteLocale;}else{if(fnTestCookieAccept()==false){location.href=strResourceRoot+"aspx/err.aspx?sloc="+strSiteLocale+"&stgxml="+strSettingXML+"&id=2";return;}var NotInLoop=fnGetCookie("WN3R");if(NotInLoop==""){var strCookie="baseurl="+strCommProfileEdit+";sloc="+strSiteLocale;fnSetCookie("WN3",strCookie+";","","/");fnSetCookie("wnpecu",location.href,"","/");location.href=strPassportHref;}else{fnSetCookie("WN3R","","","/");}}}else{alert("Unable to call Passport for user authorization");}}function fnProfileView(uid,mid,dgid,cat,lang,cr,sxml){window.open(strCommProfileView+"?uid="+uid+"&mid="+mid+"&dg="+dgid+"&cat="+cat+"&lang="+lang+"&cr="+cr+"&rdr="+((fWizard)?strCommReader2:strCommReader)+"&sloc="+strSiteLocale+"&sxml="+sxml+"&stgxml="+strSettingXML,"_blank",strProfileViewParams);}function fnShowHelp(strHelp){var winHelp=window.open(strHelp,'wnhelp','width=600,height=400,scrollbars=1,resizable=1');winHelp.focus();}