﻿// JScript File

<!--

/*
var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the FSCommand messages in a Flash movie.
function menu_DoFSCommand(command, args) {
    var menuObj = isInternetExplorer ? document.all.menu : document.menu;
    //
    // Place your code here.
    //
    if(command=="ShowPage")
    {
        ShowPage(args);
    }
    else if(command=="Rollover")
    {
        document.getElementById("menu").style.zIndex=1000;
    }
    else if(command=="Rollout")
    {
        document.getElementById("menu").style.zIndex=0;
    }

}

// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
    document.write('<script language=\"VBScript\"\>\n');
    document.write('On Error Resume Next\n');
    document.write('Sub menu_FSCommand(ByVal command, ByVal args)\n');
    document.write('	Call menu_DoFSCommand(command, args)\n');
    document.write('End Sub\n');
    document.write('</script\>\n');
}
//-->
*/
var isMozilla;
 isMozilla = (document.all) ? 0 : 1;
function AdjustMenuZIndex(str)
{
    if(str=="Rollover")
    {
        document.getElementById("menu").style.zIndex=1000;
        
        if(!document.all)
        {
            if(document.getElementById("topbanner"))
            {
                document.getElementById("topbanner").style.display="none";
            }
        }
    }
    else if(str=="Rollout")
    {
        document.getElementById("menu").style.zIndex=0;
        
        if(!document.all)
        {
            if(document.getElementById("topbanner"))
            {
                document.getElementById("topbanner").style.display="block";
            }
        }
    }
}

function ShowPage(page)
{
    var currUrl;
    currUrl=String(self.location);
    var arr;
    var seperator = '/';
    arr=currUrl.split(seperator);
    var url;
    //alert(page);
    //Get the URL
    
    switch(page)
    {
//        case "Home":
//            url="HomePage.aspx";
//            break;
//            
//        case "My Home Page":
//            url="MyHomePage.aspx";
//            break;
//                
//        case "Online Registration":
//            url="WebPages/User/OnlineRegistration.aspx";
//            break;
//            
//        case "View Profile":
//        case "Profile Settings":
//            url="WebPages/User/EditProfile.aspx";
//            break;
//        
//        case "Public Profile":
//            var hidDisplayName = document.getElementById('TopFrame1_hidDisplayName');
//            if(hidDisplayName!=null)
//            {
//                url= hidDisplayName.value;
//            }
//            else
//            {
//                url="WebPages/User/PageNotFound.aspx";
//            } 
//            break;
//                
//        case "My Photos":
//            url="WebPages/User/MyPhotos.aspx";
//            break;
//            
//        case "Edit Profile":
//            url="WebPages/User/EditProfile.aspx";
//            break;
//            
//               
//         case "Profile Settings":
//            url="WebPages/User/EditProfile.aspx";
//            break;
//            
//        case "RSS Feeds":
//            url="WebPages/RSSFeedViewer/RSSFeedViewer.aspx";
//            break;
//        
//        case "Coaching & Training Plans":
//            //url="WebPages/TrainingAndCoaching/ViewCoaches.aspx"; 
//            url="WebPages/Coaching/TrainingPlans.aspx"; 
//            break;               
//            
//        case "Forums & Communities":
//           //rl="WebPages/Community/ViewCommunities.aspx"; 
//           url="WebPages/Community/ViewForums.aspx"; 
//            break;
//            
//        case "Athlete Tools":
//        url="WebPages/AthleteTools/AthleteTools.aspx"; 
//        break;
//            
//        case "Pace Calculator":
//        //url="WebPages/AthleteTools/AthleteTools.aspx?calc=1"; 
//        SubmitQueryString("../AthleteTools/AthleteTools.aspx?calc=1");
//        return;
//        break;
//            
//        case "Heart Rate Calculator":
//        //url="WebPages/AthleteTools/AthleteTools.aspx?calc=2"; 
//        SubmitQueryString("../AthleteTools/AthleteTools.aspx?calc=2");
//        return;
//        break;
//            
//        case "Calorie Calculator":
//        //url="WebPages/AthleteTools/AthleteTools.aspx?calc=3"; 
//        SubmitQueryString("../AthleteTools/AthleteTools.aspx?calc=3");
//        return;
//        break;
//            
//        case "Conversion Calculator":
//        //url="WebPages/AthleteTools/AthleteTools.aspx?calc=4"; 
//        SubmitQueryString("../AthleteTools/AthleteTools.aspx?calc=4");
//        return;
//        break;
//        
//        case "Race Time Predictor":
//        SubmitQueryString("../AthleteTools/AthleteTools.aspx?calc=5");
//        return;
//        break;
//           
//        case "Food Diary":
//            url="WebPages/FoodDiary/SearchFoodDiary.aspx";
//            break;
//            
//        case "My Events":
//            url="WebPages/SportsLifeEventsList/EventsList.aspx";
//            break;
//       //Added by archana
//        case "Newsletter":
//            url="WebPages/NewsLetters/ViewNewsLetters.aspx";
//            break;
//            
//        case "Blogs":
//            url="WebPages/Blogs/ViewBlogs.aspx";
//            break;
//            
//        case "Browse Users":
//            url="WebPages/User/UserList.aspx";
//            break;  

//        case "Training Log":
//            url="WebPages/LogBook/LogDetails.aspx";
//            break; 
//            
//        
//        case "Log Settings":
//            setCookie("CookieLogSettings", "LogSettings", 3600);
//            url="WebPages/LogBook/LogDetails.aspx?enc=1";
//            break;  
//            
//        case "Training Routes":
//            url="WebPages/LogBook/SearchTrainingRoutes.aspx";
//            break; 
//        
//        case "Shopping":
//            url="WebPages/Other/Comingsoon.aspx";
//            break;
//            
//        case "Classifieds":
//            url="WebPages/Other/Comingsoon.aspx";
//            break;
//            
//        case "Products":
//            url="WebPages/Other/Comingsoon.aspx";
//            break;
//            
//        case "More":
//            url="WebPages/RSSFeedViewer/RSSFeedViewer.aspx";
//            break;
//        case "Widgets":
//            url="WebPages/Widgets/GetWidget.aspx";
//            break;
//        
//         case "My Goals":
//            url="WebPages/LogBook/MyGoals.aspx";
//            break;



    //menu 1
    
        case "Home":
            url="HomePage.aspx";
            break;      
       
    //menu 2   
            
        case "Workout":
            url="WebPages/LogBook/LogDetails.aspx";
            break; 
            
        case "Workout Log":
            url="WebPages/LogBook/LogDetails.aspx";
            break; 
            
        case "Import/Export":
            url="WebPages/LogBook/GPSDataUpload.aspx";
            break;    
            
        case "Workout Settings":
            setCookie("CookieLogSettings", "LogSettings", 3600);
            url="WebPages/LogBook/LogDetails.aspx?enc=1";
            break;
            
         case "Utilities":
            url="WebPages/LogBook/ShoeDetails.aspx";
            break;
            
             case "Threshold Limit":
            url="WebPages/Coaching/ThresholdLimitDetails.aspx";
            break;
         case "Report":
            url="WebPages/LogBook/LogReports.aspx";
            break;  
            
        case "Routes":
            url="WebPages/LogBook/SearchTrainingRoutes.aspx";
            break;   
            
        case "Athlete Tools":
         url="WebPages/AthleteTools/AthleteTools.aspx?calc=3";
       // SubmitQueryString("WebPages/AthleteTools/AthleteTools.aspx?calc=3"); 
        break;        
        
       case "Goals":
            url="WebPages/LogBook/MyGoals.aspx";
            break;
            
            
       case "Challenges":
            url="WebPages/LogBook/GlobalChallenges.aspx";
            break;
            
    //menu 3
        case "Training Plans":
//        "Training":
            //url="WebPages/TrainingAndCoaching/ViewCoaches.aspx"; 
            url="WebPages/Coaching/TrainingPlans.aspx"; 
            break;
        
        case "Training Plans":
            //url="WebPages/TrainingAndCoaching/ViewCoaches.aspx"; 
            url="WebPages/Coaching/TrainingPlans.aspx"; 
            break;
            
         case "My Training Plans":
             url="WebPages/Coaching/PlanDetails.aspx"; 
            break;    
            
         case "Coach":
            url="WebPages/Coaching/FindCoach.aspx"; 
            break;
            
           case "Event Setup & Registration":
            url="WebPages/EventCalendar/EventList.aspx";
            break;    
            
       case "My Coach":
            url="WebPages/Coaching/MyTrainingCoaches.aspx"; 
            break;
            
    //menu 4  EventList.aspx
         
           case "Events":
            url="WebPages/EventCalendar/EventList.aspx";
            break;  
            
            case "Global Events":
            url="WebPages/EventCalendar/EventCalendar.aspx";
            break;
            
            case "My Events":
            url="WebPages/SportsLifeEventsList/EventsList.aspx";
            break;
            
            case "Bucket List":
            //url="WebPages/SportsLifeEventsList/EventsList.aspx";
            url="WebPages/LifeEventList/LifeEventListTrial.aspx";
            break;
    //menu 5    
           case "My Stuff":
            url="MyHomePage.aspx";
            break;  
            
           case "My Home Page":
            url="MyHomePage.aspx";
            break;
            
            
             case "My Profile":
            var hidDisplayName = document.getElementById('TopFrame1_hidDisplayName');
            //alert("hidDisplayName= " + hidDisplayName);
            if(hidDisplayName!=null)
            {
            //alert("hidDisplayName.value = " + hidDisplayName.value);
                url= hidDisplayName.value;
            }
            else
            {
                url="WebPages/User/PageNotFound.aspx";
            } 
            break;
            
              case "My Photos":
            url="WebPages/User/MyPhotos.aspx";
            break;
            
              case "My Achievements":
            url="WebPages/LogBook/MyAchievement.aspx";
            break;
            
            
            case "Browse Users":
            url="WebPages/User/UserList.aspx";
            break;
            
             case "My Friends":
            url="WebPages/User/FriendRequest.aspx";
            break;
            
            
            case "User Management":
            url="WebPages/User/UserManagement.aspx";
            break;
            
           
            
             case "Settings":
            url="WebPages/User/EditProfile.aspx";
            break;
           
     //menu 6  
            case "Social Network":
            url="WebPages/Blogs/BlogHomePage.aspx";
            break; 
       
        case "Community":
            url="WebPages/Blogs/ViewBlogs.aspx";
            break; 
            
         case "Blogs":
            url="WebPages/Blogs/BlogHomePage.aspx";
            break; 
       
        case "Forums":
            url="WebPages/Community/ViewForums.aspx"; 
            break;
            
         case "Communities":
            url="WebPages/Community/ViewCommunities.aspx"; 
            break;    
            
            
      //meun 7    
      case "Extra":
            url="WebPages/Widgets/GetWidget.aspx";
            break;
      
       case "Widgets and Badges":
            url="WebPages/Widgets/GetWidget.aspx";
            break;  
       
        case "Newsletter":
            url="WebPages/NewsLetters/ViewNewsLetters.aspx";
            break;
            
        case "Glossary":
            url="WebPages/Coaching/GlossaryDetails.aspx";
            break;    
            
       case "Online Registration":
            url="WebPages/User/OnlineRegistration.aspx";
            break;     
            
         
        default:
            return;
        
        
            
    }
    
    self.location="../../"+url;
    
    
    //if(arr[arr.length-1]=="Default.aspx" || arr[arr.length-1]==""||arr[arr.length-1]=="Default.aspx#" || arr[arr.length-1]=="#")
    //{
    //    self.location=url;
    //}
    //else
    //{
    //    self.location="../../"+url;
    //}
}
        
//        function BeginRequestHandler(sender, args) 
//        {
//           alert("Started the request");
//        }
//        
function CollapseMenus()
{
    if(document.getElementById("menu")!=null)
    {
        //document.getElementById("menu").SetVariable("outsideclick", "pageclick");
        document.menu.SetVariable("outsideclick", "pageclick");
    }
}



function ShowMenus()
{    

    //This is a workaround for the Flash external interface call for SWF included in Form element
//    window.menu = document.getElementById('menu');
//    
//    var Path = self.location.href;
//    var PageName = Path.substring(Path.lastIndexOf("/")+1 ,Path.length);
//    
//    //alert(document.getElementById("menu"));
//    //document.getElementById("menu").src="images/home page/menu.swf";
// 
//    // checkFlashPlayer();
//    
//    if(document.getElementById("PageFooter_hUserId").value!="")
//    {
//        checkSessionTimeout();
//        if(document.getElementById("PageFooter_hidUserRole").value == 2 ||document.getElementById("PageFooter_hidUserRole").value == 1 ) 
//        {   
//             if(document.getElementById("TopFrame1_divCoachLink") != null)
//             {
//                document.getElementById("TopFrame1_divCoachLink").style.visibility = 'visible';
//             }
//             if(document.getElementById("TopFrame1_divCoachBar")!=null)
//             {
//                document.getElementById("TopFrame1_divCoachBar").style.visibility = 'visible';
//             }
//        }
//        else
//        {
//              if(document.getElementById("TopFrame1_divCoachLink") != null)
//              {   
//                 document.getElementById("TopFrame1_divCoachLink").style.display = 'none';
//              }
//             if(document.getElementById("TopFrame1_divCoachBar")!=null)
//             {
//                 document.getElementById("TopFrame1_divCoachBar").style.display = 'none';
//             }
//        }
//        document.getElementById("TopFrame1_pnlLogin").style.display = 'none';
//        document.getElementById("TopFrame1_pnlAfterLogin").style.display = 'block';
//        document.getElementById("diveditFBProfile").style.display='none';
//        document.getElementById("TopFrame1_lblLoginName").innerHTML = document.getElementById("PageFooter_hUserName").value;
//    }
//    else
//    {  
//       if((document.getElementById("PageFooter_hFBUserName").value!="")&&(PageName.indexOf("AddProfile.aspx") >=0))
//       {
//           document.getElementById("TopFrame1_pnlAfterLogin").style.display = 'block';
//           document.getElementById("TopFrame1_pnlLogin").style.display = 'none';
//           
//           document.getElementById("diveditFBProfile").style.display='none';
//           
//           /*if (PageName.indexOf("AddProfile.aspx") >=0)
//           {
//               document.getElementById("diveditFBProfile").style.display='none';
//           }
//           else
//           {
//               document.getElementById("diveditFBProfile").style.display='block';
//           }*/
//           
//           if(document.getElementById("TopFrame1_divCoachLink") != null)
//           {
//              document.getElementById("TopFrame1_divCoachLink").style.display = 'none';
//              document.getElementById("TopFrame1_divCoachBar").style.display = 'none';
//           }
//           document.getElementById("TopFrame1_lblLoginName").innerHTML = document.getElementById("PageFooter_hFBUserName").value ;
//       }
//       else
//       {
//            document.getElementById("TopFrame1_pnlAfterLogin").style.display = 'none';
//            document.getElementById("TopFrame1_pnlLogin").style.display = 'block';
//            document.getElementById("diveditFBProfile").style.display='none';
//       }
//    }
//    
//    if (PageName.indexOf("AddProfile.aspx")< 0)
//    { 
//       document.getElementById("tdmenu").style.height="31px";
//       //alert(document.getElementById("tdmenu").style.height);
//       document.getElementById("menucontainer").style.display="block";
//       if(document.getElementById("TopFrame1_divMyMessages")!=null)
//       {
//           document.getElementById("TopFrame1_divMyMessages").style.visibility='visible';
//           document.getElementById("TopFrame1_divMyMessagesBar").style.visibility='visible';
//           document.getElementById("TopFrame1_divInstantMessage").style.visibility='visible';
//           document.getElementById("TopFrame1_divInstantMessageBar").style.visibility='visible';
//       }
//        //Check the browser type and accordingle set the properties on the menu container
//        if(document.all)
//        {
//            //for IE
//            document.getElementById("menucontainer").style.overflow="hidden";
//            document.getElementById("topframe").style.overflow="hidden";
//         
//        }
//        else
//        {
//            //For Firefox
//            document.getElementById("menucontainer").style.overflow="visible";
//            document.getElementById("topframe").style.overflow="visible";
//        }
//    
//        document.body.onclick=CollapseMenus;
//        
////        if(document.getElementById("PageFooter_hUserId").value!="")
////        {
////            FetchData();
////            document.menu.SetVariable("MenuOption", "User");
////        }
////        else
////        {
////            document.menu.SetVariable("MenuOption", "Normal");
////        }
//    if(document.getElementById("PageFooter_hidUserRole").value=="2")
//    {
//        FetchData();
//        document.menu.SetVariable("MenuOption", "admin");
//    }
//    else if(document.getElementById("PageFooter_hidUserRole").value=="1")
//    {
//        FetchData();
//        document.menu.SetVariable("MenuOption", "coach");
//    }
//    else if(document.getElementById("PageFooter_hUserId").value!="")
//    {
//        FetchData();
//        document.menu.SetVariable("MenuOption", "User");
//    }
//    else
//    {
//        document.menu.SetVariable("MenuOption", "Normal");
//    }
//        
//        AdjustMenuZIndex("Rollout");
//    }
//    else
//    {
//       document.getElementById("tdmenu").style.height="0px";
//       //alert(document.getElementById("tdmenu").style.height);
//       document.getElementById("menucontainer").style.display="none";
//       if(document.getElementById("TopFrame1_divMyMessages")!=null)
//       {
//           document.getElementById("TopFrame1_divMyMessages").style.display='none';
//           document.getElementById("TopFrame1_divMyMessagesBar").style.display='none';
//           document.getElementById("TopFrame1_divInstantMessage").style.display='none';
//           document.getElementById("TopFrame1_divInstantMessageBar").style.display='none';
//       }
//    }

//    if(document.getElementById("PageFooter_hUserId").value!="")
//    {
//        var obj;
//        obj =  document.getElementById("TopFrame1_hidShowMessanger");
//        if (obj != null)
//        {
//            if (obj.value == "true")
//            {
//                setVisible("TopFrame1_pnlIMPopUp");
//                obj.value == "false";
//            }
//        }
//    }
//    else
//    {
//        //Check if any IM chat pop ups are open
//        if (arrWindow != null)
//        { 
//            var objWindow;
//            for (var key in  arrWindow)
//            {
//                objWindow = arrWindow[key]; 
//                if (objWindow != null)
//                {
//                objWindow.close();
//                }
//            }
//        }        
//    }
//    
//    //Load the top banner
//    if(document.getElementById("topbanner")!=null)
//    {
//        document.getElementById("topbanner").src="http://www.activeathletevector.com/OAS/AA_728x90.cfm?pub=tas.go-ultra&refresh_rate=60&refresh=yes";
//    }
//    
//    //Load the footer advertisements
//    if(document.getElementById("footerbanner")!=null)
//    {
//        document.getElementById("footerbanner").src="http://www.activeathletevector.com/OAS/AA_728x90.cfm?pub=tas.go-ultra&refresh_rate=60&refresh=yes";
//    }
//    
//    //Load the left hand side banner
//    if(document.getElementById("leftbanner")!=null)
//    {
//        document.getElementById("leftbanner").src="http://www.activeathletevector.com/OAS/AA_160x600.cfm?pub=tas.go-ultra&refresh_rate=60&refresh=yes";
//    }
//    
//    //Load the right hand side banner
//    if(document.getElementById("rightbanner")!=null)
//    {
//        document.getElementById("rightbanner").src="http://www.activeathletevector.com/OAS/AA_160x600.cfm?pub=tas.go-ultra&refresh_rate=60&refresh=yes";
//    }
    
}
function load()
{
    var myTimer;
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    
    prm.add_endRequest(EndRequestHandler); 
//    window.onbeforeunload = function () {UpdateWindowArray();};    
    //window.onscroll = function() { setTimeout("placeIt('TopFrame1_pnlIMPopUp')",500);}
    
     // prm.add_endRequest(EndRequestHandler);
    //prm.add_beginRequest(BeginRequestHandler);
    //myTimer = setTimeout("ProcessTimerRequest()", 1000);
    //FetchChatData()
}

function EndRequestHandler(sender, args) 
{  
    var UserMessage = null;
    UserMessage = document.getElementById("hidUserMessage"); 
    if(UserMessage != null && UserMessage != "")
    {
       var UserMessageVal = UserMessage.value;
    }
    //alert('hello');
    //By Ritesh to set scroll top
    //CheckForMessageWin();
    
  
    switch(UserMessageVal)
    {
       case "AddBlogCommentsSuccessful":
            UserMessage.value = "";
            var AcceptanceStaus = null;
            AcceptanceStaus = document.getElementById("hidCommentAcceptanceStatus"); 
            if(AcceptanceStaus != null && AcceptanceStaus != "")
            {
                var UserAcceptanceStaus = AcceptanceStaus.value;
            }                
            if(UserAcceptanceStaus == 0)
            {
                //alert("Comment on blog is added successfully.\nIt will be visible after approval of blog creator.");
                var msg="Congratulations! Comment has been added successfully.\nIt will be visible after approval of blog creator.";
                ShowMessageBox(msg);
             }
             else
             {
                var msg="Congratulations! Comment has been added successfully.";
                ShowMessageBox(msg);
             }
             AcceptanceStaus.value=""; 
               UserMessage.value = "";         
             break;  
             
         case "EditBlogCommentsSuccessful":
            UserMessage.value = "";
            var AcceptanceStaus = null;
            AcceptanceStaus = document.getElementById("hidCommentAcceptanceStatus"); 
            if(AcceptanceStaus != null && AcceptanceStaus != "")
            {
                var UserAcceptanceStaus = AcceptanceStaus.value;
            }                
            if(UserAcceptanceStaus == 0)
            {
                //alert("Comment on blog is added successfully.\nIt will be visible after approval of blog creator.");
                var msg="Congratulations! Comment has been updated successfully.\nIt will be visible after approval of blog creator.";
                ShowMessageBox(msg);
             }
             else
             {
                var msg="Congratulations! Comment has been updated successfully.";
                ShowMessageBox(msg);
             }
             AcceptanceStaus.value=""; 
               UserMessage.value = "";         
             break;   
             
//            case "DeleteBlogCommentsSuccessful":
//                alert("DeleteBlogCommentsSuccessful");
//                UserMessage.value = "";
//                var AcceptanceStaus = null;
//                var msg="Congratulations! Comment has been deleted successfully.";
//                ShowMessageBox(msg);
//                       
//                 break;   
         case "ReportCommentOffensive":
         
            UserMessage.value = "";  
            var msg="Congratulations! Comment is reported as offensive.";     
            ShowMessageBox(msg); 
            break;   
            
            
           
            
            
        case "PollVoteSuccess":
            UserMessage.value = "";  
           var msg="Congratulations! Vote saved successfully."; 
            ViewPollResult();   
            ShowMessageBox(msg); 
            break;  
            
        case "NotLoggedInUser":
                    document.getElementById("divTwitterLoading").style.display="none";
                    ShowInformationMessageBox("Please login to access this feature.");
                    UserMessage.value = "";  
                    break; 
        case "UserNotHavingTwitterAccount":
            document.getElementById("divTwitterLoading").style.display="none";
//            if(document.getElementById("hidViewedUserDisplayName")!=null && document.getElementById("hidViewedUserDisplayName").value!="")
//            {
//                var DisplayName=document.getElementById("hidViewedUserDisplayName").value;
//                ShowInformationMessageBox(DisplayName+" is not having an account with twitter.");
//               // ShowMessageBox("User is not having an account with twitter.");
//             } 
//             else
//             {
               ShowInformationMessageBox("User is not having an account with twitter.");
             //}  
            UserMessage.value = "";  
            break; 
      
      case "SelfCantFollow":
            document.getElementById("divTwitterLoading").style.display="none";
            ShowInformationMessageBox("Twitter doesn't allow users to follow themselves.");
            UserMessage.value = "";  
            break; 
       case "LoginUserNotHavingTwitterAccount":
                document.getElementById("divTwitterLoading").style.display="none";
                ShowConfimMessage('JSOperation','RedirectToTwitterPage');
                UserMessage.value = "";  
                break; 
                
        case "FollowsSuccess":
                document.getElementById("divTwitterLoading").style.display="none";
                ShowMessageBox("You are now following this user.");
                UserMessage.value = "";  
                break; 
       case "NikePlusLoginSuccessful":
            ShowMessageBox("Congratulations! You have successfully connected to Nike+.");
            UserMessage.value = "";  
            break;   
            
       case "InvitationDoneSuccess":
              UserMessageVal="";
              var msg="Congratulations! Invitation sent successfully.";
              ShowMessageBox(msg);
              UserMessage.value = "";  
               break;
       case "VideoHomePageUpdate":
              UserMessageVal="";
              var msg="Video on home page has been successfully updated.";
              ShowMessageBox(msg);
              UserMessage.value = "";  
               break;
        case "VideoDeleteDone":
             UserMessageVal="";
              var msg="Video has been deleted successfully.";
              
              ShowMessageBox(msg);
              UserMessage.value = "";  
               break;
        
        case "CommunityJoinSuccessful":
            //alert("You have joined community successfully.");
            var msg="Congratulations! You have joined community successfully.";
            ShowMessageBox(msg);
            UserMessage.value = "";  
            break;
            
        case "ExistingMemberOfCommunity":
            ShowInformationMessageBox("You are already a member of this community.");
            UserMessage.value = "";  
            break;
        
        case "ErrorInJoinCommunity":
            alert("Error occured while joining this community. Please try again.");
            UserMessage.value = "";  
            break;    
        
//        case "AddTopicSuccessful":
//            closepopup('divpnlAddTopic');
//            //alert("Topic has been added successfully.");
//            var msg="Congratulations! Topic has been added successfully.";
//            ShowMessageBox(msg);
//            break;
//        case "AddTopicSuccessfully":
//            closepopup('divpnlAddTopic');
//            //alert("Topic has been added successfully.");
//            var msg="Congratulations! Topic has been added successfully.";
//            ShowMessageBox(msg);
//            document.getElementById("hidUserMessage").value="";
//            break;
//        case "AddTopicSuccessfulTwitted":
//            closepopup('divpnlAddTopic');
//            //alert("Topic has been added successfully.");
//            var msg="Congratulations! Topic has been added successfully and shared with twitter.";
//            ShowMessageBox(msg);
//            break;
//            
            
        case "ErrorInAddTopic":
            alert("Error occured while adding a topic to this community. Please try again.");
            UserMessage.value = "";  
            break;  
        
        case "ErrorInDeleteCommunity":
            alert("Error occured while deleting the Community. Please try again.");
            UserMessage.value = "";  
            break;
        case "CommunityDoesntExists":
             ShowInformationMessageBox("Community does not exists.");
             self.location="../../WebPages/Community/ViewCommunities.aspx";
             closepopup('divpnlAddTopic');
             UserMessage.value = "";  
            break;
            
        case "ShareWithFacebook":
            ShowFBText();
            CallFBRequireFeatures();
            ShowFBPublish();
            break;
            
        case "UserNotLoggedIn":
             ShowInformationMessageBox("You need to login first to join community.");
             UserMessage.value = "";  
            break;
            
        case "PollVoteSuccess":
           var msg="Congratulations! Vote saved successfully."; 
            ViewPollResult();   
            ShowMessageBox(msg); 
            break;  
        
	//        case "SaveCommunitySuccessful":
	//            var registrationErrorsDiv = document.getElementById("RegistrationErrors");
	//            if(registrationErrorsDiv!=null && registrationErrorsDiv != "")
	//            {
	//                registrationErrorsDiv.style.display = "block";
	//                var msg ="";
	//                msg = "Congratulations! Community details are saved successfully !";
	//                registrationErrorsDiv.innerHTML = msg;   
	//            }
	//            break;
	//        
	//        case "ErrorInSaveCommunity":
	//            var registrationErrorsDiv = document.getElementById("RegistrationErrors");
	//            if(registrationErrorsDiv!=null && registrationErrorsDiv != "")
	//            {
	//                registrationErrorsDiv.style.display = "block";
	//                var msg ="";
	//                msg = "Error occured while saving community, Please try again!";
	//                registrationErrorsDiv.innerHTML = msg;   
	//            }
	//            break;    
			
        case "DeleteCommunitySuccessful":
            var msg = "Community has been deleted successfully.";
            ShowMessageBox(msg);
            self.location="../../WebPages/Community/ViewCommunities.aspx";
            UserMessage.value = "";  
          //  return confirm("Would you like to notify all the members?");
            break;                       
        
        case "UserNotMemberOfCommunity":
            ShowInformationMessageBox("You are not a member of this community. Please join the community first.");
            UserMessage.value = "";  
            break;
            
          
        case "AddEventCommentSuccessful":
            //closepopup('pnlComment');
            ShowMessageBox("Congratulations! Comment is added successfully.");  
            UserMessage.value = "";  
            break;
            
        case "UpdateEventCommentSuccessful":
            ShowMessageBox("Congratulations! Comment is updated successfully.");  
            UserMessage.value = "";  
        break;
                
        case "DeleteComment":
            ShowMessageBox("Congratulations! Comment deleted successfully.");  
            UserMessage.value = "";  
        break;
            
       case "PlanDeleteDone":
             var msg="Plan has been deleted successfully.";
             ShowMessageBox(msg);    
             UserMessage.value = "";       
             break;  
        case "PlanApproveDone":
             var msg="Congratulations! Plan has been successfully accepted.";
             ShowMessageBox(msg);       
             UserMessage.value = "";    
             break;
        case "UserSubscribeDeleteDone":
             var msg="User subscription has been successfully deleted.";
             ShowMessageBox(msg);    
             UserMessage.value = "";       
             break;
         case "UserSubscribeApproveDone":
             var msg="User subscription has been successfully accepted.";
             ShowMessageBox(msg);   
              UserMessage.value = "";      
             break;               
        case "DeleteTopicSuccessful":
            //alert("Topic has been deleted successfully.");
            var msg="Topic has been deleted successfully.";
            ShowMessageBox(msg);
             UserMessage.value = "";
            break;
        
        case "ErrorInDeleteTopic":
            alert("Error occured while deleting the Topic. Please try again.");
             UserMessage.value = "";
            break;        
            
        case "FriendRequestSuccessful":
            //alert("A friend request has been sent successfully.");
            var msg="A friend request has been sent successfully.";
            ShowMessageBox(msg);
             UserMessage.value = "";
            break;
            
        
        case "FriendAlreadyAdded":
            ShowInformationMessageBox("This user is already in your friend list.");
             UserMessage.value = "";
            break;  
            
        case "FriendRequestError":
            alert("Error occured while sending a friend request. Please try again.");
             UserMessage.value = "";
            break;
       
        case "SendInvitationSuccessful_InviteFriends":
            closepopup('divpnlSendInvitation');
            //alert("Invitation for joining community has been sent successfully.");
             var msg="Invitation for joining community has been sent successfully.";
            ShowMessageBox(msg);
             UserMessage.value = "";
            break;    
                            
        case "SendInvitationSuccessful_DeleteCommunity":
            self.location="../../WebPages/Community/ViewCommunities.aspx";
            //closepopup('divpnlSendInvitation');
             UserMessage.value = "";
            
            //alert("Notification of community deletion has been sent successfully !");
            
            break;
        case "AddTopicReplySuccessful":
            UserMessage.value = "";
            closepopup('divpnlAddTopic');
           // alert("Reply has been added successfully.");
            var msg = "Reply has been posted successfully.";
           ShowMessageBox(msg);
            break;
            
       case "AddTopicReplySuccessfulTwitted":
            closepopup('divpnlAddTopic');
            UserMessage.value = "";
            //alert("Reply has been added successfully!");
           var msg = "Congratulations! Reply has been posted successfully and shared with twitter.";
           ShowMessageBox(msg);
            
            break;
            
        case "ErrorInAddTopicReply":
            alert("Error occured while adding a reply to a topic. Please try again.");
             UserMessage.value = "";
            break;
            
        case "SessionExpired":
            self.location="../../WebPages/User/SessionExpired.aspx";
             UserMessage.value = "";
            break;
                
        case "EditReplySuccessful":
            UserMessage.value = "";
            closepopup('divpnlAddTopic');
            ShowMessageBox("Congratulations! Topic details are saved successfully.");
            break;
            
        case "EditReplySuccessfulTwitted":
            UserMessage.value = "";
            closepopup('divpnlAddTopic');
            //alert("Topic details are saved successfully!");
            var msg="Topic details are saved successfully and shared with twitter.";
            ShowMessageBox(msg);
             break;
            
        case "ErrorInEditReply":
            closepopup('divpnlAddTopic');
            alert("Error occured while changing the Topic details. Please try again.");
             UserMessage.value = "";
            break;   
            
//        case "DeleteTopicSuccessful":
//            alert("Topic deleted successfully !");
//            break;
//        case "ErrorInDeleteTopic":
//            alert("Error occured while deleting topic,Please try again !");
//            break;       
        case "DeletePostSuccessful":
            //alert("Post deleted successfully!");
            var msg="Post deleted successfully!";
            ShowMessageBox(msg);
             UserMessage.value = "";
            break;
        case "ErrorInDeletePost":
            alert("Error occured while deleting the Post. Please try again.");
             UserMessage.value = "";
            break;            
        case "editDeleteLinksVisible":
            var temp = document.getElementById("divAdministrativeControls");
            if(temp != null && temp != "")
            {
                temp.style.display = "block";
            }
            UserMessage.value = "";
            break;
        case "editDeleteLinksInvisible":
             var temp = document.getElementById("divAdministrativeControls");
            if(temp != null && temp != "")
            {
                temp.style.display = "none";
            }
             UserMessage.value = "";
           
            break;   
        case "CommunityUnsubscribedSuccessful":
            //alert("You have unsubscribed from the community successfully.");
             var msg="You have unsubscribed from the community successfully.";
            ShowMessageBox(msg);
             UserMessage.value = "";
            break;
        case "ErrorInUnsubscribeCommunity":
            alert("Error occured while you tried to unsubscribe to the community. Please try again.");
             UserMessage.value = "";
            break;          
        case "RemoveFriendSuccessful":
            //alert("Friend is removed from your friend list successfully.");
            var msg="Friend is removed from your friend list successfully.";
            ShowMessageBox(msg);
             UserMessage.value = "";
            break;
        case "ErrorInRemoveFriend":
            alert("Error occured while removing a friend from the friend list. Please try again.");
             UserMessage.value = "";
            break;        
        case "":
            //alert("end");
            break;     
           
        case "BlockedUser":
            //alert("User is blocked successfully.");
            var msg="User is blocked successfully.";
            ShowMessageBox(msg);
             UserMessage.value = "";
            break;
        case "ActivatedUser":
            //alert("User is activated successfully.");
             var msg="User is activated successfully.";
            ShowMessageBox(msg);
             UserMessage.value = "";
            break;
           
        case "ErrorInBlockUser":
            alert("Error occured while blocking a user. Please try again.");
             UserMessage.value = "";
            break;    
        case "ErrorInActivateUser":
             alert("Error occured while activating a user. Please try again.");
              UserMessage.value = "";
            break;
            
        case "CoachAccessRemoved":
            //alert("Coach's access is blocked successfully.");
             var msg="Coach's access is blocked successfully.";
             ShowMessageBox(msg);
              UserMessage.value = "";
            break;   
             
        case "CoachAccessActivated":
            //alert("Coach's access is activated successfully.");
              var msg="Coach's access is activated successfully.";
             ShowMessageBox(msg);
              UserMessage.value = "";
            break;    
        case "ErrorInRemoveCoachAccess":
            alert("Error occured while blocking a coach's access. Please try again.");
             UserMessage.value = "";
            break;        
        case "ErrorInActivateCoachAccess":
            alert("Error occured while activating the coach's access. Please try again.");
             UserMessage.value = "";
            break;  
        case "AcceptFriendRequestSuccessful":
            //alert("Friend request is accepted successfully.");
             var msg="Friend request is accepted successfully.";
            ShowMessageBox(msg);
             UserMessage.value = "";     
            break;
        case "ErrorInAcceptFriendRequest":
            alert("Error occured while accepting a friend  request. Please try again.");
              UserMessage.value = "";
            break;
            
        case "DenyFriendRequestSuccessful":
            //alert("Friend request is denied successfully.");
            var msg="Friend request is denied successfully.";
            ShowMessageBox(msg);
              UserMessage.value = "";
            break;
        case "ErrorInDenyFriendRequest":
            alert("Error occured while denying a friend request. Please try again.");
              UserMessage.value = "";
            break;    
        case "ErrorInSendMessage":
            alert("Error occured while sending a message. Please try again.");   
              UserMessage.value = "";
              break;         
        case "EditTopicClick":
            UserMessage.value = "";
            return ShowModalPopup('divpnlAddTopic','Topic Reply'); 
            break;
        
        case "ShowAddTopicPopup":
            AddTopic_onClick();
            break;    
        
        case "ReplyTopicClick":
            UserMessage.value = "";
           
             ShowModalPopup('divpnlAddTopic','Topic Reply','m');
             //alert(document.getElementById("trCategortRow"));
             if (document.getElementById("divReplyLoading") != null)
                {
                    document.getElementById("divReplyLoading").style.display = "none";
                }
             document.getElementById("trCategortRow").style.display="none";
             document.getElementById("ddlForumsCatagory").style.display="none";
             return true;
            break;
        case "ReplyAddTopicClick":
             UserMessage.value = "";
             ShowModalPopup('divpnlAddTopic','Topic Reply','m');
             document.getElementById("trCategortRow").style.display="block";
             document.getElementById("ddlForumsCatagory").style.display="block";
             return true;
                break;
        case "feedNameSortSuccessful":
            UserMessage.value = "";
            ShowModalPopup('divGoUltraFeeds','GoUltra RSS Feeds');
            return false;
        case "feedNamePagingSuccessful":
            UserMessage.value = "";
            ShowModalPopup('divGoUltraFeeds','GoUltra RSS Feeds');
            return false;    
            break;
        case "OpinionPollSaveDone":
             UserMessage.value = "";
             var msg="Congratulations, your opinion poll has been successfully created.";   
             ShowMessageBox(msg);
             break;
        case "setGoUltraFeed":
            UserMessage.value = ""; 
            return setGoUltraFeed();
            break;
        case "RSSFeedDeleteDone":
        UserMessage.value = ""; 
           var msg = "RSS feed deleted successfully!";
            ShowMessageBox(msg);
            break;
        case "RSSSaveDone":
        UserMessage.value = ""; 
           var msg = "Congratulations! RSS feed save successfully!";
            ShowMessageBox(msg);
            break;
        case "RssFeedSavedSuccessful":
            UserMessage.value = "";
            return closepopup('divAddRSSFeeds');
            var msg = "Congratulations! RSS Feed saved successfully.";
            ShowMessageBox(msg);
            break;
        case "ErrorInRssFeedSave":  
            UserMessage.value = "";
            alert("Error occured while saving the RSS Feed. Please try again.");
            return closepopup('divAddRSSFeeds');
            break;   
        case "SentMessageSuccessful":
         UserMessage.value = "";
         var msg = "Congratulations! Message has been successfully sent.";
         ShowMessageBox(msg);
         break;
        case "MessageDeleteDone":
         UserMessage.value = "";
         var msg = "Message deleted successfully.";
         ShowMessageBox(msg);
         break;
        case "PasswordChangedDone":
           UserMessage.value = "";
         var msg = "Congratulations! Your Password has been changed successfully.";
         ShowMessageBox(msg);
         break; 
        case "BlogsAddDone" :
         UserMessage.value = "";
         CloseCreateBlogPopup();
         var msg = "Congratulations! Your blog has been created successfully.";
         ShowMessageBox(msg);
         break; 
            
        case "BlogsUpdateDone" :
         UserMessage.value = "";
         var msg = "Congratulations! Your blog has been updated successfully.";
         ShowMessageBox(msg);
            break; 
        
        case "AddBlogCommentSuccessful":
            UserMessage.value = "";
            closepopup('pnlComment');
            var AcceptanceStaus = null;
            AcceptanceStaus = document.getElementById("hidCommentAcceptanceStatus"); 
            if(AcceptanceStaus != null && AcceptanceStaus != "")
            {
                var UserAcceptanceStaus = AcceptanceStaus.value;
            }                
            if(UserAcceptanceStaus == 0)
            {
                //alert("Comment on blog is added successfully.\nIt will be visible after approval of blog creator.");
                var msg="Congratulations! Comment has been added successfully.\nIt will be visible after approval of blog creator.";
                ShowMessageBox(msg);
             }
             else
             {
                var msg="Congratulations! Comment has been added successfully.";
                ShowMessageBox(msg);
             }
             AcceptanceStaus.value=""; 
               UserMessage.value = "";         
             break;   
          
        case "SubscribedSuccessful":
            //alert("Congratulations, You are successfully subscribed for this coach.");
            var msg="Congratulations, You are successfully subscribed for this coach.";
            ShowMessageBox(msg);
              UserMessage.value = "";
            break;
            
        case "ErrorInSubscription":
            alert("Error occured while entering the subscription for a coach. Please try again.");
              UserMessage.value = "";
            break;
        case "CoachLimitExceed":
            ShowInformationMessageBox("You can not subscribe for this coach as,\n the coach is already subscribed for limited number of users.");
              UserMessage.value = "";
            break;         
        case "UserSubscribedForCoach":
            ShowInformationMessageBox("You are already subscribed for this coach.");
             UserMessage.value = "";
            break;
        case "UserNotSubscribedForCoach":
            return lnkSubscribeCoach_onClick();
             UserMessage.value = "";
            break;
           
         
             
        case "CoachAcceptedUserRequest":
            UserMessage.value = "";
            var status = confirm("Do you want to send any message to this user?");
            if(status)
            {
                hidSendMsg = document.getElementById("hidSendMessage");
                if(hidSendMsg != null)
                {
                    hidSendMsg.value = "1";
                    ShowModalPopup('divSendMessage','Send Message To User');
                }
                return false;
            }
            else
            {
                hidSendMsg = document.getElementById("hidSendMessage");
                if(hidSendMsg != null)
                {
                    hidSendMsg.value = "0";
                    hidButton = document.getElementById("btnHiddenSubscribe");
                    if(hidButton != null)
                    {
                        hidButton.click();
                    }
                }
                else
                {
                    return false;
                }
            }
             UserMessage.value = "";
            break;            
            
        case "ErrorInAcceptingUserRequest":
            alert("Error occured while accepting the user's request. Please try again.");
             UserMessage.value = "";
            break;         
        case "CoachIgnoredUserRequest":
            UserMessage.value = "";
            var status = confirm("Do you want to send any message to this user?");
            if(status)
            {
                hidSendMsg = document.getElementById("hidSendMessage");
                if(hidSendMsg != null)
                {
                    hidSendMsg.value = "1";
                    ShowModalPopup('divSendMessage','Send Message To User');
                }
            }
            else
            {
                hidSendMsg = document.getElementById("hidSendMessage");
                if(hidSendMsg != null)
                {
                    hidSendMsg.value = "0";
                    hidButton = document.getElementById("btnHiddenSubscribe");
                    if(hidButton != null)
                    {
                        hidButton.click();
                    }
                }
            }
            return false;
            break;
        case "ErrorInIgnoringUserRequest":
            alert("Error occured while ignoring the user's request. Please try again.");
             UserMessage.value = "";
            break;
        case "NotProperXML":
            if(document.getElementById("WarningMsgs_divWarningInfo")!=null)
            {
                 document.getElementById("WarningMsgs_RegistrationErrors").innerHTML="Only XML file formats are allowed.";
                 document.getElementById("WarningMsgs_RegistrationErrors").style.display = "block";;
                 document.getElementById("WarningMsgs_divWarningInfo").style.display = "block";
            }
            else
            {
                alert("Only XML file formats are allowed.");
            }
             UserMessage.value = "";
            break;    
        case "NotValidData_ForgotPassword":
            divObj = document.getElementById("divStatus");
            divObj.innerHTML = "No such user exists with below details. Please retry.";
            divObj.style.fontWeight="bold";
            divObj.style.display="block";
            document.getElementById("divWarningInfo").style.display="block";
            if(document.getElementById('divLeftBorder')!=null)
                document.getElementById('divLeftBorder').style.height='374px';
            if(document.getElementById('divRightBorder')!=null)
                document.getElementById('divRightBorder').style.height='374px';
             UserMessage.value = "";
            break;    
//        case "SetFocusToAnswer": UserMessage.value = "";
//                                document.getElementById("txtAnswer").focus();
//                                break;
        
        case "PasswordSentDone":
            ShowMessageBox("Your password has been sent to your Email Id.");
             UserMessage.value = "";
            break;
        case "PasswordSent":
            divObj = document.getElementById("divPassStatus");
            divObj.innerHTML = "Password has been sent to ur Email-Id.";
            divObj.style.display="block";
            var objCtrl;
            objCtrl = document.getElementById("tblMiddleColumn");
            if (objCtrl != null)
            {
                objCtrl.style.display = 'none';
            }
            
            objCtrl = document.getElementById("tblPassSentMessage");
            if (objCtrl != null)
            {
                objCtrl.style.display = 'block';
            }
             UserMessage.value = "";
            break; 
        case "ErrorInSendingMail":
            divObj = document.getElementById("divStatus");
            divObj.innerHTML = "Error occured while sending the Email. Please try again.";
            divObj.style.display="block";
            document.getElementById("divWarningInfo").style.display="block";
             UserMessage.value = "";
            break;
//        case "ErrorNewsLetterConfiguration":
//            alert("You need to save newsletter before configure advertisement");
//            alert("helloindividual");
            //window.refresh;
         //   break;
        case "RSSFeedTabSaveSuccessful":
            UserMessage.value = "";
            DisplaySaveMessage();
            break; 
        
        case "ShownEventDetails":        
            self.location.href="#EventDetails";
             UserMessage.value = "";   
            break;
				 
        case "EventPhotoDeleteSuccessfull":
             //alert("Event photo successfully deleted.");
             DisplayEventStep();
             var msg="Event photo successfully deleted.";
             ShowMessageBox(msg);
             UserMessage.value = "";
             break;
      case  "CallforSnipshot":
            CallForCreateFormLifeEvent();
            UserMessageVal="";
            break;
      case  "alertOndelete":
            var msg="Blog has been successfully deleted.";
            ShowMessageBox(msg);
            UserMessage.value = "";
            break; 
            
     case "ReportCommentOffensive":
            UserMessage.value = "";  
            var msg="Congratulations! Comment is reported as offensive.";     
            ShowMessageBox(msg); 
            break;
      
      case "UserDeletedByAdmin":
            //alert("User is successfully deleted.");
            var msg="User is successfully deleted.";
            ShowMessageBox(msg);
            UserMessageVal="";
            break;
            
       case "CoachDeletedByAdmin":   
             //alert("Coach is successfully deleted.");
             var msg="Coach is successfully deleted.";
             ShowMessageBox(msg);
             UserMessageVal="";
             break;
       case "AdvertisementSaveDone":
             var msg="Congratulations! your advertisement has been successfully saved.";
             ShowMessageBox(msg);
             UserMessageVal="";
             break;
       case "AdvertismentDeleteDone": 
             var msg="Advertisement has been deleted successfully.";
             ShowMessageBox(msg);
             UserMessageVal="";
             break;
       case "NikeDataUploadDone": 
             var msg="Congratulations! Selected run(s) uploaded successfully.";
             ShowMessageBox(msg);
             document.getElementById("bg_image").style.height="5000px" ;
             document.getElementById("hidUserMessage").value="";
             break;
             
       case "SocialSettingsChangedSuccessful":
           UserMessage.value = "";
           CloseSocialSettings();
//           closepopup_O('dsocialsettings'); 
           var msg = "Congratulations! Social settings saved successfully.";
           ShowMessageBox(msg);   
               if(document.getElementById("Tabs$TabpnlBasicPanel$ddlGender") != null)
         {
            document.getElementById("Tabs$TabpnlBasicPanel$ddlGender").style.display = "block";
         }  
          if(document.getElementById("Tabs$TabpnlBasicPanel$ddlMonth") != null)
         {
            document.getElementById("Tabs$TabpnlBasicPanel$ddlMonth").style.display = "block";
         }   
          if(document.getElementById("Tabs$TabpnlBasicPanel$ddlDayOfMonth") != null)
         {
            document.getElementById("Tabs$TabpnlBasicPanel$ddlDayOfMonth").style.display = "block";
         }   
          if(document.getElementById("Tabs$TabpnlBasicPanel$ddlBirthYear") != null)
         {
            document.getElementById("Tabs$TabpnlBasicPanel$ddlBirthYear").style.display = "block";
         }   
          if(document.getElementById("Tabs$TabpnlBasicPanel$ddlAgeView") != null)
         {
            document.getElementById("Tabs$TabpnlBasicPanel$ddlAgeView").style.display = "block";
         }   
          if(document.getElementById("Tabs$TabpnlBasicPanel$ddlWebPageView") != null)
         {
            document.getElementById("Tabs$TabpnlBasicPanel$ddlWebPageView").style.display = "block";
         }   
          if(document.getElementById("Tabs$TabpnlBasicPanel$ddlCoach") != null)
         {
            document.getElementById("Tabs$TabpnlBasicPanel$ddlCoach").style.display = "block";
         }   
         if(document.getElementById("Tabs$TabpnlInterestPanel$ddlOtherInterestsView") != null)
         {
            document.getElementById("Tabs$TabpnlInterestPanel$ddlOtherInterestsView").style.display = "block";
         } 
         
         if(document.getElementById("Tabs$TabpnlContactPanel$ddlCityView") != null)
         {
            document.getElementById("Tabs$TabpnlContactPanel$ddlCityView").style.display = "block";
         }
         if(document.getElementById("Tabs$TabpnlContactPanel$ddlCountryView") != null)
         {
            document.getElementById("Tabs$TabpnlContactPanel$ddlCountryView").style.display = "block";
         } 
         if(document.getElementById("Tabs$TabpnlPreferences$ddlMessageView") != null)
         {
            document.getElementById("Tabs$TabpnlPreferences$ddlMessageView").style.display = "block";
         } 
         if(document.getElementById("Tabs$TabpnlPreferences$ddlInstantMessageView") != null)
         {
            document.getElementById("Tabs$TabpnlPreferences$ddlInstantMessageView").style.display = "block";
         } 
         if(document.getElementById("Tabs$TabpnlPreferences$ddlCommunitiesView") != null)
         {
            document.getElementById("Tabs$TabpnlPreferences$ddlCommunitiesView").style.display = "block";
         } 
         if(document.getElementById("Tabs$TabpnlPreferences$ddlFriendsFromView") != null)
         {
            document.getElementById("Tabs$TabpnlPreferences$ddlFriendsFromView").style.display = "block";
         }  
         if(document.getElementById("Tabs$TabpnlPreferences$ddlMileView") != null)
         {
            document.getElementById("Tabs$TabpnlPreferences$ddlMileView").style.display = "block";
         }  
         if(document.getElementById("Tabs$TabpnlPreferences$ddlGoalsView") != null)
         {
            document.getElementById("Tabs$TabpnlPreferences$ddlGoalsView").style.display = "block";
         }  
         if(document.getElementById("Tabs$TabpnlPreferences$ddlChallengesView") != null)
         {
            document.getElementById("Tabs$TabpnlPreferences$ddlChallengesView").style.display = "block";
         }  
         if(document.getElementById("Tabs$TabpnlPreferences$ddlcomingeventsView") != null)
         {
            document.getElementById("Tabs$TabpnlPreferences$ddlcomingeventsView").style.display = "block";
         }  
         if(document.getElementById("Tabs$TabpnlPreferences$ddlMyPhotosView") != null)
         {
            document.getElementById("Tabs$TabpnlPreferences$ddlMyPhotosView").style.display = "block";
         }  
         if(document.getElementById("Tabs$TabpnlPreferences$ddlMyAchievements") != null)
         {
            document.getElementById("Tabs$TabpnlPreferences$ddlMyAchievements").style.display = "block";
         } 
         if(document.getElementById("Tabs$TabpnlPreferences$ddlThemeNames") != null)
         {
            document.getElementById("Tabs$TabpnlPreferences$ddlThemeNames").style.display = "block";
         } 
         if(document.getElementById("Tabs$TabpnlBasicPanel$ddlSportCoached") != null)
         {
            document.getElementById("Tabs$TabpnlBasicPanel$ddlSportCoached").style.display = "block";
         } 
         
          if(document.getElementById("Tabs$TabpnlContactPanel$ddlCountry") != null)
         {
            document.getElementById("Tabs$TabpnlContactPanel$ddlCountry").style.display = "block";
         }  
           ShowFBText();
           if(document.getElementById("hidBtnSendTweet")!=null)
           {
                hidButton = document.getElementById("hidBtnSendTweet");
                    if(hidButton != null)
                    {
                        hidButton.click();
                    }
            }
          // window.location.reload();             
           break;
           
            
        case "SendFriendRequestSuccessful" :
            ShowMessageBox("Friend Request sent sucessfully.");
            document.getElementById("hidUserMessage").value="";
        break;
        
        case "SendFriendRequestError" :
            ShowInformationMessageBox("Error while sending Friend Request.");
            document.getElementById("hidUserMessage").value="";
        break;
        
        case "SendFriendAlreadyAdded" :
            ShowInformationMessageBox("Your friend request is pending.");
            document.getElementById("hidUserMessage").value="";
        break;
        
        case "RemoveFriendSucessful":
            ShowMessageBox("Friend is removed from your friend list successfully.");
            document.getElementById("hidUserMessage").value="";
        break;
        
        case "UserNotLoggedIn":
            ShowInformationMessageBox("Please log in to add this person as your friend.");
            document.getElementById("hidUserMessage").value="";
        break;
        
         case "UserFollowsOwnBlog":
            document.getElementById("hidUserMessage").value="";
             //alert("Review is added successfully.\nIt will be visible after approval of admin.");
             var msg="You can not follow your own blog.";
             ShowInformationMessageBox(msg);
             break;
             
         case "BlogFollowSuccess":
            document.getElementById("hidUserMessage").value="";
             //alert("Review is added successfully.\nIt will be visible after approval of admin.");
             var msg="Congratulations! Your request to follow blog processed successfully.";
             ShowMessageBox(msg);
             break;
             
          case "BlogFollowFailure":
            document.getElementById("hidUserMessage").value="";
             //alert("Review is added successfully.\nIt will be visible after approval of admin.");
             var msg="Sorry! Your request to follow blog is not completed.";
             ShowInformationMessageBox(msg);
             break;
             
           case "BlogUnFollowSuccess":
            document.getElementById("hidUserMessage").value="";
             //alert("Review is added successfully.\nIt will be visible after approval of admin.");
             var msg="Congratulations! Your request to unfollow blog processed successfully.";
             ShowMessageBox(msg);
             break;
             
           case "BlogUnFollowFailure":
            document.getElementById("hidUserMessage").value="";
             //alert("Review is added successfully.\nIt will be visible after approval of admin.");
             var msg="Sorry! Your request to unfollow blog is not completed.";
             ShowInformationMessageBox(msg);
             break;
             
           case "UserLikesOwnBlog":
            document.getElementById("hidUserMessage").value="";
             //alert("Review is added successfully.\nIt will be visible after approval of admin.");
             var msg="UserLikesOwnBlog.";
             ShowInformationMessageBox(msg);
             break;
           
           case "BlogPostDoesntExists":
            UserMessage.value = "";       
            var msg="Blog post does not exist.";     
            ShowInformationMessageBox(msg); 
            break;  
            
           case "BlogPostArchiveSuccess":
            document.getElementById("hidUserMessage").value="";
             var msg="Congratulations! Your post is added as archive successfully.";
             ShowMessageBox(msg);
             break;
             
          case "BlogPostArchiveFailure":
            document.getElementById("hidUserMessage").value="";
             var msg="Sorry! Your post is not added as archive.";
             ShowInformationMessageBox(msg);
             break;
             
          case "BlogPostRemoveArchiveSuccess":
            document.getElementById("hidUserMessage").value="";
             var msg="Congratulations! Your post is removed from archive successfully.";
             ShowMessageBox(msg);
             break;
             
             
          case "BlogPostRemoveArchiveFailure":
            document.getElementById("hidUserMessage").value="";
             var msg="Sorry! Your post is not removed from as archive.";
             ShowInformationMessageBox(msg);
             break; 
             
          case "BlogPostDeletedSuccessfully":
            document.getElementById("hidUserMessage").value="";
             var msg="Congratulations! Your post is deleted successfully.";
             ShowMessageBox(msg);
             break; 
             
          case "BlogPostDeletedUnSuccessful":
            document.getElementById("hidUserMessage").value="";
             var msg="Sorry! Your post is not deleted.";
             ShowInformationMessageBox(msg);
             break; 
             
           case "BlogPostAddedSuccessfully":
             var is_Safari = navigator.userAgent.indexOf('Safari');
             var is_Firefox = navigator.userAgent.indexOf('Firefox');
             var btnObj = parent.document.getElementById("btnSubmitAddPost");
             if (btnObj != null)
             { 
                if (document.all)
	            {
		            // IE
		            btnObj.click();
	            }
	            else
                if(is_Firefox > 0)
	            {
		            // FireFox 
		            var e = document.createEvent("MouseEvents");
		            e.initEvent("click", true, true);
		            btnObj.dispatchEvent(e);
	            }
	            else
	            if(is_Safari > 0)
	            { 
	                //For Safari
	                 btnObj.click();
	            }	
	            else
	            {   //For Other Browser
	                btnObj.click();
	            }	
             }  
             //closepopup("divAddBlogPost");
             break; 
             
           case "BlogPostAddedSuccessfullyClose":
                document.getElementById("hidUserMessage").value="";
                 var msg="Congratulations! New post added successfully.";
                 ShowMessageBox(msg);
           break;
           
           case "BlogPostUpdateSuccessfullyClose":
                document.getElementById("hidUserMessage").value="";
                 var msg="Congratulations! Post Updated successfully.";
                 ShowMessageBox(msg);
           break;
           
           case "ShowAddPost":
                document.getElementById("hidUserMessage").value="";
                ShowModalPopup('divAddBlogPost','Add Post','m');
           break;
           
//           case "PollVoteSuccess":
//        
//            document.getElementById("hidUserMessage").value= "";  
//            var msg="Congratulations! Vote saved successfully.";
//            ShowMessageBox(msg);  
//            ViewPollResult();   
//            
//            break;
           
           
           case "BlogPostUpdateSuccessfully":
             var is_Safari = navigator.userAgent.indexOf('Safari');
             var is_Firefox = navigator.userAgent.indexOf('Firefox');
             var btnObj = parent.document.getElementById("btnUpdateAddPost");
             if (btnObj != null)
             { 
                if (document.all)
	            {
		            // IE
		            btnObj.click();
	            }
	            else
                if(is_Firefox > 0)
	            {
		            // FireFox 
		            var e = document.createEvent("MouseEvents");
		            e.initEvent("click", true, true);
		            btnObj.dispatchEvent(e);
	            }
	            else
	            if(is_Safari > 0)
	            { 
	                //For Safari
	                 btnObj.click();
	            }	
	            else
	            {   //For Other Browser
	                btnObj.click();
	            }	
             } 
             //closepopup("divAddBlogPost");
             break; 
             
           case "BlogPostUpdateUnsuccessful":
                document.getElementById("hidUserMessage").value="";
                 var msg="Congratulations! New post added successfully.";
                 ShowMessageBox(msg);
           break;
             
           case "BlogPostAddedUnsuccessful":
            document.getElementById("hidUserMessage").value="";
             var msg="Sorry! New post is not added.";
             ShowInformationMessageBox(msg);
             break; 
             
          case "ReportBlogPostOffensive":
            UserMessage.value = "";  
            var msg="Blog Post is reported as offensive.";     
            ShowMessageBox(msg); 
            break;
            
          case "LoginToFollowBlog":
            UserMessage.value = "";  
            var msg="You need to login first to follow blog.";     
            ShowInformationMessageBox(msg); 
            break;
             //cases for event registration
             
                     case "RegistrationTextFieldEditedDone":
             UserMessage.value = "";  
             var msg="Field edited Successfully.";
             closepopup('AddNewTextField');
             ShowMessageBox(msg);
             ShowRegistrationForDDL();
             break;
       case "RegistrationListFieldEditedDone":
             UserMessage.value = "";  
             var msg="Field edited Successfully.";
             closepopup('divListItems');
             ShowMessageBox(msg);
             ShowRegistrationForDDL();
             break;
        case "SaveSectionSuccess":
             UserMessage.value = "";  
             var msg="Section added successfully.";
             ShowMessageBox(msg);
             break;
            case "DeleteSectionSuccess":
             UserMessage.value = "";  
             var msg="Section deleted successfully.";
             ShowMessageBox(msg);
             break;     
             
        case "EditSectionSuccess":
             UserMessage.value = "";  
             var msg="Section updated successfully.";
             ShowMessageBox(msg);
             break;
       case "RegistrationTextFieldAddDone":
             UserMessage.value = "";  
             var msg="Field added successfully.";
             closepopup('AddNewTextField');
             ShowMessageBox(msg);
             ShowRegistrationForDDL();
             break;
        case "RegistrationListFieldAddDone":
             UserMessageVal="";
             var msg="Field added successfully.";
             closepopup('divListItems');
             ShowMessageBox(msg);
             ShowRegistrationForDDL();
             break;
       case "RegistrationFieldSequenceDone":
             UserMessage.value = "";  
             var msg="Field order saved successfully.";
             closepopup('ChangeSequence')
             ShowMessageBox(msg);
             ShowRegistrationForDDL();
             break;
       case "ClaimRequestMailSendDone":
             UserMessage.value = "";  
             closepopup("divEventDetails");
             ShowMessageBox("Congratulation! Your claim request is sent to the administrator for approval.");
             break;
       case "RegistrationFormCreationDone":
             var PageCreationFinished = null;   
             PageCreationFinished = document.getElementById("PageCreationFinished"); 
             PageCreationFinished.value="Done";
             UserMessage.value = "";  
             ShowMessageBox("Congratulation! event has been setup successfully.");
             break;
       case "RegistrationSetupIncomplete":
             UserMessage.value = "";  
             RegistrationSetupIncomplete();
             break;
//       case "UserFieldsSaveDone":
//             UserMessage.value = "";  
//             var msg="Field changes saved successfully.";
//             UserFieldsSaveDone();
//             ShowMessageBox(msg);
//             break;

        case "UserFieldsSaveDone":
             UserMessage.value = "";  
             var msg="Field changes saved successfully.";
             UserFieldsSaveDone();
             ShowMessageBox(msg);
            if(document.getElementById("Tabs_UserTabPanel_selFieldTypes")!=null)
            {
                document.getElementById("Tabs_UserTabPanel_selFieldTypes").style.display="block";
            }
            if(document.getElementById("Tabs_UserTabPanel_ddlFontFamily")!=null)
            {
                document.getElementById("Tabs_UserTabPanel_ddlFontFamily").style.display="block";
            }
            if(document.getElementById("Tabs_UserTabPanel_ddlFontSize")!=null)
            {
                document.getElementById("Tabs_UserTabPanel_ddlFontSize").style.display="block";
            }
            if(document.getElementById("Tabs_VolunteerTabPanel_selVolunteerFieldTypes")!=null)
            {
                document.getElementById("Tabs_VolunteerTabPanel_selVolunteerFieldTypes").style.display="block";
            }
            if(document.getElementById("Tabs_VolunteerTabPanel_ddlVolunteerFontFamily")!=null)
            {
                document.getElementById("Tabs_VolunteerTabPanel_ddlVolunteerFontFamily").style.display="block";
            }
            if(document.getElementById("Tabs_VolunteerTabPanel_ddlVolunteerFontSize")!=null)
            {
                document.getElementById("Tabs_VolunteerTabPanel_ddlVolunteerFontSize").style.display="block";
            }
             break;
             
        case "RegistrationPreviewSaveDone":
             UserMessage.value = "";  
              ShowRegistrationFormPreview();
             break;
        case "VolunteerRegistrationPreviewSaveDone":
              UserMessage.value = "";  
              ShowVolunteerRegistrationPreview();
             break;
             
             
             
        
//       case "VolunteerFieldsSaveDone":
//             UserMessage.value = "";  
//             var msg="Field changes saved successfully.";
//             VolunteerFieldsSaveDone();
//             ShowMessageBox(msg);
//             break;

case "VolunteerFieldsSaveDone":
             UserMessage.value = "";  
             var msg="Field changes saved successfully.";
             VolunteerFieldsSaveDone();
             ShowMessageBox(msg);
            ShowRegistrationForDDL();
             break;
       case "RegistrationFieldDeleteDone":
             UserMessage.value = "";  
             var msg="Field deleted Successfully.";
             ShowMessageBox(msg);
            ShowRegistrationForDDL();
             break;
       case "RegistrationFeesDeleteDone":
             UserMessage.value = "";  
             var msg="Selected fees record has been deleted successfully.";
             ShowMessageBox(msg);
             break;
             
        case "SetFocusOnErrorMessage":
            UserMessage.value = "";  
            document.getElementById("divWarningInfoG").focus();
            window.scrollBy(0,-10000);
            break;
         
         case "BackToFirstStep":
            NavigateSections('-2');
            break;
            
         
      case "UserNotLoggedIn": 
            UserMessage.value = "";    
            var msg="You need to login to access this feature.";     
            ShowInformationMessageBox(msg); 
            break;   
      case "selectEvent": 
            UserMessage.value = "";    
            var msg="Please select an event to add in your event calendar.";     
            ShowInformationMessageBox(msg); 
            break;  
      case "EventAddedToMyEvent": 
            UserMessage.value = "";    
            var msg="Congratualation!! Event added to your calendar successfully.";     
            ShowInformationMessageBox(msg); 
            break;    
      case "ErrorWhileEventAddedToMyEvent": 
            UserMessage.value = "";    
            var msg="Congratualation!! Event added to your calendar successfully.";     
            ShowInformationMessageBox(msg); 
            break;  
//      case "SetupProcessCompleted":
//            UserMessage.value = "";   
//            var registrationDate =  new Date(document.getElementById("txtRegStartDate").value);
//            var curDate = new Date();
//            var days = 0;
//            var difference = 0;
//            difference = registrationDate - curDate;
//            days = Math.round(difference/(1000*60*60*24));
//            if(days > 0)
//            {
//                var msg="Congratulations! You have successfully completed the process. Event will be available for registration from "+registrationDate.format("MMM dd, yyyy",true)+".";   
//            }
//            else
//            {
//                var msg="Congratulations! You have successfully completed the process.";     
//            }
//            ShowMessageBox(msg);
//            break;

    case "SetupProcessPartiallyCompleted":
          
            var msg="Your event has partially completed the setup process. Please add the missing details after which it will be available for registration.";     
            ShowMessageBox(msg);
            document.getElementById("messageBox_hidButtonId").value = "btnCompletedSetup";
            break;
        
           case "SetupProcessCompleted":
            UserMessage.value = "";   
            var registrationDate =  new Date(document.getElementById("txtRegStartDate").value);
            var curDate = new Date();
            var days = 0;
            var difference = 0;
            difference = registrationDate - curDate;
            days = Math.round(difference/(1000*60*60*24));
            if(days > 0)
            {
               var msg="Congratulations! You have successfully completed the process. Event will be available for registration from "+registrationDate.format("MMM dd, yyyy",true)+".";   
            }
            else
            {
                var msg="Congratulations! You have successfully completed the process.";     
            }
            ShowMessageBox(msg);
            document.getElementById("messageBox_hidButtonId").value = "btnCompletedSetup";
            break;
            
//      case "AddTopicSuccessfully":
//            closepopup('divpnlAddTopic');
//            //alert("Topic has been added successfully.");
//            var msg="Congratulations! Topic has been added successfully.";
//            ShowMessageBox(msg);
//            document.getElementById("hidUserMessage").value="";
//            break;
//            
             case "CommunityPhotoDeleteSuccess":
            ShowMessageBox("Community photo deleted successfully.");
            UserMessage.value = "";  
            break;
            
        case "CommunityPhotoDeleteUnSuccess":
            ShowInformationMessageBox("Some error occured while deleting photo.");
            UserMessage.value = "";          
            break;
            case "ConfirmTwitterCredentials":
            ShowInformationMessageBox("Please confirm your twitter credentials.");
            UserMessage.value = "";
            break;
            
       case "CommunitySharedWithTwitter":
            ShowInformationMessageBox("Community already shared with twitter.");
            UserMessage.value = "";
            break;
            
       case "NotLoggedInUserTwitter":
            ShowInformationMessageBox("Please login to share community with twitter.");
            UserMessage.value = "";
            break;
            
       case "CommunityReportedOffensive":
            ShowMessageBox("Community reported as offensive.");
            UserMessage.value = "";
            break;
            
       case "ErrorInSaveCommunity":
            closepopup('divAddCommunity');
            DisplayMessage("error");
            UserMessage.value = "";
            break;
            
       case "CommunitySavedSuccess":
            closepopup('divAddCommunity');
            ShowMessageBox("Community created successfully.");
            UserMessage.value = "";
            break;
            
       case "CommunityAlreadyExists":
            closepopup('divAddCommunity');
            DisplayMessage("Exists");
            UserMessage.value = "";
            break;
            
        case "ShowMyCommunities":
            UserMessage.value = "";
            ShowMyCommunities();
            break;
            
            case "MessageMarkDone":
         UserMessage.value = "";
         var msg = "Message marked successfully.";
         ShowMessageBox(msg);
         break;
         
         case "MessageUnmarkDone":
         UserMessage.value = "";
         var msg = "Message unmarked successfully.";
         ShowMessageBox(msg);
         break;
         
         case "MessageUnreadMarkDone":
         UserMessage.value = "";
         var msg = "Message marked as unread successfully.";
         ShowMessageBox(msg);
         break;
         
         case "DisplaySearch":
            UserMessage.value = "";
            document.getElementById("tblSearchCommunity").style.display = "block";
            document.getElementById("tblMostActiveCommunities").style.display = "none";
            document.getElementById("tblMyCommunitiesList").style.display = "none";
            document.getElementById("tblMostPopularCommunities").style.display = "none";
        break;
            
        case "AttachmentDeletedSuccessfully":
            UserMessage.value = "";
            ShowMessageBox("Attachment deleted successfully.");
        break;
        
         case "ShowConfirmBoxIfSimilerEventExist":
            UserMessage.value = "";
           CheckForSimilerEventBeforeAdd();
        break;
         
        case "ShowEventDetailsPopupForExistingEvent":
             UserMessage.value = "";
             ShowEventDetailsByEventIdForEventSeup(document.getElementById("hidExistingEventDate").value,document.getElementById("hidExistingEventId").value);
             if(document.getElementById("imgLoading")!=null)
             {
                document.getElementById("imgLoading").style.display="none";
             }
        break;
        
        case "HideCalendarPanel":
            UserMessage.value = "";
            ExpandCollapseCalendar('collapse');
        break;
         
         case "ShowCalendarPanel":
            UserMessage.value = "";
            ExpandCollapseCalendar('expand');
        break;
        case "ShowAddSectionPopup":
            UserMessage.value = "";
            ShowAddSectionPopup();
        break;
        
         case "ShowVolunteerSectionPopup":
            UserMessage.value = "";
            ShowAddVolunteerSectionPopup();
        break;
        
         case "FillFeatuiredUpcomingPanelDone":
            UserMessage.value = "";
            FillFeatuiredUpcomingPanelDone();
        break; 
           
      default:
            return;
   }
    
    //UserMessage.value = "";
    
}

//Add the eventhandler for document click for making the menus collapse by passing variable to flash
//document.body.onclick=CollapseMenus;

//Function to load the flash movie for showing the menus
function LoadMenus()
{
    var script;
    var strMenuOption;
    if(document.getElementById("PageFooter_hUserId").value!="")
    {
        strMenuOption="MenuOption=User";
    }
    else
    {
        strMenuOption="MenuOption=Normal";
    }
    script='<object id="menu" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" \
                     style="visibility: visible; z-index: 1000; position: relative; \
                    width: 966px; height: 160px;"> \
                    <param name="allowScriptAccess" value="sameDomain" /> \
                    <param name="wmode" value="transparent" /> \
                    <param name="movie" value="images/home page/menu.swf" /> \
                    <param name="quality" value="high" /> \
                    <param name="bgcolor" value="#ffffff" /> \
                    <param name="FlashVars" value="' + strMenuOption + '" /> \
                    <embed src="images/home page/menu.swf" quality="high" bgcolor="#ffffff" FlashVars="' + strMenuOption + '" width="966" \
                        height="160" id="menu" name="menu" align="middle" allowscriptaccess="sameDomain" \
                        type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" \
                        wmode="transparent" /> \
                </object>';
                
    document.getElementById("menucontainer").innerHTML=script;
                    
}

// To avoid passing query string to web page.
// Sending query string by post action of form in hidden fields.
function SubmitQueryString(URLQueryStr)
{
    //alert("In function SubmitQueryString value of URLQueryString=" + URLQueryStr);
   //alert(URLQueryStr);
    var form=document.createElement("form");
    form.method = 'post';
	form.id="submitQueryForm";
	form.name="submitQueryForm";
	form.style.visibility = 'hidden';
	
	var lengthOfURL = URLQueryStr.length;
    var posOfQueryStr = URLQueryStr.indexOf("?");
    var actionURL;
    var queryStr;
   //alert(posOfQueryStr);
    if(posOfQueryStr == -1)
    {
        actionURL = URLQueryStr;
        queryStr = "" ;
    }
    else
    {
        actionURL = URLQueryStr.substring(0,posOfQueryStr);
       // actionURL = URLQueryStr;
        queryStr = URLQueryStr.substring(posOfQueryStr+1,lengthOfURL);
    }
   // alert(actionURL);
    var queryStrPair = queryStr.split("&");
    var keyValuePair;
    var i=0;
    
    for(i=0;i<queryStrPair.length;i++)
    {
        keyValuePair =  queryStrPair[i].split("=");
        
        //alert("keyName:" + keyValuePair[0]);
        //alert("keyValue:" + keyValuePair[1]);
        
        addInput(document, form, 'hidden', keyValuePair[0], keyValuePair[1]);
    }
   // alert("actionURL:" + actionURL);
	document.body.appendChild(form);
	form.action = actionURL;
	form.submit();
	document.body.removeChild(form);
    return false;
}

function addInput(doc, form, type, name, value) 
{
	  var e = doc.createElement('input');
	  e.type = type;
	  e.name = name;
	  e.id = name;
	  e.value = value;
	 
	  form.appendChild(e);
}
function MM_swapImgRestore() 
{ //v3.0
  var i,x,a=document.MM_sr; 
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
  {   x.src=x.oSrc;
  }
}

function MM_swapImage() 
{  //v3.0
   var i,j=0,x,a=MM_swapImage.arguments; 
   document.MM_sr=new Array; 
   for(i=0;i<(a.length-2);i+=3)
   {
      if ((x=MM_findObj(a[i]))!=null)
      {  document.MM_sr[j++]=x; 
          if(!x.oSrc) 
          {  x.oSrc=x.src; 
          }
          x.src=a[i+2];
      }
   }
}


function MM_findObj(n, d) 
{  //v4.01
  var p,i,x;  
  if(!d) 
  {  d=document; 
  } 
  if((p=n.indexOf("?"))>0&&parent.frames.length) 
  {
     d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
  }
  if(!(x=d[n])&&d.all)
  {  x=d.all[n];
  }
  for (i=0;!x&&i<d.forms.length;i++) 
  {  x=d.forms[i][n];
  }
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
  {   x=MM_findObj(n,d.layers[i].document);
  }
  if(!x && d.getElementById) 
  {  x=d.getElementById(n); 
  }
  return x;
}

 function toggleOnlineList(ctrlId)
   {
        var ctrl;
        ctrl = document.getElementById(ctrlId);
        if (ctrl != null)
        {
            if ((ctrl.style.display == 'block') || (ctrl.style.display == ''))
            {
                ctrl.style.display = 'none';
            }
            else 
            if (ctrl.style.display == 'none')
            {
                ctrl.style.display = 'block';  
            }              
        }
   }
   
//   function checkFlashPlayer()
//   {  if(pluginlist!=null)
//      {   
//         if (pluginlist.indexOf("Flash")!=-1)
//         {   // document.write("You have flash installed");
//            // alert("You have flash player plugin");
//         }
//         else
//         {
//            ShowMessageBox("You need to download and install player plugin.");
//         }
//       }      
//   }
   
 
   
//function reload()
//{
//    self.location.href="WebPages/User/Logout.aspx?mode=1";
//}

function refresh_page()
{
    //setTimeout("reload()",1000);
    self.location.href="../User/Logout.aspx?mode=1";
}

function FBLogout()
{
    var LoginWithFacebook  =  document.getElementById("TopFrame1_hidIsLoginwithFacebook")
    var FacebookFlag ="False";
    if(LoginWithFacebook != null )
    {
       
        FacebookFlag = LoginWithFacebook.value;
    }
    
    if(FacebookFlag == "True")
    {
    CallFBRequireFeatures();
        FB.ensureInit(function() {       
            FB.Connect.logout(function() { refresh_page(); });
        });
        refresh_page(); 
    }
    else
    { 
        refresh_page();
    
    }
}


function waiting()
{  
}

function SetFBSessionExpires()
{ 
    currUrl = String(self.location);
    var LoginWithFacebook  =  document.getElementById("TopFrame1_hidIsLoginwithFacebook")
    var FacebookFlag ="False";
    if(LoginWithFacebook != null )
    {
       
        FacebookFlag = LoginWithFacebook.value;
    }
    
  //if((currUrl.indexOf("AddProfile")>=0)||(currUrl.indexOf("OnlineRegister")>=0))
   if(currUrl.indexOf("LogDetails")<0)
   {  
       document.getElementById("PageFooter_hFBUserName").value="";
       ShowMenus();
        if(FacebookFlag == "True")
        {
          FB.ensureInit(function() {       
                FB.Connect.logout(function() { waiting(); });
            });
        }
        else
        {
            waiting();
        }
   }
   else if(document.getElementById("PageFooter_hFBAfterLoginId").value!="")
   {
       document.getElementById("PageFooter_hFBUserName").value="";
       ShowMenus();
        if(FacebookFlag == "True")
        {
           FB.ensureInit(function() {       
                FB.Connect.logout(function() { waiting(); });
            });
        }
         else
        {
            waiting();
        }
   }
}

//function clearLogout()
//{    alert("clearlogout");
//     document.getElementById("PageFooter_hFBUserName").value="";
//     ShowMenus();
//}

//function SetLogoutFBSession()
//{
//    FB.ensureInit(function() {       
//            FB.Connect.logout(function() { clearLogout(); });
//        });
//}

  function fullScreen(strUrl)
  {
       window.open(strUrl);
  }
  
 //Session Timeout
var flag = false;
var timerId=null;  
function checkSessionTimeout()
{

  registerHandlers();
  startSessionTimer();
}
function resetTimer()
{
      timeoutValue = 1200000; //20 minutes
        //timeoutValue = 60000; //1 Minute for testing
}
function startSessionTimer() 
{
  //if(timerId!=null)
  
      clearTimeout(timerId);
      resetTimer();
      timerId = setTimeout(showMsg,timeoutValue); 
}
 function CallToReset(e)
 {
    startSessionTimer();
}
function registerHandlers() 
{
    document.onclick =CallToReset;
    document.oncontextmenu = CallToReset;
    document.onkeypress =CallToReset;
    document.ondblclick =CallToReset;
    document.onfocusin  =CallToReset;  
    document.documentElement.onclick = CallToReset;
    window.onscroll = CallToReset;

    if (document.captureEvents) 
    {  document.captureEvents(Event.keyUp);
    }
    document.onkeyup = keyUp;  
}
function keyUp(e) {
var isIE = (document.all)? true:false;
var KeyID = 0;
	if (isIE)
	{
		KeyID=event.keyCode;
	} 
	else
	{
		KeyID=e.which;
	}  
   switch(KeyID)
   {
	  case 9 : /// For TAB Key
	   CallToReset();
	   break;
	  case 13: /// For ENTER Key
	   CallToReset();
	   break;
			
	}
}
function showMsg()
{
	 //path = "../../WebPages/User/Logout.aspx?mode=1"; 
	 //top.location.href = path;	
	 FBLogout();	
     //Your redirection
}


function CallFBRequireFeatures()
{
    var currUrl;
    
    var posURL1,posURL2,posURL3,posURL4,posURL5,posURL6;
    
    currUrl = String(self.location);
    
    currUrl = currUrl.toLowerCase();
    	 
    posURL1 = currUrl.indexOf("http://www.go-ultra.com");
    
    posURL2 = currUrl.indexOf("http://go-ultra.com");
    
    posURL3 = currUrl.indexOf("http://www.goultrasports.com");
    
    posURL4 = currUrl.indexOf("http://goultrasports.com");
	
	//posURL5 = currUrl.indexOf("http://goultratest2");
	
	posURL5 = currUrl.indexOf("http://192.168.200.8");
	
	posURL6 = currUrl.indexOf("http://121.241.77.229");
	
	if(posURL1 >= 0)
	{
	    FB_RequireFeatures(
					["XFBML"], 
					function(){ 
						FB.Facebook.init(
							"89fb9a953dc4eb0adf700008bbf22940", 
							"../../xd_receiver.htm"
						); 
					}
				); 
	}
   else if(posURL2 >= 0)
   {
       FB_RequireFeatures(
					["XFBML"], 
					function(){ 
						FB.Facebook.init(
							"89fb9a953dc4eb0adf700008bbf22940", 
							"../../xd_receiver.htm"
						); 
					}
				); 
   }
   else if(posURL3 >= 0)
   {
        FB_RequireFeatures(
					["XFBML"], 
					function(){ 
						FB.Facebook.init(
							"89fb9a953dc4eb0adf700008bbf22940", 
							"../../xd_receiver.htm"
						); 
					}
				); 
   }
   else if(posURL4 >= 0)
   {
        FB_RequireFeatures(
					["XFBML"], 
					function(){ 
						FB.Facebook.init(
							"89fb9a953dc4eb0adf700008bbf22940", 
							"../../xd_receiver.htm"
						); 
					}
				);    
   }
   else if(posURL5 >= 0)
   {
          FB_RequireFeatures(
					["XFBML"], 
					function(){ 
						FB.Facebook.init(
							"21fc39d41c399f7383e75ab4e8d05ae6", 
							"../../xd_receiver.htm"
						); 
					}
				);       
   }
   else if(posURL6 >= 0)
   {
        FB_RequireFeatures(
					["XFBML"], 
					function(){ 
						FB.Facebook.init(
							"9ff0f0c98159ed46f8ed389e890abab7", 
							"../../xd_receiver.htm"
						); 
					}
				);     
   }
   else
   {
       FB_RequireFeatures(
					["XFBML"], 
					function(){ 
						FB.Facebook.init(
							"21fc39d41c399f7383e75ab4e8d05ae6", 
							"../../xd_receiver.htm"
						); 
					}
				);     
   }
}

function ShowFBText()
{
   var objValue=document.getElementById("socialsettingcontrol_hidSocialSettings").value;

   if((objValue=="")||(objValue.indexOf("False$False") >= 0))
   {
      if(document.getElementById("divSocialSettingsText")!=null)
      {
//        document.getElementById("divSocialSettingsText").style.display="block";
      }
   }
   else
   {
      if(document.getElementById("divSocialSettingsText")!=null)
      {
        document.getElementById("divSocialSettingsText").style.display="none";
      }
   }
}

function ShowFBMessage()
{
    if(document.getElementById("PageFooter_hUserId").value!="")
    {
       ShowFBText();
    }
    else
    {
      if(document.getElementById("divSocialSettingsText")!=null)
      {
        document.getElementById("divSocialSettingsText").style.display="none";
      }
    }
}

function setCookie(name, value, seconds) 
{
	if (typeof(seconds) != 'undefined') 
	{
		var date = new Date();
		date.setTime(date.getTime() + (seconds*1000));
		var expires = "; expires=" + date.toGMTString();
	}
	else 
	{
		var expires = "";
	}

	document.cookie = name+"="+value+expires+"; path=/";
}
 
function getCookie(name) 
{
	name = name + "=";
	var carray = document.cookie.split(';');
	for(var i=0;i < carray.length;i++) {
		var c = carray[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
	}
    return null;
}
 
function deleteCookie(name) 
{
	setCookie(name, "", -1);
}
function swapImage(btnId,cssClassName) 
{ 
   document.getElementById(btnId).className = cssClassName; 
}
 function ShowRegistrationForDDL()
{
     if(document.getElementById("Tabs_UserTabPanel_selFieldTypes")!=null)
            {
                document.getElementById("Tabs_UserTabPanel_selFieldTypes").style.display="block";
            }
            if(document.getElementById("Tabs_UserTabPanel_ddlFontFamily")!=null)
            {
                document.getElementById("Tabs_UserTabPanel_ddlFontFamily").style.display="block";
            }
            if(document.getElementById("Tabs_UserTabPanel_ddlFontSize")!=null)
            {
                document.getElementById("Tabs_UserTabPanel_ddlFontSize").style.display="block";
            }
            if(document.getElementById("Tabs_VolunteerTabPanel_selVolunteerFieldTypes")!=null)
            {
                document.getElementById("Tabs_VolunteerTabPanel_selVolunteerFieldTypes").style.display="block";
            }
            if(document.getElementById("Tabs_VolunteerTabPanel_ddlVolunteerFontFamily")!=null)
            {
                document.getElementById("Tabs_VolunteerTabPanel_ddlVolunteerFontFamily").style.display="block";
            }
            if(document.getElementById("Tabs_VolunteerTabPanel_ddlVolunteerFontSize")!=null)
            {
                document.getElementById("Tabs_VolunteerTabPanel_ddlVolunteerFontSize").style.display="block";
            }
}       
function ShowSubMenus(e)
{
     var objpopup; 

    objX=(document.all)?document.documentElement.scrollLeft:window.pageXOffset;
    objY=(document.all)?document.documentElement.scrollTop:window.pageYOffset;

    objX=e.clientX+objX; //document.body.scrollLeft;
    objY=e.clientY+objY; //document.body.scrollTop;
     var Div=document.getElementById("TopFrame1_divThirdMenu");
     if(Div!=null)
     {
        Div.style.display="none";
     }
    
   // document.getElementById("divSubMenu").style.left = objX+"px";
  //  document.getElementById("divSubMenu").style.top = objY+"px";
     
    //alert("objX="+objX);
}
var WorkoutLeft2=0,WorkoutTop2=0,ImportTop2=0,ImportLeft2=0,AtheleleLeft2=0,AtheleleTop2=0,settingleft2=0,settingtop2=0,challegesLeft2=0,challengesTop2=0;

function getDefaultLeftTop()
{
    //WorkoutLeft2=0,WorkoutTop2=0,ImportTop2=0,ImportLeft2=0,AtheleleLeft2=0,AtheleleTop2=0,settingleft2=0,settingtop2=0;
     if(document.getElementById("ancmy workouts")!=null)
         {
             WorkoutTop2=getElTop(document.getElementById("ancmy workouts"))+22+"px";
              WorkoutLeft2=getElLeft(document.getElementById("ancmy workouts"))+8+"px";
              
         }
          if(document.getElementById("ancimport/export")!=null)
        {
              ImportTop2=getElTop(document.getElementById("ancimport/export"))+22+"px";
              ImportLeft2=getElLeft(document.getElementById("ancimport/export"))+8+"px";
        }
         if(document.getElementById("ancathlete tools")!=null)
        {
             AtheleleTop2=getElTop(document.getElementById("ancathlete tools"))+22+"px";
              AtheleleLeft2=getElLeft(document.getElementById("ancathlete tools"))+8+"px";
        }
        if(document.getElementById("ancprofile")!=null)
        {
              settingtop2=getElTop(document.getElementById("ancprofile"))+22+"px";
              settingleft2=getElLeft(document.getElementById("ancprofile"))+8+"px";
        }
        if(document.getElementById("ancchallenges")!=null)
        {
              challengesTop2=getElTop(document.getElementById("ancchallenges"))+22+"px";
              challegesLeft2=getElLeft(document.getElementById("ancchallenges"))+8+"px";
        }
}
function showThirdLevelMenu(path)
{
  var DivScript="";
  var Div=document.getElementById("TopFrame1_divThirdMenu");
   
  if(WorkoutLeft2==0 && AtheleleLeft2==0)
  {
    getDefaultLeftTop();
  }
  
  if(path.indexOf("LogDetails")==0)
  {
  
    DivScript="";
    DivScript=DivScript+"<div class='MiddleArrow' style='top:-0px;left:20px;'></div>";
    DivScript=DivScript+"<div class='clsthirdMenu'><a href='../../WebPages/LogBook/LogDetails.aspx' style='color:white;text-decoration: none;'><div style=\"padding-top:8px;\">Workout Log</div></a></div>";
    DivScript=DivScript+"<div class='clsthirdMenu'><a href='../../WebPages/LogBook/LogDetails.aspx?Show=WorkoutSetting' style='color:white;text-decoration: none; cursor:hand;'><div style=\"padding-top:10px;\">Workout Settings</div></a></div>";
    DivScript=DivScript+"<div class='clsthirdMenu'><a href='../../WebPages/LogBook/LogReports.aspx' style='color:white;text-decoration: none;'><div style=\"padding-top:8px;\">Reports</div></a></div>";
    DivScript=DivScript+"<div class='clsthirdMenu'><a href='../../WebPages/LogBook/ShoeDetails.aspx' style='color:white;text-decoration: none;'><div style=\"padding-top:8px;\">Shoe Tracking</div></a></div>";
    DivScript=DivScript+"<div class='clsthirdMenuLast'><a href='../../WebPages/LogBook/TireDetails.aspx' style='color:white;text-decoration: none;'><div style=\"padding-top:8px;\">Tire Tracking</div></a></div>";
    
    
    
//    DivScript="";
//    DivScript=DivScript+"<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"> <tr> <td class='MiddleArrow' style='top:-0px;left:70px;'></td></tr>";
//    DivScript=DivScript+"<tr><td class='clsthirdMenu'><a onclick=\"javascript:return ShowLogSettings();\" style='color:white;text-decoration: none;'><span style=\"padding-top:10px;\">Workout Setting</span></a></td></tr>";
//    DivScript=DivScript+"<tr><td class='clsthirdMenu'><a href='../../WebPages/LogBook/LogReports.aspx' style='color:white;text-decoration: none;'><span style=\"padding-top:8px;\">Report</span></a></td></tr>";
//    DivScript=DivScript+"<tr><td class='clsthirdMenu'><a href='ShoeDetails.aspx' style='color:white;text-decoration: none;'><span style=\"padding-top:8px;\">Shoe Tracking</span></a></td></tr>";
//    DivScript=DivScript+"<tr><td class='clsthirdMenuLast'><a href='TireDetails.aspx' style='color:white;text-decoration: none;'><span style=\"padding-top:8px;\">Tire Tracking</span></a></td></tr>";
//    DivScript=DivScript+"</table>";
      if(Div!=null)
      {
    
         Div.innerHTML=DivScript;
        Div.style.display="block";
//        Div.style.left="150px";
//          if(document.getElementById("PageFooter_hidUserRole").value!="")
//        {
//            Div.style.top="196px";
//         }
//         else
//         {
//            Div.style.top="194px";
//         }
        if(WorkoutLeft2==0)
        {
             if(document.getElementById("ancmy workouts")!=null)
             {
                  Div.style.top=getElTop(document.getElementById("ancmy workouts"))+22+"px";
                  Div.style.left=getElLeft(document.getElementById("ancmy workouts"))+8+"px";
             }
         }
          else
          {
            //Div.style.top=WorkoutTop2;
             Div.style.top=getElTop(document.getElementById("ancmy workouts"))+22+"px";
            Div.style.left=WorkoutLeft2;
          }
      }
  }
  else if(path.indexOf("GPSDataUpload")==0)
  {
    DivScript="";
//    DivScript=DivScript+"<div class='MiddleArrow' style='top:-0px;left:20px;'></div>";
//    DivScript=DivScript+"<div class='clsthirdMenu'><a  href='../../WebPages/LogBook/GPSDataUpload.aspx' style='color:white;text-decoration: none;'><div style=\"padding-top:10px;\">Garmin</div></a></div>";
//    DivScript=DivScript+"<div class='clsthirdMenu'><a href='../../WebPages/LogBook/NikePlusDataUpload.aspx' style='color:white;text-decoration: none;'><div style=\"padding-top:8px;\">Nike+</div></a></div>";
//    DivScript=DivScript+"<div class='clsthirdMenuLast'><a onclick='../../WebPages/LogBook/LogDetails.aspx?Show=ImportData' style='color:white;text-decoration: none;'><div style=\"padding-top:8px;\">Excel Spreadsheet</div></a></div>";

        DivScript=DivScript+"<div class='MiddleArrow' style='top: -0px;left:20px;'></div>";
        DivScript=DivScript+"<div class='clsthirdMenu'><a href='../../WebPages/LogBook/GPSDataUpload.aspx' style='color:white;text-decoration: none;cursor:hand;'><div style=\"padding-top:8px;\">Garmin</div></a></div>";
        DivScript=DivScript+"<div class='clsthirdMenu'><a href='../../WebPages/LogBook/NikePlusDataUpload.aspx?Show=WorkoutSetting' style='color:white;text-decoration: none; cursor:hand;'><div style=\"padding-top:8px;\">Nike+</div></a></div>";
        DivScript=DivScript+"<div class='clsthirdMenuLast'><a href='../../WebPages/LogBook/LogDetails.aspx?Show=ImportData' style='color:white;text-decoration: none;cursor:hand; '><div style=\"padding-top:8px;\">Excel Spreadsheet</div></a></div>";
       
    
//       alert(" individual  : DivScript = "+DivScript);
      if(Div!=null)
      {
        Div.innerHTML=DivScript;
        Div.style.display="block";
//        Div.style.left="280px";
//           if(document.getElementById("PageFooter_hidUserRole").value!="")
//        {
//            Div.style.top="196px";
//         }
//         else
//         {
//            Div.style.top="194px";
//         }
        if(ImportLeft2==0)
        {
            if(document.getElementById("ancimport/export")!=null)
            {
                  Div.style.top=getElTop(document.getElementById("ancimport/export"))+22+"px";
                  Div.style.left=getElLeft(document.getElementById("ancimport/export"))+8+"px";
            }
        }
        else
          {
            //Div.style.top=ImportTop2;
             Div.style.top=getElTop(document.getElementById("ancimport/export"))+22+"px";
            Div.style.left=ImportLeft2;
          }
      }
  }
 else if(path.indexOf("AthleteTools")==0)
  {
    DivScript="";
    DivScript=DivScript+"<div class='MiddleArrow' style='top:-0px;left:20px;'></div>";
    DivScript=DivScript+"<div class='clsthirdMenu'><a  href='../../WebPages/AthleteTools/AthleteTools.aspx?calc=6' style='color:white;text-decoration: none;'><div style=\"padding-top:10px;\">BMI Calculator</div></a></div>";
    DivScript=DivScript+"<div class='clsthirdMenu'><a  href='../../WebPages/AthleteTools/AthleteTools.aspx?calc=1' style='color:white;text-decoration: none;'><div style=\"padding-top:10px;\">Pace Calculator</div></a></div>";
    DivScript=DivScript+"<div class='clsthirdMenu'><a  href='../../WebPages/AthleteTools/AthleteTools.aspx?calc=3' style='color:white;text-decoration: none;'><div style=\"padding-top:10px;\">Calorie Calculator</div></a></div>";
    DivScript=DivScript+"<div class='clsthirdMenu'><a  href='../../WebPages/AthleteTools/AthleteTools.aspx?calc=4' style='color:white;text-decoration: none;'><div style=\"padding-top:10px;\">Conversion Calculator</div></a></div>";
    DivScript=DivScript+"<div class='clsthirdMenu'><a  href='../../WebPages/AthleteTools/AthleteTools.aspx?calc=2' style='color:white;text-decoration: none;'><div style=\"padding-top:10px;\">Heart Rate Calculator</div></a></div>";
    DivScript=DivScript+"<div class='clsthirdMenuLast'><a  href='../../WebPages/AthleteTools/AthleteTools.aspx?calc=5' style='color:white;text-decoration: none;'><div style=\"padding-top:10px;\">Race Time Predictor</div></a></div>";
    
      if(Div!=null)
      {
        Div.innerHTML=DivScript;
        Div.style.display="block";
//        if(document.getElementById("PageFooter_hidUserRole").value!="")
//        {
//            Div.style.left="590px";
//        }
//        else
//        {
//            Div.style.left="270px";
//        }
//          if(document.getElementById("PageFooter_hidUserRole").value!="")
//        {
//            Div.style.top="196px";
//         }
//         else
//         {
//            Div.style.top="194px";
//         }
         if(AtheleleLeft2==0)
        {
             if(document.getElementById("ancathlete tools")!=null)
            {
                  Div.style.top=getElTop(document.getElementById("ancathlete tools"))+22+"px";
                  Div.style.left=getElLeft(document.getElementById("ancathlete tools"))+8+"px";
            }
        }
         else
          {
           // Div.style.top=AtheleleTop2;
            Div.style.top=getElTop(document.getElementById("ancathlete tools"))+22+"px";
            Div.style.left=AtheleleLeft2;
          }
      }
  }
  else if(path.indexOf("PublicProfile")==0)
  {
    var LoginUserName="";
    if(document.getElementById("PageFooter_hUserName")!=null && document.getElementById("PageFooter_hUserName").value!="")
    {
     LoginUserName=document.getElementById("PageFooter_hUserName").value;
    }
    DivScript="";
    DivScript=DivScript+"<div class='MiddleArrow' style='top:-0px;left:20px;'></div>";
    DivScript=DivScript+"<div class='clsthirdMenu'><a  href='../../Profile/"+LoginUserName+"' style='color:white;text-decoration: none;'><div style=\"padding-top:10px;\">View Profile</div></a></div>";
    DivScript=DivScript+"<div class='clsthirdMenu'><a  href='../../WebPages/User/EditProfile.aspx' style='color:white;text-decoration: none;'><div style=\"padding-top:10px;\">Edit Profile</div></a></div>";
    DivScript=DivScript+"<div class='clsthirdMenuLast'><a  href='../../WebPages/User/ChangePassword.aspx' style='color:white;text-decoration: none;'><div style=\"padding-top:10px;\">Settings</div></a></div>";
    
      if(Div!=null)
      {
     
        Div.innerHTML=DivScript;
        Div.style.display="block";
//        Div.style.left="890px";
//           if(document.getElementById("PageFooter_hidUserRole").value!="")
//        {
//            Div.style.top="196px";
//         }
//         else
//         {
//            Div.style.top="194px";
//         }
        if(settingleft2==0)
        {
              if(document.getElementById("ancprofile")!=null)
            {
                  Div.style.top=getElTop(document.getElementById("ancprofile"))+22+"px";
                  Div.style.left=getElLeft(document.getElementById("ancprofile"))+8+"px";
            }
        }
         else
          {
            //Div.style.top=settingtop2;
             Div.style.top=getElTop(document.getElementById("ancprofile"))+22+"px";
            Div.style.left=settingleft2;
          }
      }
  }
  
  
   else if(path.indexOf("GlobalChallenges")==0)
  {
 
    DivScript="";
    DivScript=DivScript+"<div class='MiddleArrow' style='top:-0px;left:20px;'></div>";
    DivScript=DivScript+"<div class='clsthirdMenu'><a  href='../../WebPages/LogBook/GlobalChallenges.aspx' style='color:white;text-decoration: none;'><div style=\"padding-top:10px;\">All Challenges</div></a></div>";
   var isUserLoggedIn = document.getElementById("TopFrame1_hidIsUserLoggedIn").value;
       
        if (isUserLoggedIn == "true")
        DivScript=DivScript+"<div class='clsthirdMenu'><a  href='../../WebPages/LogBook/MyChallenges.aspx' style='color:white;text-decoration: none;'><div style=\"padding-top:10px;\">My Challenges</div></a></div>";
    
      if(Div!=null)
      {
     
        Div.innerHTML=DivScript;
        Div.style.display="block";

        if(challegesLeft2==0)
        {
              if(document.getElementById("ancchallenges")!=null)
            {
                  Div.style.top=getElTop(document.getElementById("ancchallenges"))+22+"px";
                  Div.style.left=getElLeft(document.getElementById("ancchallenges"))+8+"px";
            }
        }
         else
          {
            //Div.style.top=settingtop2;
             Div.style.top=getElTop(document.getElementById("ancchallenges"))+22+"px";
            Div.style.left=challegesLeft2;
          }
      }
  }
  
  else
  {
    if(Div!=null)
      {
        Div.innerHTML="";
        Div.style.display="none";
      }
  }
    document.getElementById("TopFrame1_tblThirdMenu").style.display="block";
     document.getElementById("TopFrame1_tblThirdMenuTop").style.display="block";
    return false;
  
}
function HeighlightTopMenu()
{

    var Div=document.getElementById("TopFrame1_divThirdMenu");
    var ActiveMenu="";
    var OnSameMenu=false;
    var OnWorkoutMenu=false;
    if(document.getElementById("TopFrame1_hidCurrentMenu")!=null)
    {
         ActiveMenu=document.getElementById("TopFrame1_hidCurrentMenu").value;
    }
      if(Div!=null)
      {
       if(Div.innerHTML.indexOf("AthleteTools")>=0 || Div.innerHTML.indexOf("NikePlusDataUpload")>=0 ||  Div.innerHTML.indexOf("LogReports")>=0 ||  Div.innerHTML.indexOf("GlobalChallenges")>=0 )
       {
             document.getElementById("WORKOUTS").className="selectedcurrent";
             OnWorkoutMenu=true;
       }
       else if(Div.innerHTML.indexOf("EditProfile")>=0)
       {
            document.getElementById("MY STUFF").className="selectedcurrent";
            OnSameMenu=true;
       }
       
      }
  
    if(ActiveMenu!="")
    {
        document.getElementById(ActiveMenu).className="deselectedcurrent"; 
    }
    if(OnSameMenu==true && ActiveMenu=="MY STUFF")
    {
          document.getElementById(ActiveMenu).className="current"; 
    }
    if(OnWorkoutMenu==true && ActiveMenu=="WORKOUTS")
    {
         document.getElementById(ActiveMenu).className="current"; 
    }
    document.getElementById("TopFrame1_tblThirdMenu").style.display="block";
     document.getElementById("TopFrame1_tblThirdMenuTop").style.display="block";
    return false;
}
function RestoreOriginal()
{

     var Div=document.getElementById("TopFrame1_divThirdMenu");
     var ActiveMenu="";
   if(document.getElementById("TopFrame1_hidCurrentMenu")!=null)
   {
     ActiveMenu=document.getElementById("TopFrame1_hidCurrentMenu").value;
   }
     if(Div!=null)
      {
       if(Div.innerHTML.indexOf("AthleteTools")>=0 || Div.innerHTML.indexOf("NikePlusDataUpload")>=0 ||  Div.innerHTML.indexOf("LogReports")>=0 ||  Div.innerHTML.indexOf("GlobalChallenges")>=0 )
       {
             document.getElementById("WORKOUTS").className="select";
       }
       else if(Div.innerHTML.indexOf("EditProfile")>=0 )
       {
             document.getElementById("MY STUFF").className="select";
       }
      }
   
   if(ActiveMenu!="")
   {
      document.getElementById(ActiveMenu).className="current"; 
    
     }

    return false;
}
function HideMenu()
{
  var Div=document.getElementById("TopFrame1_divThirdMenu");
  document.getElementById("TopFrame1_tblThirdMenu").style.display="none";
   document.getElementById("TopFrame1_tblThirdMenuTop").style.display="none";
  WorkoutLeft2=0,WorkoutTop2=0,ImportTop2=0,ImportLeft2=0,AtheleleLeft2=0,AtheleleTop2=0,settingleft2=0,settingtop2=0;
 Div.style.display="none";
   return false;
}


var ns4 = (navigator.appName.indexOf("Netscape")>=0 
          && parseFloat(navigator.appVersion) >= 4 
          && parseFloat(navigator.appVersion) < 5)? true : false;
var ns6 = (parseFloat(navigator.appVersion) >= 5 
          && navigator.appName.indexOf("Netscape")>=0 )? true: false;
var ns = (document.layers)? true:false;
var ie = (document.all)? true:false;

function getElLeft(el) {
    if (ns4) {return el.pageX;} 
    else {
        xPos = el.offsetLeft;
        tempEl = el.offsetParent;
        while (tempEl != null) {
            xPos += tempEl.offsetLeft;
              tempEl = tempEl.offsetParent;
        }
        return xPos;
    }
}
function getElTop(el) {
    if (ns4) {return el.pageY;} 
    else {
        yPos = el.offsetTop;
        tempEl = el.offsetParent;
        while (tempEl != null) {
            yPos += tempEl.offsetTop;
              tempEl = tempEl.offsetParent;
        }
        return yPos;
    }
}
