var wsm_app_url ='http://www.wheresinglesmeet.com/App'; var popWidth=685; var popHeight=470; function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i0&&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 2) && (str.indexOf("@") > 0); var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)"); var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"); return (!r1.test(str) && r2.test(str)); } //-------------------------------------------------------------------- // Function: JSubmit // // Purpose: Submit form //-------------------------------------------------------------------- function JSubmit(form, button, action) { form.elements[button].value = action; form.submit() } //-------------------------------------------------------------------- // Function: stripDelimiters // // Purpose: Takes out characters specified in the parameters //-------------------------------------------------------------------- function stripDelimiters (s, bag) { var i; var returnString = ""; // Search through string's characters one by one. // If character is not in bag, append to returnString. for (i = 0; i < s.length; i++) { // Check that current character isn't whitespace. var c = s.charAt(i); if (bag.indexOf(c) == -1) returnString += c; } return returnString; } //-------------------------------------------------------------------- // Function: stripWhitespace (s) // // Purpose: Removes all whitespace characters from s. // defines which characters are considered whitespace. //-------------------------------------------------------------------- function stripWhitespace (s) { return stripDelimiters (s, whitespace) } //-------------------------------------------------------------------- // Function: isEmpty(s) // // Purpose: Returns true if the string entered is a null string. //-------------------------------------------------------------------- function isEmpty(s) { return ((s == null) || (s.length == 0)) } //-------------------------------------------------------------------- // Function: isInteger (s) // // Purpose: Returns true if the string entered is an integer //-------------------------------------------------------------------- function isInteger (s) { var i; if (isEmpty(s)) if (isInteger.arguments.length == 1) return defaultEmptyOK; else return (isInteger.arguments[1] == true); // Search through string's characters one by one // until we find a non-numeric character. // When we do, return false; if we don't, return true. for (i = 0; i < s.length; i++) { // Check that current character is number. var c = s.charAt(i); if (!isDigit(c)) return false; } // All characters are numbers. return true; } //-------------------------------------------------------------------- // Function: isDigit (c) // // Purpose: Returns true if character c is a digit // (0 .. 9). //-------------------------------------------------------------------- function isDigit (c) { return ((c >= "0") && (c <= "9")) } //-------------------------------------------------------------------- // Function: trim(strText) // // Purpose: Returns string with no trailing or leading spaces. //-------------------------------------------------------------------- function trim(strText) { // this will get rid of leading spaces while (strText.substring(0,1) == ' ') strText = strText.substring(1, strText.length); // this will get rid of trailing spaces while (strText.substring(strText.length-1,strText.length) == ' ') strText = strText.substring(0, strText.length-1); return strText; } //-------------------------------------------------------------------- //Function: Money(expr) // // Purpose: Turns floating point numbers into a Money value //-------------------------------------------------------------------- function Money(expr) { var str = "" + Math.round (eval(expr) * Math.pow(10,2)) while (str.length <= 2){ str = "0" + str } var decpoint = str.length - 2 return "" + str.substring(0,decpoint) + "." + str.substring(decpoint,str.length); } function OpenHelpWindow(SiteName,HelpKey) { NewWindow('/bin2/PopupHelp.asp?SiteName=' + SiteName + '&HelpKey=' + HelpKey ,'help', '650' , '400' , 'yes'); } function OpenUpload() { NewWindow('/bin/Upload.asp', 'wtmail', '300' , '100' , 'yes'); } function UploadFinish() { NewWindow('/bin/UploadFinish.asp', 'wtmail', '300' , '100' , 'yes'); } function openAddrFromPostcodeXzap(postcode,address) { // results list can be quite wide NewWindow('/bin2/PopupAddressFromPostcode.asp?Postcode=' + postcode + '&address=' + address,'AddrFromPostcode', '650' , '300' , 'yes'); } function openAddrFromPostcode(postcode,address) { // results list can be quite wide NewWindow('/bin2/PopupAddressFromPostcode.asp?Postcode=' + postcode,'AddrFromPostcode', '650' , '300' , 'yes'); } function openAddrFromAddressXzap(address) { NewWindow('/bin2/PopupAddressSearch1.asp?address=' + address,'PostcodeFromAddress', '550' , '350' , 'yes'); } function openAddrFromAddress(address) { NewWindow('/bin2/PopupAddressSearch1.asp','PostcodeFromAddress', '550' , '350' , 'yes'); } function openRememberPasswordPopup(SiteAddress,SiteNumber) { NewWindow(SiteAddress + '/Info/RememberPwd.asp?SiteID=' + SiteNumber,'PopupSelectAreas', '640' , '480' , 'yes'); } function OpenCalendarWindow(intDay, intMonth, intYear) { NewWindow('/bin/PopupCalendar.asp?day=' + intDay + '&month=' + intMonth + '&year=' + intYear, 'Calendar', '500' , '400' , 'yes'); } function openSpellChecker(ScriptToRun,intSiteNumber) { // results list can be quite wide NewWindow('/bin2/PopupSpellcheck.asp?ScriptToRun=' + ScriptToRun + '&SiteNumber=' + intSiteNumber,'SpellCheck', '550' , '500' , 'yes'); } function OpenCheckEmailExists(strEmailAddress,strSite,strNameNum, strFirstName, strLastName) { NewWindow('/bin2/PopupCheckEmailExists.asp?EmailAddress=' + strEmailAddress + '&Site=' + strSite + '&NameNum=' + strNameNum + '&LastName=' + strLastName + '&FirstName=' + strFirstName,'CheckEmail', '550' , '300' , 'yes'); } function OpenUserNameCheck(strUserName, strFirstName, strLastName, strSite) { $TableWidth='650'; $TableHeight='450'; //NewWindow(wsm_app_url + '/Pop/PopIndex.php?Page=CheckUserNamePopup&UserName=' + strUserName + '&LastName=' + strLastName + '&FirstName=' + strFirstName + '&Site=' + strSite,'UserNameCheck', '550' , '420' , 'yes'); NewWindow(wsm_app_url + '/Pop/PopIndex.php?Page=CheckUserNamePopup&UserName=' + strUserName + '&LastName=' + strLastName + '&FirstName=' + strFirstName + '&Site=' + strSite,'UserNameCheck', '550' , '420' , 'yes'); } function OpenTermsAndConditionsPopup() { NewWindow(wsm_app_url + '/Info/TermsAndConditionsPopup.asp','TAndC', '550' , '420' , 'yes'); } function OpenCheckWSMAlias(strWSMAlias) { $TableWidth='650'; $TableHeight='450'; //NewWindow(wsm_app_url + '/Pop/PopIndex.php?Page=CheckWsmAliasPopup&WSMAlias=' + escape(strWSMAlias),'CheckWSMAlias', '550' , '420' , 'yes'); NewWindow(wsm_app_url + '/Pop/PopIndex.php?Page=CheckWsmAliasPopup&WSMAlias=' + escape(strWSMAlias),'CheckWSMAlias', $TableWidth,$TableHeight,'yes'); } function OpenWSMNewShortlist(redirectURL, Action, shortlistID) { NewWindow('/app/PopupWSMNewShortlist.asp?redirectURL=' + escape(redirectURL) + '&shortlistID=' + shortlistID + '&Action=' + Action,'PopupSelectAreas', '450' , '250' , 'yes'); } function OpenWSMMemberNotes(WSMAlias, RefreshOpener) { NewWindow(wsm_app_url + '/Main/edit-note-popup.php?WSMAlias=' + escape(WSMAlias) + '&RefreshOpener=' + RefreshOpener,'WSMMemberNotes', popWidth , '450' , 'yes'); } function OpenWSMMoveShortlist(ShortlistID, ShortlistItemID) { NewWindow(wsm_app_url + '/Main/edit-move-from-shortlist-popup.php?ShortlistID=' + escape(ShortlistID) + '&ShortlistItemID=' + ShortlistItemID,'WSMMoveShortlist', '650' , '350' , 'yes'); } function OpenWSMMemberDetails(WSMAlias, BookMark) { NewWindow( wsm_app_url + '/Srch/display-overview-popup.php?WSMAlias=' + escape(WSMAlias) + '&BookMark=' + escape(BookMark),'',popWidth,popHeight, 'yes'); } function OpenWSMMemberDetails2(WSMAlias, BookMark, popUp,popUrl,popName,popDetails,returnUrl) { NewWindow( wsm_app_url + '/Srch/SrchIndex.php?Page=DisplayOverviewPopup&WSMAlias=' + escape(WSMAlias) + '&BookMark=' + escape(BookMark) + '&popUp=' + popUp + '&popUrl=' + popUrl + '&popName=' + popName + '&popDetails=' + popDetails + '&returnUrl=' + returnUrl,'', popWidth , popHeight , 'yes'); } function OpenWSMMemberPhotoDetails(WSMAlias, BookMark) { NewWindow(wsm_app_url + '/Srch/SrchIndex.php?Page=DisplayPhotosPopup&WSMAlias=' + escape(WSMAlias) + '&BookMark=' + escape(BookMark),'', popWidth , popHeight , 'yes'); } function OpenWSMPhotoDetails(WSMAlias, SearchID) { NewWindow('/app/Search/DisplayPhotos.asp?WSMAlias=' + escape(WSMAlias) + '&SearchID=' + escape(SearchID),'', popWidth , popHeight , 'yes'); } function OpenWSMSearchViewStyle(WSMAlias) { NewWindow('/app/Search/DisplayStyleandPersonality.asp?WSMAlias=' + escape(WSMAlias) ,'WSMMemberStyle', '670' , '500' , 'yes'); } function OpenWSMManageShortlist(ShortlistID) { NewWindow(wsm_app_url + '/Main/manage-shortlist-popup.php?ShortlistID=' + ShortlistID ,'WSMMemberShortlist', popWidth ,400, 'yes'); } function OpenWSMTour() { NewWindow('/Tour/Default.asp' ,'WSMTour', '670', '550' ,'yes'); } function OpenWSMNewState(CountryID, CountryName) { NewWindow('/Join/PopupNewState.asp?CountryID=' + escape(CountryID) + '&CountryName=' + escape(CountryName) ,'WSMNewState', '650', '500' ,'yes'); } function OpenWSMCurrencyConvertor(Amount,Unit) { NewWindow('/bin2/PopupCurrencyConversion.asp?Amount=' + escape(Amount) + '&Unit=' + escape(Unit),'', '650', '500' ,'yes'); } function OpenWSMManageMatches() { NewWindow(wsm_app_url + '/Main/MainIndex.php?Page=EditMatchChoicesPopup&' ,'WSMMemberMatches', popWidth, 355, 'yes'); } function OpenWSMChatAbuse() { NewWindow(wsm_app_url + '/Main/MainIndex.php?Page=ReportAbusePopup&' ,'WSMChatAbuse', '650' , '500' , 'yes'); } function OpenWSMPrivateChatManage(RoomID) { NewWindow('/app/Talk/PrivateChat/Manage.asp?RoomID=' + RoomID ,'WSMChatManage', '650' , '500' , 'yes'); } function OpenSt( WSMAlias, Email, ToAlias, ToEmail) { var stUrl; stUrl='http://www.wheresinglesmeet.com/st/App/Display/Main/MainIndex.php?action=VerifySystemLogin&referer=wsm&siteAlias=Wsm&alias=' +escape(WSMAlias) + '&email=' + escape(Email) + '&ToAlias=' + escape(ToAlias) + '&ToEmail=' + escape(ToEmail) ; NewWindow(stUrl,'Sweettalk', '730' , '480' , 'yes'); } function OpenSt1( WSMAlias, Email, ToAlias, ToEmail) { var stUrl; stUrl='http://www.wheresinglesmeet.com/st/App/Display/Main/MainIndex.php?action=VerifySystemLogin&referer=wsm&siteAlias=Wsm&alias=' +escape(WSMAlias) + '&email=' + escape(Email) + '&ToAlias=' + escape(ToAlias) + '&ToEmail=' + escape(ToEmail) ; NewWindow(stUrl,'Sweettalk', '730' , '480' , 'yes'); // NewWindow(stUrl,'Sweettalk', '10' , '10' , 'yes'); } function OpenStRegister(WSMAlias, Email) { var stRegisterUrl; stRegisterUrl='http://www.wheresinglesmeet.com/st/App/Display/Main/MainIndex.php?action=VerifySystemLogin&referer=wsm&request=Register&siteAlias=Wsm&alias='+escape(WSMAlias) + '&email=' + Email; NewWindow(stRegisterUrl,'Sweettalk', '730' , '480' , 'yes'); } function OpenWSMSendaSmile(WSMAlias) { NewWindow(wsm_app_url + '/Main/MainIndex.php?Page=EditSendSmilePopup&WSMAlias=' + escape(WSMAlias) ,'WSMSendSmile', popWidth, 250, 'yes'); } function openPublicChatRules(){ NewWindow('/app/Talk/PublicChat/Rules.asp','WSMPublicChatRules', '650' , '500' , 'yes'); } /* -------------------------------------------------------------------- Auto centering pop-up Function: NewWindow -----------------------------------------------------------------------*/ var win = null; function NewWindow(mypage,myname,w,h,scroll){ LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable' win = window.open(mypage,myname,settings) } function OpenWSMMemberDetails(WSMAlias, BookMark) { NewWindow( wsm_app_url + '/Srch/display-overview-popup.php?WSMAlias=' + escape(WSMAlias) + '&BookMark=' + escape(BookMark),'',popWidth,popHeight, 'yes'); } function openWsmWin(url,winName,features ) { window.open(url,winName, features); } function openWsmWin(url,winName, winWidth, winHeight) { if(winWidth>0) popWidth=winWidth; if(winHeight>0) popHeight=winHeight; NewWindow(url,winName, popWidth , popHeight , 'yes'); }