var NS4 = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) < 5);
var addEvent;
if (document.addEventListener) {
  addEvent = function(element, type, handler) {
      element.addEventListener( type, handler, null);
  }
}
else if (document.attachEvent) {
  addEvent = function(element, type, handler) {
  element.attachEvent("on" + type, handler);
  }
}
else {
  addEvent = new Function; // not supported
}
var is_ie = (document.all && document.getElementById);
var is_moz = (!document.all && document.getElementById);
var is_opera = (navigator.userAgent.indexOf("Opera") > -1);
function checkPlanForm()
{
    var select = document.getElementById( "itneraries" );    
    l_name = document.getElementById( "nametxtfld" ).value;
    l_name = Trim( l_name );
    if( l_name.length == 0 && select.selectedIndex == -1 ) {
    	alert( "Please give a plan name or select an existing plan!" );
        return false;
    }
    return true;
}
function mbox_submit_click( a_form ) {
    l_message = Trim( document.getElementById( 'emsg_msg_id' ).value );
    if( l_message.length == 0 ) {
        var choice = window.confirm( "A default invitation message would be sent to all the invitees!" );   
        if( !choice ) {
	    return false;
	}
    }
    document.getElementById('loading-objects' ).style.display = 'block';
    return true;
}
function newPlan() {
	location.reload(true);
}
function loadVenues() {
	rate_loading_venues(); 
	var select = document.getElementById( "itneraries" );
    	itnrid = select.options[select.selectedIndex].value;

    	var ajax = new Ajax.Updater('venues', '../ajax/ddrtrvr.php?itnrid=' + itnrid,{method:'get',asynchronous:true,onComplete: showVenuesList });
    	rate_unloading_venues();
}
function showVenuesList( req ) {   
      
	   var l_data =  req.responseText;
        var php = new PHP_Serializer();
        var myJSvar = php.unserialize(l_data);
        position = 1;
        var l_tbl = document.getElementById( "venuetbl" );
        l_length =  l_tbl.rows.length;
        
        for (i=l_length - 1;i > 1;i--)
	    {
             l_tbl.deleteRow( i );
        }
		var itnrtype_set = false;
		var datetime_set = false;
	for (i=0;i<myJSvar.length;i++)
	{
	 if( itnrtype_set == false && datetime_set == false ) {
		itnrtype_set = true;
		datetime_set = true;
		var l_itnrtype = document.getElementById( "itnr_type" );
		for (var j = 0; j < l_itnrtype.length; j++) {
			if (l_itnrtype.options[j].value == myJSvar[i][ "itnr_type" ] ) {
				l_itnrtype.setAttribute( "selectedIndex", j );
		}
	    }
		var l_datetime = document.getElementById( "datetime" )
		l_datetime.setAttribute( "value", myJSvar[i][ "date_time" ] );
	 }		
	     var l_tr = document.getElementById( "venuetbl" ).insertRow( i + 2 );
	     var l_td1  = l_tr.insertCell( 0 );
	     l_td1.setAttribute( "width" , "100%" );
	     l_td1.setAttribute( "style", "font-family: arial, helvetica, sans-serif; font-size: 9pt;border-top: 2px dashed;color:#cccccc" );
	     var l_td1innerhtml = '<span class="small"><span style="font-size:11pt;font-weight:bold">' +
				myJSvar[i]["wfs_name"] + ' </span><br/>' +
		   		myJSvar[i]["wfs_address"] + ' <br/>' +
		  		' Phone: ' + myJSvar[i]["wfs_phone"] +  '</span>';
	     l_td1innerhtml = l_td1innerhtml + '<br/><br/>';
	     l_td1.innerHTML = l_td1innerhtml;
	     
	     var l_td2  = l_tr.insertCell( 1 );
	     l_td2.setAttribute( "width" , "50%" );
	     l_td2.setAttribute( "style", "border-top: 2px dashed;color:#cccccc" );
	     var l_td2innerhtml = '<span class="small">Planning for:&nbsp;&nbsp;' + myJSvar[i]["ptype_name"] + ' <br/>' +
	     			   'Date & time:&nbsp;&nbsp; ' + myJSvar[i]["date_time"];	     
   	}

		l_fielddiv = document.getElementById( "npfielddiv" );
		l_fielddescrdiv = document.getElementById( "npfielddescrdiv" );
		if( l_fielddiv != null ) {
			l_fielddiv.className = "hide";  
			l_fielddescrdiv.className = "hide";  
		}
		l_npchkdiv = document.getElementById( "npchkboxdiv" );
		if( l_npchkdiv != null ) {
			l_npchkdiv.className = "show";
		}
		
	   	var txtfield = document.getElementById( "nametxtfld" );
		if( txtfield != null ) {
			txtfield.setAttribute( "value", "" );
		}
		var select = document.getElementById( "itneraries" );
    	itnrid = select.options[select.selectedIndex].value;
    	var itnrid_elem = document.getElementById( "itnr_id" );
    	itnrid_elem.setAttribute( "value", itnrid );
    	
    	l_arelem = document.getElementById( "ar_id" );
    	l_checked = myJSvar[0]["access_rights"];
    	
    	if( l_checked == 1 ) {
    	    l_arelem.checked = true;   	    
    	} else {    	    
    	    l_arelem.checked = false;
    	}
		
	
    	
}
function get_chat_friends( a_ids ) {	
	id = getFriendsId( a_ids );
	if( id == false ) {
		return false;
    }
    var ajax = new Ajax.Updater('friends', '../ajax/ddrtrvr.php?frndslistid=' + id,{method:'get',asynchronous:true,onComplete: showChatFriendsList });
}
function get_friends( a_ids ) {	
   rate_loading_friends
   var select = document.getElementById( "frndsgrp" );
   l_id = select.options[select.selectedIndex].value;
   var ajax = new Ajax.Updater('', '../ajax/ddrtrvr.php?frndslistid=' + l_id,{method:'get',asynchronous:true,onComplete: showFriendsList });
}
function showFriendsList( req ) {   
	var frndstr =  req.responseText;	
	if( frndstr.length == 0 ) {
		
	    l_frndselem = document.getElementById( 'frndslist' );               
	    var length = l_frndselem.length;
	    for(i=length-1; i>=0; i--)
	    {               
	       if(length>0)
	       {
		   l_frndselem.options[i] = null;
	       }
	    }
	    alert( "No friends are found for your current selection!" );
	    rate_unloading_friends();
	    return false;
	}
	var frnds = frndstr.split("," );
	l_frndselem = document.getElementById( 'frndslist' );               
        l_parentelem = l_frndselem.parentNode;     
        if( frnds.length > 0 ) {
           var length = l_frndselem.length;
           for(i=length-1; i>=0; i--)
  	   {               
	        if(length>0)
	        {
	            l_frndselem.options[i] = null;
                }
            }
        }
        var countOnline = 0;
        for( i = 0; i < frnds.length; i++ )
        {
	    frndar = frnds[i].split( "~~" );
	    option = document.createElement('option');
 	    option.appendChild(document.createTextNode( frndar[0] ));
	    var l_name = frndar[0];
	    var l_value = frndar[1];
	    option.setAttribute( "name", l_name );
	    option.setAttribute( "value", l_value );			
	    countOnline++;	
	    l_frndselem.appendChild( option );
        }	
	selectedFriendsCount();	
        rate_unloading_friends();
}
function getFriendsId( a_ids )
{
    rate_loading_friends(); 
    var select = document.getElementById( "frndsgrp" );
    grpid = select.options[select.selectedIndex].value;    
    l_ids = a_ids.split("_");
    id = l_ids[0] + "_" + grpid;
    if( grpid > 1 ) {
	    cityid = 0;
	    if( l_ids.length > 1 ) {
		cityid = l_ids[1];
	    } else {
	        alert( "You don't seem to have set your city. Goto my profile, set your current city and try again!" );
	        l_frndselem = document.getElementById( 'frndslist' );
	        var length = l_frndselem.length;
	   	for(i=length-1; i>=0; i--)
	   	{               
			if(length>0)
			{
			    l_frndselem.options[i] = null;
			}
            	}
	        rate_unloading_friends();
	        return false;
	    }
	    if( cityid > 0 ) {
		id = id + "_" + cityid;   
	    }
    }
    return id;
}
function showChatFriendsList( req ) {   
    var frndstr =  req.responseText;
	if( frndstr.length == 0 ) {
		alert( "No friends are found for your current selection. Please try again with another choice!" );
		rate_unloading_friends();
		return false;
	}
	var frnds = frndstr.split("," );
	tblelem = document.getElementById( 'frndsarea' );               
	
	if( frnds.length == 0 ) {
		alert( "No friends are found for your current selection. Please try again with another choice!" );
		rate_unloading_friends();
		return false;
	}
	for( i = frnds.length - 1; i > -1; i-- ) {
		tblelem.deleteRow( i );
	}	
	for( i = 0; i < frnds.length; i++ )
	{
		frndar = frnds[i].split( "~~" );
		var l_tr = tblelem.insertRow( -1 );
		var l_td  = l_tr.insertCell( 0 );
		
		if( frndar[2] == 1 && frndar[0].length > 0 ) {
			l_td.setAttribute( "style", "font-size:9pt;font-family:Arial,Verdana;font-weight:bold" );
			l_td.innerHTML = '<img src="../image/online1.jpg" width="18px" height="18px"/><a href="" onclick="" style="text-decoration:none;color:#363636">' + frndar[0] + '</a>';
		} else if( frndar[0].length > 0 ) {
			l_td.setAttribute( "style", "font-size:9pt;font-family:Arial,Verdana;" );
			l_td.innerHTML = '<img src="../image/offline1.jpg" width="18px" height="18px"/><a href="" onclick="" style="text-decoration:none;color:#363636">' + frndar[0] + '</a>';
		}
	}  
        rate_unloading_friends();
}

function rate_loading_friends() {
    var l_frndsloading = document.getElementById('loading-friends' );
    if( l_frndsloading != null ) {
        document.getElementById('loading-friends' ).style.display = 'inline';
        return;
    }
    var l_frndsloading1 = document.getElementById('loading-friends1' );
    if( l_frndsloading1 != null ) {
        document.getElementById('loading-friends1' ).style.display = 'inline';	
    }
}
function rate_unloading_friends() {
    var l_frndsunloading = document.getElementById('loading-friends' );
    if( l_frndsunloading != null ) {
        document.getElementById('loading-friends' ).style.display = 'none';	
        return;
    }
    var l_frndsunloading1 = document.getElementById('loading-friends1' );
    if( l_frndsunloading1 != null ) {
        document.getElementById('loading-friends1' ).style.display = 'none';	
    }
}
function rate_loading_venues() {
    document.getElementById('loading-venues' ).style.display = 'inline';	
}
function rate_unloading_venues() {
	document.getElementById('loading-venues' ).style.display = 'none';	
}

function confirmVenueDeleteAjax() {
	var answer = confirm ("Do you really want to remove the venue from your plan?")
	if (answer) {
	    window.location=url;
	    return true;
	}
	return false;
}

function confirmVenueDelete( url ) {
	var answer = confirm ("Do you really want to remove the venue from this event?")
	if (answer) {
	    window.location=url;
	    return true;
	}
	return false;
}

function confirmItineraryDelete( url ) {
	var answer = confirm ("Do you really want to delete the plan?")
	if (answer) {
	    window.location=url;
	    return true;
	}
	return false;
}

function sendInvites( url ) 
{    
    window.location=url;
    return true;
}

function Trim(a_value)
{
    if(a_value.length < 1)
    {
        return"";
    }
    a_value = RTrim(a_value);
    a_value = LTrim(a_value);
    if(a_value == "")
    {
        return "";
    }else
    {
        return a_value;
    }
} 

function RTrim(a_value)
{
    var w_space = String.fromCharCode(32);
    var v_length = a_value.length;
    var strTemp = "";
    if(v_length < 0)
    {
        return"";
    }
    var iTemp = v_length -1;

    while(iTemp > -1)
    {
        if(a_value.charAt(iTemp) == w_space)
        {
        }else
        {
            strTemp = a_value.substring(0,iTemp +1);
            break;
        }
        iTemp = iTemp-1;
    } 
    return strTemp;
} 

function LTrim(a_value)
{
    var w_space = String.fromCharCode(32);
    if(v_length < 1)
    {
         return"";
    }
    var v_length = a_value.length;
    var strTemp = "";
    var iTemp = 0;

    while(iTemp < v_length)
    {
        if(a_value.charAt(iTemp) == w_space)
        {
        }else
        {
            strTemp = a_value.substring(iTemp,v_length);
            break;
        }
        iTemp = iTemp + 1;
    } 
    return strTemp;
}

function selectedFriendsCount()
{
	if( is_ie ) 
	{
		setTimeout( "selectedFriendsCount()", 200 );
	}
	frndsList = document.forms['form1'].frndslist;
	var existingCount  = document.getElementById( "selectedfrndscount" ).innerHTML;
	var selectedCount = 0;
	var selLength = frndsList.length;
	for(i=0; i < selLength; i++)
    {
        if(frndsList.options[i].selected)
        {
            selectedCount++;
        }
    }
	document.getElementById( "selectedfrndscount" ).innerHTML = selectedCount;
}
function get_cities() {	
    rate_loading_text();
    var select = document.plnform.country;
    a_countryid = select.options[select.selectedIndex].value;    
    var ajax = new Ajax.Updater('city', '../ajax/ddrtrvr.php?country_id=' + a_countryid,{method:'get',asynchronous:true,onComplete: showCities });
}
function showCities( req ) {
    var citystr =  req.responseText;
    var cities = citystr.split("," );
    l_ctyelem = document.getElementById( 'city' );
    
    l_parentelem = l_ctyelem.parentNode;
    var selectf = document.createElement('select');
	selectf.id = 'city';
	selectf.setAttribute( "name", 'city' );
    soption = document.createElement('option');
    soption.appendChild(document.createTextNode( '-- Select --' ));
    selectf.appendChild( soption );    
    for( i = 0; i < cities.length; i++ )
    {
	if( cities[i] == "" ) {
	    continue;
	}
	cnameids = cities[i].split("__");
	soption = document.createElement('option');
	soption.appendChild(document.createTextNode( cnameids[0] ));
	var l_name = cnameids[0];
	var l_value = cnameids[1];
	soption.setAttribute( "name", l_name );
	soption.setAttribute( "value", l_value );
	selectf.appendChild(soption);
    }
    l_parentelem.replaceChild( selectf, l_ctyelem ); 
    rate_unloading_text();
}
function rate_loading_text() {
    document.getElementById('loading-cities' ).style.display = 'inline';	
}
function rate_unloading_text() {
	document.getElementById('loading-cities' ).style.display = 'none';	
}
function getCityCenters()
{
	var country_select 	= document.plnform.country;
	var city_select 	= document.plnform.city;
	var venue_select 	= document.plnform.venue;
	
	country_id 	= country_select.options[country_select.selectedIndex].value;
	city_id 	= city_select.options[city_select.selectedIndex].value;
	venue_id	= venue_select.options[venue_select.selectedIndex].value;	
	if( city_id == -1 || venue_id == -1 ) {
		alert( "Select from drop-down Cities and Venues to get the search result." );
		return false;
	}
	var ajax = new Ajax.Updater('venues', '../ajax/ddrtrvr.php?country_id=' + a_countryid + '&city_id=' + city_id + '&venue_id=' + venue_id,{method:'get',asynchronous:true,onComplete: showVenues });
}

function showVenues( req )
{
	var venuestr = req.responseText;
	var venues = venuestr.split("___|___" );
	tblelem = document.getElementById( "ctycenterstbl" );
	for( var i = 0; i < venues.length; i++ ) { 
	    var l_tr = tblelem.insertRow( -1 );
		var l_td  = l_tr.insertCell( 0 );
		l_td.setAttribute( "style", "border:1px groove #ccc;" );
		var strs = venues[i].split( "___" );
		var l_displayContent = "";
		for( var j = 0; j < strs.length; j++ ) {
			var tokens = strs[j].split( "::" );
			if( tokens[0] == 'wfs_name' ) {
				l_displayContent += '<span style="font-family:arial, verdana;color:#333399;font-size:14pt;">'+ tokens[1] + '</span><br/>';
			} else if( tokens[0] != 'wfs_id' ) {
				if( tokens[0] == 'wfs_address' ) {
					l_displayContent += '<span style="font-family: arial, helvetica, sans-serif; font-size: 9pt; color: #363636">Address: ';
				} else if( tokens[0] == 'wfs_phone' ) {
					l_displayContent += '<span style="font-family: arial, helvetica, sans-serif; font-size: 9pt; color: #363636">Phone: ';
				}
				l_displayContent += tokens[1] + '</span><br/>';
				
			}
		}
		l_displayContent += "<br/>" + '<span style="font-size:10pt;font-family:arial, verdana"><img src="../image/basket.jpeg" width="25" height="25" /><a href="" style="color:purple;text-decoration:none">Include in your Chat</a></span>';
		l_td.innerHTML = l_displayContent;
	}
}
function displayInviteeInfo( a_mid ) {
	rate_loading_friends();
	tblelem = document.getElementById( "inviteestbl" );
	tblRowsLength = tblelem.rows.length;
	if( tblRowsLength > 0 ) {
		for( var i = tblRowsLength - 1; i > -1; i-- ) {
			tblelem.deleteRow( i );
		}
		rate_unloading_friends();
		return false;
	}
	var ajax = new Ajax.Updater('displayInvitees', '../ajax/ddrtrvr.php?displayInviteeMid=' + a_mid,{method:'get',asynchronous:true,onComplete: displayInvitees });
}

function displayInvitees( req )
{
	inviteestr = req.responseText;
	var invitees = inviteestr.split("___|___" );
	tblelem = document.getElementById( "inviteestbl" );
	for( var i = 0; i < invitees.length; i++ ) { 
	    var l_tr = tblelem.insertRow( -1 );
		var l_td  = l_tr.insertCell( 0 );
		l_td.setAttribute( "style", "border:1px groove #ccc;" );
		l_td.setAttribute( "valign", "top" );
		var strs = invitees[i].split( "___" );
		var l_displayContent = "";
		var fullname="";
		var picture = "";
		var phone = "";
		var address = "";
		for( var j = 0; j < strs.length; j++ ) {
			var tokens = strs[j].split( "::" );
			if( tokens[0] == 'fname' || tokens[0] == 'lname' ) {
				if( tokens.length > 1 ) {
					if( fullname != "" ) {
						fullname += " ";
					}
					fullname += tokens[1];
				}
			} else if( tokens[0] != 'user_id' ) {
				if( tokens[0] == 'addr' && tokens.length > 1  ) {
					address = tokens[1];				
				} else if( tokens[0] == 'phon' ||  tokens[0] == 'mobi' ) {
					if( tokens.length > 1 ) {
						if( phone != "" ) {
							phone += ", ";
						}
						phone += tokens[1];
					}
				} else if( tokens[0] == 'pict' && tokens.length > 1 ) {
					picture = tokens[1];
				}
			}
		}
		if( picture == "" ) {
			l_displayContent += '<img style="float:left" src="../image/user2.jpg"/>';
		} else {
			l_displayContent += '<img style="float:left" src="' + picture + '"/>';
		}
		l_displayContent += '<span style="padding-left:10px;font-size:14pt;font-family:bold;font-family:Arial">' + fullname + '</span>';
		if( address != "" ) {
			l_displayContent += '<br/><span style="padding-left:10px;font-size:10pt;font-family:bold;font-family:Arial">Address: ' + address +'</span>';
		}
		if( phone != "" ) {
			l_displayContent += '<br/><span style="padding-left:10px;font-size:10pt;font-family:bold;font-family:Arial">Phone: ' + phone +'</span>';
		}
		l_td.innerHTML = l_displayContent;
	}
	rate_unloading_friends();
}
function getMyVenue() {
	rate_loading_venues(); 
	var select = document.getElementById( "myvenues" );
    wfsid = select.options[select.selectedIndex].value;   
       $.ajax({
   	    url: "../ajax/ddrtrvr.php",
   	    cache: false,
   	    type:"GET",
   	    dataType: "html",
   	    data:({ wfs_id:wfsid }),
   	    success: function( html ) {				
   		showMyVenue( html );				   		
   		rate_unloading_venues();
   	    }
    });
    
}

function showMyVenue( html ) {
	venuestr = html;
	venuear = venuestr.split( "~~" );
	var namelem = document.getElementById( "wfs_name_id" );
	namelem.setAttribute( "value", venuear[0] );
	var addrelem = document.getElementById( "wfs_address_id" );
	if( venuear.length > 1 ) {		
		addrelem.setAttribute( "value", venuear[1] );
	} else {
		addrelem.setAttribute( "value", "" );
	}
	var phoneelem = document.getElementById( "wfs_phone_id" );
	if( venuear.length > 2 ) {		
		phoneelem.setAttribute( "value", venuear[2] );
	} else {
		phoneelem.setAttribute( "value", "" );
	}
}

function addInviteeElements() {
	invelem = document.getElementById( "invelemsid" );
	var l_length = invelem.childNodes.length;
	if( l_length == 0 ) {
	    l_length = 1;
	}

	var input = document.createElement( 'input' );
	input.type = 'text';
	input.id = 'invnameid' + l_length;
	input.value = '--- name ---';
	input.setAttribute( 'name', 'inv_name_' + l_length );
	input.setAttribute( 'class', 'small' );
	input.setAttribute( 'size', '14' );
	input.setAttribute( 'maxlength', '25' );
	input.setAttribute( 'style', 'margin-top:4px' );
	addEvent( input, "click", clearInvTextField );
	addEvent( input, "focus", clearInvTextField );	
	invelem.appendChild( input );

	var input = document.createElement( 'input' );
	input.type = 'text';
	input.id = 'invmobileid' + l_length;
	input.value = '--- mobile number ---';
	input.setAttribute( 'name', 'inv_mobile_' + l_length );
	input.setAttribute( 'class', 'small' );
	input.setAttribute( 'size', '20' );
	input.setAttribute( 'maxlength', '10' );
	input.setAttribute( 'style', 'margin-left:3px' );
	addEvent( input, "click", clearInvTextField );	
	addEvent( input, "focus", clearInvTextField );
	invelem.appendChild( input );

	var input = document.createElement( 'input' );
	input.type = 'text';
	input.id = 'invemailid' + l_length;
	input.value = '--- email address ---';
	input.setAttribute( 'name', 'inv_email_' + l_length );
	input.setAttribute( 'class', 'small' );
	input.setAttribute( 'size', '30' );
	input.setAttribute( 'maxlength', '50' );
	input.setAttribute( 'style', 'margin-left:3px' );
	addEvent( input, "click", clearInvTextField );	
	addEvent( input, "focus", clearInvTextField );
	invelem.appendChild( input );
	var br = document.createElement( 'br' );
	invelem.appendChild( br );
	
	invitelem = document.getElementById( "sendinvitid" );
	if( invitelem.style.display == 'none' ) {
	    invitelem.style.display = 'block';
	}
	
}

function delInviteeElements() {
	invelem = document.getElementById( "invelemsid" );
	var l_length = invelem.childNodes.length;
	if( l_length == 0 ) {
		return false;
	}
	brelem = invelem.childNodes[ l_length - 1 ];	
	invelem.removeChild( brelem );
	txtelem = invelem.childNodes[ l_length - 2 ];	
	invelem.removeChild( txtelem );
	nmelem = invelem.childNodes[ l_length - 3 ];	
	invelem.removeChild( nmelem );
	nmelem = invelem.childNodes[ l_length - 4 ];	
	invelem.removeChild( nmelem );
	l_length = invelem.childNodes.length;
	if( l_length < 4 ) {
	    invitelem = document.getElementById( "sendinvitid" );
    	    invitelem.style.display = 'none';
	}
}

function clearInvTextField() {
    l_element = null;
    if (document.addEventListener) {
      l_element = this;
    }
    else if (document.attachEvent) {
      l_element = event.srcElement;
    }
    var l_value = document.getElementById( l_element.id ).value;
    if( l_value.indexOf( "-" ) != -1 ) {
        document.getElementById( l_element.id ).value = "";
    }
}


function MakeAsFinalVenue( a_ids ) {
    rate_loading_template_decision(); 
    var ajax = new Ajax.Updater('', '../ajax/ddrtrvr.php?ipmfvids=' + a_ids,{method:'get',asynchronous:true,onComplete: ChangeVenueStyle });
    rate_unloading_template_decision();
}

function ChangeVenueStyle( req ) {
    ipmid = req.responseText;
    divid = "ipm_" + ipmid;
    var elem = document.getElementById( divid );
    elem.style.background = "#ff9";
    elem = document.getElementById( "ipmfnlid" );
    l_ipmid =  elem.value;
    elem.value = ipmid;
    elem = document.getElementById( "ipm_" + l_ipmid );
    elem.style.background = "#fff";
}

function rate_loading_template_decision() {
    document.getElementById('loading-decisions' ).style.display = 'inline';	
}
function rate_unloading_template_decision() {
	document.getElementById('loading-decisions' ).style.display = 'none';	
}


var divcount = 0;
function changeJoineeStatus( a_divcount, a_status, a_ids ) {
	rate_loading_template_objects(); 
	divcount = a_divcount;
    	var ajax = new Ajax.Updater('', '../ajax/ddrtrvr.php?jstatus=' + a_status + '&invids=' + a_ids,{method:'get',asynchronous:true,onComplete: UpdateJoineeStatusMessage });
    	rate_unloading_template_objects();
}
function UpdateJoineeStatusMessage( req ) {   
    var l_msg = req.responseText;
    var l_msgelem = document.getElementById( "joinee_msg_id" + divcount );
    l_msgelem.style.display = 'none';
    var l_statuselem = document.getElementById( "joinee_status_id" );
    l_statuselem.innerHTML = l_msg;
    l_statuselem.style.display = 'block';	
}

function rate_loading_template_objects() {
    document.getElementById('loading-objects' ).style.display = 'inline';	
}
function rate_unloading_template_objects() {
	document.getElementById('loading-objects' ).style.display = 'none';	
}

