﻿/* Author: Antony Benito(tonybenito@gmail.com) +91 9745003819 */



function TagRemovePBL(pblid,tagmapid,loadhere)
{
    new Ajax.Request('ajax/TAG_remove.aspx?tagmapid='+tagmapid+'', {
  
   onLoading: function x(){
   
                           $(loadhere+'_loading').innerHTML="Please wait..";
                          },
                          
       onComplete: function x(transport){
                              
                            
                              sts=transport.responseText;
                              if(sts!="done")
                              {
                                 
                                 alert(sts)
                                 
                              }
                              else{
                                     AppledTagsLoadPBL(pblid,loadhere)                          
                             
                                  }
                           
                          }
  });
}

function AppledTagsLoadPBL(spid,loadhere)
{
new Ajax.Updater(loadhere, 'ajax/TAGS_appliedtagsPBL.aspx?spid='+spid+'', {
          
          method:'get',
         onLoading: function x(){
                                    $(loadhere+'_loading').innerHTML="Loading...";
                                },
                                  
               onComplete: function x(transport){
                                  
                                  $(loadhere+'_loading').innerHTML="";                                
                                                              
                                
                                     
                                      }
                                   
                                
          });

}

function TagCreateApplyPBL(spid,tagname,loadhere)
{
    new Ajax.Request('ajax/TAG_CreateApply.aspx?spid='+spid+'&tagname='+tagname+'', {
  
   onLoading: function x(){
   
                           $(loadhere+'_loading').innerHTML="Please wait..";
                          },
                          
       onComplete: function x(transport){
                              
                             $(loadhere+'_loading').innerHTML="";
                              sts=transport.responseText;
                              if(sts!="done")
                              {
                                 
                                 alert(sts)
                                 
                              }
                              else{
                                    MyTagsLoadPBL(spid,'BacklogCloud')
                                    AppledTagsLoadPBL(spid,'BacklogAppledTags')                          
                             
                                  }
                           
                          }
  });
}
function TagApplyPBL(pblid,tagid,loadhere)
{
    new Ajax.Request('ajax/TAG_apply.aspx?tagid='+tagid+'&spid='+pblid+'', {
  
   onLoading: function x(){
   
                           $(loadhere+'_loading').innerHTML="Please wait..";
                          },
                          
       onComplete: function x(transport){
                              
                            $(loadhere+'_loading').innerHTML="";
                            
                              sts=transport.responseText;
                              if(sts!="done")
                              {
                                 
                                 alert(sts)
                                 
                              }
                              else{
                                     AppledTagsLoadPBL(pblid,'BacklogAppledTags')                          
                             
                                  }
                           
                          }
  });
}

function MyTagsLoadPBL(pblid,loadhere)
{
new Ajax.Updater(loadhere, 'ajax/TAGS_mytagsloadPBL.aspx?pblid='+pblid+'', {
          
          method:'get',
         onLoading: function x(){
                                    $(loadhere+'_loading').innerHTML="Loading...";
                                },
                                  
               onComplete: function x(transport){
                                  
                                  $(loadhere+'_loading').innerHTML="";                                
                                                              
                                
                                     
                                      }
                                   
                                
          });

}


/*********** Tag sprin ******************/

function LoasSprintTagwise(tag,loadhere)
{
    new Ajax.Updater(loadhere, 'ajax/SPRINT_tagwise.aspx?tags='+tag+'', {
              
              method:'get',
             onLoading: function x(){
                                        $(loadhere+'_loading').innerHTML="<center>Loading...</center>";
                                    },
                                      
                   onComplete: function x(transport){
                                      
                                                $(loadhere+'_loading').innerHTML="";  
                                                
                                             //   $$(".sprintInfoBox").each(function(elmt) {  curv(elmt.id,5)});
                                         
                                          }
                                       
                                    
              });    
}

function loadTagsFilterScreen(uid)
{ 

 new Ajax.Updater('holderRight', 'forms/tagfilter.aspx', {
          
          method:'get',
         onLoading: function x(){
                                    $('holderRight').innerHTML="<div class='taskLoading'>Loading...</div>";
                                },
                                  
               onComplete: function x(transport){
                                  
                                             TagCloud(uid,'tagscloud')
                                     
                                      }
                                   
                                
          });         
          
}

function TagCloud(uid,loadhere)
{
    new Ajax.Updater(loadhere, 'ajax/TAG_cloud.aspx?uid='+uid+'', {
              
              method:'get',
             onLoading: function x(){
                                        $(loadhere).innerHTML="Loading...";
                                    },
                                      
                   onComplete: function x(transport){
                                      
                                                                  
                                                                  
                                    
                                         
                                          }
                                       
                                    
              });
}

function MyTagsLoad(loadhere)
{
new Ajax.Updater(loadhere, 'ajax/TAGS_mytagsload.aspx', {
          
          method:'get',
         onLoading: function x(){
                                    $(loadhere+'_loading').innerHTML="Loading...";
                                },
                                  
               onComplete: function x(transport){
                                  
                                  $(loadhere+'_loading').innerHTML="";                                
                                                              
                                
                                     
                                      }
                                   
                                
          });

}

function TagApply(spid,tagid,loadhere)
{
    new Ajax.Request('ajax/TAG_apply.aspx?tagid='+tagid+'&spid='+spid+'', {
  
   onLoading: function x(){
   
                           $(loadhere+'_loading').innerHTML="Please wait..";
                          },
                          
       onComplete: function x(transport){
                              
                            
                              sts=transport.responseText;
                              if(sts!="done")
                              {
                                 
                                 alert(sts)
                                 
                              }
                              else{
                                     AppledTagsLoad(spid,'sprinttags')                          
                             
                                  }
                           
                          }
  });
}

function AppledTagsLoad(spid,loadhere)
{
new Ajax.Updater(loadhere, 'ajax/TAGS_appliedtags.aspx?spid='+spid+'', {
          
          method:'get',
         onLoading: function x(){
                                    $(loadhere+'_loading').innerHTML="Loading...";
                                },
                                  
               onComplete: function x(transport){
                                  
                                  $(loadhere+'_loading').innerHTML="";                                
                                                              
                                
                                     
                                      }
                                   
                                
          });

}

function TagCreateApply(spid,tagname,loadhere)
{
    new Ajax.Request('ajax/TAG_CreateApply.aspx?spid='+spid+'&tagname='+tagname+'', {
  
   onLoading: function x(){
   
                           $(loadhere+'_loading').innerHTML="Please wait..";
                          },
                          
       onComplete: function x(transport){
                              
                            
                              sts=transport.responseText;
                              if(sts!="done")
                              {
                                 
                                 alert(sts)
                                 
                              }
                              else{
                                     MyTagsLoad('mytags')
                                     AppledTagsLoad(spid,'sprinttags')                          
                             
                                  }
                           
                          }
  });
}

function TagRemove(tagmapid,loadhere)
{
    new Ajax.Request('ajax/TAG_remove.aspx?tagmapid='+tagmapid+'', {
  
   onLoading: function x(){
   
                           $(loadhere+'_loading').innerHTML="Please wait..";
                          },
                          
       onComplete: function x(transport){
                              
                            
                              sts=transport.responseText;
                              if(sts!="done")
                              {
                                 
                                 alert(sts)
                                 
                              }
                              else{
                                     AppledTagsLoad($('sprintselected').value,'sprinttags')                          
                             
                                  }
                           
                          }
  });
}

