﻿function jscroll() { jQuery(document).ready(function() { jQuery('#search-carousel').jcarousel({ horizontal: true, scroll: 5 }); }); jQuery(document).ready(function() { jQuery('#invite-carousel').jcarousel({ horizontal: true, scroll: 5 }); }); jQuery(document).ready(function() { jQuery('#search-carousel-down').jcarousel({ horizontal: true, scroll: 5 }); }); jQuery(document).ready(function() { jQuery('#sponsored-carousel').jcarousel({ horizontal: true, scroll: 5 }); }); jQuery(document).ready(function() { jQuery('#charitable-carousel').jcarousel({ horizontal: true, scroll: 5 }); }); jQuery(document).ready(function() { jQuery('#invite-carousel1').jcarousel({ horizontal: true, scroll: 5 }); }); jQuery(document).ready(function() { jQuery('#invite-carousel11').jcarousel({ horizontal: true, scroll: 5 }); }); jQuery(document).ready(function() { jQuery('#chat-carousel11').jcarousel({ horizontal: true, scroll: 5 }); }); jQuery(document).ready(function() { jQuery('#chat-carousel5').jcarousel({ horizontal: true, scroll: 5 }); }); jQuery(document).ready(function() { jQuery('#friends-carousel').jcarousel({ horizontal: true, scroll: 5 }); }); jQuery(document).ready(function() { jQuery('#invite-carousel3').jcarousel({ horizontal: true, scroll: 5 }); }); jQuery(document).ready(function() { jQuery('#invite-carousel21').jcarousel({ horizontal: true, scroll: 5 }); }); jQuery(document).ready(function() { jQuery('#suser-carousel').jcarousel({ horizontal: true, scroll: 5 }); }); jQuery(document).ready(function() { jQuery('#suser-carousel-down').jcarousel({ horizontal: true, scroll: 5 }); }); }
function wsTrim(str) { return str.replace(/^[\s]+/, '').replace(/[\s]+$/, '').replace(/[\s]{2,}/, ' '); }; function GetObjectById(id) { return document.getElementById(id); }
var Base64 = { _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", encode: function(input) {
    var output = ""; var chr1, chr2, chr3, enc1, enc2, enc3, enc4; var i = 0; input = Base64._utf8_encode(input); while (i < input.length) {
        chr1 = input.charCodeAt(i++); chr2 = input.charCodeAt(i++); chr3 = input.charCodeAt(i++); enc1 = chr1 >> 2; enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); enc4 = chr3 & 63; if (isNaN(chr2)) { enc3 = enc4 = 64; } else if (isNaN(chr3)) { enc4 = 64; }
        output = output +
this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
    }
    return output;
}, decode: function(input) {
    var output = ""; var chr1, chr2, chr3; var enc1, enc2, enc3, enc4; var i = 0; input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); while (i < input.length) {
        enc1 = this._keyStr.indexOf(input.charAt(i++)); enc2 = this._keyStr.indexOf(input.charAt(i++)); enc3 = this._keyStr.indexOf(input.charAt(i++)); enc4 = this._keyStr.indexOf(input.charAt(i++)); chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); chr3 = ((enc3 & 3) << 6) | enc4; output = output + String.fromCharCode(chr1); if (enc3 != 64) { output = output + String.fromCharCode(chr2); }
        if (enc4 != 64) { output = output + String.fromCharCode(chr3); } 
    }
    output = Base64._utf8_decode(output); return output;
}, _utf8_encode: function(string) {
    string = string.replace(/\r\n/g, "\n"); var utftext = ""; for (var n = 0; n < string.length; n++) {
        var c = string.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); }
        else if ((c > 127) && (c < 2048)) { utftext += String.fromCharCode((c >> 6) | 192); utftext += String.fromCharCode((c & 63) | 128); }
        else { utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128); } 
    }
    return utftext;
}, _utf8_decode: function(utftext) {
    var string = ""; var i = 0; var c = c1 = c2 = 0; while (i < utftext.length) {
        c = utftext.charCodeAt(i); if (c < 128) { string += String.fromCharCode(c); i++; }
        else if ((c > 191) && (c < 224)) { c2 = utftext.charCodeAt(i + 1); string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); i += 2; }
        else { c2 = utftext.charCodeAt(i + 1); c3 = utftext.charCodeAt(i + 2); string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3; } 
    }
    return string;
} 
}; function getXmlHttpObject() {
    var xmlHttp = null; try { xmlHttp = new XMLHttpRequest(); }
    catch (e) {
        try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); }
        catch (e) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } 
    }
    return xmlHttp;
}; var content = "ctl00_ContentPlaceHolder1_"; var siteURL = "http://www.mysomeday.com/"; function getPageSize(i) {
    var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = document.body.scrollWidth; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight) { xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; }
    var windowWidth, windowHeight; if (self.innerHeight) { windowWidth = self.innerWidth; windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; }
    if (yScroll < windowHeight) { pageHeight = windowHeight; } else { pageHeight = yScroll; }
    if (xScroll < windowWidth) { pageWidth = windowWidth; } else { pageWidth = xScroll; }
    var paghg; paghg = windowHeight + yScroll; arrayPageSize = new Array(pageWidth, pageHeight, windowWidth, windowHeight)
    if (navigator.userAgent.indexOf("Firefox") != -1) { pageWidth = pageWidth - 17; }
    if (i != '') { GetObjectById('fade').style.width = (pageWidth + 'px'); GetObjectById('fade').style.height = (pageHeight + 'px'); }
    if (i == 2) { GetObjectById('fade_long_img').style.width = (pageWidth + 'px'); GetObjectById('fade_long_img').style.height = (pageHeight + 'px'); } 
}; function getWindowSize() {
    var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = document.body.scrollWidth; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight) { xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; }
    var windowWidth, windowHeight; if (self.innerHeight) { windowWidth = self.innerWidth; windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; }
    if (yScroll < windowHeight) { pageHeight = windowHeight; } else { pageHeight = yScroll; }
    if (xScroll < windowWidth) { pageWidth = windowWidth; } else { pageWidth = xScroll; }
    var paghg; paghg = windowHeight + yScroll; arrayPageSize = new Array(pageWidth, pageHeight, windowWidth, windowHeight)
    if (navigator.userAgent.indexOf("Firefox") != -1) { pageWidth = pageWidth - 17; }
    GetObjectById(content + "width_window").value = (pageWidth + 'px'); GetObjectById(content + "ht_window").value = (pageHeight + 'px');
}; function homeTab() { GetObjectById('home').style.backgroundImage = 'url(../cssimages/myprofile_roll.gif)'; }; function myprofileTab() { GetObjectById('myprofile').style.background = "url(./cssimages/myprofile_roll.gif)"; }; function chitchatTab() { GetObjectById('chitchat').style.background = "url(./cssimages/chitchat_roll.gif)"; }; function spotlightOnTab() { GetObjectById('spotlighton').style.background = "url(./cssimages/spotlighton_roll.gif)"; }; function messagesTab() { GetObjectById('DivMessages').style.background = "url(./cssimages/messagesTabHov.gif)"; }; function callReg() { document.location = "/newuser-registration.aspx"; }; function removeText(cid) { GetObjectById(cid).select(); return; }
function pageDataHomeNew(flag, somedaytype, pgno, pgInprogressCount, pgneedplanCount, pgachievedCount, pgViewallCount, recordsperpage) { var recordsper = recordsperpage; var url_arg; url_arg = "pgInprogressCount=" + pgInprogressCount + "&pgneedplanCount=" + pgneedplanCount + "&pgachievedCount=" + pgachievedCount + "&pgViewallCount=" + pgViewallCount + "&perpage=" + recordsper + "&currentpg=" + pgno + "&somedaytype=" + somedaytype + ""; makePOSTRequest('/ajaxHome-featuredsomedays.aspx?enc=' + Base64.encode(url_arg), '', '4'); }; function validate(val, field) {
    var expr; switch (field) { case "splchars": expr = /^[a-zA-Z0-9@~$!:.#&^`*_|{}-]+$/; break; }
    return expr.test(val);
}; function chkAvailability() {
    var usernm = wsTrim(GetObjectById("ctl00_ContentPlaceHolder1_txtEnterUName").value); if (usernm != "" && usernm != null) {
        var errStr = ""; if (usernm.indexOf(' ') != -1) { errStr += "Please remove spaces from Display Name.\n" }; if (usernm.length < 4) errStr += "Display Name must be of minimum 4 characters.\n"; if (!validate(usernm, "splchars")) errStr += "Please use alphanumeric Display Name.\n"; if (errStr != "")
        { alert(errStr); return; }
        var regex = /^[0-9A-Za-z_]+$/; if (regex.test(usernm)) {
            if (usernm != null) { var url = ""; var urldat = "usn=" + usernm; url = "/UserNameAvailability.aspx?lnk=" + Base64.encode(urldat); makePOSTRequest(url, '', '30'); }
            else { alert(geterrmsg('e46')); return; } 
        }
        else {
            alert(geterrmsg('e168'))
            return;
        } 
    }
    else { alert(geterrmsg('e46')); return; } 
}; function showRegispage() {
    if (http_request.readyState == 4) {
        if (http_request.status == 200) {
            result = http_request.responseText; if (result == "1") { alert(geterrmsg('e151')); GetObjectById("ctl00_ContentPlaceHolder1_txtEnterEmail").focus(); return; }
            else { alert(geterrmsg('e150')); GetObjectById("ctl00_ContentPlaceHolder1_txtEnterUName").focus(); return; } 
        }
        else { alert('There was a problem with the request: ' + http_request.status); } 
    } 
}; function makePOSTRequest(url, parameters, type) {
    http_request = false; if (window.XMLHttpRequest) { http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/html'); } } else if (window.ActiveXObject) { try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { } } }
    if (!http_request) { alert(geterrmsg('e54')); return false; }
    if (type == "4") http_request.onreadystatechange = showFeaturedSomedays; if (type == "30") http_request.onreadystatechange = showRegispage; if (type == "163") http_request.onreadystatechange = loginStateChanged; if (type == "164") http_request.onreadystatechange = loginOutStateChanged; if (type == "165") http_request.onreadystatechange = emailStateChanged; if (type == "201") http_request.onreadystatechange = ResultClickTracking; if (type == "210") http_request.onreadystatechange = showExpertOnRefresh; if (type == "510") http_request.onreadystatechange = showNextCAF; url = "http://www.mysomeday.com" + url; http_request.open('POST', url, true); http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http_request.setRequestHeader("Content-length", parameters.length); http_request.setRequestHeader("Connection", "close"); http_request.send(parameters);
}; function showFeaturedSomedays() {
    if (http_request.readyState == 4) {
        if (http_request.status == 200) {
            result = http_request.responseText; rec_count = result.split("^^^^"); var somedaytypes = rec_count[0]; var pagerecord = rec_count[1]; var datapagerecord = rec_count[2]; var new1 = rec_count[3]; var pgcount = rec_count[4]; var newwh = rec_count[5]; var pagingdown = rec_count[6]; var newstart = 1; if (new1 > 5) {
                if (newwh == 0) { newstart = ((new1 - 5) + 1); }
                else { newstart = ((new1 - newwh) + 1); } 
            }
            GetObjectById("id_featured_paging").innerHTML = pagerecord; jQuery(document).ready(function() { jQuery('#search-carousel').jcarousel({ horizontal: true, scroll: 5, start: newstart }); }); GetObjectById("id_featured_paging_down").innerHTML = pagingdown; jQuery(document).ready(function() { jQuery('#search-carousel-down').jcarousel({ horizontal: true, scroll: 5, start: newstart }); }); GetObjectById("bindsomedaytypes").innerHTML = somedaytypes; GetObjectById("bindsomedaytypes_down").innerHTML = somedaytypes; if (GetObjectById("id_featured") != null)
                GetObjectById("id_featured").innerHTML = datapagerecord;
        }
        else { alert('There was a problem with the request: ' + http_request.status); } 
    } 
}; function cycle() { makePOSTRequest('/Ajax-ExpertRefresh.aspx', "", "210"); }; function showExpertOnRefresh() {
    if (http_request.readyState == 4) {
        if (http_request.status == 200) { result = http_request.responseText; GetObjectById("sponsored_content").innerHTML = result; var getTime = GetObjectById("ctl00_ContentPlaceHolder1_hidexp").value; window.setTimeout('cycle();', getTime); }
        else { alert("There was problem with request." + http_request.status); } 
    } 
}; var chkElem, lnk; function trackClicks(somedayID, page, element, link) { chkElem = element; lnk = link; var qs = "somedayID=" + somedayID + "&page=" + page + "&element=" + element; makePOSTRequest('/Ajax-ClickTracking.aspx?' + qs, "", "201"); }; function ResultClickTracking() {
    if (http_request.readyState == 4) {
        if (http_request.status == 200) { if (chkElem == "name") window.open(lnk, "website"); else if (chkElem == "logo") window.location = lnk; else if (chkElem == "original") { window.open(lnk, "website"); } }
        else alert("There was problem with request." + http_request.status);
    } 
}; function callChitChatLayer() { GetObjectById('start_chitchat').style.display = 'block'; GetObjectById('fade').style.display = 'block'; alertSize(); GetObjectById('start_chitchat').style.left = (parseInt(myWidth / 2) - 213) + "px"; window.scrollTo(0, 0); }; function closeChitchatLayer() { GetObjectById('ctl00_drp_cat').value = "0"; GetObjectById('ctl00_txt_title_chat').value = ""; GetObjectById('ctl00_txt_msg_chat').value = ""; GetObjectById('start_chitchat').style.display = 'none'; GetObjectById('fade').style.display = 'none'; }; var myWidth = 0, myHeight = 0; function alertSize() { if (typeof (window.innerWidth) == 'number') { myWidth = window.innerWidth; myHeight = window.innerHeight; } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) { myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } }; function callSomedayLayer() { GetObjectById('id_someday_what').style.display = 'block'; GetObjectById('fade').style.display = 'block'; alertSize(); GetObjectById('id_someday_what').style.left = (parseInt(myWidth / 2) - 460) + "px"; window.scrollTo(0, 0); }; function closeSomedayLayer() {
    if (GetObjectById('ctl00_rigth_uname1') != null)
        GetObjectById('ctl00_rigth_uname1').value = ""; if (GetObjectById('ctl00_rigth_pword1') != null)
        GetObjectById('ctl00_rigth_pword1').value = ""; if (GetObjectById('ctl00_chk_remember1') != null)
        GetObjectById('ctl00_chk_remember1').checked = false; GetObjectById('id_someday_what').style.display = 'none'; GetObjectById('fade').style.display = 'none';
}; function callLoginLayer() { GetObjectById('id_login').style.display = 'block'; GetObjectById('fade').style.display = 'block'; alertSize(); GetObjectById('id_login').style.left = (parseInt(myWidth / 2) - 213) + "px"; window.scrollTo(0, 0); }; function closeLoginLayer() { GetObjectById('ctl00_rigth_uname').value = ""; GetObjectById('ctl00_rigth_pword').value = ""; GetObjectById('ctl00_chk_remember').checked = false; GetObjectById('id_login').style.display = 'none'; GetObjectById('fade').style.display = 'none'; }; function callForgotpassLayer(pagename) {
    if (pagename == 'login')
        GetObjectById('id_login').style.display = 'none'; else if (pagename == 'somedaycopy')
        GetObjectById('id_someday_copy').style.display = 'none'; else
        GetObjectById('id_someday').style.display = 'none'; GetObjectById('id_forgotpass').style.display = 'block'; GetObjectById('fade').style.display = 'block'; alertSize(); GetObjectById('id_forgotpass').style.left = (parseInt(myWidth / 2) - 213) + "px"; window.scrollTo(0, 0);
}; function closeForgotpassLayer() { GetObjectById('ctl00_rigth_email').value = ""; GetObjectById('id_login').style.display = 'none'; GetObjectById('id_forgotpass').style.display = 'none'; GetObjectById('fade').style.display = 'none'; }; function checkLogin() { alert("Please login to contact"); }; function callLoginAlert() { alert(geterrmsg('e55')); }; function removeSpaces(strVal) { strVal = strVal.replace(/^\s*(\S*(\s+\S+)*)\s*$/, '$1'); return strVal; }; function keyPress(e, type) { if (e.keyCode == 13) { if (type == "Login") loginValidate(); if (type == "Search") searchfn(); if (type == "SearchUsers") searchuser(); if (type == "Splash") loginValidateMembers('buttonid', 'imgpreload'); if (type == "Register") loginValidateMembers('sbtnid', 'preloader'); if (type == "Default") return true; if (type == "Searchtxt") return true; if (type == "Searchreplytxt") return true; return false; } }; var specialchar = "#"; function loginValidate() {
    GetObjectById("subbutton").style.visibility = "hidden"; GetObjectById("imgpreloader").style.visibility = "visible"; for (var i = 0; i < GetObjectById("ctl00_rigth_uname").value.length; i++) { if (specialchar.indexOf(GetObjectById("ctl00_rigth_uname").value.charAt(i)) != -1) { alert(geterrmsg('e512')); GetObjectById("ctl00_rigth_uname").focus(); GetObjectById("subbutton").style.visibility = "visible"; GetObjectById("imgpreloader").style.visibility = "hidden"; return false; } }
    if (removeSpaces(GetObjectById("ctl00_rigth_uname").value) == "") { alert(geterrmsg('e46')); GetObjectById("ctl00_rigth_uname").focus(); GetObjectById("subbutton").style.visibility = "visible"; GetObjectById("imgpreloader").style.visibility = "hidden"; return false; }
    if (removeSpaces(GetObjectById("ctl00_rigth_pword").value) == "") { alert(geterrmsg('e43')); GetObjectById("ctl00_rigth_pword").focus(); GetObjectById("subbutton").style.visibility = "visible"; GetObjectById("imgpreloader").style.visibility = "hidden"; return false; }
    loginCheck("1", GetObjectById("ctl00_rigth_uname").value, GetObjectById("ctl00_rigth_pword").value, GetObjectById("ctl00_chk_remember").checked, 'nonmember');
}
function preloader(divID, preID, mode) { switch (mode.toLowerCase()) { case "show": GetObjectById(divID).style.display = "none"; GetObjectById(preID).style.display = "block"; break; case "hide": GetObjectById(preID).style.display = "none"; GetObjectById(divID).style.display = "block"; break; } }; function validateFBSignUp() {
    var success = false; var SomedayGoal = wsTrim(GetObjectById(content + "txtSomedayTitle").value); var userName = wsTrim(GetObjectById(content + "txtEnterUName").value); var email1 = wsTrim(GetObjectById(content + "txtEnterEmail").value); var captcha = wsTrim(GetObjectById(content + "txtCaptcha").value); var errStr = ""; if (SomedayGoal == "")
        errStr += "Someday I'm going to?\n"; if (userName == "")
        errStr += "Display Name?\n"; else { if (userName.indexOf(' ') != -1) errStr += "Please remove spaces from Display Name.\n"; if (userName.length < 4) errStr += "Display Name must be of minimum 4 characters.\n"; if (!validate(userName, "splchars")) errStr += "Please use alphanumeric Display Name.\n"; }
    if (email1 == "") errStr += "email address?\n"; else if (!validateEmail(email1)) errStr += "email address is invalid.\n"; if (captcha == "") errStr += "security code?\n"; preloader("divSubmit", "divPreloder", "show"); if (errStr != "") { alert("Have you entered your:\n" + errStr); preloader("divSubmit", "divPreloder", "hide"); }
    else { success = true; preloader("divSubmit", "divPreloder", "show"); }
    return success;
}
function loginValidateWelcome() {
    GetObjectById("welcombtn").style.visibility = "hidden"; GetObjectById("welcomepl").style.visibility = "visible"; for (var i = 0; i < GetObjectById("ctl00_rigth_uname1").value.length; i++) { if (specialchar.indexOf(GetObjectById("ctl00_rigth_uname1").value.charAt(i)) != -1) { alert(geterrmsg('e512')); GetObjectById("ctl00_rigth_uname1").focus(); GetObjectById("welcombtn").style.visibility = "visible"; GetObjectById("welcomepl").style.visibility = "hidden"; return; } }
    if (removeSpaces(GetObjectById("ctl00_rigth_uname1").value) == "") { alert(geterrmsg('e46')); GetObjectById("ctl00_rigth_uname1").focus(); GetObjectById("welcombtn").style.visibility = "visible"; GetObjectById("welcomepl").style.visibility = "hidden"; return; }
    if (removeSpaces(GetObjectById("ctl00_rigth_pword1").value) == "") { alert(geterrmsg('e43')); GetObjectById("ctl00_rigth_pword1").focus(); GetObjectById("welcombtn").style.visibility = "visible"; GetObjectById("welcomepl").style.visibility = "hidden"; return; }
    loginCheck("1", GetObjectById("ctl00_rigth_uname1").value, GetObjectById("ctl00_rigth_pword1").value, GetObjectById("ctl00_chk_remember1").checked, 'welcome');
}; function loginValidateMembers(btnid, preloadid, isFbLink) {
    GetObjectById(btnid).style.visibility = "hidden"; GetObjectById(preloadid).style.visibility = "visible"; for (var i = 0; i < GetObjectById(content + "rigth_uname").value.length; i++) { if (specialchar.indexOf(GetObjectById(content + "rigth_uname").value.charAt(i)) != -1) { alert(geterrmsg('e512')); GetObjectById(content + "rigth_uname").focus(); GetObjectById(btnid).style.visibility = "visible"; GetObjectById(preloadid).style.visibility = "hidden"; return; } }
    if (removeSpaces(GetObjectById(content + "rigth_uname").value) == "") { alert("Please enter a Username to login"); GetObjectById(content + "rigth_uname").focus(); GetObjectById(btnid).style.visibility = "visible"; GetObjectById(preloadid).style.visibility = "hidden"; return; }
    if (removeSpaces(GetObjectById(content + "rigth_pword").value) == "") { alert("Please enter a Password to login"); GetObjectById(content + "rigth_pword").focus(); GetObjectById(btnid).style.visibility = "visible"; GetObjectById(preloadid).style.visibility = "hidden"; return; }
    if (GetObjectById(content + "chk_remember") == null) { checkrem = false; }
    else { checkrem = false; if (GetObjectById(content + "chk_remember").checked == true) checkrem = true; }
    if (isFbLink == undefined) { if (btnid = "sbtnid") loginCheck("2", GetObjectById(content + "rigth_uname").value, GetObjectById(content + "rigth_pword").value, checkrem, 'member'); if (btnid = "buttonid") loginCheck("1", GetObjectById(content + "rigth_uname").value, GetObjectById(content + "rigth_pword").value, checkrem, 'member'); } else { loginCheck("F1", GetObjectById(content + "rigth_uname").value, GetObjectById(content + "rigth_pword").value, checkrem, 'member'); } 
}; function loginCheck(strpagecheck, struname, strpword, chk_checked, memberst) {
    xmlHttp = getXmlHttpObject(); if (xmlHttp == null) { alert(geterrmsg('e51')); return; }
    var url = "/login_layer.aspx"; url = url + "?usernam=" + struname + "&password=" + Base64.encode(strpword) + "&checked=" + chk_checked + "&pgchk=" + strpagecheck + "&memst=" + memberst; makePOSTRequest(url, "", '163');
}; function callClear() { GetObjectById('ctl00_rigth_uname').value = ""; GetObjectById('rigth_pword').value = ""; GetObjectById('ctl00_chk_remember').checked = false; }; function loginStateChanged() {
    if (http_request.readyState == 4) {
        if (http_request.status == 200) {
            result = http_request.responseText.split("^^^^"); if (result[0] == "1") { window.location.reload(true); }
            else if (result[0] == "2") { document.location = siteURL + "/UserProfile.aspx"; }
            else if (result[0] == "3") { callConfirmMessage(); } else if (result[0] == "F1") { document.location = siteURL + "/FbConfirmation.aspx?st=1"; }
            else {
                alert(geterrmsg('e48')); if (result[1] == "nonmember") { GetObjectById("subbutton").style.visibility = "visible"; GetObjectById("imgpreloader").style.visibility = "hidden"; GetObjectById("ctl00_rigth_uname").focus(); }
                else if (result[1] == "member") { GetObjectById("buttonid").style.visibility = "visible"; GetObjectById("imgpreload").style.visibility = "hidden"; GetObjectById("ctl00_ContentPlaceHolder1_rigth_uname").focus(); }
                else if (result[1] == "welcome") { GetObjectById("welcombtn").style.visibility = "visible"; GetObjectById("welcomepl").style.visibility = "hidden"; GetObjectById("ctl00_rigth_uname1").focus(); }
                else if (result[1] == "copysomeday") { GetObjectById("ctl00_rigth_uname2").focus(); } 
            } 
        } 
    } 
}; function callConfirmMessage() { getPageSize(0); GetObjectById('id_login').style.display = 'none'; GetObjectById('id_forgotpass').style.display = 'none'; GetObjectById('id_addasfriend').style.display = 'none'; GetObjectById('id_Confirmmessage').style.display = 'block'; GetObjectById('fade').style.width = (pageWidth + 'px'); GetObjectById('fade').style.height = (pageHeight + 'px'); GetObjectById('fade').style.display = 'block'; alertSize(); GetObjectById('id_Confirmmessage').style.left = (parseInt(myWidth / 2) - 213) + "px"; window.scrollTo(0, 0); }; function loggedOut() {
    xmlHttp = getXmlHttpObject(); if (xmlHttp == null) { alert(geterrmsg('e51')); return; }
    var url = "/logout.aspx"; makePOSTRequest(url, "", '164');
}; function loginOutStateChanged() { if (http_request.readyState == 4) { if (http_request.status == 200) { result = http_request.responseText; if (result == "1") { RedirectToHome(); } else if (result == "F1") { fBlogout(); } } } }; function fBlogout() { try { FB.Connect.ifUserConnected(function() { FB.Connect.logoutAndRedirect(siteURL + "Default_home.aspx"); }); } catch (e) { location.href = siteURL + "Default_home.aspx"; } }
function RedirectToHome() { window.location = siteURL + "Default_home.aspx"; }; function validateEmail(id) { var expression = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; return expression.test(id); }; function forgetPassEmail() {
    GetObjectById("forgetmail").style.display = "none"; GetObjectById("preload").style.display = "block"; if (GetObjectById("ctl00_rigth_email").value == "") { alert(geterrmsg('e9')); GetObjectById("ctl00_rigth_email").focus(); GetObjectById("forgetmail").style.display = "block"; GetObjectById("preload").style.display = "none"; return false; }
    if (validateEmail(GetObjectById("ctl00_rigth_email").value) == false) { alert(geterrmsg('e23')); GetObjectById("forgetmail").style.display = "block"; GetObjectById("preload").style.display = "none"; return false; }
    sendEmail(GetObjectById("ctl00_rigth_email").value);
}; function sendEmail(stremailId) {
    xmlHttp = getXmlHttpObject(); if (xmlHttp == null) { alert(geterrmsg('e51')); return; }
    var url = "/ForgetPassword-Layer.aspx"; url = url + "?email=" + stremailId; makePOSTRequest(url, '', '165');
}; function emailStateChanged() {
    if (http_request.readyState == 4) {
        if (http_request.status == 200) {
            result = http_request.responseText; if (result == "1") { alert(geterrmsg('e164')); GetObjectById("ctl00_rigth_email").value = ""; window.location.reload(); }
            else { alert(geterrmsg('e49')); GetObjectById("ctl00_rigth_email").value = ""; GetObjectById("ctl00_rigth_email").focus(); GetObjectById("forgetmail").style.display = "block"; GetObjectById("preload").style.display = "none"; } 
        } 
    } 
}; function validateChitChat() {
    var valid = true; var errorstr = "The following fields are incomplete:" + '\r\n'; GetObjectById("chatbutton").style.visibility = "hidden"; GetObjectById("chatpreloader").style.visibility = "visible"; if (GetObjectById("ctl00_drp_cat").value == "0") { errorstr = errorstr + '\r\n' + geterrmsg('e158'); valid = false; }
    if (GetObjectById("ctl00_txt_title_chat").value.replace(/^\s+|\s+$/g, "") == "") { errorstr = errorstr + '\r\n' + geterrmsg('e159'); valid = false; }
    if (GetObjectById("ctl00_txt_msg_chat").value.replace(/^\s+|\s+$/g, "") == "") { errorstr = errorstr + '\r\n' + geterrmsg('e160'); valid = false; }
    if (valid == false) { errorstr = errorstr + '\r\n'; GetObjectById("chatbutton").style.visibility = "visible"; GetObjectById("chatpreloader").style.visibility = "hidden"; alert(errorstr); }
    if (valid == true) { GetObjectById("chatbutton").style.visibility = "hidden"; GetObjectById("chatpreloader").style.visibility = "visible"; }
    return valid;
}; function searchuser() {
    var usrnam = GetObjectById("ctl00_txtUsername").value; if (removeSpaces(usrnam) == "") { alert("Please enter the name."); return; }
    if (usrnam == 'Search by Name') { alert("Please enter the name."); return; }
    document.location = '/Searchusers.aspx?lnk=' + Base64.encode(usrnam);
}; function searchfn() {
    var kew = GetObjectById("ctl00_txt_key").value; var ddl = GetObjectById("ctl00_DropDownList1").value; kew = kew.replace(/^\s*(\S*(\s+\S+)*)\s*$/, '$1'); if (kew == "Search by keyword") { kew = ""; }
    if (kew == "" && ddl == "0") { alert(geterrmsg('e153')); }
    else { window.location = "/Search.aspx?msl=" + Base64.encode("cat=" + ddl + "&kw=" + kew); } 
}; function CAFNext() { }
