Example #1
0
     @$p->changePersonalFlickrAccount($u->getID(), $_POST['flickr_username']);
 }
 if (isset($_FILES['avatar'])) {
     include_once 'includes/phpThumb/phpthumb.class.php';
     include_once 'includes/custom_avatar.inc.php';
     $phpThumb = new phpThumb();
     $phpThumb->setParameter('config_allow_src_above_docroot', true);
     // very important
     $phpThumb->setSourceFilename($_FILES['avatar']['tmp_name']);
     $phpThumb->setParameter('w', 80);
     $phpThumb->setParameter('h', 80);
     $phpThumb->setParameter('zc', 1);
     $phpThumb->setParameter('config_output_format', 'png');
     if ($phpThumb->GenerateThumbnail()) {
         include_once 'configs/globals.php';
         $membership_id = $u->getMembershipID($group_name);
         $bigfile = $app_base . "avatars/{$membership_id}/80.png";
         $smallfile = $app_base . "avatars/{$membership_id}/16.png";
         $target = $app_base . "avatars/{$membership_id}/";
         @mkdir($target);
         $phpThumb->RenderToFile($bigfile);
         makeSmallAvatar($bigfile, $smallfile);
         makeFlags($smallfile, $target);
         $u->setCustomAvatar($group_name);
     }
 } else {
     $membership_id = $u->getMembershipID($group_name);
     $u->copyAvatar($group_name, $u->getAvatarNo($group_name), $membership_id);
 }
 ob_end_clean();
 //header("location:{$service_host}{$group_name}/");
Example #2
0
    function getAjaxFunctions()
    {
        global $access_isGroupMember;
        global $people_allow_sexe, $people_allow_birthday, $people_allow_website, $people_allow_nation;
        $functions = '';
        if (isset($_SESSION['valid_user']) && $access_isGroupMember) {
            $u = new User($_SESSION['valid_user']);
            $mid = $u->getMembershipID();
            $functions .= "var current_user_membership_id = {$mid};\n\n";
        } else {
            $functions .= "var current_user_membership_id = -1;\n\n";
        }
        $functions .= <<<EOS
        
        
        function removeQuote(rid) {
            
            var txt = '';
EOS;
        $functions .= "txt += '" . $this->_("Do you really want to remove this quote?") . "';\n";
        $functions .= " txt += '<br /><br />';\n";
        $functions .= "txt += '<input type=\"button\" value=\"" . $this->_("Yes") . "\" onclick=\"removeQuoteYes('+rid+')\" /> ';\n";
        $functions .= "txt += '<input type=\"button\" value=\"" . $this->_("No") . "\" onclick=\"close_ajax_popup()\" /> ';\n";
        $functions .= <<<EOS
    
            popup_ajax(txt);
            
        }
        
        var removed_quote_id = -1;
        function removeQuoteYes(rid) {
            removed_quote_id = rid;
            make_busy();
            x_removeQuote(rid,removeQuoteRes);
            
             }
        
                function removeQuoteRes(res) {
                    if(res=='1') {
                        xDisplay("personal_quote_"+removed_quote_id,"none");
EOS;
        $functions .= "popup_ajax('" . $this->_("Quote removed. <a href=\"javascript:void(close_ajax_popup())\">Click</a> to continue...") . "');\n";
        $functions .= "}                    else {\n";
        $functions .= "popup_ajax('There was a problem while removing the quote. <a href=\"javascript:void(close_ajax_popup())\">Click</a> try again...');\n";
        $functions .= <<<EOS
    }
             }
        
        
        
EOS;
        $functions .= "function addQuote() {\n";
        $functions .= "\t var txt = '';\n";
        $functions .= "\t txt += '" . $this->_("Your quotes will be displayed randomly on top of this group pages") . "<br /><br />';\n";
        $functions .= "\t txt += '<form><textarea required=\"1\" realname=\"Quote\" onblur=\"inputblur(this)\" onfocus=\"inputfocus(this)\" id=\"your_quote\" style=\"width:250px;height:100px;\"></textarea><br /><br />';\n";
        $functions .= "\t txt += '<input type=\"button\" value=\"" . $this->_("Submit") . "\" onclick=\"addQuoteForSure(this.form)\" /></form>';\n";
        $functions .= "\t popup_ajax(txt);\n";
        $functions .= "}\n\n";
        $functions .= "var saved_quote = '';\n";
        $functions .= "function addQuoteForSure(formobj) {\n";
        $functions .= "\t if(!validateCompleteForm(formobj,'error')) return false;\n";
        $functions .= "\t var quote = xGetElementById('your_quote').value;\n";
        $functions .= "\t saved_quote = quote;\n";
        $functions .= "\t make_busy();\n";
        $functions .= "\t x_addQuoteX(quote,quoteAdded);\n";
        $functions .= "}\n\n";
        $functions .= "function quoteAdded(res) {\n";
        $functions .= "\t var txt = '';\n";
        $functions .= "\t if(res=='1') {\n";
        //$functions .= "xWinScrollTo(window,0,0,0);\n";
        $functions .= "if(xGetElementById('noquoteyet')&&xGetElementById('noquoteyet').value==1) xInnerHtml('personal_quotes','');\n";
        $functions .= "xInnerHtml('personal_quotes',xInnerHtml('personal_quotes')+'<div style=\"margin-bottom:3px;\">\"'+saved_quote+'\"</div>');";
        //$functions .= "\t\t txt += 'Your quote has been added.<br /><a href=\"javascript:void(location.reload())\">Click</a> to continue...';\n";
        // we don't reload.. no need to do it..
        $functions .= "\t\t txt += 'Your quote has been added.<br /><a href=\"javascript:void(close_ajax_popup())\">Click</a> to continue...';\n";
        $functions .= "\t } else\n";
        $functions .= "\t\t txt += 'Failure!<br /><a href=\"javascript:void(close_ajax_popup())\">Click</a> to try again...';\n";
        $functions .= "\t popup_ajax(txt)\n";
        $functions .= "}\n\n";
        $functions .= "function redecorate_peopleblock(res) {\n" . "\txGetElementById('block_title_no_2').innerHTML = 'People';\n" . "\txGetElementById('block_no_2').innerHTML = res;showAllBlocks();\n" . "}\n";
        $functions .= "function redecorate_lovestuff(res) {\n" . "\t var isOpen = res.substring(0,2)=='++';\n" . "\t var obj;\n" . "\t if(xGetElementById('top_block_no_6')) obj = xGetElementById('top_block_no_6');\n" . "\t else obj = xGetElementById('hidden_block_6');\n" . "\t if(isOpen) obj.style.display='block';\n" . "\t else obj.style.display='none';\n" . "\t xGetElementById('block_no_6').innerHTML = res.substring(2);showAllBlocks();\n" . "}\n";
        $functions .= "function redecorate_healthstuff(res) {\n" . "\t var isOpen = res.substring(0,2)=='++';\n" . "\t var obj;\n" . "\t if(xGetElementById('top_block_no_8')) obj = xGetElementById('top_block_no_8');\n" . "\t else obj = xGetElementById('hidden_block_8');\n" . "\t if(isOpen) obj.style.display='block';\n" . "\t else obj.style.display='none';\n" . "\txGetElementById('block_no_8').innerHTML = res.substring(2);showAllBlocks();\n" . "}\n";
        $functions .= "function redecorate_businessstuff(res) {\n" . "\t var isOpen = res.substring(0,2)=='++';\n" . "\t var obj;\n" . "\t if(xGetElementById('top_block_no_7')) obj = xGetElementById('top_block_no_7');\n" . "\t else obj = xGetElementById('hidden_block_7');\n" . "\t if(isOpen) obj.style.display='block';\n" . "\t else obj.style.display='none';\n" . "\t xGetElementById('block_no_7').innerHTML = res.substring(2);showAllBlocks();\n" . "}\n";
        $functions .= "function redecorate_tags(res) {\n" . "\t var isOpen = res.substring(0,2)=='++';\n" . "\t var obj;\n" . "\t if(xGetElementById('top_block_no_4')) obj = xGetElementById('top_block_no_4');\n" . "\t else obj = xGetElementById('hidden_block_4');\n" . "\t if(isOpen) obj.style.display='block';\n" . "\t else obj.style.display='none';\n" . "\t xGetElementById('block_no_4').innerHTML = res.substring(2);showAllBlocks();\n" . "}\n";
        $functions .= "function redecorate_favourites(res) {\n" . "\t var isOpen = res.substring(0,2)=='++';\n" . "\t var obj;\n" . "\t if(xGetElementById('top_block_no_5')) obj = xGetElementById('top_block_no_5');\n" . "\t else obj = xGetElementById('hidden_block_5');\n" . "\t if(isOpen) obj.style.display='block';\n" . "\t else obj.style.display='none';\n" . "\t xGetElementById('block_no_5').innerHTML = res.substring(2);showAllBlocks();\n" . "\t close_ajax_popup();\n" . "}\n";
        // always open
        $functions .= "function redecorate_profile(res) {\n" . "\t xGetElementById('block_no_3').innerHTML = res;\n" . "}\n";
        $functions .= "function redecorate_lovestuff_step3(res) {\n" . "\tif(res=='1') {\n" . "\t\t//x_peopleGetLoveStuff(lovestuff_current_id,redecorate_lovestuff);\n" . "\t\tpeople_show(lovestuff_current_id);\n" . "\t\tpopup_ajax('" . $this->_("Content Update was successful! <a href=\"javascript:void(close_ajax_popup())\">Click</a> to continue...") . "');\n" . "\t}\n" . "\telse {\n" . "\t\tpopup_ajax('" . $this->_("Could not update the content! <a href=\"javascript:void(close_ajax_popup())\">Click</a> to try again...") . "');\n" . "\t}\n" . "}\n";
        $functions .= "function empty_boxes() {\n" . "\tredecorate_lovestuff('');" . "\tredecorate_healthstuff('');\n" . "\tredecorate_businessstuff('');\n" . "\tredecorate_profile('');\n" . "}\n";
        $functions .= <<<EOS
\t
\tfunction redecorate_operationsblock(res) {
\t\t// xGetElementById('block_title_no_2').innerHTML = 'People';
        \txGetElementById('block_no_1').innerHTML = res;
\t}
    
    var section_transparencies = new Array();
    var last_me = true;
    function save_section_transparencies() {
        
 
        section_transparencies['tags'] = xInnerHtml('visopt_tags')=='Hide';
        section_transparencies['favourites'] = xInnerHtml('visopt_favourites')=='Hide';
        section_transparencies['lovestuff'] = xInnerHtml('visopt_love')=='Hide';
        section_transparencies['healthstuff'] = xInnerHtml('visopt_health')=='Hide';
        section_transparencies['businessstuff'] = xInnerHtml('visopt_business')=='Hide';
        

        
    }
    
    
    function restore_section_transparencies() {
        
                

        if(!section_transparencies['tags'])
            peopleHideSection(4,true);
        
        if(!section_transparencies['favourites'])
            peopleHideSection(5,true);
        
        if(!section_transparencies['lovestuff'])
            peopleHideSection(6,true);
        
        if(!section_transparencies['healthstuff'])
            peopleHideSection(8,true);
        
        if(!section_transparencies['businessstuff'])
            peopleHideSection(7,true);
        
        
    }
    
    
        function reset_section_transparencies() {

            peopleShowSection(4,true);        
            peopleShowSection(5,true); 
            peopleShowSection(6,true);       
            peopleShowSection(7,true);   
            peopleShowSection(8,true);
        
        
    }
        
        
        var zrv_id = -1;
        function showAllBlocks() {
    
            if(zrv_id==current_user_membership_id) {
        
                obj1 = xGetElementById('top_block_no_4')?'top_block_no_4':'hidden_block_4';
                obj2 = xGetElementById('top_block_no_5')?'top_block_no_5':'hidden_block_5';
                obj3 = xGetElementById('top_block_no_6')?'top_block_no_6':'hidden_block_6';
                obj4 = xGetElementById('top_block_no_7')?'top_block_no_7':'hidden_block_7';
                obj5 = xGetElementById('top_block_no_8')?'top_block_no_8':'hidden_block_8';
        
                xDisplay(obj1,'block');
                xDisplay(obj2,'block');
                xDisplay(obj3,'block');
                xDisplay(obj4,'block');
                xDisplay(obj5,'block');
   
            }
            
        }
        
        
    \t// will be implemented
        function pageload(id) {
            history.go(0);
             
        }
\t
EOS;
        $functions .= "function people_show(id,username) {\n" . "\t location.assign('http://grou.ps/{}/people/'+username);\n" . "\t /*make_busy();\n";
        //. "\t empty_boxes();\n"
        //. "\t make_busy();\n"
        $functions .= <<<EOS
        zrv_id = id;
    differentiate_bg();
        
    if(id==current_user_membership_id) {
        
        xDisplay('top_block_no_9','block')
        
        // don't touch if this is the first
        if(!last_me)
            restore_section_transparencies();
        
        last_me = true;
    }
    else {
        
        xDisplay('top_block_no_9','none')
        
        if(last_me)
            save_section_transparencies();
        
        reset_section_transparencies();
        
        last_me = false;
        
    }
    
    
    
EOS;
        if ($access_isGroupMember) {
            $functions .= "\t x_getOperationsBlock(id,redecorate_operationsblock);\n";
        }
        $functions .= "\t x_getPeopleBlock(id,redecorate_peopleblock);\n" . "\t x_peopleGetProfileX(id,redecorate_profile);\n" . "\t x_peopleGetLoveStuff(id,redecorate_lovestuff);\n" . "\t x_peopleGetBusinessStuff(id,redecorate_businessstuff);\n" . "\t x_peopleGetHealthStuff(id,redecorate_healthstuff);\n" . "\t x_peopleGetTags(id,username,redecorate_tags);\n" . "\t x_peopleGetFavourites(id,username,redecorate_favourites);*/\n" . "}\n";
        /*
        
        
        $functions  .= "var lovestuff_current_id;\n";
        		$functions  .= "var lovestuff_saved_content;\n";
        		$functions  .= "var healthstuff_current_id;\n";
        		$functions  .= "var healthstuff_saved_content;\n";
        		$functions  .= "var businessstuff_current_id;\n";
        		$functions  .= "var businessstuff_saved_content;\n";
        
        $functions  .= "function people_editlove(id) {\n"
        		. "\tmake_ajax_popup_bigger();\n"
        		. "\tlovestuff_current_id = id;\n"
        		. "\tvar a = xGetElementById('lovestuff_stripped_content').value;\n"
        		. "\tvar con = '<b>".str_replace("'","\\'",$this->_("Edit Love Stuff"))."</b><br /><br />'\n"
        		. "\tcon += '<textarea id=\"xxx_love\" rows=\"12\" cols=\"50\">'\n"
        		. "\tcon += xGetElementById('lovestuff_stripped_content').value\n"
        		. "\tcon += '</textarea>'\n"
        		. "\tcon += '<br /><br />'\n"
        		. "\tcon += '<input type=\"button\" value=\"".$this->_("Continue")."\" onclick=\"javascript:lovestuff_saved_content=xGetElementById(\'xxx_love\').value;make_busy(); x_registerLoveStuff(lovestuff_current_id,lovestuff_saved_content,redecorate_lovestuff_step3);\" /> '\n"
        		. "\tcon += '<input type=\"button\" value=\"".$this->_("Cancel")."\" onclick=\"javascript:void(close_ajax_popup())\" /> '\n"
        		. "\tpopup_ajax(con);\n"
        		. "}\n";
        */
        /******
         * now let's deal with profile stuff
         *************/
        /*
        
        $functions .= <<<EOS
        
        
        var people_showhealth_id = -1;
        		function people_showhealth(pid) {
        		people_showhealth_id = pid;
        		make_busy();
        		x_hideHealthStuff(pid, people_showhealth_res);
        }
        function people_showhealth_res(res) {
        var txt = '';
        if(res=='1') {
        		xDisplay('people_health_options_'+people_showhealth_id,'none');
        		xDisplay('people_health_options_'+people_showhealth_id,'block');
        		txt += 'Health Stuff section is hidden now. You will continue seeing it for editing purposes.';
        		txt += '<br /><a href="close_ajax_popup()">Click</a> to continue';
        		}
        		else {
        		txt += 'There was a problem!';
        		txt += '<br /><a href="close_ajax_popup()">Click</a> to try again';
        		}
        popup_ajax(txt);
        		}
        
        
        
        
        EOS;
        */
        $functions .= <<<EOS
                function people_editprofilex(membership_id) { 
\t\t\t
\t\t\tvar inf_namesurname = xGetElementById('inf_namesurname').value;
\t\t\tvar inf_sexe = xGetElementById('inf_sexe').value;
\t\t\tvar inf_birthday = xGetElementById('inf_birthday').value;
\t\t\tvar inf_nationality = xGetElementById('inf_nationality').value;
\t\t\tvar inf_myspace = xGetElementById('inf_myspace').value;
\t\t\tif(inf_myspace=='') inf_myspace = 'http://';
\t\t\t
            var txt = "";
            txt += "<form><table width=\\"420\\" border=\\"0\\" cellpadding=\\"3\\" cellspacing=\\"0\\">";
EOS;
        $functions .= 'txt += "<tr><td align=\\"left\\">' . $this->_("Name Surname") . '</td><td align=\\"left\\" style=\\"padding-left:10px;\\"><input onfocus=\\"inputfocus(this)\\" onblur=\\"inputblur(this)\\" required=\\"1\\" minlength=\\"3\\" realname=\\"Name Surname\\" regexp=\\"/^[a-z A-Z]{3,}$/\\" type=\\"text\\" id=\\"namesurname\\" value=\\""+inf_namesurname+"\\" /></td></tr>";';
        if ($people_allow_sexe) {
            $functions .= 'txt += "<tr><td align=\\"left\\">' . $this->_("Sexe") . '</td><td align=\\"left\\" style=\\"padding-left:10px;\\"><select id=\\"sexe\\" realname=\\"Sexe\\" required=\\"1\\"><option value=\\"Female\\">' . $this->_("Female") . '</option><option value=\\"male\\">' . $this->_("Male") . '</option></select></td></tr>";';
        } else {
            $functions .= 'txt += "<input type=\\"hidden\\" id=\\"sexe\\" value=\\""+inf_sexe+"\\" />";';
        }
        if ($people_allow_birthday) {
            $functions .= 'txt += "<tr><td align=\\"left\\">' . $this->_("Birthday") . '</td><td align=\\"left\\" style=\\"padding-left:10px;\\"><input onfocus=\\"inputfocus(this)\\" onblur=\\"inputblur(this)\\" required=\\"1\\" regexp=\\"JSVAL_RX_DATE\\" realname=\\"Birthday\\" type=\\"text\\" id=\\"birthday\\" value=\\""+inf_birthday+"\\" /> ' . $this->_("(mm/dd/yyyy)") . '</td></tr>";';
        } else {
            $functions .= 'txt += "<input type=\\"hidden\\" id=\\"birthday\\" value=\\""+inf_birthday+"\\" />";';
        }
        if ($people_allow_website) {
            $functions .= 'txt += "<tr><td align=\\"left\\">' . $this->_("Web/MySpace Page") . '</td><td align=\\"left\\" style=\\"padding-left:10px;\\"><input onfocus=\\"inputfocus(this)\\" onblur=\\"inputblur(this)\\" required=\\"0\\" realname=\\"Web/MySpace Page\\" type=\\"text\\" id=\\"myspace\\" value=\\""+inf_myspace+"\\" />";';
        } else {
            $functions .= 'txt += "<input type=\\"hidden\\" id=\\"myspace\\" value=\\""+inf_myspace+"\\" />";';
        }
        if ($people_allow_nation) {
            $functions .= 'txt += "<tr><td align=\\"left\\">' . $this->_("Nationality") . '</td><td align=\\"left\\" style=\\"padding-left:10px;\\"><select required=\\"1\\" realname=\\"Nationality\\" type=\\"text\\" id=\\"nationality\\" />";';
            $functions .= <<<EOS
            txt += '<option value="AF">Afghanistan</option>';
            txt += '<option value="AL">Albania</option>';
            txt += '<option value="DZ">Algeria</option>';
            txt += '<option value="AS">American Samoa</option>';
            txt += '<option value="AD">Andorra</option>';
            txt += '<option value="AO">Angola</option>';
            txt += '<option value="AI">Anguilla</option>';
            txt += '<option value="AQ">Antarctica</option>';
            txt += '<option value="AG">Antigua and Barbuda</option>';
            txt += '<option value="AR">Argentina</option>';
            txt += '<option value="AM">Armenia</option>';
            txt += '<option value="AW">Aruba</option>';
            txt += '<option value="AU">Australia</option>';
            txt += '<option value="AT">Austria</option>';
            txt += '<option value="AZ">Azerbaijan</option>';
            txt += '<option value="AP">Azores</option>';
            txt += '<option value="BS">Bahamas</option>';
            txt += '<option value="BH">Bahrain</option>';
            txt += '<option value="BD">Bangladesh</option>';
            txt += '<option value="BB">Barbados</option>';
            txt += '<option value="BY">Belarus</option>';
            txt += '<option value="BE">Belgium</option>';
            txt += '<option value="BZ">Belize</option>';
            txt += '<option value="BJ">Benin</option>';
            txt += '<option value="BM">Bermuda</option>';
            txt += '<option value="BT">Bhutan</option>';
            txt += '<option value="BO">Bolivia</option>';
            txt += '<option value="BA">Bosnia And Herzegowina</option>';
            txt += '<option value="XB">Bosnia-Herzegovina</option>';
            txt += '<option value="BW">Botswana</option>';
            txt += '<option value="BV">Bouvet Island</option>';
            txt += '<option value="BR">Brazil</option>';
            txt += '<option value="IO">British Indian Ocean Territory</option>';
            txt += '<option value="VG">British Virgin Islands</option>';
            txt += '<option value="BN">Brunei Darussalam</option>';
            txt += '<option value="BG">Bulgaria</option>';
            txt += '<option value="BF">Burkina Faso</option>';
            txt += '<option value="BI">Burundi</option>';
            txt += '<option value="KH">Cambodia</option>';
            txt += '<option value="CM">Cameroon</option>';
            txt += '<option value="CA">Canada</option>';
            txt += '<option value="CV">Cape Verde</option>';
            txt += '<option value="KY">Cayman Islands</option>';
            txt += '<option value="CF">Central African Republic</option>';
            txt += '<option value="TD">Chad</option>';
            txt += '<option value="CL">Chile</option>';
            txt += '<option value="CN">China</option>';
            txt += '<option value="CX">Christmas Island</option>';
            txt += '<option value="CC">Cocos (Keeling) Islands</option>';
            txt += '<option value="CO">Colombia</option>';
            txt += '<option value="KM">Comoros</option>';
            txt += '<option value="CG">Congo</option>';
            txt += '<option value="CD">Congo, The Democratic Republic</option>';
            txt += '<option value="CK">Cook Islands</option>';
            txt += '<option value="XE">Corsica</option>';
            txt += '<option value="CR">Costa Rica</option>';
            txt += '<option value="CI">Cote d\\'Ivoire (Ivory Coast)</option>';
            txt += '<option value="HR">Croatia</option>';
            txt += '<option value="CU">Cuba</option>';
            txt += '<option value="CY">Cyprus</option>';
            txt += '<option value="CZ">Czech Republic</option>';
            txt += '<option value="DK">Denmark</option>';
            txt += '<option value="DJ">Djibouti</option>';
            txt += '<option value="DM">Dominica</option>';
            txt += '<option value="DO">Dominican Republic</option>';
            txt += '<option value="TP">East Timor</option>';
            txt += '<option value="EC">Ecuador</option>';
            txt += '<option value="EG">Egypt</option>';
            txt += '<option value="SV">El Salvador</option>';
            txt += '<option value="GQ">Equatorial Guinea</option>';
            txt += '<option value="ER">Eritrea</option>';
            txt += '<option value="EE">Estonia</option>';
            txt += '<option value="ET">Ethiopia</option>';
            txt += '<option value="FK">Falkland Islands (Malvinas)</option>';
            txt += '<option value="FO">Faroe Islands</option>';
            txt += '<option value="FJ">Fiji</option>';
            txt += '<option value="FI">Finland</option>';
            txt += '<option value="FR">France (Includes Monaco)</option>';
            txt += '<option value="FX">France, Metropolitan</option>';
            txt += '<option value="GF">French Guiana</option>';
            txt += '<option value="PF">French Polynesia</option>';
            txt += '<option value="TA">French Polynesia (Tahiti)</option>';
            txt += '<option value="TF">French Southern Territories</option>';
            txt += '<option value="GA">Gabon</option>';
            txt += '<option value="GM">Gambia</option>';
            txt += '<option value="GE">Georgia</option>';
            txt += '<option value="DE">Germany</option>';
            txt += '<option value="GH">Ghana</option>';
            txt += '<option value="GI">Gibraltar</option>';
            txt += '<option value="GR">Greece</option>';
            txt += '<option value="GL">Greenland</option>';
            txt += '<option value="GD">Grenada</option>';
            txt += '<option value="GP">Guadeloupe</option>';
            txt += '<option value="GU">Guam</option>';
            txt += '<option value="GT">Guatemala</option>';
            txt += '<option value="GN">Guinea</option>';
            txt += '<option value="GW">Guinea-Bissau</option>';
            txt += '<option value="GY">Guyana</option>';
            txt += '<option value="HT">Haiti</option>';
            txt += '<option value="HM">Heard And Mc Donald Islands</option>';
            txt += '<option value="VA">Holy See (Vatican City State)</option>';
            txt += '<option value="HN">Honduras</option>';
            txt += '<option value="HK">Hong Kong</option>';
            txt += '<option value="HU">Hungary</option>';
            txt += '<option value="IS">Iceland</option>';
            txt += '<option value="IN">India</option>';
            txt += '<option value="ID">Indonesia</option>';
            txt += '<option value="IR">Iran</option>';
            txt += '<option value="IQ">Iraq</option>';
            txt += '<option value="IE">Ireland</option>';
            txt += '<option value="EI">Ireland (Eire)</option>';
            txt += '<option value="IL">Israel</option>';
            txt += '<option value="IT">Italy</option>';
            txt += '<option value="JM">Jamaica</option>';
            txt += '<option value="JP">Japan</option>';
            txt += '<option value="JO">Jordan</option>';
            txt += '<option value="KZ">Kazakhstan</option>';
            txt += '<option value="KE">Kenya</option>';
            txt += '<option value="KI">Kiribati</option>';
            txt += '<option value="KP">Korea, Democratic People Repub</option>';
            txt += '<option value="KW">Kuwait</option>';
            txt += '<option value="KG">Kyrgyzstan</option>';
            txt += '<option value="LA">Laos</option>';
            txt += '<option value="LV">Latvia</option>';
            txt += '<option value="LB">Lebanon</option>';
            txt += '<option value="LS">Lesotho</option>';
            txt += '<option value="LR">Liberia</option>';
            txt += '<option value="LY">Libya</option>';
            txt += '<option value="LI">Liechtenstein</option>';
            txt += '<option value="LT">Lithuania</option>';
            txt += '<option value="LU">Luxembourg</option>';
            txt += '<option value="MO">Macao</option>';
            txt += '<option value="MK">Macedonia</option>';
            txt += '<option value="MG">Madagascar</option>';
            txt += '<option value="ME">Madeira Islands</option>';
            txt += '<option value="MW">Malawi</option>';
            txt += '<option value="MY">Malaysia</option>';
            txt += '<option value="MV">Maldives</option>';
            txt += '<option value="ML">Mali</option>';
            txt += '<option value="MT">Malta</option>';
            txt += '<option value="MH">Marshall Islands</option>';
            txt += '<option value="MQ">Martinique</option>';
            txt += '<option value="MR">Mauritania</option>';
            txt += '<option value="MU">Mauritius</option>';
            txt += '<option value="YT">Mayotte</option>';
            txt += '<option value="MX">Mexico</option>';
            txt += '<option value="FM">Micronesia, Federated States Of</option>';
            txt += '<option value="MD">Moldova, Republic Of</option>';
            txt += '<option value="MC">Monaco</option>';
            txt += '<option value="MN">Mongolia</option>';
            txt += '<option value="MS">Montserrat</option>';
            txt += '<option value="MA">Morocco</option>';
            txt += '<option value="MZ">Mozambique</option>';
            txt += '<option value="MM">Myanmar (Burma)</option>';
            txt += '<option value="NA">Namibia</option>';
            txt += '<option value="NR">Nauru</option>';
            txt += '<option value="NP">Nepal</option>';
            txt += '<option value="NL">Netherlands</option>';
            txt += '<option value="AN">Netherlands Antilles</option>';
            txt += '<option value="NC">New Caledonia</option>';
            txt += '<option value="NZ">New Zealand</option>';
            txt += '<option value="NI">Nicaragua</option>';
            txt += '<option value="NE">Niger</option>';
            txt += '<option value="NG">Nigeria</option>';
            txt += '<option value="NU">Niue</option>';
            txt += '<option value="NF">Norfolk Island</option>';
            txt += '<option value="MP">Northern Mariana Islands</option>';
            txt += '<option value="NO">Norway</option>';
            txt += '<option value="OM">Oman</option>';
            txt += '<option value="PK">Pakistan</option>';
            txt += '<option value="PW">Palau</option>';
            txt += '<option value="PS">Palestinian Territory, Occupied</option>';
            txt += '<option value="PA">Panama</option>';
            txt += '<option value="PG">Papua New Guinea</option>';
            txt += '<option value="PY">Paraguay</option>';
            txt += '<option value="PE">Peru</option>';
            txt += '<option value="PH">Philippines</option>';
            txt += '<option value="PN">Pitcairn</option>';
            txt += '<option value="PL">Poland</option>';
            txt += '<option value="PT">Portugal</option>';
            txt += '<option value="PR">Puerto Rico</option>';
            txt += '<option value="QA">Qatar</option>';
            txt += '<option value="RE">Reunion</option>';
            txt += '<option value="RO">Romania</option>';
            txt += '<option value="RU">Russian Federation</option>';
            txt += '<option value="RW">Rwanda</option>';
            txt += '<option value="KN">Saint Kitts And Nevis</option>';
            txt += '<option value="SM">San Marino</option>';
            txt += '<option value="ST">Sao Tome and Principe</option>';
            txt += '<option value="SA">Saudi Arabia</option>';
            txt += '<option value="SN">Senegal</option>';
            txt += '<option value="XS">Serbia-Montenegro</option>';
            txt += '<option value="SC">Seychelles</option>';
            txt += '<option value="SL">Sierra Leone</option>';
            txt += '<option value="SG">Singapore</option>';
            txt += '<option value="SK">Slovak Republic</option>';
            txt += '<option value="SI">Slovenia</option>';
            txt += '<option value="SB">Solomon Islands</option>';
            txt += '<option value="SO">Somalia</option>';
            txt += '<option value="ZA">South Africa</option>';
            txt += '<option value="GS">South Georgia And The South Sand</option>';
            txt += '<option value="KR">South Korea</option>';
            txt += '<option value="ES">Spain</option>';
            txt += '<option value="LK">Sri Lanka</option>';
            txt += '<option value="NV">St. Christopher and Nevis</option>';
            txt += '<option value="SH">St. Helena</option>';
            txt += '<option value="LC">St. Lucia</option>';
            txt += '<option value="PM">St. Pierre and Miquelon</option>';
            txt += '<option value="VC">St. Vincent and the Grenadines</option>';
            txt += '<option value="SD">Sudan</option>';
            txt += '<option value="SR">Suriname</option>';
            txt += '<option value="SJ">Svalbard And Jan Mayen Islands</option>';
            txt += '<option value="SZ">Swaziland</option>';
            txt += '<option value="SE">Sweden</option>';
            txt += '<option value="CH">Switzerland</option>';
            txt += '<option value="SY">Syrian Arab Republic</option>';
            txt += '<option value="TW">Taiwan</option>';
            txt += '<option value="TJ">Tajikistan</option>';
            txt += '<option value="TZ">Tanzania</option>';
            txt += '<option value="TH">Thailand</option>';
            txt += '<option value="TG">Togo</option>';
            txt += '<option value="TK">Tokelau</option>';
            txt += '<option value="TO">Tonga</option>';
            txt += '<option value="TT">Trinidad and Tobago</option>';
            txt += '<option value="XU">Tristan da Cunha</option>';
            txt += '<option value="TN">Tunisia</option>';
            txt += '<option value="TR">Turkey</option>';
            txt += '<option value="TM">Turkmenistan</option>';
            txt += '<option value="TC">Turks and Caicos Islands</option>';
            txt += '<option value="TV">Tuvalu</option>';
            txt += '<option value="UG">Uganda</option>';
            txt += '<option value="UA">Ukraine</option>';
            txt += '<option value="AE">United Arab Emirates</option>';
            txt += '<option value="UK">United Kingdom</option>';
            txt += '<option value="GB">Great Britain</option>';
            txt += '<option value="US" selected>United States</option>';
            txt += '<option value="UM">United States Minor Outlying Isl</option>';
            txt += '<option value="UY">Uruguay</option>';
            txt += '<option value="UZ">Uzbekistan</option>';
            txt += '<option value="VU">Vanuatu</option>';
            txt += '<option value="XV">Vatican City</option>';
            txt += '<option value="VE">Venezuela</option>';
            txt += '<option value="VN">Vietnam</option>';
            txt += '<option value="VI">Virgin Islands (U.S.)</option>';
            txt += '<option value="WF">Wallis and Furuna Islands</option>';
            txt += '<option value="EH">Western Sahara</option>';
            txt += '<option value="WS">Western Samoa</option>';
            txt += '<option value="YE">Yemen</option>';
            txt += '<option value="YU">Yugoslavia</option>';
            txt += '<option value="ZR">Zaire</option>';
            txt += '<option value="ZM">Zambia</option>';
            txt += '<option value="ZW">Zimbabwe</option>';\t
\t
            
            
            txt += "</select></td></tr>";
EOS;
        } else {
            $functions .= 'txt += "<input type=\\"hidden\\" id=\\"nationality\\" value=\\""+inf_nationality+"\\" />";';
        }
        $functions .= 'txt += "<tr><td>&nbsp;</td><td align=\\"left\\" style=\\"padding-left:10px;\\"><br /><input type=\\"button\\" value=\\"' . $this->_("Save") . '\\" onclick=\\"people_editprofilex_go(this.form,"+membership_id+")\\" /></form></td></tr>";';
        $functions .= 'popup_ajax(txt);';
        if ($people_allow_sexe) {
            $functions .= "selectBoxDefault('sexe',inf_sexe);";
        }
        if ($people_allow_nation) {
            $functions .= "selectBoxDefault('nationality',inf_nationality);";
        }
        $functions .= "}";
        $functions .= <<<EOS
            
            var zmid = -1;
        function people_editprofilex_go(formobj,mid) { 
            
                
                
            if(!validateCompleteForm(formobj,'error'))
                return false;
            
            zmid = mid;
            var namesurname = xGetElementById('namesurname').value;
            var birthday = xGetElementById('birthday').value;
            var nationality = xGetElementById('nationality').value;
            var myspace = xGetElementById('myspace').value;
            
\t    var sexe = xGetElementById('sexe').value;
            
            make_busy();
            x_registerProfileX(mid,namesurname,birthday,myspace,nationality,sexe,people_editprofilex_finish);
            
}
            
            
            
            
            
            function people_editprofilex_finish(res) {
                
                if(res=='1') {
         
                    popup_ajax('Profile successfully modified! <a href="javascript:void(pageload('+zmid+'))">Click</a> to continue...');
        }
            else {
                
                popup_ajax('Failure! <a href="javascript:void(pageload('+zmid+'))">Click</a> to try again...');
                
        }
                
        }
            
            
            
            
            
            
EOS;
        /*
        		$functions .= <<<EOS
        
        		function people_editcontacts(mid) {
        
        		var email = xGetElementById('inf_email').value;
        		var aim = xGetElementById('inf_aim').value;
        		var icq = xGetElementById('inf_icq').value;
        		var yahoo = xGetElementById('inf_yahoo').value;
        		var msn = xGetElementById('inf_msn').value;
        		var jabber = xGetElementById('inf_jabber').value;
        
        		var txt = "";
        		txt += "<form>";
        		EOS;
        
        
        		$functions .= 'txt += "<label style=\"width:100px;\">'.$this->_('Email').'</label><span style=\"width:250px;padding-left:10px;\"><input value=\""+email+"\" onfocus=\"inputfocus(this)\" onblur=\"inputblur(this)\" required=\"1\" realname=\"Email\" regexp=\"JSVAL_RX_EMAIL\" type=\"text\" id=\"email\" /></span><br /><br />";';
        
        
        		$functions .= <<<EOS
        		txt += "<label style=\"width:100px;\">AIM</label><span style=\"width:250px;padding-left:10px;\"><input value=\""+aim+"\" onfocus=\"inputfocus(this)\" onblur=\"inputblur(this)\" required=\"0\" realname=\"AIM\" type=\"text\" id=\"aim\" /></span><br /><br />";
        		txt += "<label style=\"width:100px;\">ICQ</label><span style=\"width:250px;padding-left:10px;\"><input value=\""+icq+"\" onfocus=\"inputfocus(this)\" onblur=\"inputblur(this)\" required=\"0\" realname=\"ICQ\" type=\"text\" id=\"icq\" /></span><br /><br />";
        		txt += "<label style=\"width:100px;\">Jabber</label><span style=\"width:250px;padding-left:10px;\"><input value=\""+jabber+"\" onfocus=\"inputfocus(this)\" onblur=\"inputblur(this)\" required=\"0\" regexp=\"JSVAL_RX_EMAIL\" realname=\"Jabber\" type=\"text\" id=\"jabber\" /></span><br /><br />";
        		txt += "<label style=\"width:100px;\">MSN</label><span style=\"width:250px;padding-left:10px;\"><input value=\""+msn+"\" onfocus=\"inputfocus(this)\" onblur=\"inputblur(this)\" required=\"0\" realname=\"MSN\" regexp=\"JSVAL_RX_EMAIL\" type=\"text\" id=\"msn\" /></span><br /><br />";
        		txt += "<label style=\"width:100px;\">Yahoo</label><span style=\"width:250px;padding-left:10px;\"><input value=\""+yahoo+"\" onfocus=\"inputfocus(this)\" onblur=\"inputblur(this)\" required=\"0\" realname=\"Yahoo\" type=\"text\" id=\"yahoo\" /></span><br /><br />";
        		EOS;
        
        		$functions .= 'txt += "<input type=\"button\" value=\"'.$this->_("Save").'\" onclick=\"people_editcontacts_go(this.form,"+mid+")\" /></form>";';
        
        		$functions .= <<<EOS
        
        		popup_ajax(txt);
        		}
        		EOS;
        
        
        
        		$functions .= <<<EOS
        		function people_editcontacts_go(formobj,mid) {
        
        		if(!validateCompleteForm(formobj,'error'))
        		return false;
        
        		var email = xGetElementById('email').value;
        		var aim = xGetElementById('aim').value;
        		var icq = xGetElementById('icq').value;
        		var msn = xGetElementById('msn').value;
        		var jabber = xGetElementById('jabber').value;
        		var yahoo = xGetElementById('yahoo').value;
        
        		make_busy();
        		x_registerContactsX(mid,email,aim,icq,msn,jabber,yahoo,people_editcontacts_finish);
        
        		}
        
        
        
        		function people_editcontacts_finish(res) {
        
        		if(res=='1') {
        
        		popup_ajax('Success! <a href="javascript:void(pageload('+zmid+'))">Click</a> to continue...');
        		}
        		else {
        
        		popup_ajax('Failure! Make sure you entered valid contact data. <a href="javascript:void(pageload('+zmid+'))">Click</a> to try again...');
        
        		}
        
        		}
        */
        $functions .= <<<EOS
\t    
\t    var isTagsEmpty = false;
\t    function people_edittags(mid) {
\t\t
\t\t    var tags = xGetElementById('inf_tags').value;
\t\t    
\t\t    
\t\t    if(tags=='') {
\t\t\t    isTagsEmpty = true;
EOS;
        $functions .= "tags = '" . $this->_("Stanford University, USA, MacOS X, easy going, GEEK, origin:israel, Starbucks, yellow, romantic, University Avenue, Palo Alto, Computer Sciences, beer, NY City, soft rock, BMW, desperate single, sunset, religion: jewish, girls, heterosexual, fun, Steve Jobs, sushi, Tel Aviv, BA, honesty") . "';\n";
        $functions .= <<<EOS

\t\t    }
\t\t    else {
\t\t\t    isTagsEmpty = false;
\t\t    }
\t\t\t    
\t\t    var txt = '';
\t\t    
\t\t    txt += '<form>';
EOS;
        $functions .= "txt += '" . $this->_("Describe yourself by tags. Separate them by <u>commas</u>. Sort by <u>descending</u> <u>priority</u> order. (e.g highest priority is at the first tag)") . "<br /><br />';\n";
        $functions .= <<<EOS
\t\t    \t\t    
\t\t    txt += '<textarea onclick="tagcheck(this)" id="yourtags" required="1" realname="Tags" style="width:300px;height:100px;">'+tags+'</textarea>';
\t\t    txt += '<br /><br />';
EOS;
        $functions .= "txt += '<input type=\"button\" value=\"" . $this->_("Submit") . "\" onclick=\"people_edittags_go(this.form,'+mid+')\" />';\n";
        $functions .= <<<EOS
\t\t    
\t\t    txt += '</form>';
\t\t    
\t\t    popup_ajax(txt);
\t\t    
\t\t    if(isTagsEmpty)
\t\t\t    xGetElementById('yourtags').style.color='red';
\t\t    
\t\t    
\t    }
\t    
\t    function tagcheck(obj) {
\t\t    
\t\t    if(isTagsEmpty) {
\t\t\t    obj.value='';
\t\t\t    obj.style.color='black';
\t\t\t    isTagsEmpty=false;
\t\t    }
\t    }
\t    
\t    
\t    
\t    
\t   function people_edittags_go(formobj,mid) { 
            
            if(!validateCompleteForm(formobj,'error'))
                return false;
            
            var tags = xGetElementById('yourtags').value;
            
            make_busy();
            x_registerTagsX(mid,tags,people_edittags_finish);
            
\t}



            function people_edittags_finish(res) {
                
                if(res=='1') {
         
\t\t\tpopup_ajax('Success! <a href="javascript:void(pageload('+zmid+'))">Click</a> to continue...');
\t\t}
\t\telse {
                
\t\t\tpopup_ajax('Failure! <a href="javascript:void(pageload('+zmid+'))">Click</a> to try again...');
                
\t\t}
        \t        
\t    }

\t    
\t    function people_edit_favourites(mid) {
\t    
\t\t    var txt = '';
\t\t    
\t\t    var favsongs = xGetElementById('inf_favsongs').value;
\t\t    var favsingers = xGetElementById('inf_favsingers').value;
\t\t    var favmovies = xGetElementById('inf_favmovies').value;
\t\t    var favactors = xGetElementById('inf_favactors').value;
\t\t    var favbooks = xGetElementById('inf_favbooks').value;
\t\t    var favauthors = xGetElementById('inf_favauthors').value;
\t\t    var favsportsmen = xGetElementById('inf_favsportsmen').value;
\t\t    var favartists = xGetElementById('inf_favartists').value;
\t\t    var favcities = xGetElementById('inf_favcities').value;
\t\t    
\t\t    
\t\t    txt += "<form><table width=\\"300\\" border=\\"0\\" cellpadding=\\"3\\" cellspacing=\\"0\\">";
\t\t    
EOS;
        $functions .= 'txt += "<tr><td colspan=\\"2\\" align=\\"left\\">' . $this->_("Separate your favorites by <u>commas</u>") . '</td></tr>";';
        $functions .= 'txt += "<tr><td align=\\"left\\">' . $this->_("Fav Songs") . '</td><td align=\\"left\\" style=\\"padding-left:10px;\\"><input onfocus=\\"inputfocus(this)\\" onblur=\\"inputblur(this)\\" required=\\"0\\" type=\\"text\\" id=\\"favsongs\\" value=\\""+favsongs+"\\" /></td></tr>";';
        $functions .= 'txt += "<tr><td align=\\"left\\">' . $this->_("Fav Singers") . '</td><td align=\\"left\\" style=\\"padding-left:10px;\\"><input onfocus=\\"inputfocus(this)\\" onblur=\\"inputblur(this)\\" required=\\"0\\" type=\\"text\\" id=\\"favsingers\\" value=\\""+favsingers+"\\" /></td></tr>";';
        $functions .= 'txt += "<tr><td align=\\"left\\">' . $this->_("Fav Movies") . '</td><td align=\\"left\\" style=\\"padding-left:10px;\\"><input onfocus=\\"inputfocus(this)\\" onblur=\\"inputblur(this)\\" required=\\"0\\" type=\\"text\\" id=\\"favmovies\\" value=\\""+favmovies+"\\" /></td></tr>";';
        $functions .= 'txt += "<tr><td align=\\"left\\">' . $this->_("Fav Actors") . '</td><td align=\\"left\\" style=\\"padding-left:10px;\\"><input onfocus=\\"inputfocus(this)\\" onblur=\\"inputblur(this)\\" required=\\"0\\" type=\\"text\\" id=\\"favactors\\" value=\\""+favactors+"\\" /></td></tr>";';
        $functions .= 'txt += "<tr><td align=\\"left\\">' . $this->_("Fav Books") . '</td><td align=\\"left\\" style=\\"padding-left:10px;\\"><input onfocus=\\"inputfocus(this)\\" onblur=\\"inputblur(this)\\" required=\\"0\\" type=\\"text\\" id=\\"favbooks\\" value=\\""+favbooks+"\\" /></td></tr>";';
        $functions .= 'txt += "<tr><td align=\\"left\\">' . $this->_("Fav Authors") . '</td><td align=\\"left\\" style=\\"padding-left:10px;\\"><input onfocus=\\"inputfocus(this)\\" onblur=\\"inputblur(this)\\" required=\\"0\\" type=\\"text\\" id=\\"favauthors\\" value=\\""+favauthors+"\\" /></td></tr>";';
        $functions .= 'txt += "<tr><td align=\\"left\\">' . $this->_("Fav Sportsmen") . '</td><td align=\\"left\\" style=\\"padding-left:10px;\\"><input onfocus=\\"inputfocus(this)\\" onblur=\\"inputblur(this)\\" required=\\"0\\" type=\\"text\\" id=\\"favsportsmen\\" value=\\""+favsportsmen+"\\" /></td></tr>";';
        $functions .= 'txt += "<tr><td align=\\"left\\">' . $this->_("Fav Artists") . '</td><td align=\\"left\\" style=\\"padding-left:10px;\\"><input onfocus=\\"inputfocus(this)\\" onblur=\\"inputblur(this)\\" required=\\"0\\" type=\\"text\\" id=\\"favartists\\" value=\\""+favartists+"\\" /></td></tr>";';
        $functions .= 'txt += "<tr><td align=\\"left\\">' . $this->_("Fav Cities") . '</td><td align=\\"left\\" style=\\"padding-left:10px;\\"><input onfocus=\\"inputfocus(this)\\" onblur=\\"inputblur(this)\\" required=\\"0\\" type=\\"text\\" id=\\"favcities\\" value=\\""+favcities+"\\" /></td></tr>";';
        $functions .= "txt += '<tr><td align=\"left\">&nbsp;</td><td align=\"left\" style=\"padding-left:10px;\"><input type=\"button\" value=\"" . $this->_("Submit") . "\" onclick=\"people_edit_favourites_go('+mid+')\" /></td></tr>';";
        $functions .= <<<EOS
\t\t    txt += '</form>';
\t\t    
\t\t    popup_ajax(txt);
\t    
\t    }
            
            
            
            /**
             * no form check
             */
                
                var rrmidr = -1;
        function people_edit_favourites_go(mid) {
\t    
               rrmidr = mid;
            var txt = '';
\t\t    
\t\t    var favsongs = xGetElementById('favsongs').value;
\t\t    var favsingers = xGetElementById('favsingers').value;
\t\t    var favmovies = xGetElementById('favmovies').value;
\t\t    var favactors = xGetElementById('favactors').value;
\t\t    var favbooks = xGetElementById('favbooks').value;
\t\t    var favauthors = xGetElementById('favauthors').value;
\t\t    var favsportsmen = xGetElementById('favsportsmen').value;
\t\t    var favartists = xGetElementById('favartists').value;
\t\t    var favcities = xGetElementById('favcities').value;
\t\t    
\t\t    make_busy();
            x_registerFavourites(mid,favsongs,favsingers,favmovies,favactors,favbooks,favauthors,favsportsmen,favartists,favcities,people_edit_favourites_finish);
\t    
\t    }
\t    
            
            
            
            function people_edit_favourites_finish(res) {    
     
                if(res=='1') {
EOS;
        $functions .= "popup_ajax('" . $this->_("Success! <a href=\"javascript:void(pageload('+rrmidr+'))\">Click</a> to continue...") . "');\n";
        $functions .= "}\n            else {\n";
        $functions .= "popup_ajax('" . $this->_("Failure! <a href=\"javascript:void(pageload('+rrmidr+'))\">Click</a> to try again...") . "');";
        $functions .= <<<EOS
        }                
            
        }
            
         
            function people_vishealth(mid) {
EOS;
        $functions .= "if(xInnerHtml('visopt_health')=='" . $this->_("Hide") . "') {\n";
        $functions .= <<<EOS
                \t                \t
                    peopleHideSection(8,false);
            make_busy();
EOS;
        $functions .= "xInnerHtml('visopt_health','" . $this->_("Show") . "');\n";
        $functions .= <<<EOS
            xGetElementById('view_visopt_health').src = 'http://grou.ps/images/show.gif';
            x_hideSectionHealth(mid,visres);
                    
        }
            else {
                
                peopleShowSection(8,false);
            make_busy();
EOS;
        $functions .= "xInnerHtml('visopt_health','" . $this->_("Hide") . "');\n";
        $functions .= <<<EOS
            xGetElementById('view_visopt_health').src = 'http://grou.ps/images/hide.gif';
            x_showSectionHealth(mid,visres);
        }
                
                
                
        }
            
            function people_visbusiness(mid) {
                
EOS;
        $functions .= "if(xInnerHtml('visopt_business')=='" . $this->_("Hide") . "') {\n";
        $functions .= <<<EOS
                    
                    peopleHideSection(7,false);
            make_busy();
EOS;
        $functions .= "xInnerHtml('visopt_business','" . $this->_("Show") . "');\n";
        $functions .= <<<EOS
            xGetElementById('view_visopt_business').src = 'http://grou.ps/images/show.gif';
            x_hideSectionBusiness(mid,visres);
                    
        }
            else {
                
                peopleShowSection(7,false);
            make_busy();
EOS;
        $functions .= "xInnerHtml('visopt_business','" . $this->_("Hide") . "');\n";
        $functions .= <<<EOS
            xGetElementById('view_visopt_business').src = 'http://grou.ps/images/hide.gif';
            x_showSectionBusiness(mid,visres);
        }
        
        }  
        
            function people_vislove(mid) {
                
EOS;
        $functions .= "if(xInnerHtml('visopt_love')=='" . $this->_("Hide") . "') {\n";
        $functions .= <<<EOS
                    
                    peopleHideSection(6,false);
            make_busy();
EOS;
        $functions .= "xInnerHtml('visopt_love','" . $this->_("Show") . "');\n";
        $functions .= <<<EOS
            xGetElementById('view_visopt_love').src = 'http://grou.ps/images/show.gif';
                    x_hideSectionLove(mid,visres);
        }
            else {
                
                peopleShowSection(6,false);
            make_busy();
EOS;
        $functions .= "xInnerHtml('visopt_love','" . $this->_("Hide") . "');\n";
        $functions .= <<<EOS
            xGetElementById('view_visopt_love').src = 'http://grou.ps/images/hide.gif';
                x_showSectionLove(mid,visres);
        }
        
                
        }
            
            function people_vistags(mid) {
                
EOS;
        $functions .= "if(xInnerHtml('visopt_tags')=='" . $this->_("Hide") . "') {\n";
        $functions .= <<<EOS
                                    
                    peopleHideSection(4,false);    
            make_busy();
EOS;
        $functions .= "xInnerHtml('visopt_tags','" . $this->_("Show") . "');\n";
        $functions .= <<<EOS
            xGetElementById('view_visopt_tags').src = 'http://grou.ps/images/show.gif';
                    x_hideSectionTags(mid,visres);
        }
            else {
                
                peopleShowSection(4,false);
            make_busy();
EOS;
        $functions .= "xInnerHtml('visopt_tags','" . $this->_("Hide") . "');\n";
        $functions .= <<<EOS
            xGetElementById('view_visopt_tags').src = 'http://grou.ps/images/hide.gif';
                x_showSectionTags(mid,visres);
        }
        
                
        }
\t    
            function people_visfavourites(mid) {
                
EOS;
        $functions .= "if(xInnerHtml('visopt_favourites')=='" . $this->_("Hide") . "') {\n";
        $functions .= <<<EOS
                                    
                    peopleHideSection(5,false);
            make_busy();
EOS;
        $functions .= "xInnerHtml('visopt_favourites','" . $this->_("Show") . "');\n";
        $functions .= <<<EOS
            xGetElementById('view_visopt_favourites').src = 'http://grou.ps/images/show.gif';
                    x_hideSectionFavourites(mid,visres);
        }
            else {
                peopleShowSection(5,false);
            make_busy();
EOS;
        $functions .= "xInnerHtml('visopt_favourites','" . $this->_("Hide") . "');\n";
        $functions .= <<<EOS
            xGetElementById('view_visopt_favourites').src = 'http://grou.ps/images/hide.gif';
            x_showSectionFavourites(mid,visres);
        }
        
                
        }
            
            
            function visres(res) {
                
                if(res=='1')
                close_ajax_popup();
            else
EOS;
        $functions .= "popup_ajax('" . $this->_("There was an error! <a href=\"javascript:void(history.go(0))\">Refresh</a> this page and try again...") . "');\n";
        $functions .= <<<EOS
                
                
                
        }
\t
\t
\t
\tfunction add_watchlist(membername) {
\t\tmake_busy();
\t\tx_addToWatchlist(membername,watchlist_res)
\t}
            
\t
\tfunction watchlist_res(res) {
\t
\t\tif(res=='0') {
EOS;
        $functions .= "popup_ajax('" . $this->_("There was an error! <a href=\"javascript:void(close_ajax_popup())\">Click</a> to try again...") . "');\n";
        $functions .= "\t\t}\t\telse if(res=='1') {\n";
        $functions .= "popup_ajax('" . $this->_("This person is already in your watchlist. <a href=\"javascript:void(close_ajax_popup())\">Click</a> to continue...") . "');\n";
        $functions .= "}\t\telse if(res=='2') { \n";
        $functions .= "xGetElementById('block_no_1').innerHTML = '<img align=\"absbottom\" src=\"http://grou.ps/images/eye.gif\" width=\"16\" height=\"16\" border=\"0\" /> " . $this->_("In Your Watchlist") . "';\n";
        $functions .= "popup_ajax('" . $this->_("Success! Please notice that this feature is currently experimental and you may not enjoy all of its benefits during the \"early adopters\" phase. <a href=\"javascript:void(close_ajax_popup())\">Click</a> to continue...") . "');\n";
        $functions .= <<<EOS
\t\t}
\t\t
\t}
            
EOS;
        $functions .= <<<EOS
        
        function avatar_chosen(pid) {
            
            for(i=1;i<=15;i++) {
            
                if(i==pid) {
                    xGetElementById('chosen_avatar').value = i;
                    xGetElementById('avatar_option_'+i).style.borderColor='pink';
                }
                else {
                    xGetElementById('avatar_option_'+i).style.borderColor='black';
                   
                }
            }
        }
        
        
        function no_chosen_avatar(obj) {
            
            if(obj.value!='') {
            
                for(i=1;i<=15;i++) {
                    
                    xGetElementById('avatar_option_'+i).style.borderColor='black';
                    
                }
                
            }
        }
        
        
        function avon(obj) {
         
            if(obj.style.borderLeftColor!='pink')
                obj.style.borderColor='yellow';
            
        }
        
        function avout(obj) {
            
            if(obj.style.borderLeftColor!='pink') {
                obj.style.borderColor='black';
            }
            
        }
        
        
        function people_changepicture(mid) { 
            
            alert("this function is not supported in this version!")
                
            
        }
        
        function people_changepicture_process(formobj,mid) {
         
            var ava = xGetElementById('chosen_avatar').value;
            var pic = xGetElementById('custom_avatar_file').value;
            
            if(pic!='') {
                formobj.submit();
                make_busy();
            }
            else {
                make_busy();
                x_setAvatar(ava,cropRes);
            }
            
        }
        
        
        function addPhotoSubmitRes(nnresult) {
            if(nnresult==4) {
                popup_ajax('There was an error.. <a href="javascript:void(close_ajax_popup())">Click</a> to try again.');
            }
            else if(nnresult==3) {
                popup_ajax('Image too big.. <a href="javascript:void(close_ajax_popup())">Click</a> to try again.');
            }
            else if(nnresult==1) {
                popup_ajax('Image type not valid.. <a href="javascript:void(close_ajax_popup())">Click</a> to try again.');
            }
            else  {
                
                people_changepicture_crop(nnresult);
            }
        }
             
        
        function people_changepicture_crop(res) {
           
            var s = res.split('-----::----bjsds__kdbasdf--'); 
            
            var src = s[0];
            var width = s[1];
            var height = s[2];
            
            
            if(width<=80||height<=80) {
                x_cropCustomPicture(src,0,0,width,height,cropRes);
                return;
            }

            txt = '';
           
EOS;
        $functions .= "txt += '" . str_replace("'", "\\'", $this->_("You can crop the image below. <u>Shift</u> key to resize. The cropped portion will be resized to 80x80")) . "<br /><br />';\n";
        $functions .= <<<EOS

            txt += '<img src="'+src+'" id="theImage" style="width:'+width+'px;height:'+height+'px;" />';
EOS;
        $functions .= "txt += '<br /><br /><input type=\"button\" value=\"" . $this->_("Continue") . "\" onclick=\"people_changepicture_crop2(\\''+src+'\\')\" />';\n";
        $functions .= <<<EOS

            //txt += '<img src=\\"http://grou.ps/wysiwyg_files/tmp/'+res+'\\" id=\\"theImage\\">';
            
            popup_ajax(txt);
            
            xGetElementById('theImage').src = 'http://grou.ps/wysiwyg_files/tmp/'+src;
                        
            
            dd.elements.theCrop.setOpacity(0.5);
            dd.elements.theCrop.defx = xPageX('theImage');
            dd.elements.theCrop.defy = xPageY('theImage');
            dd.elements.theCrop.moveTo(xPageX('theImage'),xPageY('theImage'));
            dd.elements.theCrop.resizeTo(xWidth('theImage')>300?300:xWidth('theImage'),xHeight('theImage')>300?300:xHeight('theImage'));
            dd.elements.theCrop.setDraggable(true);
            dd.elements.theCrop.setScalable(true);
            
            var z = xHeight('theImage')<=xWidth('theImage')?xHeight('theImage'):xWidth('theImage');
            
            dd.elements.theCrop.maxoffr = xWidth('theImage') - dd.elements.theCrop.w;
            dd.elements.theCrop.maxoffb = xHeight('theImage') - dd.elements.theCrop.h;
            dd.elements.theCrop.maxoffl = 0;
            dd.elements.theCrop.maxofft = 0;
            dd.elements.theCrop.minw = 80;
            dd.elements.theCrop.minh = 80;
            dd.elements.theCrop.maxw = z;
            dd.elements.theCrop.maxh = z;
            
            
            dd.elements.theCrop.show();
            
           
        }
        
        
        function people_changepicture_crop2(src) {
            
         
            var x = dd.elements.theCrop.x-xPageX('theImage');
            var y = dd.elements.theCrop.y-xPageY('theImage');
            var w = dd.elements.theCrop.w;
            var h = dd.elements.theCrop.h;
            
            dd.elements.theCrop.hide();
            
            x_cropCustomPicture(src,x,y,w,h,cropRes);
            
        }
        
        
        function cropRes(res) {
            
            dd.elements.theCrop.hide();
            
            var txt = '';
            
            if(res=='1') {

EOS;
        $functions .= "txt += '" . $this->_("Avatar successfully changed! <a href=\"javascript:void(history.go(0))\">Refresh</a> this page or <a href=\"javascript:void(close_ajax_popup())\">click</a> to continue...") . "';\n";
        $functions .= <<<EOS
                
            }
            else {
                
EOS;
        $functions .= "txt += 'Failure! <a href=\"javascript:void(close_ajax_popup())\">Click</a> to continue...';\n";
        $functions .= <<<EOS

            }
            
            popup_ajax(txt);
            
        }

        
        function make_wall_comment() {
        \tvar mycomment = xGetElementById('mycomment').value;
        \tif(mycomment=="") {
        \t\talert("It's empty!");
        \t\treturn;
        \t}
        \tvar wallid = xGetElementById('wallid').value;
        \tmake_busy();
        \tx_commentOn(wallid,mycomment,commenting_done);
        }
        
        function comment_delete(cid) {
        \tif(confirm("Are you sure you want to delete this comment?")) {
        \t\tmake_busy();
        \t\tx_commentDelete(cid,comment_deleted);
        \t}
        }
        
        function comment_deleted(res) {
        \tif(res==1)
        \t\thistory.go(0);
        \telse
        \t\tpopup_ajax("Oops, there was a problem. <a href='javascript:void(0)' onclick='close_ajax_popup()'>Please try again!</a>");
        }

EOS;
        $functions .= "function comment_on(formobj,pid) {\n" . "\t if(!validateCompleteForm(formobj,'error')) return false;\n" . "\t make_busy();\n" . "\t var my_comments = xGetElementById('my_comments').value;\n" . "\t last_subject = pid;\n" . "\t x_commentOn(pid,my_comments,commenting_done);\n" . "} \n";
        $functions .= "function commenting_done(res) {\n" . "\t var msg = '';\n" . "\t if(res=='1') { // true\n" . "\t\t history.go(0);\n" . "\t }\n" . "\t else { \n" . "\t\t msg = 'Failure! <a href=\"javascript:void(close_ajax_popup())\">Click</a> to try again...';\n" . "\t\t popup_ajax(msg);\n" . "\t }\n" . "} \n";
        return $functions;
    }