/* 
 * this file contains functions for the index folder
 */
 
function index_showFaceBookLikeBtn(div_fb_btn,share_url)
 {
  //alert("i have been called");
  //   alert(div_fb_btn);
    var url="http://www.facebook.com/plugins/like.php?"+
        "href="+share_url+"&&"+
        "layout=standard&&"+
        "show_faces=true&&"+
        "action=recommend&&"+
        "font=trebuchet+ms+&&"+
        "colorscheme=light";
      //url
    $.ajax({
  url: url,
  dataType: 'json',  
   success: function(html)
                    { //so, if data is retrieved, store it in html
                   alert(html);
                    }
});


 }//showComments()


//this function helps to show the facebook like button
       function index_showFaceBookLikeBtn_(div_fb_btn,share_url)
 {
      //   alert(div_fb_btn);
    /* var url="http://www.facebook.com/plugins/like.php?"+
        "href="+share_url+"&&"+
        "layout=standard&&"+
        "show_faces=true&&"+
        "action=recommend&&"+
        "font=trebuchet+ms+&&"+
        "colorscheme=light";*/
               var action_file_path = "view_tour/index.php";
               var actioncmd = "?view_tour_list_request=1";
               var url = action_file_path+actioncmd;
               url=url+"&sid="+Math.random();
        
        //get the content to display using ajax
                $.ajax({
                    method: "get",url:url,data: "page",
                    beforeSend: function()
                    {
                      
                    }, //show loading just when link is clicked
                    complete: function()
                    {
                   
                    }, //stop showing loading when the process is complete
                    success: function(html)
                    { //so, if data is retrieved, store it in html
                    $("#"+div_fb_btn).show("slow"); //animation
                    $("#"+div_fb_btn).html(html); //show the html inside .content div
                    }
         }); //close $.ajax()     

 }//index_showFaceBookLikeBtn()


 //this function helps to show the form for getting a message
function index_showLoginForm(input)
{
        var delim =',';
        var btn_login_box_id=getTokenAt(input,0,delim,2);
        var div_login_box_id=getTokenAt(input,1,delim,2);
        
       $(function()
       {
		// a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
		$( "#dialog:ui-dialog" ).dialog( "destroy" );

		$( "#"+div_login_box_id ).dialog({
			autoOpen: false,
			height: 210,
			width: 350,
			modal: true,
                        show :"fade",
                        hide :"fade",
                        draggable: false,
                        resizable:false
		});

		$( "#"+btn_login_box_id )
                .click(function(e)
                {
                        e.preventDefault();
                        $( "#"+div_login_box_id ).dialog( "open" );
                });
	});
}//member_showInviteMembersEmailForm()


