﻿// JScript File

function deleteMemberPhoto(id)
{
    url = "ajaxRequestPage.aspx?req=DeleteMemberPhoto&id=" + id;   
    alert(url); 
    xmlhttp = getXMLHttpObject();   
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window  
                             alert("Image deleted successfully"+xmlhttp.responseText+"\n"+ xmlhttp.statusText);
                            
                            window.location = window.location;
                            
                            location.href = location.href;            
                        }
                        else
                        {
                            alert("Counld not process request"+xmlhttp.responseText);
                            window.location = window.location;
                            
                            location.href = location.href;  
                        }
                    }
                  else
                    alert("Problem deleting image:" + xmlhttp.statusText);
                  }
            };
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}

//To remove member friend
function deleteMemberFriend(id)
{
    url = "ajaxRequestPage.aspx?req=DeleteFriend&id=" + id; 
    
    xmlhttp = getXMLHttpObject();   
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window  
                            alert("Friend removed Successfully");
                            window.location = window.location;
                            location.href = location.href;            
                        }
                    }
                  else
                    alert("Problem deleting friend:" + xmlhttp.statusText);
                  }
            };
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}
    
function setPrimaryMemberPhoto(mid, id)
{
    url = "ajaxRequestPage.aspx?req=SetPrimaryMemberPhoto&mid="+mid+"&id=" + id;  
    //location.href = url;
    xmlhttp = getXMLHttpObject();   
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {   
                
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"   
                    
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window  
                           alert("Your primary picture has been changed");
                            window.location = window.location;
                            location.href = location.href;            
                        }
                         else
                            alert("Problem performing request");
                        
                    }
                  else
                    alert("Problem performing request:" + xmlhttp.statusText);
                  }
            };
            xmlhttp.open("GET",url,true);
            xmlhttp.send(null);
            }
    else
        alert("Your browser does not support XMLHTTP.");   
}

function commentAction(id, action)
{
   url = "ajaxRequestPage.aspx?req="+action+"&id=" + id; 
 
    xmlhttp = getXMLHttpObject();   
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window 
                             if(action == "ApproveComment") alert ("Comment approved!");
                            if(action == "DeleteComment") alert ("Comment deleted!");
                            if(action == "RejectComment") alert ("Comment rejected!"); 
                                                                                   
                            window.location = window.location;
                           
                            location.href = location.href;            
                        }
                    }
                  else
                    alert("Problem executing action:" + xmlhttp.statusText);
                  }
            };
            xmlhttp.open("GET",url,true);
            xmlhttp.send(null);
            }
    else
        alert("Your browser does not support XMLHTTP.");   
}

//Photo comment actions
function deletePhotoComment(id)
{
    url = "ajaxRequestPage.aspx?req=DeletePhotoComment&id=" + id;   
    xmlhttp = getXMLHttpObject();   
    //location.href=url;
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window 
                           alert("Photo comment deleted successfully");
                            window.location = window.location;
                            location.href = location.href;            
                        }
                    }
                  else
                    alert("Problem executing action:" + xmlhttp.statusText);
                  }
            };
            xmlhttp.open("GET",url,true);
            xmlhttp.send(null);
            }
    else
        alert("Your browser does not support XMLHTTP.");   
}

//To remove headbanger tour
function deleteHeadbangerTour(id)
{
    url = "ajaxRequestPage.aspx?req=DeleteHeadbangerTour&id=" + id;    
    xmlhttp = getXMLHttpObject();   
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window  
                            alert("Tour removed Successfully");
                            window.location = window.location;
                            location.href = location.href;            
                        }
                    }
                  else
                    alert("Problem deleting tour:" + xmlhttp.statusText);
                  }
            };
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}

//To remove playlist item
function deletePlaylistItem(id)
{
    url = "ajaxRequestPage.aspx?req=DeletePlaylistItem&id=" + id;    
    xmlhttp = getXMLHttpObject();   
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window  
                            alert("Item removed successfully from playlist.");
                            window.location = window.location;
                            location.href = location.href;            
                        }
                    }
                  else
                    alert("Problem removing song:" + xmlhttp.statusText);
                  }
            };
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}

//To add a playlist entry
function addPlaylistItem(id)
{
    url = "ajaxRequestPage.aspx?req=AddPlaylistItem&id=" + id; 
    xmlhttp = getXMLHttpObject();   
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window  
                            alert("Item added successfully to playlist.");
                            window.location = window.location;
                            location.href = location.href;            
                        }
                        else  if(xmlhttp.responseText != "1")
                        {           
                            //Reload Window  
                            alert("Song already exist on your playlist.");
                            window.location = window.location;
                            location.href = location.href;            
                        }
                        else
                        {
                            alert("Error performing request.");
                        }
                    }
                  else
                    alert("Problem adding song:" + xmlhttp.statusText);
                  }
            };
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}
//To add a playlist mp3 
function addPlaylistMP3(id)
{
    url = "ajaxRequestPage.aspx?req=AddPlaylistMP3&id=" + id;
    //location.href = url;
    xmlhttp = getXMLHttpObject();   
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window  
                            alert("Item added successfully to playlist.");                                     
                        }
                        else
                        {
                            alert("Error performing request.");
                        }
                    }
                  else
                    alert("Problem adding song:" + xmlhttp.statusText);
                  }
            };
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}


//To delete band member
function deleteBandMember(id)
{
    url = "ajaxRequestPage.aspx?req=DeleteBandMember&id=" + id; 
    alert(url);
    xmlhttp = getXMLHttpObject();   
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window  
                            alert("Band member removed successfully.");
                            window.location = window.location;
                            location.href = location.href;            
                        }
                    }
                  else
                    alert("Problem removing band member." + xmlhttp.statusText);
                  }
            };
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}



//To delete band member
function deleteMemberMP3(id)
{
    url = "ajaxRequestPage.aspx?req=DeleteMemberMP3&id=" + id; 
    xmlhttp = getXMLHttpObject();   
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window  
                            alert("Song was removed successfully.");
                            alert("");
                            window.location = window.location;
                            location.href = location.href;            
                        }
                        else
                        {
                        alert("Error deleting song.");
                        }
                    }
                  else
                    alert("Problem removing song: " + xmlhttp.statusText);
                  }
            };
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}



//To delete band member
function adminDeleteMP3(id)
{

    url = "../ajaxRequestPage.aspx?req=adminDeleteMemberMP3&id=" + id; 
    
    xmlhttp = getXMLHttpObject();   
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window  
                            alert("Song was removed successfully.");
                     
                            window.location = window.location;
                            location.href = location.href;            
                        }
                        else
                        {
                        alert("Error deleting song.");
                        }
                    }
                  else
                    alert("Problem removing song: " + xmlhttp.statusText);
                  }
            };
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}

//To delete album Mp3
function deleteAlbumMP3(id)
{
    url = "../ajaxRequestPage.aspx?req=DeleteAlbumMP3&id=" + id; 
    xmlhttp = getXMLHttpObject();   
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window  
                            alert("Song was removed successfully.");
                         
                            window.location = window.location;
                            location.href = location.href;            
                        }
                        else
                        {
                        alert("Error deleting song.");
                        }
                    }
                  else
                    alert("Problem removing song: " + xmlhttp.statusText);
                  }
            };
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}

//To add tour to wishlist
function addTourToWishlist(a,id)
{
    url = "ajaxRequestPage.aspx?req=AddTourToWishlist&id=" + id; 
    
    xmlhttp = getXMLHttpObject();   
    //location.href=url;
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window  
                            alert("Tour added successfully.");
                            a.style.display="none";
                            a.nextSibling.style.display='';
                        }
                        else
                        {
                            alert("Could not add tour.");
                        }
                    }
                  else
                    alert("Problem adding tour: " + xmlhttp.statusText);
                  }
            };
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}


//To delete
function deleteBandTour(id)
{
    url = "ajaxRequestPage.aspx?req=DeleteBandTour&id=" + id; 
    xmlhttp = getXMLHttpObject();   
    //location.href=url;
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window  
                            alert("Tour deleted successfully.");
                                  
                        }
                        else
                        {
                            alert("Could not delete tour.");
                        }
                    }
                  else
                    alert("Problem deleting tour: " + xmlhttp.statusText);
                  }
            };
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}



//To delete
function deleteFromWishList(ab,id)
{
    url = "ajaxRequestPage.aspx?req=deleteFromWishList&id=" + id; 
    xmlhttp = getXMLHttpObject();   
    //location.href=url;
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window  
                            alert("Tour deleted from wishlist successfully.");
                             $j(ab).parents(".wishTd").remove();
                                  
                        }
                        else
                        {
                            alert("Could not delete tour.");
                        }
                    }
                  else
                    alert("Problem deleting tour: " + xmlhttp.statusText);
                  }
            };
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
       
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}


//To delete band member
function deleteInactiveBandMember(id)
{
    url = "../ajaxRequestPage.aspx?req=deleteInactiveBandMember&id=" + id; 

    xmlhttp = getXMLHttpObject();   
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window  
                            alert("Band member removed successfully.");
                            window.location = window.location;
                            location.href = location.href;            
                        }
                    }
                  else
                    alert("Problem removing band member." + xmlhttp.statusText);
                  }
            };
            
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}
//To delete band member
function deleteDiscography(id)
{
    url = "ajaxRequestPage.aspx?req=deleteDiscography&id=" + id; 
    
    xmlhttp = getXMLHttpObject();   
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window  
                            alert("Discography removed successfully.");
                            window.location = window.location;
                            location.href = location.href;            
                        }
                    }
                  else
                    alert("Problem removing Discography." + xmlhttp.statusText);
                  }
            };
            
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}

//To delete band member
function deleteDiscographyAdmin(id)
{
    url = "../ajaxRequestPage.aspx?req=deleteDiscography&id=" + id; 
    
    xmlhttp = getXMLHttpObject();   
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window  
                            alert("Discography removed successfully.");
                            window.location = window.location;
                            location.href = location.href;            
                        }
                    }
                  else
                    alert("Problem removing Discography." + xmlhttp.statusText);
                  }
            };
            
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}

function DeleteProfilePhoto(id)
{
    url = "ajaxRequestPage.aspx?req=DeleteProfilePhoto&id=" + id;    
    xmlhttp = getXMLHttpObject();   
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window  
                             alert("Image deleted successfully");
                            
                            window.location = window.location;
                            
                            location.href = location.href;            
                        }
                        else
                        {
                            alert("Counld not process request");
                            window.location = window.location;
                            
                            location.href = location.href;  
                        }
                    }
                  else
                    alert("Problem deleting image:" + xmlhttp.statusText);
                  }
            };
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}

function deleteTracks(id)
{
    url = "ajaxRequestPage.aspx?req=DeleteTrack&id=" + id;  
    
    xmlhttp = getXMLHttpObject();   
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window  
                             alert("Track deleted successfully");
                            
                            window.location = window.location;
                            
                            location.href = location.href;            
                        }
                        else
                        {
                            alert("Counld not process request");
                            window.location = window.location;
                            
                            location.href = location.href;  
                        }
                    }
                  else
                    alert("Problem deleting image:" + xmlhttp.statusText);
                  }
            };
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}

function deleteTracksAdmin(id)
{
    url = "../ajaxRequestPage.aspx?req=DeleteTrack&id=" + id;  
  
    xmlhttp = getXMLHttpObject();   
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window  
                             alert("Track deleted successfully");
                            
                            window.location = window.location;
                            
                            location.href = location.href;            
                        }
                        else
                        {
                            alert("Counld not process request");
                            window.location = window.location;
                            
                            location.href = location.href;  
                        }
                    }
                  else
                    alert("Problem deleting image:" + xmlhttp.statusText);
                  }
            };
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}
function deleteVideo(id)
{
    url = "ajaxRequestPage.aspx?req=deleteVideo&id=" + id;  
 
    xmlhttp = getXMLHttpObject();   
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window  
                             alert("Video deleted successfully");
                           
                           
                            window.location = window.location;
                            
                            location.href = location.href; 
                                       
                        }
                        else
                        {
                            alert("Counld not process request");
                            window.location = window.location;
                            
                            location.href = location.href;  
                        }
                    }
                  else
                    alert("Problem deleting Video:" + xmlhttp.statusText);
                  }
            };
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}


function deleteBlog(ab,id)
{
    url = "ajaxRequestPage.aspx?req=deleteBlog&id=" + id;  
  
    xmlhttp = getXMLHttpObject();   
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window  
                             alert("Blog deleted successfully");
                            $j(ab).parents(".wishTd1").remove();
                           
                            window.location = window.location;
                            
                            location.href = location.href; 
                                       
                        }
                        else
                        {
                            alert("Counld not process request");
                            window.location = window.location;
                            
                            location.href = location.href;  
                        }
                    }
                  else
                    alert("Problem deleting Blog:" + xmlhttp.statusText);
                  }
            };
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}



function addPlaylistItem1(id)
{ 
    url = "../ajaxRequestPage.aspx?req=AddPlaylistItem1&id=" + id; 
    alert(url);
    xmlhttp = getXMLHttpObject();   
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText == "1")
                        {           
                            //Reload Window  
                            alert("Item added successfully to playlist.");
                            window.location = window.location;
                            location.href = location.href;            
                        }
                        else  if(xmlhttp.responseText == "0")
                        {           
                            //Reload Window  
                            alert("Song already exist on your playlist.");
                            window.location = window.location;
                            location.href = location.href;            
                        }
                        else  if(xmlhttp.responseText == "2")
                        {           
                            //Reload Window  
                            alert("Number of songs Exceed in Playlist.");
                            window.location = window.location;
                            location.href = location.href;            
                        }
                     
                        
                        else
                        {
                            alert("Error performing request.");
                        }
                    }
                  else
                    alert("Problem adding song:" + xmlhttp.statusText);
                  }
            };
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}

/////////////////For generating tourEvent DIV///////////////////








function insertTour(tourTitle, band, appWith, description, divTourEvent)
{
tourTitle=document.getElementById(tourTitle).value;
band=document.getElementById(band).value;
appWith=document.getElementById(appWith).value;
description=document.getElementById(description).value;
divTourEvent=document.getElementById(divTourEvent);

    url = "../ajaxRequestPage.aspx?req=insertTour&tourTitle=" + tourTitle + "&band=" + band +"&appWith=" + appWith +"&description="+description; 
   alert(url);
    xmlhttp = getXMLHttpObject();   
    //location.href=url;
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {  
                         alert(xmlhttp.responseText);
                         
                                  
                        }
                        else
                        {
                            alert("Could not open DIV.");
                        }
                    }
                  else
                    alert("Problem Opening DIV: test" + xmlhttp.statusText);
                  }
            };
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
      
        }
    else
    alert("Your browser does not support XMLHTTP.");   
}

function showDiv(divTourEvent)
{
alert("got inside div");
//document.getElementById(<%=divTourEvent%>).style.display='block';
}


function homeCommentAction(id, action)
{
   url = "ajaxRequestPage.aspx?homeReq="+action+"&id=" + id; 

    xmlhttp = getXMLHttpObject();   
    if (xmlhttp!=null)
        {
        xmlhttp.onreadystatechange=function state_Change()
            {        
            if (xmlhttp.readyState==4)
                {// 4 = "loaded"
                if (xmlhttp.status==200)
                    {// 200 = "OK"            
                        if(xmlhttp.responseText != "0")
                        {           
                            //Reload Window 
                             if(action == "ApproveComment") alert ("Comment approved!");
                            if(action == "DeleteComment") alert ("Comment deleted!");
                            if(action == "RejectComment") alert ("Comment rejected!"); 
                                                                                   
                            window.location = window.location;
                           
                            location.href = location.href;            
                        }
                    }
                  else
                    alert("Problem executing action:" + xmlhttp.statusText);
                  }
            };
            xmlhttp.open("GET",url,true);
            xmlhttp.send(null);
            }
    else
        alert("Your browser does not support XMLHTTP.");   
}


