﻿
/* -------------------------- */
/* Handy tools  */
/* -------------------------- */


/* close something */
function close_x(divtarget) {
clean_div(divtarget);
}

function gg_tr(tgt_page) {
try {
var pageTracker = _gat._getTracker("UA-12284728-1");
pageTracker._trackPageview(tgt_page);
} catch(err) {}
}
var lurl = "http://www.rlife.fr";
var l_min = "<img src=\"img/l_min.gif\"/>";
function hp_ck() {if (http){http.abort();}}
function no_cach() {nocache = Math.random();}


/* PLAYER EXTENDED FUNCTIONS */

function set_w(divid, newW, newH) {
	      hide_div('v_m_l');
        document.getElementById(divid).style.width = newW + "px";
        document.getElementById(divid).style.height = newH + "px";
        document.getElementById('size_toggle').innerHTML = "<a href=\"javascript:set_n('"+divid+"', 560, 320);\"><img src=\"img/v_size_m_bt.png\" alt=\"Réduire l'écran\" title=\"Réduire l'écran\"/></a>";
        document.getElementById('v_m_m_t').style.width = "830px";
        document.getElementById('v_m_m_t').style.height = "415px";        
      };

function set_n(divid, newW, newH) {
        document.getElementById(divid).style.width = newW + "px";
        document.getElementById(divid).style.height = newH + "px";
        show_div('v_m_l'); 
        document.getElementById('size_toggle').innerHTML = "<a href=\"javascript:set_w('"+divid+"', 830, 453);\"><img src=\"img/v_size_p_bt.png\" alt=\"Agrandir l'écran\" title=\"Agrandir l'écran\"/></a>";
        document.getElementById('v_m_m_t').style.width = "560px";
        document.getElementById('v_m_m_t').style.height = "280px";     
      };      
    
        
/* COSMETIC FONCTIONS */
function set_divbg(divtarget) {
    document.getElementById(divtarget).style.background = "url(http://www.rlife.fr/img/backnight.jpg) top center no-repeat";
}

/* out vid cat menu  */
function v_cat_out_trans(div_id) {
document.getElementById(div_id).className = "v_m_l_cat2";
}

function v_cat_out_black(div_id) {
document.getElementById(div_id).className = "v_m_l_cat1";
}

/* over vid cat menu  */
function v_cat_over(div_id) {
document.getElementById(div_id).className = "v_cat_over";
}



/* SHOW-HIDE FONCTIONS */

function clean_div(divtarget) {
    document.getElementById(divtarget).innerHTML = "";
}

function clear_val(divtarget) {
    document.getElementById(divtarget).value  = "";
}

function show_div(divtarget) {
    document.getElementById(divtarget).className = "divShow";
}
function hide_div(divtarget) {
    document.getElementById(divtarget).className = "divHide";
}



function show(divtarget) {
    document.getElementById(divtarget).className = "divShow";
    document.getElementById('selecthideshow_'+divtarget).innerHTML = "<strong><a href=\"javascript:hide('"+divtarget+"')\" class=\"selecthideshowstyle\"> - </a></strong>";
}


function hide(divtarget) {
    document.getElementById(divtarget).className = "divHide";
    document.getElementById('selecthideshow_'+divtarget).innerHTML = "<a href=\"javascript:show('"+divtarget+"')\" class=\"selecthideshowstyle\"> + </a>";
}


function set_nodebg(divtarget,color) {
document.getElementById(divtarget+'_go').style.background = color

}
function show_node(divtarget) {
	  set_nodebg(divtarget,'#6e85b5')
    document.getElementById(divtarget+'_focus').className = "divShow_node"
}

function hide_node(divtarget) {
	  set_nodebg(divtarget,'')
    document.getElementById(divtarget+'_focus').className = "divHide_node"
}

 function gowallfeed_share(vidid,chanvids,fb_user_id,sessionkey) {
    FB.Connect.showPermissionDialog("offline_access", getvidinfo_share(vidid,chanvids,fb_user_id,sessionkey), false, [fb_user_id]);
     }

/* -------------------------- */
/* Main Toggles */
/* -------------------------- */
/* TOGGLE TO PROFILE */
function toggle_profil() {
hp_ck();
clean_div('dyn_menu');
document.getElementById('dyn_menu').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/toggle_menu_profile.php?nocache='+nocache);
http.onreadystatechange = function () {gtoggle_profil(); };
http.send(null);
}



/*  TOGGLE TO PROFILE REPLY */
function gtoggle_profil() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyn_menu').innerHTML = response;
if(http.status == 200){
toggle_menu_profil();
}
}
}



/*  TOGGLE TO PROFILE menu  */
function toggle_menu_profil() {
hp_ck();
document.getElementById('dyncont').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/toggle_profil.php?nocache='+nocache);
http.onreadystatechange = function () {gtoggle_menu_profil(); };
http.send(null);
}



/* TOGGLE TO PROFILE menu REPLY */
function gtoggle_menu_profil() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont').innerHTML = response;
if(http.status == 200){
var tp = "/profil";
gg_tr(tp);
}
}
}

/*  TOGGLE TO PROFILE billet  */
function toggle_menu_tikts() {
hp_ck();
document.getElementById('dyncont').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/toggle_tikts.php?nocache='+nocache);
http.onreadystatechange = function () {gtoggle_menu_profil(); };
http.send(null);
}



/* TOGGLE TO PROFILE menu REPLY */
function gtoggle_menu_profil() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont').innerHTML = response;
if(http.status == 200){
var tp = "/billeterie";
gg_tr(tp);
}
}
}


/*  TOGGLE TO PROFILE menu  */
function toggle_menu_amis() {
hp_ck();
document.getElementById('dyncont').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/toggle_amis.php?nocache='+nocache);
http.onreadystatechange = function () {gtoggle_menu_amis(); };
http.send(null);
}



/* TOGGLE TO PROFILE menu REPLY */
function gtoggle_menu_amis() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont').innerHTML = response;
if(http.status == 200){
t_frds();
}
}
}

/* TOGGLE TO TV */
function select_chan() {
hp_ck();
var prechannel = document.getElementById('chanvids').value;
var channel = "ch"+prechannel;
player.sendEvent('STOP')
document.getElementById('v_m_m_b_r').innerHTML = "<div id=\"v_ipre\" name=\"v_ipre\"></div>	<div id=\"v_inn\" name=\"v_inn\"><span id=\"comvid_div\"><a href=\"javascript:getvid_live('"+prechannel+"')\">Live Chat</a></span></div>	<div id=\"v_ipost\" name=\"v_ipost\"></div>	<div id=\"v_ipre\" name=\"v_ipre\"></div>	<div id=\"v_inn\" name=\"v_inn\"><span id=\"sharevid_div\" name=\"sharevid_div\"><a href=\"javascript:getvidinfo_liveshare('"+prechannel+"')\">J'aime !</a></span></div>	<div id=\"v_ipost\" name=\"v_ipost\"></div>	<div id=\"v_ipre\" name=\"v_ipre\"></div>	<div id=\"v_inn\" name=\"v_inn\"><span id=\"sharevid_div\"><a href=\"http://apps.facebook.com/rouen-life-tv/invite-vod.php?channel=ch"+prechannel+"&fb_force_mode=fbml\" target=\"_blank\">Recommander</a></div>	<div id=\"v_ipost\" name=\"v_ipost\"></div>	 <div id=\"v_ipre\" name=\"v_ipre\"></div>	<div id=\"v_inn\" name=\"v_inn\">Partager !</div><div id=\"v_ipost\" name=\"v_ipost\"></div>";

toggleTv(channel)

FB_RequireFeatures(["XFBML"], function(){ FB.Facebook.init("0599a0fa368dcd42f8a2d4f76b1aecfd", "../../receiver.html"); });
var tp = "/AUDIOVIDEO/chan/"+channel;
gg_tr(tp);
}




/* TOGGLE TO TV */
function toggle_Tv(channel) {
hp_ck();
clean_div('dyn_menu');
document.getElementById('dyncont').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/toggle_tv.php?channel='+channel+'&nocache='+nocache);
http.onreadystatechange = function () {gettoggle_Tv(channel); };
http.send(null);
}


/*  TOGGLE TO TV REPLY */
function gettoggle_Tv(channel) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont').innerHTML = response;
if(http.status == 200){
toggleTv(channel)
FB_RequireFeatures(["XFBML"], function(){ FB.Facebook.init("0599a0fa368dcd42f8a2d4f76b1aecfd", "../../receiver.html"); });
var tp = "/AUDIOVIDEO/chan/"+channel;
gg_tr(tp);
}
}
}


/* TOGGLE TO VIDID */
function toggle_vidid(vidid) {
hp_ck();
clean_div('dyn_menu');
document.getElementById('dyncont').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/toggle_vidid.php?vidid='+vidid+'&nocache='+nocache);
http.onreadystatechange = function () {gettoggle_vidid(vidid); };
http.send(null);
}


/*  TOGGLE TO TV REPLY */
function gettoggle_vidid(vidid) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont').innerHTML = response;
if(http.status == 200){
toggle_vidin(vidid,'','','');
}
}
}


/* TOGGLE TO LIVE */
function toggle_Live(channel) {
hp_ck();
document.getElementById('dyncont').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/toggle_tv_h264.php?channel='+channel+'&nocache='+nocache);
http.onreadystatechange = function () {gettoggle_Live(channel); };
http.send(null);
}


/*  TOGGLE TO LIVE REPLY */
function gettoggle_Live(channel) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont').innerHTML = response;
if(http.status == 200){
toggleLive(channel)
}
}
}


/* TOGGLE TO EVENTS */
function toggle_events() {
hp_ck();
clean_div('dyn_menu');
document.getElementById('dyncont').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/toggle_events.php?nocache='+nocache);
http.onreadystatechange = function () {gettoggle_events(); };
http.send(null);
}


/*  TOGGLE TO EVENTS REPLY */
function gettoggle_events() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont').innerHTML = response;
if(http.status == 200){
get_u_events_start('attending','0','3')
var tp = "/AGENDA";
gg_tr(tp);
}
}
}

/*  TOGGLE TO WHO menu  */
function toggle_menu_who() {
hp_ck();
clean_div('dyn_menu');
document.getElementById('dyn_menu').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/toggle_menu_who.php?nocache='+nocache);
http.onreadystatechange = function () {gtoggle_menu_who(); };
http.send(null);
}


/* TOGGLE TO WHO menu REPLY */
function gtoggle_menu_who() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyn_menu').innerHTML = response;
if(http.status == 200){
toggle_who();
var tp = "/GUIDE";
gg_tr(tp);
}
}
}

/*  TOGGLE TO WHO menu  */
function toggle_menu_dwho() {
hp_ck();
clean_div('dyn_menu');
document.getElementById('dyn_menu').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/toggle_menu_who.php?nocache='+nocache);
http.onreadystatechange = function () {gtoggle_menu_dwho(); };
http.send(null);
}


/* TOGGLE TO WHO menu REPLY */
function gtoggle_menu_dwho() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyn_menu').innerHTML = response;
if(http.status == 200){
}
}
}


/* TOGGLE TO top3 */
function toggle_who() {
hp_ck();
document.getElementById('dyncont').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/toggle_who.php?nocache='+nocache);
http.onreadystatechange = function () {gettoggle_who(); };
http.send(null);
}


/*  TOGGLE TO top3 REPLY */
function gettoggle_who() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont').innerHTML = response;
if(http.status == 200){
loadgmap_glob('1','49.442844','1.086223','who_map_first','13');
}
}
}

/* TOGGLE TO top3 */
function toggle_sub_who() {
hp_ck();
document.getElementById('dyncont_sub_who').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/toggle_sub_who.php?nocache='+nocache);
http.onreadystatechange = function () {gettoggle_sub_who(); };
http.send(null);
}


/*  TOGGLE TO top3 REPLY */
function gettoggle_sub_who() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont_sub_who').innerHTML = response;
if(http.status == 200){
loadgmap_glob('1','49.442844','1.086223','who_map_first','12');
}
}
}

/*  TOGGLE TO CGU  */
function toggle_cgu() {
hp_ck();
clean_div('dyn_menu');
document.getElementById('dyncont').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/toggle_cgu.php?nocache='+nocache);
http.onreadystatechange = function () {gtoggle_cgu(); };
http.send(null);
}


/* TOGGLE TO CGU REPLY */
function gtoggle_cgu() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont').innerHTML = response;
if(http.status == 200){
var tp = "/CGU";
gg_tr(tp);
}
}
}

/*  TOGGLE TO CONTACT  */
function toggle_contact() {
hp_ck();
clean_div('dyn_menu');
document.getElementById('dyncont').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/toggle_ctct.php?nocache='+nocache);
http.onreadystatechange = function () {gtoggle_contact(); };
http.send(null);
}


/* TOGGLE TO CONTACT REPLY */
function gtoggle_contact() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont').innerHTML = response;
if(http.status == 200){
var tp = "/CONTACT";
gg_tr(tp);
}
}
}


/*  check fields  */
function validatetikt(tiktval) {
var stikt_owner_fname = document.getElementById('stikt_owner_fname_'+tiktval);
var stikt_owner_lname = document.getElementById('stikt_owner_lname_'+tiktval);
var stikt_owner_email = document.getElementById('stikt_owner_email_'+tiktval);

var filtertxt = /^([a-zA-Z_áéíóäëiöüúàèìùêâîôû-])+$/;
var filter = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
var whiteSpace = /^[\s]+$/;

if ( stikt_owner_fname.value == '' || whiteSpace.test(stikt_owner_fname.value) || !filtertxt.test(stikt_owner_fname.value) ) {
	alert("Entrez un prénom");
	stikt_owner_fname.focus();
}
else if ( stikt_owner_lname.value == '' || whiteSpace.test(stikt_owner_lname.value) || !filtertxt.test(stikt_owner_lname.value) ) {
	alert("Entrez un nom");
	stikt_owner_lname.focus();
}
else if ( stikt_owner_email.value == '' || whiteSpace.test(stikt_owner_email.value) || !filter.test(stikt_owner_email.value) ) {
	alert("Entrez une adresse email valide");
	stikt_owner_email.focus();
}
else {
	tikt_activate(tiktval);
}

}

function Rem_El(tiktval) {

  var d = document.getElementById('up_inf_m_tikt');
  var olddiv = document.getElementById('tikt_'+tiktval);
  d.removeChild(olddiv);
  tikt_list_active();

}


/*  TIKT ACTIVATE  */
function tikt_activate(tiktval) {
hp_ck();

var stikt_owner_fname = document.getElementById('stikt_owner_fname_'+tiktval).value;
var stikt_owner_lname = document.getElementById('stikt_owner_lname_'+tiktval).value;
var stikt_owner_email = document.getElementById('stikt_owner_email_'+tiktval).value;

document.getElementById('tikt_'+tiktval).innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable

http.open('get', lurl+'/inc/tikt_activate.php?tiktval='+tiktval+'&stikt_owner_fname='+stikt_owner_fname+'&stikt_owner_lname='+stikt_owner_lname+'&stikt_owner_email='+stikt_owner_email+'&nocache='+nocache);
http.onreadystatechange = function () {gtikt_activate(tiktval); };
http.send(null);
}


/* Tikt validate  REPLY */
function gtikt_activate(tiktval) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('tikt_'+tiktval).innerHTML = response;
if(http.status == 200){
Rem_El(tiktval);
var tp = "/activate-tikt";
gg_tr(tp);
}
}
}


/*  LIST ACTIVE TIKT  */
function tikt_list_active() {
hp_ck();
document.getElementById('up_inf_m_tikt_activ').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable

http.open('get', lurl+'/inc/tikt_list_active.php?nocache='+nocache);
http.onreadystatechange = function () {gtikt_list_active(); };
http.send(null);
}


/* LIST ACTIVE TIKT  REPLY */
function gtikt_list_active() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('up_inf_m_tikt_activ').innerHTML = response;
if(http.status == 200){
}
}
}


/*  check fields  */
function validateFields() {
var ctct_name = document.getElementById('ctct_name');
var ctct_pseudo = document.getElementById('ctct_pseudo');
var ctct_email = document.getElementById('ctct_email');
var ctct_tel = document.getElementById('ctct_tel');
var ctct_msg = document.getElementById('ctct_msg');
var filter = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
var whiteSpace = /^[\s]+$/;

if ( ctct_msg.value == '' || whiteSpace.test(ctct_msg.value) ) {
	alert("Merci d'entrer le message");
	ctct_msg.focus();
}
else if ( ctct_email.value == '' || !filter.test(ctct_email.value) ) {
	alert("Merci d'entrer une adresse email valide");
	ctct_email.focus();
}
else if ( ctct_name.value == '' ) {
	alert("Merci d'entrer un nom");
	ctct_name.focus();
}
else {
	ctct_send();
}

}

/*  TOGGLE TO CONTACT  */
function ctct_send() {
hp_ck();
clean_div('dyn_menu');

var ctct_name = document.getElementById('ctct_name').value;
var ctct_pseudo = document.getElementById('ctct_pseudo').value;
var ctct_email = document.getElementById('ctct_email').value;
var ctct_tel = document.getElementById('ctct_tel').value;
var ctct_msg = document.getElementById('ctct_msg').value;

document.getElementById('bod_inn_float_ctct').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable

http.open('get', lurl+'/inc/ctct_send.php?ctct_name='+ctct_name+'&ctct_pseudo='+ctct_pseudo+'&ctct_email='+ctct_email+'&ctct_tel='+ctct_tel+'&ctct_msg='+ctct_msg+'&nocache='+nocache);
http.onreadystatechange = function () {gctct_send(); };
http.send(null);
}


/* TOGGLE TO CONTACT REPLY */
function gctct_send() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('bod_inn_float_ctct').innerHTML = response;
if(http.status == 200){
var tp = "/ctct-msg-sent";
gg_tr(tp);
}
}
}




/* TOGGLE TO news */
function toggle_news() {
hp_ck();
clean_div('dyn_menu');
document.getElementById('dyncont').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/toggle_news.php?nocache='+nocache);
http.onreadystatechange = function () {gettoggle_news(); };
http.send(null);
}




/*  TOGGLE TO news REPLY */
function gettoggle_news() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont').innerHTML = response;
if(http.status == 200){
FB_RequireFeatures(["XFBML"], function(){ FB.Facebook.init("0599a0fa368dcd42f8a2d4f76b1aecfd", "../../receiver.html"); });

}
}
}

/* TOGGLE TO showcases */
function toggle_who_map() {
hp_ck();
document.getElementById('dyncont_sub_who').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/toggle_who_map.php?nocache='+nocache);
http.onreadystatechange = function () {gettoggle_who_map(); };
http.send(null);
}


/*  TOGGLE TO showcases REPLY */
function gettoggle_who_map() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont_sub_who').innerHTML = response;
if(http.status == 200){
loadgmap_glob('1','49.442844','1.086223','map_glob','13');
var tp = "/GUIDE/Mode-carte";
gg_tr(tp);
}
}
}

/* TOGGLE TO listing */
function toggle_listing(cat_id,query_start_at) {
hp_ck();
document.getElementById('dyncont_sub_who').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/toggle_who_listing.php?cat_id='+cat_id+'&query_start_at='+query_start_at+'&nocache='+nocache);
http.onreadystatechange = function () {gettoggle_listing(); };
http.send(null);
}


/*  TOGGLE TO showcases REPLY */
function gettoggle_listing() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont_sub_who').innerHTML = response;
if(http.status == 200){

}
}
}

/* -------------------------- */
/* EVENTS STUFF */
/* -------------------------- */
/* GET GLOB EVENT START*/
function get_u_events_start(rsvp_type,query_start_at,query_limit_nb) {
hp_ck();
document.getElementById('dyncont_events1').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/get_featured_events.php?rsvp_type='+rsvp_type+'&query_start_at='+query_start_at+'&query_limit_nb='+query_limit_nb+'&nocache='+nocache);
http.onreadystatechange = function () {getget_u_events_start(); };
http.send(null);
}

/*  GET Glob EVENT START*/
function getget_u_events_start() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont_events1').innerHTML = response;
if(http.status == 200){
get_u_events_others('unsure','0','6')
}
}
}


/* GET GLOB EVENT */
function get_u_events(rsvp_type,query_start_at,query_limit_nb) {
hp_ck();
document.getElementById('dyncont_events1').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/get_featured_events.php?rsvp_type='+rsvp_type+'&query_start_at='+query_start_at+'&query_limit_nb='+query_limit_nb+'&nocache='+nocache);
http.onreadystatechange = function () {getget_u_events(); };
http.send(null);
}

/*  GET Glob EVENT */
function getget_u_events() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont_events1').innerHTML = response;
if(http.status == 200){
}
}
}


/* GET GLOB EVENT OTHERS */
function get_u_events_others(rsvp_type,query_start_at,query_limit_nb) {
hp_ck();
document.getElementById('dyncont_events2').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/get_other_events.php?rsvp_type='+rsvp_type+'&query_start_at='+query_start_at+'&query_limit_nb='+query_limit_nb+'&nocache='+nocache);
http.onreadystatechange = function () {getget_u_events_others(); };
http.send(null);
}

/*  GET Glob EVENT  OTHERS */
function getget_u_events_others() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont_events2').innerHTML = response;
if(http.status == 200){
}
}
}

/* TOGGLE FIRST ONE EVENT */
function toggle_event(ev_eid) {
hp_ck();
document.getElementById('dyncont').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/toggle_event.php?nocache='+nocache);
http.onreadystatechange = function () {gettoggle_event(ev_eid); };
http.send(null);
}


/*  TOGGLE FIRST ONE EVENT REPLY */
function gettoggle_event(ev_eid) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont').innerHTML = response;
if(http.status == 200){
get_that_event_first(ev_eid)
}
}
}


/* GET ONE EVENT START */
function get_that_event_first(ev_eid) {
hp_ck();
document.getElementById('dyncont_event').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/get_thatfeat_event.php?ev_eid='+ev_eid+'&nocache='+nocache);
http.onreadystatechange = function () {getget_that_event_first(); };
http.send(null);
}

/*  GET ONE EVENT REPLY START */
function getget_that_event_first() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont_event').innerHTML = response;
if(http.status == 200){
get_u_events_side_first('attending','0','1','1')
}
}
}

/* GET GLOB EVENT SIDEWIDE FIRST */
function get_u_events_side_first(rsvp_type,query_start_at,query_limit_nb,div_nb) {
hp_ck();
document.getElementById('dyncont_event_side'+div_nb).innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/get_side_events.php?rsvp_type='+rsvp_type+'&query_start_at='+query_start_at+'&query_limit_nb='+query_limit_nb+'&div_nb='+div_nb+'&nocache='+nocache);
http.onreadystatechange = function () {getget_u_events_side_first(div_nb); };
http.send(null);
}

/*  GET Glob EVENT SIDEWIDE REPLY  FIRST*/
function getget_u_events_side_first(div_nb) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont_event_side'+div_nb).innerHTML = response;
if(http.status == 200){
get_u_events_side('unsure','0','1','2')
}
}
}


/* GET ONE EVENT */
function get_that_event(ev_eid) {
hp_ck();
document.getElementById('dyncont_event').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/get_thatfeat_event.php?ev_eid='+ev_eid+'&nocache='+nocache);
http.onreadystatechange = function () {getget_that_event(); };
http.send(null);
}

/*  GET ONE EVENT REPLY */
function getget_that_event() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont_event').innerHTML = response;
if(http.status == 200){
}
}
}


/* GET GLOB EVENT SIDEWIDE */
function get_u_events_side(rsvp_type,query_start_at,query_limit_nb,div_nb) {
hp_ck();
document.getElementById('dyncont_event_side'+div_nb).innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/get_side_events.php?rsvp_type='+rsvp_type+'&query_start_at='+query_start_at+'&query_limit_nb='+query_limit_nb+'&div_nb='+div_nb+'&nocache='+nocache);
http.onreadystatechange = function () {getget_u_events_side(div_nb); };
http.send(null);
}

/*  GET Glob EVENT SIDEWIDE REPLY */
function getget_u_events_side(div_nb) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont_event_side'+div_nb).innerHTML = response;
if(http.status == 200){
}
}
}


/* -------------------------- */
/* TOP 10  STUFF*/
/* -------------------------- */


/* GET TOP10 section */
function get_u_top10(query_start_at,query_limit_nb,div_nb) {
hp_ck();
document.getElementById('top10_holder'+div_nb).innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/get_u_top10.php?query_start_at='+query_start_at+'&query_limit_nb='+query_limit_nb+'&div_nb='+div_nb+'&nocache='+nocache);
http.onreadystatechange = function () {getget_u_top10(div_nb); };
http.send(null);
}

/*  GET Glob EVENT */
function getget_u_top10(div_nb) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('top10_holder'+div_nb).innerHTML = response;
if(http.status == 200){
}
}
}


/* -------------------------- */
/* MAP TOGGLE STUFF*/
/* -------------------------- */


/* GET whoswho next map section */
function get_who_newmap(query_start_at,query_limit_nb,div_nb,scat_id,latin,lngin,map_div,zoom_start) {
hp_ck();
document.getElementById('get_who_map'+div_nb).innerHTML = l_min
loadgmap_glob(scat_id,latin,lngin,map_div,zoom_start)

// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/get_who_newmap.php?query_start_at='+query_start_at+'&query_limit_nb='+query_limit_nb+'&div_nb='+div_nb+'&scat_id='+scat_id+'&latin='+latin+'&lngin='+lngin+'&map_div='+map_div+'&zoom_start='+zoom_start+'&nocache='+nocache);
http.onreadystatechange = function () {getget_who_newmap(div_nb); };
http.send(null);
}

/*  GET whoswho next map section Reply  */
function getget_who_newmap(div_nb) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('get_who_map'+div_nb).innerHTML = response;
if(http.status == 200){
}
}
}


/* -------------------------- */
/* RSS STUFF*/
/* -------------------------- */



/* GET cine news Context*/
function Get_context_cine(user_fb_id,sessionkey) {
hp_ck();
document.getElementById('dyncont_news').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/get_news_context_cine.php?user_fb_id='+user_fb_id+'&sessionkey='+sessionkey+'&nocache='+nocache);
http.onreadystatechange = function () {getGet_context_cine(); };
http.send(null);
}


/*  GET cine news Context REPLY */
function getGet_context_cine() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont_news').innerHTML = response;
if(http.status == 200){
}
}
}

/* GET cine news */
function Get_cine_news(user_fb_id,sessionkey,cine_id) {
hp_ck();
document.getElementById('cine_cont').innerHTML = l_min
document.getElementById('cine_cont_scraped').innerHTML = ""
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/get_rss_cine.php?user_fb_id='+user_fb_id+'&sessionkey='+sessionkey+'&cine_id='+cine_id+'&nocache='+nocache);
http.onreadystatechange = function () {getGet_cine_news(); };
http.send(null);
}


/*  GET cine news REPLY */
function getGet_cine_news() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('cine_cont').innerHTML = response;
if(http.status == 200){
}
}
}

/* GET cine news */
function Get_cine_scrap(user_fb_id,sessionkey,cine_id,movie_tag) {
hp_ck();
document.getElementById('cine_cont_scraped').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/get_rss_cine_scraped.php?user_fb_id='+user_fb_id+'&sessionkey='+sessionkey+'&cine_id='+cine_id+'&movie_tag='+movie_tag+'&nocache='+nocache);
http.onreadystatechange = function () {getGet_cine_scrap(); };
http.send(null);
}


/*  GET cine news REPLY */
function getGet_cine_scrap() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('cine_cont_scraped').innerHTML = response;
if(http.status == 200){
}
}
}


/* GET meteo news Context*/
function Get_context_meteo(user_fb_id,sessionkey) {
hp_ck();
document.getElementById('dyncont_news').innerHTML = l_min

// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/get_news_context_meteo.php?user_fb_id='+user_fb_id+'&sessionkey='+sessionkey+'&nocache='+nocache);
http.onreadystatechange = function () {getGet_context_meteo(); };
http.send(null);
}


/*  GET meteo news Context REPLY */
function getGet_context_meteo() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont_news').innerHTML = response;
if(http.status == 200){
}
}
}

/* GET meteo news */
function Get_meteo_news(user_fb_id,sessionkey,meteotown_id) {
hp_ck();
document.getElementById('meteo_cont').innerHTML = l_min
document.getElementById('meteo_cont_scraped').innerHTML = ""
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/get_rss_meteo.php?user_fb_id='+user_fb_id+'&sessionkey='+sessionkey+'&meteotown_id='+meteotown_id+'&nocache='+nocache);
http.onreadystatechange = function () {getGet_meteo_news(); };
http.send(null);
}


/*  GET meteo REPLY */
function getGet_meteo_news() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('meteo_cont').innerHTML = response;
if(http.status == 200){
}
}
}

/* GET meteo news */
function Get_meteo_scrap(user_fb_id,sessionkey,meteotown_id,meteo_tagdate) {
hp_ck();
document.getElementById('meteo_cont_scraped').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/get_rss_meteo_scraped.php?user_fb_id='+user_fb_id+'&sessionkey='+sessionkey+'&meteotown_id='+meteotown_id+'&meteo_tagdate='+meteo_tagdate+'&nocache='+nocache);
http.onreadystatechange = function () {getGet_meteo_scrap(); };
http.send(null);
}


/*  GET meteo news REPLY */
function getGet_meteo_scrap() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('meteo_cont_scraped').innerHTML = response;
if(http.status == 200){
}
}
}

/* GET sport news Context*/
function Get_context_sport(user_fb_id,sessionkey) {
hp_ck();
document.getElementById('dyncont_news').innerHTML = l_min

// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/get_news_context_sport.php?user_fb_id='+user_fb_id+'&sessionkey='+sessionkey+'&nocache='+nocache);
http.onreadystatechange = function () {getGet_context_sport(); };
http.send(null);
}


/*  GET sport news Context REPLY */
function getGet_context_sport() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont_news').innerHTML = response;
if(http.status == 200){
}
}
}

/* GET sport news */
function Get_sport_news(user_fb_id,sessionkey,sport_id) {
hp_ck();
document.getElementById('sport_cont').innerHTML = l_min
document.getElementById('sport_cont_scraped').innerHTML = ""
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/get_rss_sport.php?user_fb_id='+user_fb_id+'&sessionkey='+sessionkey+'&sport_id='+sport_id+'&nocache='+nocache);
http.onreadystatechange = function () {getGet_sport_news(); };
http.send(null);
}


/*  GET sport news REPLY */
function getGet_sport_news() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('sport_cont').innerHTML = response;
if(http.status == 200){
}
}
}

/* -------------------------- */
/* VOD STUFF */
/* -------------------------- */

/* GET oadlisting_glob */
function get_vid_cat(vid_cat_id,div) {
hp_ck();
document.getElementById(div).innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/get_vid_listing_scat_vid.php?vid_cat_id='+vid_cat_id+'&div='+div+'&nocache='+nocache);
http.onreadystatechange = function () {getget_vid_cat(div); };
http.send(null);
}

/*  GET oadlisting_glob REPLY*/
function getget_vid_cat(div) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById(div).innerHTML = response;
if(http.status == 200){
}
}
}


/*  GET INITIATE VID */
function toggle_vid(vidid,chanvids,fb_user_id,sessionkey) {
hp_ck();
player.sendEvent('STOP')
document.getElementById('v_m_m_b_r').innerHTML = "<div id=\"v_ipre\" name=\"v_ipre\"></div>	<div id=\"v_inn\" name=\"v_inn\"><span id=\"comvid_div\"><a href=\"javascript:getvid_com('"+vidid+"','"+chanvids+"','"+fb_user_id+"','"+sessionkey+"')\">Commentaires</a></span></div>	<div id=\"v_ipost\" name=\"v_ipost\"></div>	<div id=\"v_ipre\" name=\"v_ipre\"></div>	<div id=\"v_inn\" name=\"v_inn\"><span id=\"sharevid_div\" name=\"sharevid_div\"><a href=\"javascript:getvidinfo_share('"+vidid+"','"+chanvids+"','"+fb_user_id+"','"+sessionkey+"')\">J'aime !</a></span></div>	<div id=\"v_ipost\" name=\"v_ipost\"></div>	<div id=\"v_ipre\" name=\"v_ipre\"></div>	<div id=\"v_inn\" name=\"v_inn\"><span id=\"sharevid_div\"><a href=\"http://apps.facebook.com/rouen-life-tv/invite-vod.php?vidid="+vidid+"&chanvids="+chanvids+"&fb_force_mode=fbml\" target=\"_blank\">Recommander</a></div>	<div id=\"v_ipost\" name=\"v_ipost\"></div>	 <div id=\"v_ipre\" name=\"v_ipre\"></div>	<div id=\"v_inn\" name=\"v_inn\">Partager !</div><div id=\"v_ipost\" name=\"v_ipost\"></div>";
document.getElementById('v_m_l').innerHTML = l_min
getvid(vidid)

// Set te random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/getvidinfo.php?vidid='+vidid+'&fb_user_id='+fb_user_id+'&sessionkey='+sessionkey+'&nocache='+nocache);
http.onreadystatechange = function () {gettoggle_vid(vidid,chanvids,fb_user_id,sessionkey);}; 
http.send(null);
} 

/*  GET INITATE VID REPLY*/
function gettoggle_vid(vidid,chanvids,fb_user_id,sessionkey) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('v_m_l').innerHTML = response
if(http.status == 200){
FB_RequireFeatures(["XFBML"], function(){ FB.Facebook.init("0599a0fa368dcd42f8a2d4f76b1aecfd", "../../receiver.html"); });
var tp = "/AUDIOVIDEO/vidid-"+vidid;
gg_tr(tp);
}
}
}

/*  GET INITIATE VID */
function toggle_vidin(vidid,chanvids,fb_user_id,sessionkey) {
hp_ck();
document.getElementById('v_m_m_b_r').innerHTML = "<div id=\"v_ipre\" name=\"v_ipre\"></div>	<div id=\"v_inn\" name=\"v_inn\"><span id=\"comvid_div\"><a href=\"javascript:getvid_com('"+vidid+"','"+chanvids+"','"+fb_user_id+"','"+sessionkey+"')\">Commentaires</a></span></div>	<div id=\"v_ipost\" name=\"v_ipost\"></div>	<div id=\"v_ipre\" name=\"v_ipre\"></div>	<div id=\"v_inn\" name=\"v_inn\"><span id=\"sharevid_div\" name=\"sharevid_div\"><a href=\"javascript:getvidinfo_share('"+vidid+"','"+chanvids+"','"+fb_user_id+"','"+sessionkey+"')\">J'aime !</a></span></div>	<div id=\"v_ipost\" name=\"v_ipost\"></div>	<div id=\"v_ipre\" name=\"v_ipre\"></div>	<div id=\"v_inn\" name=\"v_inn\"><span id=\"sharevid_div\"><a href=\"http://apps.facebook.com/rouen-life-tv/invite-vod.php?vidid="+vidid+"&chanvids="+chanvids+"&fb_force_mode=fbml\" target=\"_blank\">Recommander</a></div>	<div id=\"v_ipost\" name=\"v_ipost\"></div>	 <div id=\"v_ipre\" name=\"v_ipre\"></div>	<div id=\"v_inn\" name=\"v_inn\">Partager !</div><div id=\"v_ipost\" name=\"v_ipost\"></div>";
document.getElementById('v_m_l').innerHTML = l_min
getvid(vidid)

// Set te random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/getvidinfo.php?vidid='+vidid+'&fb_user_id='+fb_user_id+'&sessionkey='+sessionkey+'&nocache='+nocache);
http.onreadystatechange = function () {gettoggle_vidin(vidid,chanvids,fb_user_id,sessionkey);}; 
http.send(null);
} 

/*  GET INITATE VID REPLY*/
function gettoggle_vidin(vidid,chanvids,fb_user_id,sessionkey) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('v_m_l').innerHTML = response
if(http.status == 200){
FB_RequireFeatures(["XFBML"], function(){ FB.Facebook.init("0599a0fa368dcd42f8a2d4f76b1aecfd", "../receiver.html"); });
var tp = "/AUDIOVIDEO/vidid-"+vidid;
gg_tr(tp);
}
}
}

/*  GET COM VID  */
function getvid_com(vidid,chanvids,fb_user_id,sessionkey) {
hp_ck();
document.getElementById('v_m_m_com').innerHTML = l_min

// Set te random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/getvidid_com.php?vidid='+vidid+'&chanvids='+chanvids+'&fb_user_id='+fb_user_id+'&sessionkey='+sessionkey+'&nocache='+nocache);
http.onreadystatechange = function () {getgetvid_com(vidid,chanvids,fb_user_id,sessionkey);}; 
http.send(null);
} 


/*  GET COM VID REPLY*/
function getgetvid_com(vidid,chanvids,fb_user_id,sessionkey) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('v_m_m_com').innerHTML = response
if(http.status == 200){
FB_RequireFeatures(["XFBML"], function(){ FB.Facebook.init("0599a0fa368dcd42f8a2d4f76b1aecfd", "../receiver.html"); });
var tp = "/AUDIOVIDEO/VIDEO/voir-coms-vidid-"+vidid;
gg_tr(tp);
}
}
}

/*  GET LIVE CHAT  */
function getvid_live(prechannel) {
hp_ck();
document.getElementById('v_m_m_com').innerHTML = l_min

// Set te random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/getvidid_live.php?prechannel='+prechannel+'&nocache='+nocache);
http.onreadystatechange = function () {getgetvid_live(prechannel);}; 
http.send(null);
} 


/*  GET COM VID REPLY*/
function getgetvid_live(prechannel) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('v_m_m_com').innerHTML = response
if(http.status == 200){
FB_RequireFeatures(["XFBML"], function(){ FB.Facebook.init("0599a0fa368dcd42f8a2d4f76b1aecfd", "../receiver.html"); });
var tp = "/AUDIOVIDEO/VIDEO/v-live-chat-ch"+prechannel;
gg_tr(tp);
}
}
}

/*  GET WALLFEED SHARE  VID INFO */
function getvidinfo_share(vidid,chanvids,fb_user_id,sessionkey) {
hp_ck();
// Set te random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/getvidid_share.php?vidid='+vidid+'&chanvids='+chanvids+'&fb_user_id='+fb_user_id+'&sessionkey='+sessionkey+'&nocache='+nocache);
http.onreadystatechange = function () {getgetvidinfo_share(vidid,chanvids,fb_user_id,sessionkey);}; 
http.send(null);
} 


/*  GET VID SHARE INFO REPLY*/
function getgetvidinfo_share(vidid,chanvids,fb_user_id,sessionkey) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('sharevid_div').innerHTML = response
if(http.status == 200){
var tp = "/AUDIOVIDEO/VIDEO/publish-vidid-"+vidid;
gg_tr(tp);
}
}
}


/*  GET RELOAD VIDINFO */
function getreloadvidinfo(vidid,fb_user_id,sessionkey) {
hp_ck();
// Set te random number to add to URL request
no_cach();
// Pass the login variables like URL variable

http.open('get', lurl+'/inc/getvidinfo.php?vidid='+vidid+'&fb_user_id='+fb_user_id+'&sessionkey='+sessionkey+'&nocache='+nocache);
http.onreadystatechange = function () {getgetreloadvidinfo();}; 
http.send(null);
} 

/*  GET RELOAD VIDINFO REPLY*/
function getgetreloadvidinfo() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('infoplayer1').innerHTML = response
if(http.status == 200){

}
}
}


/*  GET VID CHAN PANNEL */
function getvidchans(fb_user_id,sessionkey) {
hp_ck();
var chanvids = document.getElementById('chanvids').value;
document.getElementById('vidchanpannel').innerHTML = l_min


// Set te random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/getchanvids.php?chanvids='+chanvids+'&fb_user_id='+fb_user_id+'&sessionkey='+sessionkey+'&nocache='+nocache);
http.onreadystatechange = function () {getgetvidchans();}; 
http.send(null);
} 


/*  GET VID CHAN PANNEL REPLY*/
function getgetvidchans() {
if(http.readyState == 4){
var response = http.responseText;
if(http.status == 200){
document.getElementById('vidchanpannel').innerHTML = response
}
}
}
  	
function VidJump_to(vidid,jump_at) {
player.sendEvent('SEEK', jump_at)
document.getElementById('markfriendlist').innerHTML = ""
}

/* -------------------------- */
/* WHOSWHO */
/* -------------------------- */

/* GET LISTCAT */
function ListCat() {
hp_ck();
document.getElementById('dyncont_whoswho').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/listcat.php?nocache='+nocache);
http.onreadystatechange = function () {getListCat(); };
http.send(null);
}


/*  GET LISTCAT REPLY */
function getListCat() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont_whoswho').innerHTML = response;
if(http.status == 200){
}
}
}

/* MANAGE SCAT */
function ListSCat(cat_id) {
hp_ck();
document.getElementById('dyncont_whoswho').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/listscat.php?cat_id='+cat_id+'&nocache='+nocache);
http.onreadystatechange = function () {getListSCat(); };
http.send(null);
}

/*  GET manageSCat REPLY */
function getListSCat() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont_whoswho').innerHTML = response;
if(http.status == 200){
}
}
}

/* GET SeeSCAT */
function SeeSCat(xparam, yparam) {
hp_ck();
document.getElementById('dyncont_whoswho').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/seescat.php?xparam='+xparam+'&yparam='+yparam+'&nocache='+nocache);
http.onreadystatechange = function () {getSeeSCat(); };
http.send(null);
}

/*  GET SeeSCAT REPLY*/
function getSeeSCat() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont_whoswho').innerHTML = response;
if(http.status == 200){
}
}
}


/* GET oadlisting_glob */
function loadlisting_glob(scat_id,div) {
hp_ck();
document.getElementById(div).innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/get_who_listing_scat_item.php?scat_id='+scat_id+'&div='+div+'&nocache='+nocache);
http.onreadystatechange = function () {getloadlisting_glob(div); };
http.send(null);
}

/*  GET oadlisting_glob REPLY*/
function getloadlisting_glob(div) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById(div).innerHTML = response;
if(http.status == 200){
}
}
}

/* GET Check who */
function whoswho(p_id,div) {
hp_ck();
document.getElementById(div).innerHTML = l_min

// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/getwho.php?p_id='+p_id+'&nocache='+nocache);
http.onreadystatechange = function () {getwhoswho(p_id,div); };
http.send(null);
}

/*  GET Check who REPLY*/
function getwhoswho(p_id,div) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById(div).innerHTML = response;
if(http.status == 200){
gp_map(p_id,'49.443817','1.082716');
FB_RequireFeatures(["XFBML"], function(){ FB.Facebook.init("0599a0fa368dcd42f8a2d4f76b1aecfd", "../../receiver.html"); });
}
}
}

/* GET Check who */
function dwhoswho(p_cat,p_id,div) {
hp_ck();
document.getElementById('dyncont').innerHTML = l_min

// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/dgetwho.php?p_cat='+p_cat+'&p_id='+p_id+'&nocache='+nocache);
http.onreadystatechange = function () {getdwhoswho(p_id,div); };
http.send(null);
}

/*  GET Check who REPLY*/
function getdwhoswho(p_id,div) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont').innerHTML = response;
if(http.status == 200){
gp_map(p_id,'49.443817','1.082716');
FB_RequireFeatures(["XFBML"], function(){ FB.Facebook.init("0599a0fa368dcd42f8a2d4f76b1aecfd", "../../receiver.html"); });
toggle_menu_dwho();
var tp = "/GUIDE/placeid-"+p_id;
gg_tr(tp);
}
}
}

/* Send new checkin */
function getpid_share(p_id) {
hp_ck();
document.getElementById('dyn_love').innerHTML = l_min
// Set the random number to add to URL request

no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/getpid_share.php?p_id='+p_id+'&nocache='+nocache);
http.onreadystatechange = function () {ggetpid_share(); };
http.send(null);
}

/* get Send new checkin reply */
function ggetpid_share() {
if(http.readyState == 4){
try {	
if(http.status == 200){
var response = http.responseText;
document.getElementById('dyn_love').innerHTML = response;
}
}catch(e) {document.getElementById('dyn_love').innerHTML = "Timout, please try again"}
}
}



/* GET Check who */
function preloadmap(p_id) {
hp_ck();
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/preloadmap.php?p_id='+p_id+'&nocache='+nocache);
http.onreadystatechange = function () {getpreloadmap(); };
http.send(null);
}

/*  GET Check who REPLY*/
function getpreloadmap() {
if(http.readyState == 4){
var response = http.responseText;
eval(response)
if(http.status == 200){


}
}
}

/* GET who SIDEWIDE MAP MODE */
function get_u_who_side(cat_id,query_start_at,query_limit_nb,div_nb) {
hp_ck();
document.getElementById('dyncont_who_side'+div_nb).innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/get_side_who.php?cat_id='+cat_id+'&query_start_at='+query_start_at+'&query_limit_nb='+query_limit_nb+'&div_nb='+div_nb+'&nocache='+nocache);
http.onreadystatechange = function () {getget_u_who_side(div_nb); };
http.send(null);
}

/*  GET who SIDEWIDE MAP MODE REPLY */
function getget_u_who_side(div_nb) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont_who_side'+div_nb).innerHTML = response;
if(http.status == 200){
}
}
}

/* GET who SIDEWIDE  LISTING MODE*/
function get_u_who_side_listing(cat_id,query_start_at,query_limit_nb,div_nb) {
hp_ck();
document.getElementById('dyncont_who_side'+div_nb).innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/get_side_who_listing.php?cat_id='+cat_id+'&query_start_at='+query_start_at+'&query_limit_nb='+query_limit_nb+'&div_nb='+div_nb+'&nocache='+nocache);
http.onreadystatechange = function () {getget_u_who_side_listing(div_nb); };
http.send(null);
}

/*  GET who SIDEWIDE LISTING MODE REPLY */
function getget_u_who_side_listing(div_nb) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('dyncont_who_side'+div_nb).innerHTML = response;
if(http.status == 200){
}
}
}
/* -------------------------- */
/* ENDWHOSWHO */
/* -------------------------- */


/* -------------------------- */
/* TOP3 STUFFS */
/* -------------------------- */

/* GET GLOBAL TOP3 BOARD */
function getGlobaltop3(user_fb_id) {
hp_ck();
document.getElementById('top3target').innerHTML = l_min

// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/getglobaltop3.php?user_fb_id='+user_fb_id+'&nocache='+nocache);
http.onreadystatechange = function () {getGlobaltop3Reply(); };
http.send(null);
}

/*  GET GLOBAL TOP3 BOARD REPLY */
function getGlobaltop3Reply() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('top3target').innerHTML = response;
if(http.status == 200){
}
}
}


/* GET LIST CAT 1 */
function ListCat1(xparam, yparam, user_fb_id) {
hp_ck();
document.getElementById('top3target').innerHTML = l_min

// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/listcat1.php?xparam='+xparam+'&yparam='+yparam+'&user_fb_id='+user_fb_id+'&nocache='+nocache);
http.onreadystatechange = function () {getListCat1(); };
http.send(null);
}

/*  GET LIST CAT REPLY*/
function getListCat1() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('top3target').innerHTML = response;
if(http.status == 200){
}
}
}


/* GET LIST CAT 2 */
function ListCat2(xparam, yparam) {
hp_ck();
var top3selected1 = document.getElementById('user_top1').value;
document.getElementById('top2here').innerHTML = l_min
document.getElementById('top3here').innerHTML = ""
document.getElementById('top3okgo').innerHTML = ""

// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable top3selected1
http.open('get', lurl+'/inc/listcat2.php?xparam='+xparam+'&yparam='+yparam+'&top3selected1='+top3selected1+'&nocache='+nocache);
http.onreadystatechange = function () {getListCat2(); };
http.send(null);
}

/*  GET LIST CAT REPLY*/
function getListCat2() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('top2here').innerHTML = response;
if(http.status == 200){
}
}
}


/* GET LIST CAT 3 */
function ListCat3(xparam, yparam) {
hp_ck();
var top3selected1 = document.getElementById('user_top1').value;
var top3selected2 = document.getElementById('user_top2').value;

document.getElementById('top3here').innerHTML = l_min
document.getElementById('top3okgo').innerHTML = ""
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/listcat3.php?xparam='+xparam+'&yparam='+yparam+'&top3selected1='+top3selected1+'&top3selected2='+top3selected2+'&nocache='+nocache);
http.onreadystatechange = function () {getListCat3(); };
http.send(null);
}

/*  GET LIST CAT REPLY*/
function getListCat3() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('top3here').innerHTML = response;
if(http.status == 200){
}
}
}

/* GET LIST CAT 4 */
function ListCat4() {
hp_ck();
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/listcat4.php?nocache='+nocache);
http.onreadystatechange = function () {getListCat4(); };
http.send(null);
}

/*  GET LIST CAT REPLY*/
function getListCat4() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('top3okgo').innerHTML = response;
if(http.status == 200){
}
}
}


/* GET START VOTE */
function startVottop3(user_fb_id) {
hp_ck();
document.getElementById('top3target').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/startvotetop3.php?user_fb_id='+user_fb_id+'&nocache='+nocache);
http.onreadystatechange = function () {getstartVottop3(); };
http.send(null);
}


/*  GET START VOTE REPLY*/
function getstartVottop3() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('top3target').innerHTML = response;
if(http.status == 200){
}
}
}


/* RegisterVote TOP3 */
function RegisterVote() {
hp_ck();
var user_fb_id = document.getElementById('user_fb_id').value;
var xparam = document.getElementById('xparam').value;
var yparam = document.getElementById('yparam').value;
var top3selected1 = document.getElementById('user_top1').value;
var top3selected2 = document.getElementById('user_top2').value;
var top3selected3 = document.getElementById('user_top3').value;
var top3type = document.getElementById('top3type').value;

document.getElementById('top3target').innerHTML = l_min

// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/registervote.php?xparam='+xparam+'&yparam='+yparam+'&user_fb_id='+user_fb_id+'&top3selected1='+top3selected1+'&top3selected2='+top3selected2+'&top3selected3='+top3selected3+'&nocache='+nocache);
http.onreadystatechange = function () {getRegisterVote(xparam,user_fb_id); };
http.send(null);
}


/*  GET REGISTER VOTE REPLY*/
function getRegisterVote(xparam,fb_user_id) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('top3target').innerHTML = response;
if(http.status == 200){
mywalltop3names(xparam,fb_user_id)
}
}
}

/* Get mywall TOP3 NAMES*/
function mywalltop3names(xparam,user_fb_id) {
hp_ck();
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/getmywalltop3.php?xparam='+xparam+'&user_fb_id='+user_fb_id+'&nocache='+nocache);
http.onreadystatechange = function () {getmywalltop3names(); };
http.send(null);
}




/*  GET REGISTER VOTE REPLY*/
function getmywalltop3names() {
if(http.readyState == 4){
var response = http.responseText;
if(http.status == 200){
mytop3wallfeed1(response)
}
}
}



/* GMAP STUFF */

/* GMAP GLOBAL */
//<![CDATA[

    var iconBlue_glob = new GIcon(); 
    iconBlue_glob.image = 'http://labs.google.com/ridefinder/images/mm_20_blue.png';
    iconBlue_glob.shadow = 'http://labs.google.com/ridefinder/images/mm_20_shadow.png';
    iconBlue_glob.iconSize = new GSize(12, 20);
    iconBlue_glob.shadowSize = new GSize(22, 20);
    iconBlue_glob.iconAnchor = new GPoint(6, 20);
    iconBlue_glob.infoWindowAnchor = new GPoint(5, 1);

    var iconRed_glob = new GIcon(); 
    iconRed_glob.image = 'http://www.rlife.fr/img/gpictos/club.png';
    iconRed_glob.shadow = 'http://www.rlife.fr/img/gpictos/club_shadow.png';
    iconRed_glob.iconSize = new GSize(17, 21);
    iconRed_glob.shadowSize = new GSize(22, 21);
    iconRed_glob.iconAnchor = new GPoint(20, 30);
    iconRed_glob.infoWindowAnchor = new GPoint(5, 1);

    var customIcons_glob = [];
    customIcons_glob["1"] = iconRed_glob;
    customIcons_glob["2"] = iconRed_glob;
    customIcons_glob["3"] = iconRed_glob;
    customIcons_glob["4"] = iconRed_glob;
    customIcons_glob["5"] = iconRed_glob;
    customIcons_glob["6"] = iconRed_glob;
    customIcons_glob["7"] = iconRed_glob;
    customIcons_glob["8"] = iconRed_glob;
    customIcons_glob["9"] = iconRed_glob;
    customIcons_glob["10"] = iconRed_glob;
    customIcons_glob["11"] = iconRed_glob;
    customIcons_glob["12"] = iconRed_glob;
    customIcons_glob["13"] = iconRed_glob;
    customIcons_glob["14"] = iconRed_glob;
    customIcons_glob["15"] = iconRed_glob;
    customIcons_glob["16"] = iconRed_glob;
    customIcons_glob["17"] = iconRed_glob;
    customIcons_glob["18"] = iconRed_glob;
    customIcons_glob["19"] = iconRed_glob;
    customIcons_glob["20"] = iconRed_glob;
     customIcons_glob["21"] = iconRed_glob;       
    
    var panoClient_glob;
    var houseMarker_glob;


    function loadgmap_glob(scat_id,latin,lngin,map_div,zoom_start) {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById(map_div));
        map.enableScrollWheelZoom();
        map.addControl(new GLargeMapControl3D());
       /*  map.addControl(new GMapTypeControl());  */

        map.setCenter(new GLatLng(latin,lngin), +zoom_start);
        
        GDownloadUrl("http://www.rlife.fr/inc/gmap-xml-global.php?scat_id="+scat_id, function(data) {
          var xml = GXml.parse(data);
          var markers = xml.documentElement.getElementsByTagName("marker");
          for (var i = 0; i < markers.length; i++) {
            var name = markers[i].getAttribute("name");
            var pid = markers[i].getAttribute("pid");
            var pcat = markers[i].getAttribute("pcat");
            var address = markers[i].getAttribute("address");
            var type = markers[i].getAttribute("type");
            var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")),
                                    parseFloat(markers[i].getAttribute("lng")));
            var marker = createMarker_glob(point, pid, name, address, type, pcat);
            map.addOverlay(marker);
          
          }
        });
        
        

      }
    }

    function createMarker_glob(point, pid, name, address, type, pcat) {
      var marker = new GMarker(point, customIcons_glob[type]);
      var html = "<div id=\"mapstyle\"><div id=\"mapstyle_left\"></div><div id=\"mapstyle_right\"><b>" + name + "</b> <br/>" + address + " <br/><a href=\"javascript:dwhoswho('"+pcat+"','"+pid+"','')\">Voir les détails</a><br/></div></div>" ;
      GEvent.addListener(marker, "mouseover", function() {
       marker.openInfoWindowHtml(html);
      });
      return marker;
    }
    
   
    //]]>


/* GMAP SINGLE PLACE */
//<![CDATA[

    var iconBlue_pl = new GIcon(); 
    iconBlue_pl.image = 'http://labs.google.com/ridefinder/images/mm_20_blue.png';
    iconBlue_pl.shadow = 'http://labs.google.com/ridefinder/images/mm_20_shadow.png';
    iconBlue_pl.iconSize = new GSize(12, 20);
    iconBlue_pl.shadowSize = new GSize(22, 20);
    iconBlue_pl.iconAnchor = new GPoint(6, 20);
    iconBlue_pl.infoWindowAnchor = new GPoint(5, 1);

    var iconRed_pl = new GIcon(); 
    iconRed_pl.image = 'http://www.rlife.fr/img/gpictos/club.png';
    iconRed_pl.shadow = 'http://www.rlife.fr/img/gpictos/club_shadow.png';
    iconRed_pl.iconSize = new GSize(17, 21);
    iconRed_pl.shadowSize = new GSize(22, 21);
    iconRed_pl.iconAnchor = new GPoint(20, 30);
    iconRed_pl.infoWindowAnchor = new GPoint(5, 1);

    var customIcons_pl = [];
    customIcons_pl["1"] = iconRed_pl;
    customIcons_pl["2"] = iconRed_pl;
    customIcons_pl["3"] = iconRed_pl;
    customIcons_pl["4"] = iconRed_pl;    
    customIcons_pl["5"] = iconRed_pl;
    customIcons_pl["6"] = iconRed_pl;
    customIcons_pl["7"] = iconRed_pl;
    customIcons_pl["8"] = iconRed_pl;
    customIcons_pl["9"] = iconRed_pl;
    customIcons_pl["10"] = iconRed_pl;
    customIcons_pl["11"] = iconRed_pl;
    customIcons_pl["12"] = iconRed_pl;
    customIcons_pl["13"] = iconRed_pl;
    customIcons_pl["14"] = iconRed_pl;
    customIcons_pl["15"] = iconRed_pl;
    customIcons_pl["16"] = iconRed_pl;
    customIcons_pl["17"] = iconRed_pl;
    customIcons_pl["18"] = iconRed_pl;
    customIcons_pl["19"] = iconRed_pl;
    customIcons_pl["20"] = iconRed_pl;
    
    function gp_map(p_id,lat_in,lng_in) {
    	
	   var j = 0;
   	 document.getElementById('p_m_r_dyn').innerHTML = "<div id=\"p_lnk\" name=\"p_lnk\">Accès</div><div id=\"p_map\" name=\"p_map\"></div>"
   	 
      if (GBrowserIsCompatible()) {
        var map_pl = new GMap2(document.getElementById("p_map"));
        map_pl.enableScrollWheelZoom();
        map_pl.addControl(new GLargeMapControl3D());
        map_pl.addControl(new GMapTypeControl());
        map_pl.setCenter(new GLatLng(lat_in,lng_in), 15);


        GDownloadUrl("http://www.rlife.fr/inc/gmap-xml.php?p_id="+p_id, function(data) {
          var xml_pl = GXml.parse(data);
          var markers_pl = xml_pl.documentElement.getElementsByTagName("marker");
          for (var j = 0; j < markers_pl.length; j++) {
            var name_pl = markers_pl[j].getAttribute("name");
            var address_pl = markers_pl[j].getAttribute("address");
            var type_pl = markers_pl[j].getAttribute("type");
            var point_pl = new GLatLng(parseFloat(markers_pl[j].getAttribute("lat")),
                                    parseFloat(markers_pl[j].getAttribute("lng")));
            var marker_pl = createMarker_pl(point_pl, name_pl, address_pl, type_pl);
            map_pl.addOverlay(marker_pl);
            map_pl.setCenter(point_pl, 15);

          }
        });
        
        
        

      }
      var j = 0;
    }

    function createMarker_pl(point_pl, name_pl, address_pl, type_pl) {
      var marker_pl = new GMarker(point_pl, customIcons_pl[type_pl]);
      var html_pl = "<div id=\"mapstyle\"><div id=\"mapstyle_left\"></div><div id=\"mapstyle_right\"><b>" + name_pl + "</b> <br/>" + address_pl + " <br/><br/></div></div>" ;
      GEvent.addListener(marker_pl, "mouseover", function() {
      marker_pl.openInfoWindowHtml(html_pl);
      });

      return marker_pl;
    }


    var myPOV; 
    
function gp_sview(p_lat,p_lng,p_yaw,p_pitch,p_zoom) {
	      var pyaw = parseFloat(p_yaw);
	      var ppitch = parseFloat(p_pitch);
	      var pzoom = parseFloat(p_zoom);
	      var panoC = new GStreetviewClient();
	   	  document.getElementById('p_m_r_dyn').innerHTML = "<div id=\"p_lnk\" name=\"p_lnk\">Streetview</div><div id=\"p_pano\" name=\"p_pano\"></div>"
      	p_thispoint = new GLatLng(p_lat, p_lng);
      	myPOV = {yaw:pyaw, pitch:ppitch, zoom:pzoom};
      	svOpts = {latlng:p_thispoint, pov:myPOV};
      	var mySview = new GStreetviewPanorama(document.getElementById("p_pano"),svOpts);
 	}


    //]]>
 
 
 /* get descr */
function gp_desc(p_id) {
hp_ck();
document.getElementById('p_m_r_dyn').innerHTML = "<div id=\"p_lnk\" name=\"p_lnk\">Description</div><div id=\"p_desc\" name=\"p_desc\"><img src=\"img/loader-facebookmini.gif\"/></div>"

// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/gp_desc.php?p_id='+p_id+'&nocache='+nocache);
http.onreadystatechange = function () {getgp_desc(p_id); };
http.send(null);
}


/*  get descr REPLY */
function getgp_desc(p_id) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('p_desc').innerHTML = response;
if(http.status == 200){

}
}
}   

 /* get opens */
function gp_opens(p_id) {
hp_ck();
document.getElementById('p_m_r_dyn').innerHTML = "<div id=\"p_lnk\" name=\"p_lnk\">Horaires</div><div id=\"p_opens\" name=\"p_opens\"><img src=\"img/loader-facebookmini.gif\"/></div>"

// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/gp_opens.php?p_id='+p_id+'&nocache='+nocache);
http.onreadystatechange = function () {getgp_opens(p_id); };
http.send(null);
}


/*  get opens REPLY */
function getgp_opens(p_id) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('p_opens').innerHTML = response;
if(http.status == 200){

}
}
}

 /* get events */
function gp_evs(p_id) {
hp_ck();
document.getElementById('p_m_r_dyn').innerHTML = "<div id=\"p_lnk\" name=\"p_lnk\">Events</div><div id=\"p_evs\" name=\"p_evs\"><img src=\"img/loader-facebookmini.gif\"/></div>"

// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/gp_evs.php?p_id='+p_id+'&nocache='+nocache);
http.onreadystatechange = function () {getgp_evs(p_id); };
http.send(null);
}


/*  get events REPLY */
function getgp_evs(p_id) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('p_evs').innerHTML = response;
if(http.status == 200){

}
}
}

 /* get vids */
function gp_vids(p_id) {
hp_ck();
document.getElementById('p_m_r_dyn').innerHTML = "<div id=\"p_lnk\" name=\"p_lnk\">Vidéos</div><div id=\"p_vids\" name=\"p_vids\"><img src=\"img/loader-facebookmini.gif\"/></div>"

// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/gp_vids.php?p_id='+p_id+'&nocache='+nocache);
http.onreadystatechange = function () {getgp_vids(p_id); };
http.send(null);
}


/*  get events REPLY */
function getgp_vids(p_id) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('p_vids').innerHTML = response;
if(http.status == 200){

}
}
}
    
    /* GMAP ONE EVENT */
//<![CDATA[

    var iconBlue_ev = new GIcon(); 
    iconBlue_ev.image = 'http://labs.google.com/ridefinder/images/mm_20_blue.png';
    iconBlue_ev.shadow = 'http://labs.google.com/ridefinder/images/mm_20_shadow.png';
    iconBlue_ev.iconSize = new GSize(12, 20);
    iconBlue_ev.shadowSize = new GSize(22, 20);
    iconBlue_ev.iconAnchor = new GPoint(6, 20);
    iconBlue_ev.infoWindowAnchor = new GPoint(5, 1);

    var iconRed_ev = new GIcon(); 
    iconRed_ev.image = 'http://www.rlife.fr/img/gpictos/club.png';
    iconRed_ev.shadow = 'http://www.rlife.fr/img/gpictos/club_shadow.png';
    iconRed_ev.iconSize = new GSize(17, 21);
    iconRed_ev.shadowSize = new GSize(22, 21);
    iconRed_ev.iconAnchor = new GPoint(20, 30);
    iconRed_ev.infoWindowAnchor = new GPoint(5, 1);

    var customIcons_ev = [];
    customIcons_ev["event"] = iconRed_ev;
    customIcons_ev["1"] = iconRed_ev;
    customIcons_ev["2"] = iconRed_ev;
    customIcons_ev["3"] = iconRed_ev;
    customIcons_ev["4"] = iconRed_ev;
    customIcons_ev["5"] = iconRed_ev;
    customIcons_ev["6"] = iconRed_ev;
    customIcons_ev["7"] = iconRed_ev;
    customIcons_ev["8"] = iconRed_ev;
    customIcons_ev["9"] = iconRed_ev;
    customIcons_ev["10"] = iconRed_ev;
    customIcons_ev["11"] = iconRed_ev;
    customIcons_ev["12"] = iconRed_ev;
    customIcons_ev["13"] = iconRed_ev;
    customIcons_ev["14"] = iconRed_ev;
    customIcons_ev["15"] = iconRed_ev;
    customIcons_ev["16"] = iconRed_ev;
    customIcons_ev["17"] = iconRed_ev;
    customIcons_ev["18"] = iconRed_ev;
    customIcons_ev["19"] = iconRed_ev;
    customIcons_ev["20"] = iconRed_ev;
    

   
    var panoClient_ev;
    var houseMarker_ev;





    function loadgmap_event(ev_eid,latin,lngin) {
    	
    	document.getElementById('event_bg_huge_desc').innerHTML = "<div id=\"event_bg_huge_map\"/></div>"
    	
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("event_bg_huge_map"));
        map.enableScrollWheelZoom();
        map.addControl(new GLargeMapControl3D());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(latin,lngin), 14);


        GDownloadUrl("http://www.rlife.fr/inc/gmap-xml-event.php?ev_eid="+ev_eid, function(data) {
          var xml = GXml.parse(data);
          var markers = xml.documentElement.getElementsByTagName("marker");
          for (var i = 0; i < markers.length; i++) {
            var name = markers[i].getAttribute("name");
            var address = markers[i].getAttribute("address");
            var type = markers[i].getAttribute("type");
            var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")),
                                    parseFloat(markers[i].getAttribute("lng")));
            var marker = createMarker_ev(point, name, address, type);
            map.addOverlay(marker);
          
          }
        });
        
        

      }
    }

    function createMarker_ev(point, name, address, type) {
      var marker = new GMarker(point, customIcons_ev[type]);
      var html = "<div id=\"mapstyle\"><div id=\"mapstyle_left\"></div><div id=\"mapstyle_right\"><b>" + name + "</b> <br/>" + address + " <br/><br/></div></div>" ;
      GEvent.addListener(marker, "mouseover", function() {
       marker.openInfoWindowHtml(html);
      });
      return marker;
    }
    
    


    //]]>



/* -------------------------- */
/* TIKTS HANDLING */
/* -------------------------- */


/* GET ev tickets */
function toggle_ev_tikt_shop(ev_internal_id) {
hp_ck();
document.getElementById('event_bg_huge_desc').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/toggle_ev_tikt_shop.php?ev_internal_id='+ev_internal_id+'&nocache='+nocache);
http.onreadystatechange = function () {gettoggle_ev_tikt_shop(); };
http.send(null);
}


/* GET ev tickets REPLY */
function gettoggle_ev_tikt_shop() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('event_bg_huge_desc').innerHTML = response;
if(http.status == 200){
}
}
}

/* -------------------------- */
/* AUTO COMPLETE HANDLING */
/* -------------------------- */

/* Auto search Place */
function g_pl(stringtoget) {
var s_size = stringtoget.length;
if (s_size > 2){
hp_ck();
document.getElementById('g_pl_rep').innerHTML = l_min;
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/auto_p.php?stringtoget='+stringtoget+'&nocache='+nocache);
http.onreadystatechange = function () {g_g_pl(); };
http.send(null);
}

}

/* Auto search products reply */
function g_g_pl() {
if(http.readyState == 4){
try {	
if(http.status == 200){
var response = http.responseText;
document.getElementById('g_pl_rep').innerHTML = response;
}
}catch(e) {document.getElementById('g_pl_rep').innerHTML = "Oupss, un petit soucis.. merci de réessayer"}
}
}

/* Auto search video */
function autosearch_vid(stringtoget) {
hp_ck();
document.getElementById('v_m_m_com').innerHTML = l_min
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/autosearch_vid.php?stringtoget='+stringtoget+'&nocache='+nocache);
http.onreadystatechange = function () {getautosearch_vid(); };
http.send(null);
}

/* Auto search video reply */
function getautosearch_vid() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('v_m_m_com').innerHTML = response;
if(http.status == 200){
}
}
}

/* -------------------------- */
/* Global Client */
/* -------------------------- */

/* Create new client */
function new_customer() {
hp_ck();
document.getElementById('action_zone_main').innerHTML = l_min
// Set te random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/sregister.php?nocache='+nocache);
http.onreadystatechange = function () {getnew_customer(); };
http.send(null);
}

/* Create new client Reply */
function getnew_customer() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('action_zone_main').innerHTML = response
if(http.status == 200){
FB_RequireFeatures(["XFBML"], function(){ FB.Facebook.init("0599a0fa368dcd42f8a2d4f76b1aecfd", "../../receiver.html"); });
}
}
}

/* Confirm Create new client */
function new_customer_go() {
hp_ck();
var email = document.getElementById('email').value;
var username = document.getElementById('username').value;
var password = document.getElementById('password').value;
var fb_id = document.getElementById('fb_id').value;
var first_name = document.getElementById('first_name').value;
var last_name = document.getElementById('last_name').value;
var pic_small = document.getElementById('pic_small').value;
var website = document.getElementById('website').value;
var about_me = document.getElementById('about_me').value;
var city = document.getElementById('city').value;
var state = document.getElementById('state').value;
var cp = document.getElementById('cp').value;
var country = document.getElementById('country').value;
var timezone = document.getElementById('timezone').value;
if(document.getElementById('cgu').checked == true){
var cgu = document.getElementById('cgu').value;
}else{
var cgu  = '0';
}

document.getElementById('action_zone_main').innerHTML = l_min
// Set te random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/session/manage-registering-fb.php?email='+email+'&username='+username+'&fb_id='+fb_id+'&password='+password+'&first_name='+first_name+'&last_name='+last_name+'&pic_small='+pic_small+'&website='+website+'&about_me='+about_me+'&city='+city+'&state='+state+'&cp='+cp+'&country='+country+'&timezone='+timezone+'&cgu='+cgu+'&submit=yes&nocache='+nocache);
http.onreadystatechange = function () {getnew_customer_go(); };
http.send(null);
}

/* Confirm Create new client Reply */
function getnew_customer_go() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('action_zone_main').innerHTML = response
if(http.status == 200){
}
}
}

/* Confirm Create new client */
function new_customer_fb_go() {
hp_ck();
var email = document.getElementById('email').value;
var username = document.getElementById('username').value;
var password = document.getElementById('password').value;
var fb_id = document.getElementById('fb_id').value;
var first_name = document.getElementById('first_name').value;
var last_name = document.getElementById('last_name').value;
var pic_small = document.getElementById('pic_small').value;
var website = document.getElementById('website').value;
var about_me = document.getElementById('about_me').value;
var city = document.getElementById('city').value;
var state = document.getElementById('state').value;
var cp = document.getElementById('cp').value;
var country = document.getElementById('country').value;
var timezone = document.getElementById('timezone').value;
if(document.getElementById('cgu').checked == true){
var cgu = document.getElementById('cgu').value;
}else{
var cgu  = '0';
}

document.getElementById('action_zone_main').innerHTML = l_min
// Set te random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/session/manage-registering-fb.php?email='+email+'&username='+username+'&fb_id='+fb_id+'&password='+password+'&first_name='+first_name+'&last_name='+last_name+'&pic_small='+pic_small+'&website='+website+'&about_me='+about_me+'&city='+city+'&state='+state+'&cp='+cp+'&country='+country+'&timezone='+timezone+'&cgu='+cgu+'&submit=yes&nocache='+nocache);
http.onreadystatechange = function () {getnew_customer_fb_go(); };
http.send(null);
}

/* Confirm Create new client Reply */
function getnew_customer_fb_go() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('action_zone_main').innerHTML = response
if(http.status == 200){
check_loginstate()
}
}
}

/* Confirm first step Create new client */
function fb_first_step() {
hp_ck();
document.getElementById('action_zone_main').innerHTML = l_min
// Set te random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/sregister-fb-one.php?nocache='+nocache);
http.onreadystatechange = function () {getfb_first_step(); };
http.send(null);
}

/* Confirm first step Create new client Reply */
function getfb_first_step() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('action_zone_main').innerHTML = response
if(http.status == 200){
FB.Connect.showPermissionDialog('email,offline_access,publish_stream', null);
}
}
}

/* Confirm 2nd step Create new client */
function fb_2nd_step() {
hp_ck();
document.getElementById('action_zone_main').innerHTML = l_min
// Set te random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/sregister-fb-two.php?nocache='+nocache);
http.onreadystatechange = function () {getfb_2nd_step(); };
http.send(null);
}

/* Confirm 2nd step Create new client Reply */
function getfb_2nd_step() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('action_zone_main').innerHTML = response
if(http.status == 200){
}
}
}

/* Confirm Speed Create new client */
function new_customer_fb_sgo_two() {
hp_ck();
var email = document.getElementById('email').value;
var proxymail = document.getElementById('proxymail').value;
var username = document.getElementById('username').value;
var password = document.getElementById('password').value;
var fb_id = document.getElementById('fb_id').value;
var first_name = document.getElementById('first_name').value;
var last_name = document.getElementById('last_name').value;
var pic_small = document.getElementById('pic_small').value;
var website = document.getElementById('website').value;
var about_me = document.getElementById('about_me').value;
var city = document.getElementById('city').value;
var state = document.getElementById('state').value;
var cp = document.getElementById('cp').value;
var country = document.getElementById('country').value;
var timezone = document.getElementById('timezone').value;
var user_birthday_d = document.getElementById('user_birthday_d').value;
var user_birthday_m = document.getElementById('user_birthday_m').value;
var user_birthday_y = document.getElementById('user_birthday_y').value;
var user_gender = document.getElementById('user_gender').value;
if(document.getElementById('cgu').checked == true){
var cgu = document.getElementById('cgu').value;
}else{
var cgu  = '0';
}

document.getElementById('action_zone_main').innerHTML = l_min
// Set te random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/session/manage-sregistering-fb-two.php?email='+email+'&proxymail='+proxymail+'&username='+username+'&fb_id='+fb_id+'&password='+password+'&first_name='+first_name+'&last_name='+last_name+'&pic_small='+pic_small+'&website='+website+'&about_me='+about_me+'&city='+city+'&state='+state+'&cp='+cp+'&country='+country+'&timezone='+timezone+'&cgu='+cgu+'&user_birthday_d='+user_birthday_d+'&user_birthday_m='+user_birthday_m+'&user_birthday_y='+user_birthday_y+'&user_gender='+user_gender+'&submit=yes&nocache='+nocache);
http.onreadystatechange = function () {getnew_customer_fb_sgo_two(); };
http.send(null);
}

/* Confirm Speed Create new client Reply */
function getnew_customer_fb_sgo_two() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('action_zone_main').innerHTML = response
if(http.status == 200){
check_loginstate()
}
}
}
/* Confirm Speed Create new client */
function new_customer_fb_sgo() {
hp_ck();
var email = document.getElementById('email').value;
var proxymail = document.getElementById('proxymail').value;
var username = document.getElementById('username').value;
var password = document.getElementById('password').value;
var fb_id = document.getElementById('fb_id').value;
var first_name = document.getElementById('first_name').value;
var last_name = document.getElementById('last_name').value;
var pic_small = document.getElementById('pic_small').value;
var website = document.getElementById('website').value;
var about_me = document.getElementById('about_me').value;
var city = document.getElementById('city').value;
var state = document.getElementById('state').value;
var cp = document.getElementById('cp').value;
var country = document.getElementById('country').value;
var timezone = document.getElementById('timezone').value;
var user_birthday_d = document.getElementById('user_birthday_d').value;
var user_birthday_m = document.getElementById('user_birthday_m').value;
var user_birthday_y = document.getElementById('user_birthday_y').value;
var user_gender = document.getElementById('user_gender').value;
if(document.getElementById('cgu').checked == true){
var cgu = document.getElementById('cgu').value;
}else{
var cgu  = '0';
}

document.getElementById('action_zone_main').innerHTML = l_min
// Set te random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/session/manage-sregistering-fb.php?email='+email+'&proxymail='+proxymail+'&username='+username+'&fb_id='+fb_id+'&password='+password+'&first_name='+first_name+'&last_name='+last_name+'&pic_small='+pic_small+'&website='+website+'&about_me='+about_me+'&city='+city+'&state='+state+'&cp='+cp+'&country='+country+'&timezone='+timezone+'&cgu='+cgu+'&user_birthday_d='+user_birthday_d+'&user_birthday_m='+user_birthday_m+'&user_birthday_y='+user_birthday_y+'&user_gender='+user_gender+'&submit=yes&nocache='+nocache);
http.onreadystatechange = function () {getnew_customer_fb_sgo(); };
http.send(null);
}

/* Confirm Speed Create new client Reply */
function getnew_customer_fb_sgo() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('action_zone_main').innerHTML = response
if(http.status == 200){
check_loginstate()
FB_RequireFeatures(["XFBML"], function(){ FB.Facebook.init("0599a0fa368dcd42f8a2d4f76b1aecfd", "../../receiver.html"); });

}
}
}


/* Client get login page */
function customer_getlogin() {
hp_ck();
document.getElementById('action_zone_main').innerHTML = l_min
// Set te random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/login.php?nocache='+nocache);
http.onreadystatechange = function () {getcustomer_getlogin(); };
http.send(null);
}

/* Confirm Create new client Reply */
function getcustomer_getlogin() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('action_zone_main').innerHTML = response
if(http.status == 200){
FB_RequireFeatures(["XFBML"], function(){ FB.Facebook.init("0599a0fa368dcd42f8a2d4f76b1aecfd", "../../receiver.html"); });
}
}
}

/* Client login */
function customer_login() {
hp_ck();
var username = document.getElementById('username').value;
var password = document.getElementById('password').value;
document.getElementById('action_zone_main').innerHTML = l_min
// Set te random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/session/manage-check.php?username='+username+'&password='+password+'&submit=yes&nocache='+nocache);
http.onreadystatechange = function () {getcustomer_login(); };
http.send(null);
}

/* Confirm login Reply */
function getcustomer_login() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('action_zone_main').innerHTML = response
if(http.status == 200){
FB_RequireFeatures(["XFBML"], function(){ FB.Facebook.init("0599a0fa368dcd42f8a2d4f76b1aecfd", "../../receiver.html"); });
check_loginstate()
}
}
}

/* Client logout */
function customer_logout() {
hp_ck();
clean_div('dyn_menu');
document.getElementById('login_head').innerHTML = "Loggin out.."
document.getElementById('action_zone_main').innerHTML = "Loggin out.."
// Set te random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/logout.php?nocache='+nocache);
http.onreadystatechange = function () {getcustomer_logout(); };
http.send(null);
}

/* Confirm logout Reply */
function getcustomer_logout() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('login_head').innerHTML = response
document.getElementById('action_zone_main').innerHTML = "<div id=\"log_main_try\"><div id=\"log_head\">Logout<div id=\"reg_close\"><a href=\"javascript:close_x('action_zone_main')\"><img src=\"http://www.rlife.fr/img/close_cross.png\"></a></div></div><div id=\"log_body1\"><br><div id=\"log_body1_1\"></div><div id=\"log_body1_2\"></div><div id=\"log_body1_1\"></div><div id=\"log_body1_2\">Vous vous êtes déconnecté - <br > <br > A bientôt ! <br > <br ><a href=\"javascript:close_x('action_zone_main')\">Fermer cette fenetre</a> </div><div id=\"log_body1_valid\"></div><div id=\"log_body1_valid\"></div></div></div>"
if(http.status == 200){
FB_RequireFeatures(["XFBML"], function(){ FB.Facebook.init("0599a0fa368dcd42f8a2d4f76b1aecfd", "../../receiver.html"); });
setTimeout("clean_div('action_zone_main')", 3000);

}
}
}


/* Check login state */
function check_loginstate() {
hp_ck();
document.getElementById('login_head').innerHTML = l_min
// Set te random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/check_login_state.php?nocache='+nocache);
http.onreadystatechange = function () {getcheck_loginstate(); };
http.send(null);
}

/* Check login state Reply */
function getcheck_loginstate() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('login_head').innerHTML = response
if(http.status == 200){

}
}
}



/* UPDATE EDIT ITEM   */
function update_item(node_target) {
hp_ck();

var node_val = document.getElementById(node_target+'_val').value;

document.getElementById(node_target+'_GLOB').innerHTML = l_min

// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/edit_item_node.php?node_target='+node_target+'&node_val='+node_val+'&nocache='+nocache);
http.onreadystatechange = function () {getupdate_item(node_target,node_val); };
http.send(null);
}

/* UPDATE EDIT ITEM REPLY */
function getupdate_item(node_target,node_val) {
if(http.readyState == 4){
var response = http.responseText;
if(http.status == 200){
document.getElementById(node_target+'_GLOB').innerHTML = node_target+" : <input name=\""+node_target+"_val\" id=\""+node_target+"_val\" type=\"text\" size=\"30\" maxlength=\"255\" value=\""+node_val+"\" onfocus=\"javascript:show_node('"+node_target+"')\"/><span id=\""+node_target+"_focus\" class=\"divHide_node\"><a href=\"javascript:update_item('"+node_target+"')\">OK</a></span>"

}
}
}
/* -------------------------- */
/* BASKET */
/* -------------------------- */

/* SHOW BASKET */
function show_items() {
hp_ck();

document.getElementById('action_zone_main').innerHTML = "<span id=\"fbloaderbig\"><br />"+l_min+"<br /><br /></span>"
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/card_show_ajx.php?nocache='+nocache);
http.onreadystatechange = function () {getshow_items(); };
http.send(null);
}


/* SHOW BASKET REPLY */
function getshow_items() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('action_zone_main').innerHTML = response;
if(http.status == 200){
}
}
}

/* PROCESS BASKET */
function process_cart(divtarget) {
hp_ck();
document.getElementById('action_zone_main').innerHTML = "<span id=\"fbloaderbig\"><br />"+l_min+"<br /><br /></span>"
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/card_process_ajx.php?nocache='+nocache);
http.onreadystatechange = function () {getprocess_cart(); };
http.send(null);
}


/* PROCESS BASKET REPLY */
function getprocess_cart() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('action_zone_main').innerHTML = response;
if(http.status == 200){
FB_RequireFeatures(["XFBML"], function(){ FB.Facebook.init("0599a0fa368dcd42f8a2d4f76b1aecfd", "../../receiver.html"); });

}
}
}

/* PROCESS BASKET */
function process_cart_free(divtarget) {
hp_ck();
document.getElementById('action_zone_main').innerHTML = "<span id=\"fbloaderbig\"><br />"+l_min+"<br /><br /></span>"
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/card_process_ajx_free.php?nocache='+nocache);
http.onreadystatechange = function () {getprocess_cart_free(); };
http.send(null);
}


/* PROCESS BASKET REPLY */
function getprocess_cart_free() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('action_zone_main').innerHTML = response;
if(http.status == 200){
}
}
}


/* SHOW BASKET */
function gfree_tikts_checkout(divtarget) {
clean_div(divtarget);
show_items_mini();
toggle_menu_profil();
toggle_menu_tikts();
}



/* SHOW BASKET */
function close_cart(divtarget) {
clean_div(divtarget);
show_items_mini();
}
/* SHOW BASKET */
function show_items_mini() {
hp_ck();
document.getElementById('cart_mini').innerHTML = "<span id=\"fbloaderbig\"><br />"+l_min+"<br /><br /></span>"
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/card_show_ajx_mini.php?nocache='+nocache);
http.onreadystatechange = function () {getshow_items_mini(); };
http.send(null);
}


/* SHOW BASKET REPLY */
function getshow_items_mini() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('cart_mini').innerHTML = response;
if(http.status == 200){
}
}
}

/* SHOW BASKET */
function show_items_mini_added(item,nbadd) {
hp_ck();
document.getElementById('ttxt_head').innerHTML = "<span id=\"fbloaderbig\"><br />"+l_min+"<br /><br /></span>"
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/card_show_ajx_mini_added.php?item='+item+'&nbadd='+nbadd+'&nocache='+nocache);
http.onreadystatechange = function () {getshow_items_mini_added(); };
http.send(null);
}


/* SHOW BASKET REPLY */
function getshow_items_mini_added() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('ttxt_head').innerHTML = response;
if(http.status == 200){
setTimeout("clean_div('cart_mini_added')", 3000);
}
}
}

/* ADD TO BASKET */
function add_item(item,nbadd) {
hp_ck();
document.getElementById('cart').innerHTML = "<span id=\"fbloaderbig\"><br />"+l_min+"<br /><br /></span>"
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/card_add_ajx.php?item='+item+'&nbadd='+nbadd+'&nocache='+nocache);
http.onreadystatechange = function () {getadd_item(); };
http.send(null);
}


/*  ADD TO BASKET REPLY */
function getadd_item() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('cart').innerHTML = response;
if(http.status == 200){
show_items()
}
}
}

/* ADD TO BASKET MINI*/
function add_item_mini(item,nbadd) {
hp_ck();
document.getElementById('ttxt_head').innerHTML = "<span id=\"fbloaderbig\"><br />"+l_min+"<br /><br /></span>"
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/card_add_ajx.php?item='+item+'&nbadd='+nbadd+'&nocache='+nocache);
http.onreadystatechange = function () {getadd_item_mini(item,nbadd); };
http.send(null);
}


/*  ADD TO BASKET MINI REPLY */
function getadd_item_mini(item,nbadd) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('ttxt_head').innerHTML = response;
if(http.status == 200){
show_items_mini_added(item,nbadd)
}
}
}

/* ADD TO BASKET MINI*/
function add_item_mini_inev(item) {
hp_ck();
var nbadd = document.getElementById('tikt_nb_sel'+item).value;
document.getElementById('ttxt_head').innerHTML = "<span id=\"fbloaderbig\"><br />"+l_min+"<br /><br /></span>"

// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/card_add_ajx.php?item='+item+'&nbadd='+nbadd+'&nocache='+nocache);
http.onreadystatechange = function () {getadd_item_mini_inev(item,nbadd); };
http.send(null);
}


/*  ADD TO BASKET MINI REPLY */
function getadd_item_mini_inev(item,nbadd) {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('ttxt_head').innerHTML = response;
if(http.status == 200){
scroll(0,0);
show_items_mini_added(item,nbadd)
}
}
}
/* DEL FROM BASKET */
function del_item(item,key_val) {
hp_ck();
document.getElementById('cart').innerHTML = "<span id=\"fbloaderbig\"><br />"+l_min+"<br /><br /></span>"
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/card_del_ajx.php?delitem='+item+'&valitem='+key_val+'&nocache='+nocache);
http.onreadystatechange = function () {getdel_item(); };
http.send(null);
}

/* DEL FROM BASKET REPLY */
function getdel_item() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('cart').innerHTML = response;
if(http.status == 200){
show_items()
}
}
}



/* Toggle Game map   */
function toggle_game_map(memberid,latin,lngin) {

document.getElementById('dyn_game_map'+memberid).innerHTML = "<div name=\"game_gmap_radius\" id=\"game_gmap_radius\"></div><div name=\"game_pano\" id=\"game_pano\"></div><div name=\"game_gmap\" id=\"game_gmap\"></div>_________________________________________________________________________<br>"
load_game_gmap(memberid,latin,lngin)
}


    /* GMAP MY POSITION AND PLACE */
//<![CDATA[

    var iconBlue_p = new GIcon(); 
    iconBlue_p.image = 'http://labs.google.com/ridefinder/images/mm_20_blue.png';
    iconBlue_p.shadow = 'http://labs.google.com/ridefinder/images/mm_20_shadow.png';
    iconBlue_p.iconSize = new GSize(12, 20);
    iconBlue_p.shadowSize = new GSize(22, 20);
    iconBlue_p.iconAnchor = new GPoint(6, 20);
    iconBlue_p.infoWindowAnchor = new GPoint(5, 1);

    var iconRed_p = new GIcon(); 
    iconRed_p.image = 'http://www.rlife.fr/img/gpictos/club.png';
    iconRed_p.shadow = 'http://www.rlife.fr/img/gpictos/club_shadow.png';
    iconRed_p.iconSize = new GSize(17, 21);
    iconRed_p.shadowSize = new GSize(22, 21);
    iconRed_p.iconAnchor = new GPoint(20, 30);
    iconRed_p.infoWindowAnchor = new GPoint(5, 1);


    var customIcons_p = [];
    customIcons_p["1"] = iconRed_p;
    customIcons_p["2"] = iconRed_p;
    customIcons_p["3"] = iconRed_p;
    customIcons_p["4"] = iconRed_p;
    customIcons_p["5"] = iconRed_p;
    customIcons_p["6"] = iconRed_p;
    customIcons_p["7"] = iconRed_p;
    customIcons_p["8"] = iconRed_p;
    customIcons_p["9"] = iconRed_p;
    customIcons_p["10"] = iconRed_p;
    customIcons_p["11"] = iconRed_p;
    customIcons_p["12"] = iconRed_p;
    customIcons_p["13"] = iconRed_p;
    customIcons_p["14"] = iconRed_p;
    customIcons_p["15"] = iconRed_p;
    customIcons_p["16"] = iconRed_p;
    customIcons_p["17"] = iconRed_p;
    customIcons_p["18"] = iconRed_p;
    customIcons_p["19"] = iconRed_p;
    customIcons_p["20"] = iconRed_p;
    
    
    
    var myPano;   
    var panoClient;
    var nw_point;
    var nw_yaw;
    var nw_pitch;
    var nw_zoom;
    var myPOV;
         
    function load_game_gmap(memberid,latin,lngin) {
      if (GBrowserIsCompatible()) {
      	panoClient = new GStreetviewClient();
      	myPano = new GStreetviewPanorama(document.getElementById("game_pano"));
        var map = new GMap2(document.getElementById("game_gmap"));
        map.enableScrollWheelZoom();
        map.addControl(new GLargeMapControl3D());
        map.setCenter(new GLatLng(latin,lngin), 14);
        var map2 = new GMap2(document.getElementById("game_gmap_radius"));
        map2.enableScrollWheelZoom();
        map2.addControl(new GLargeMapControl3D());
        map2.addControl(new GMapTypeControl());
        map2.setCenter(new GLatLng(latin,lngin), 14);

        GDownloadUrl("http://www.rlife.fr/inc/game-gmap-xml.php?memberid="+memberid, function(data) {
          var xml = GXml.parse(data);
          var markers = xml.documentElement.getElementsByTagName("marker");
          for (var i = 0; i < markers.length; i++) {
            var name = markers[i].getAttribute("name");
            var address = markers[i].getAttribute("address");
            var type = markers[i].getAttribute("type");
            var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")),
                                    parseFloat(markers[i].getAttribute("lng")));
            var p_hasstreetview = markers[i].getAttribute("phasstreetview");
            var p_yaw = parseFloat(markers[i].getAttribute("pyaw"));
            var p_pitch = parseFloat(markers[i].getAttribute("ppitch"));
            var p_zoom = markers[i].getAttribute("pzoom");
            var marker = createMarker_p(point, name, address, type, map, map2, p_hasstreetview, p_yaw, p_pitch, p_zoom);
            map.addOverlay(marker);
            nw_point = marker.getPoint();
            myPOV = {yaw:p_yaw,pitch:p_pitch,zoom:p_zoom};
            myPano.setLocationAndPOV(nw_point, myPOV);

             }
              
        });
        
      }
         
    }

    function createMarker_p(point, name, address, type, map, map2, p_hasstreetview, p_yaw, p_pitch, p_zoom) {
      var marker = new GMarker(point, {draggable: true, bouncy:false});
      var html = "<div id=\"mapstyle\">" + address + "</div>" ;
      
      GEvent.addListener(marker, "dragend", function() {
      nw_point = marker.getPoint();
      map.panTo(nw_point);
      
      document.getElementById("p_lat").value = nw_point.lat();
      document.getElementById("p_lng").value = nw_point.lng();
      myPOV = {yaw:p_yaw,pitch:p_pitch,zoom:p_zoom};
      myPano.setLocationAndPOV(nw_point, myPOV);      
      });
      
      GEvent.addListener(myPano, "initialized", function(call) {
      var nw_yaw = call.yaw;
      var nw_pitch = call.pitch;
      var nw_zoom = call.zoom;
      var nw_plat = call.latlng.lat();
      var nw_plng = call.latlng.lng();
      document.getElementById("p_yaw").value = nw_yaw;
      document.getElementById("p_pitch").value = nw_pitch;
      document.getElementById("p_zoom").value = nw_zoom;
      document.getElementById("p_lat").value = call.latlng.lat();
      document.getElementById("p_lng").value = call.latlng.lng();
      map.setCenter(new GLatLng(nw_plat,nw_plng), 14);
      var nw_latlng = new GLatLng(nw_plat, nw_plng); 
      marker.setLatLng(nw_latlng)
      searchLocationsNear(nw_latlng,map2)
      });
      GEvent.addListener(myPano, "yawchanged", function(nw_yaw_nw) {
      document.getElementById("p_yaw").value = nw_yaw_nw;
      });
      GEvent.addListener(myPano, "pitchchanged", function(nw_pitch_nw) {
      document.getElementById("p_pitch").value = nw_pitch_nw;
      });
      GEvent.addListener(myPano, "zoomchanged", function(nw_zoom_nw) {
      document.getElementById("p_zoom").value = nw_zoom_nw;
      });     
      
      return marker;
    }
    
  
    //]]>


/* Radisu search */
    //<![CDATA[

   function searchLocationsNear(center,map2) {
     var radius = 0.1;
     var searchUrl = 'inc/radius-search-xml.php?user_lat=' + center.lat() + '&user_lng=' + center.lng() + '&user_radius=' + radius;
     GDownloadUrl(searchUrl, function(data) {
       var xml = GXml.parse(data);
       var p_searcheds = xml.documentElement.getElementsByTagName('p_searched');
       map2.clearOverlays();

       var sidebar = document.getElementById('sidebar');
       sidebar.innerHTML = '';
       if (p_searcheds.length == 0) {
         sidebar.innerHTML = 'No results found.';
         map2.setCenter(center, 14);
         return;
       }

       var bounds = new GLatLngBounds();
       for (var i = 0; i < p_searcheds.length; i++) {
         var pse_name = p_searcheds[i].getAttribute('p_name');
         var pse_address = p_searcheds[i].getAttribute('p_address');
         var pse_distance = parseFloat(p_searcheds[i].getAttribute('p_distance'));
         var pse_point = new GLatLng(parseFloat(p_searcheds[i].getAttribute('p_lat')),
                                 parseFloat(p_searcheds[i].getAttribute('p_lng')));
         
         var p_searched = createp_searched(pse_point, pse_name, pse_address);
         map2.addOverlay(p_searched);
         var sidebarEntry = createSidebarEntry(p_searched, pse_name, pse_address, pse_distance);
         sidebar.appendChild(sidebarEntry);
         bounds.extend(pse_point);
       }
       map2.setCenter(bounds.getCenter(), map2.getBoundsZoomLevel(bounds));

     });
   }

    function createp_searched(pse_point, pse_name, pse_address) {
      var p_searched = new GMarker(pse_point);
      var p_html = "<div id=\"mapstyle\"><div id=\"mapstyle_left\"></div><div id=\"mapstyle_right\"><b>" + pse_name + "</b> <br/>" + pse_address + " <br/><br/></div></div>";
      GEvent.addListener(p_searched, 'click', function() {
        p_searched.openInfoWindowHtml(p_html);
      });
      return p_searched;
    }

    function createSidebarEntry(p_searched, pse_name, pse_address, pse_distance) {
      var span = document.createElement('span');
      var pside_html = '<b>' + pse_name + '</b> (' + pse_distance.toFixed(1) + ') | ' + pse_address;
      span.innerHTML = pside_html;

      return span;
    }
    //]]>
    
    
    
    /* -------------------------- */
/* FRIENDS */
/* -------------------------- */


function t_frds() {
hp_ck();
document.getElementById('d_dyn').innerHTML = "<div id=\"g_frds\"><input name=\"chkin_p_frdsid\" type=\"hidden\" id=\"chkin_p_frdsid\" value=\"\" />Rechercher: <input size=\"20\" onkeyup=\"g_frds(this.value);\" type=\"text\" name=\"nw_p_frds\" id=\"nw_p_frds\" value=\"\"/> <span id=\"nw_p_frds_ok\"> ex: Rlife</span></div><br><div id=\"g_pz_frdsrep\">...</div><br><div id=\"dyn_frds\"></div>"
}



function t_frd() {
hp_ck();

document.getElementById('d_dyn').innerHTML = l_min;
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/t_frd.php?nocache='+nocache);
http.onreadystatechange = function () {g_t_frd(); };
http.send(null);
}

/* get Get invites reply */
function g_t_frd() {
if(http.readyState == 4){
try {	
if(http.status == 200){
var response = http.responseText;
document.getElementById('d_dyn').innerHTML = "| <a href=\"javascript:t_frds()\">Rechercher</a><br><br>"+response;
}
}catch(e) {document.getElementById('d_dyn').innerHTML = "Timout, please try again"}
}
}


/* Get invites */
function g_invits() {
hp_ck();

document.getElementById('d_dyn').innerHTML = l_min;
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/g_invits.php?nocache='+nocache);
http.onreadystatechange = function () {g_g_invits(); };
http.send(null);
}

/* get Get invites reply */
function g_g_invits() {
if(http.readyState == 4){
try {	
if(http.status == 200){
var response = http.responseText;
document.getElementById('d_dyn').innerHTML = "| <a href=\"javascript:t_frds()\">Recherche</a><br><br>"+response;
}
}catch(e) {document.getElementById('d_dyn').innerHTML = "Timout, please try again"}
}
}

/* accept invit */
function acc_frd(targ_id) {
hp_ck();

document.getElementById('d_dyn').innerHTML = l_min;
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/acc_frd.php?invit_id='+targ_id+'&nocache='+nocache);
http.onreadystatechange = function () {g_acc_frd(); };
http.send(null);
}

/* get accept invit reply */
function g_acc_frd() {
if(http.readyState == 4){
try {	
if(http.status == 200){
var response = http.responseText;
document.getElementById('d_dyn').innerHTML = response;
}
}catch(e) {document.getElementById('d_dyn').innerHTML = "Timout, please try again"}
}
}


/* decline invit */
function dec_frd(targ_id) {
hp_ck();

document.getElementById('d_dyn').innerHTML = l_min;
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/dec_frd.php?invit_id='+targ_id+'&nocache='+nocache);
http.onreadystatechange = function () {g_dec_frd(); };
http.send(null);
}

/* get decline invit reply */
function g_dec_frd() {
if(http.readyState == 4){
try {	
if(http.status == 200){
var response = http.responseText;
document.getElementById('d_dyn').innerHTML = response;
}
}catch(e) {document.getElementById('d_dyn').innerHTML = "Timout, please try again"}
}
}



/* Auto search My friends */
function g_frds(stringtoget) {

var s_size = stringtoget.length;
if (s_size > 2){
hp_ck();
document.getElementById('nw_p_frds_ok').innerHTML = "";
document.getElementById('g_pz_frdsrep').innerHTML = l_min;
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/g_frds.php?stringtoget='+stringtoget+'&nocache='+nocache);
http.onreadystatechange = function () {g_g_frds(); };
http.send(null);
}

}

/* Auto search friends reply */
function g_g_frds() {
if(http.readyState == 4){
try {	
if(http.status == 200){
var response = http.responseText;
document.getElementById('g_pz_frdsrep').innerHTML = response;
}
}catch(e) {document.getElementById('g_pz_frdsrep').innerHTML = "Timout, please try again"}
}
}



/* Send new checkin */
function s_ifrd() {
hp_ck();
var invit_to = document.getElementById('chkin_p_frdsid').value;
var invit_msg1 = document.getElementById('chkin_frdsmsg').value;
var invit_msg = escape(invit_msg1);

document.getElementById('nw_p_frds_ok').innerHTML = l_min;
document.getElementById('g_pz_frdsrep').innerHTML = l_min;
// Set the random number to add to URL request
no_cach();
// Pass the login variables like URL variable
http.open('get', lurl+'/inc/s_ifrd.php?invit_to='+invit_to+'&invit_msg='+invit_msg+'&nocache='+nocache);
http.onreadystatechange = function () {g_s_ifrd(); };
http.send(null);
}

/* get Send new checkin reply */
function g_s_ifrd() {
if(http.readyState == 4){
try {	
if(http.status == 200){
var response = http.responseText;
document.getElementById('d_dyn').innerHTML = response;
}
}catch(e) {document.getElementById('d_dyn').innerHTML = "Timout, please try again"}
}
}
