﻿// JScript File

/* Functions developed by Maheswaran */

//Description: This function is used for redirecting the user to site home page while clicking the logo in header.
//Pages used: All pages.
function ClickLogo()
             {
               //alert("Called");
               //window.location.href = "http://192.168.42.196/partyinfo/";
               window.location.href = "http://partyinfo.com";
             }
             
//Description: This function is used for changing the text (Los Angeles by default) under the logo to the selected city in city dropdown in header for each selection change.
//Pages used: All pages.
function ChangeCitySelection()
             {
               //alert("Called");
               var strSelectedCity;
               var drpCity=document.getElementById("drpCity");
               for(var i=0; i<drpCity.options.length;i++)
                  {
                    if (drpCity.options[i].selected)
                        {
                          strSelectedCity = drpCity.options[i].value;
                        }
                  }
               //alert(strSelectedCity);
               document.getElementById("div_Logo_1_DynamicText").innerHTML = strSelectedCity;
             }
            
//Description: This function is used for clearing the text 'Event Name' in textbox only if the text is 'Event Name' orelse it won't in header.
//Pages used: All pages.
function ClearName()
             {
               if(document.getElementById("Header_User1_txtEventName")!=null)
                  {
		   //alert(document.getElementById("Header_User1_txtEventName").value == "Search")
                   if (document.getElementById("Header_User1_txtEventName").value == "Search")
                       {
                        document.getElementById("Header_User1_txtEventName").value="";
                       }
                  }
               if(document.getElementById("Header_User1_txtEventId")!=null)
                  {
                   if (document.getElementById("Header_User1_txtEventId").value == "Event Id")
                       {
                        document.getElementById("Header_User1_txtEventId").value="";
                       }
                  }
             }

 function ClearPartnerSearchName()
             {
               if(document.getElementById("Header_User1_txtPartnerName")!=null)
                  {
                   if (document.getElementById("Header_User1_txtPartnerName").value == "Partner Name")
                       {
                        document.getElementById("Header_User1_txtPartnerName").value="";
                       }
                  }               
             }

//Description: This function is used for invoking the thickbox effect when the particular div has been clicked.
//Pages used: Home page.
function ClickDivForPopup(intEventId, intTemplateId)
             {
               /*Functtionality has been changed
               //alert("Called_Chg");
               tb_show(null, 'Adv_Popup_2.htm?keepThis=true&TB_iframe=true&height=469&width=609', null);
               */
               
               //New functionality
               if (intTemplateId == 1)
                  {
                   parent.location.href="http://partyinfo.com/EventDetails.aspx?EventId=" + intEventId;
                  }
               else if (intTemplateId == 2)
                  {
                   parent.location.href="http://partyinfo.com/EventDetails2.aspx?EventId=" + intEventId;
                  }
               else if(intTemplateId == 3)
                  {
                   parent.location.href="http://partyinfo.com/EventDetails3.aspx?EventId=" + intEventId;
                  }
             }
function ClickLightBoxMoreInfo(intEventId, intTemplateId)
             {
               //alert(intEventId);
               //alert(intTemplateId);
               //Redirect to particular template url.
               if (intTemplateId == 1)
                  {
                   parent.location.href="http://partyinfo.com/EventDetails.aspx?EventId=" + intEventId;
                  }
               else if (intTemplateId == 2)
                  {
                   parent.location.href="http://partyinfo.com/EventDetails2.aspx?EventId=" + intEventId;
                  }
               else if(intTemplateId == 3)
                  {
                   parent.location.href="http://partyinfo.com/EventDetails3.aspx?EventId=" + intEventId;
                  }
               //Close lightbox window.              
               ClickCloseDivForPopup();
             }
function OpenEventDetailsPopup(intEventId, intTemplateId)
             {
               //alert(intEventId);
               //alert(intTemplateId);
               //Redirect to particular template url.
               if (intTemplateId == 1)
                  {
                   mywindow = window.open("http://partyinfo.com/EventDetails.aspx?EventId=" + intEventId,intEventId, "scrollbars=1,toolbar=no,status=1,resizable=1,width=400,height=600");
                   mywindow.moveTo(0,0);
                  }
               else if (intTemplateId == 2)
                  {
                   mywindow = window.open("http://partyinfo.com/EventDetails2.aspx?EventId=" + intEventId,intEventId, "scrollbars=1,toolbar=no,status=1,resizable=1,width=400,height=600");
                   mywindow.moveTo(0,0);
                  }
               else if(intTemplateId == 3)
                  {
                   mywindow = window.open("http://partyinfo.com/EventDetails3.aspx?EventId=" + intEventId,intEventId, "scrollbars=1,toolbar=no,status=1,resizable=1,width=400,height=600");
                   mywindow.moveTo(0,0);
                  }
               //Close lightbox window.              
               ClickCloseDivForPopup();
             }

	    function ClickDivForPopup_New(intEventId, Bannerid, zoneid)
             {
             


	     var theWidth, theHeight;
            // Window dimensions:
            if (window.innerWidth) {            
            theWidth=window.innerWidth;
            }
            else if (document.documentElement && document.documentElement.clientWidth) {
            theWidth=1054;//document.documentElement.offsetWidth-40;
            }
            else if (document.body) {
            theWidth=document.body.clientWidth;
            }
            if (window.innerHeight) {
            theHeight=window.innerHeight;
            }
            else if (document.documentElement && document.documentElement.clientHeight) {
            theHeight=650;//document.documentElement.offsetHeight-40;
            }
            else if (document.body) {
            theHeight=document.body.clientHeight;
            }
           
           
             params  = 'width='+theWidth;
             params += ', height='+theHeight;
             params += ', scrollbars=1,scrollbars=yes,resizable=1,resizable=yes,toolbar=no,status=1,top=0, left=0'
             params += ', fullscreen=yes';             
                           
             //http://www.partyinfo.com/absolutebm/abmc.aspx?b=122&z=7	
		//alert('abmc.aspx');	
             newwin=window.open("http://www.partyinfo.com/absolutebm/abmc.aspx?b=" + Bannerid+"&z=" + zoneid,"EventProfile",params);                      
                
		
             if (window.focus) {newwin.focus()}

             }


function GoToEventPhotoGallery(intEventId)
             {
               //alert(intEventId);
               location.href="GalleryListing.aspx?EventId=" + intEventId;
               return false;
             }
             
function GoToPersonalPhotoGallery(intGalleryid)
             {
               location.href="PersonalGalleryListing.aspx?Galleryid=" + intGalleryid;
               return false;
             }
                          
function ClickDivForPopup_Small(intEventId)
             {
               //alert(intEventId);
               tb_show(null, 'Adv_Popup_1.aspx?EventId=' + intEventId + '&keepThis=true&TB_iframe=true&height=410&width=305', null);
             }
             
             function ClickForPopup(EventPicture,EventId)
             {
               //alert(EventId);
               tb_show(null, 'AddtoFavouritePopup.aspx?EventPicture=' + EventPicture + '&EventId='+ EventId +'&keepThis=true&TB_iframe=true&height=279&width=286', null);
             }
             
             function ClickForDelete(Galleryid,PhotofileName,Photoid,GalleryName)
             {
               //alert(Photoid);
               tb_show(null, 'DeletePersonalGallery.aspx?GalleryId=' + Galleryid + '&PhotoFileName='+ PhotofileName +'&PhotoId='+ Photoid +'&GalleryName='+ GalleryName +'&keepThis=true&TB_iframe=true&height=279&width=286', null);
             }
             
             
             function ClickDivForPopupforEdit(intGalleryName,intGalleryId)
             {
             
               tb_show(null, 'EditGalleryPopup.aspx?GalleryName=' + intGalleryName + '&GalleryId='+ intGalleryId +'&keepThis=true&TB_iframe=true&height=279&width=291', null);
                //window.open("EditGalleryPopup.aspx?GalleryName=" + intGalleryName + "&GalleryId="+ intGalleryId +"","","width=305px,height=410px"); 
                //return false;
             }
             
//Description: This function is used for closing the thickbox effect when the particular close button has been clicked.
//Pages used: Home page.
function ClickCloseDivForPopup()
             {
               //alert("Called_Close");
               self.parent.tb_remove();
               //alert("Called_Close_1");
             }
             
         function ClickCloseDivForDelete(Galleryid)
         {
           //alert("Called_Close");
           parent.location.href="CreateGalleryXML.aspx?Galleryid=" + Galleryid;
             parent.location.href="PersonalGalleryListing.aspx?Galleryid=" + Galleryid;
            self.parent.tb_remove();
           //alert("Called_Close_1");
         }
         
          function ClickCloseDivForEdit()
         {
           //alert("Called_Close");
             parent.location.href="PersonalGallery.aspx";
            self.parent.tb_remove();
           //alert("Called_Close_1");
         }
             
//Description: This function is used for changing the text (Los Angeles by default) under the logo to the selected city in city dropdown in header for each selection change.
//Pages used: All pages.
function OpenForgotPasswordPopup()
             {
               //alert("Called");
               //window.open("ForgotPassword.aspx","Party Info - Forgot password","scrollbar=no,toolbar=no,status=1,resizable=no,width=340,height=190");
               mywindow = window.open("ForgotPassword.aspx","Forgotpassword", "scrollbar=no,toolbar=no,status=1,resizable=0,width=340,height=190");
               mywindow.moveTo(0,0);
               return false;
             }
function OpenChangePasswordPopup()
             {
              //alert("Called");
              mywindow = window.open("ChangePassword.aspx","Changepassword","scrollbar=no,toolbar=no,status=1,resizable=0,width=340,height=300");
              mywindow.moveTo(0,0);
              //return false;
             }
function OpenGoogleMapPopup(strGoogleMapUrl)
             {
              //alert(strGoogleMapUrl);
              mywindow = window.open(strGoogleMapUrl,"GoogleMap","scrollbar=no,toolbar=no,status=1,resizable=0,width=400,height=600");
              mywindow.moveTo(0,0);
              //return false;
             }
//function OpenEventPreviewPopup()
//             {
//               alert("Called");
//               //window.open("ForgotPassword.aspx","Party Info - Forgot password","scrollbar=no,toolbar=no,status=1,resizable=no,width=340,height=190");
//               PauseComp(15000);
//               mywindow = window.open("EventDetails.aspx","EventDetailsPopup", "scrollbar=no,toolbar=no,status=1,resizable=1,width=600,height=600");
//               mywindow.moveTo(0,0);
//               return true;
//             }
function PauseComp(millis) 
{
    var date = new Date();
    var curDate = null;

    do { curDate = new Date(); } 
    while(curDate-date < millis);
} 

function ShowLoggedUserStatus()
             {
               var elemMessage = document.getElementById("lblMessage");
               //alert(elemMessage);
               elemMessage.innerHTML = "Only Logged users can change the password."
               return false;
             }
function ClickOnWeeklyThumpnail()
          {
             //alert('Called');
          }
function SetBigImageInTabPage(strImagePath, intTabIndex, strEventId)
             {
               //alert(strEventId);
               if (intTabIndex == 0)
                  {
                    var BigImage=document.getElementById("img_Thumpnail_Big_Caribean");
                    if (BigImage)
                        {
                          BigImage.src = strImagePath;
                          var elem_HFEventId=document.getElementById("hfEventId");
                          if (elem_HFEventId)
                             {
                               elem_HFEventId.value= strEventId;
                             }
                        }
                  }
               else if (intTabIndex == 1)
                  {
                    var BigImage=document.getElementById("img_Thumpnail_Big_Hiphop");
                    if (BigImage)
                        {
                          BigImage.src = strImagePath;
                          var elem_HFEventId=document.getElementById("hfEventId");
                          if (elem_HFEventId)
                             {
                               elem_HFEventId.value= strEventId;
                             }
                        }
                  }
               else if (intTabIndex == 2)
                  {
                    var BigImage=document.getElementById("img_Thumpnail_Big_Latino");
                    if (BigImage)
                        {
                          BigImage.src = strImagePath;
                          var elem_HFEventId=document.getElementById("hfEventId");
                          if (elem_HFEventId)
                             {
                               elem_HFEventId.value= strEventId;
                             }
                        }
                  }   
               else if (intTabIndex == 3)
                  {
                    var BigImage=document.getElementById("img_Thumpnail_Big_Top");
                    if (BigImage)
                        {
                          BigImage.src = strImagePath;
                          var elem_HFEventId=document.getElementById("hfEventId");
                          if (elem_HFEventId)
                             {
                               elem_HFEventId.value= strEventId;
                             }
                        }
                  }
              else if (intTabIndex == 4)
                  {
                    var BigImage=document.getElementById("img_Thumpnail_Big_Happy");
                    if (BigImage)
                        {
                          BigImage.src = strImagePath;
                          var elem_HFEventId=document.getElementById("hfEventId");
                          if (elem_HFEventId)
                             {
                               elem_HFEventId.value= strEventId;
                             }
                        }
                  }
             }
function OpenBannerReportPopup()
         {
              //alert('Called');
              mywindow = window.open("absolutebm/login.aspx","ABMLogin","scrollbar=no,toolbar=no,status=1,resizable=1,width=800,height=800");
              mywindow.moveTo(0,0);
              return false;
         }
function OpenBannerTargetUrlPopup(strTargetUrl)
         {
              alert(strTargetUrl);
              mywindow = window.open(strTargetUrl,strTargetUrl,"scrollbar=no,toolbar=no,status=1,resizable=1,width=800,height=800");
              mywindow.moveTo(0,0);
              return false;
         }
function OpenSendBannerMailPopup(strToId, intEventId, strCCId, strFromId)
         {
             alert(strToId);
             alert(strCCId);
             alert(intEventId);
             alert(strFromId);
             location.href= "mailto:" + strToId + "?cc=" + strCCId + "&subject=Event Id: " + intEventId + "-From: " + strFromId;
             return false;
         }
function CallTabPageChange(intTabIndex, strDestinationPage)
{
  //alert(strDestinationPage);
  var el_Index = document.getElementById("TabPageIndex");
  //alert(el_Index.value);
  if (el_Index)
     {
       if(intTabIndex==el_Index.value)
          {
            //alert("1");
            return false;
          }
       else
          {
            //alert("2");
            location.href = "ChangeTabPage.aspx?TabPageIndex=" + intTabIndex +"&Destination=" + strDestinationPage;
          }
     }
  else
     {
       //alert("3");
       location.href = "ChangeTabPage.aspx?TabPageIndex=" + intTabIndex +"&Destination=" + strDestinationPage;
     }
  
}
function SetFocusForControl()
         {
           var el = document.getElementById("ibPhotoPrevious");
           if(el)
              {
               el.focus();
              }
         }
var ImageIndex_DJL_Row1=0;
var ImageIndex_DJL_Row2=0;

/* Bar landing page variables and functions */

var ImageIndex_BL=0;
//Bar landing page functions
function MoveImageOneBackward_BL()
         {
           images = new Array();
           images = document.getElementById("strImagePath").value.split('#');
           var intImageCount_BL = document.getElementById("imgCount").value;
           if (ImageIndex_BL!=0)
              {
                ImageIndex_BL = ImageIndex_BL - 1;
              }
           else
              {
                 ImageIndex_BL = intImageCount_BL - 1;
              }
           var ImageIndex_Temp = ImageIndex_BL;
           for(var i=1;i<=intImageCount_BL;i++)
              {
                          if (ImageIndex_Temp < intImageCount_BL)
                             {
                             var strImageItemName;
                             var j = i-1;
                             if (j<10)
                                {
                                
                                 strImageItemName = "rpPhotoGallery_ctl0" + j + "_img1";
                                }
                               else
                                 {
                                  strImageItemName = "rpPhotoGallery_ctl" + j + "_img1";
                                 }
                              document.getElementById(strImageItemName).src =  images[ImageIndex_Temp];
                              ImageIndex_Temp = ImageIndex_Temp + 1;
                             }
                          else
                             {
                               var strImageItemName;
                               var j = i-1;
                               if (j<10)
                                {
                                
                                 strImageItemName = "rpPhotoGallery_ctl0" + j + "_img1";
                                }
                               else
                                 {
                                  strImageItemName = "rpPhotoGallery_ctl" + j + "_img1";
                                 }
                               ImageIndex_Temp = 0;
                               document.getElementById(strImageItemName).src =  images[ImageIndex_Temp];
                               ImageIndex_Temp = ImageIndex_Temp + 1;
                             }
              }
         }
function MoveImageOneForward_BL()
         {
           images = new Array();
           images = document.getElementById("strImagePath").value.split('#');
           var intImageCount_BL = document.getElementById("imgCount").value;
           ImageIndex_BL = ImageIndex_BL + 1;
           var ImageIndex_Temp = ImageIndex_BL;
           for(var i=1;i<=intImageCount_BL;i++)
              {
                     if (ImageIndex_Temp < intImageCount_BL)
                         {
                           var strImageItemName;
                           var j = i-1;
                           if (j<10)
                                {
                                
                                 strImageItemName = "rpPhotoGallery_ctl0" + j + "_img1";
                                }
                               else
                                 {
                                  strImageItemName = "rpPhotoGallery_ctl" + j + "_img1";
                                 }
                           document.getElementById(strImageItemName).src =  images[ImageIndex_Temp];
                           ImageIndex_Temp = ImageIndex_Temp + 1;
                         }
                     else
                         {
                           var strImageItemName;
                           var j = i-1;
                           if (j<10)
                                {
                                
                                 strImageItemName = "rpPhotoGallery_ctl0" + j + "_img1";
                                }
                               else
                                 {
                                  strImageItemName = "rpPhotoGallery_ctl" + j + "_img1";
                                 }
                           ImageIndex_Temp = 0;
                           document.getElementById(strImageItemName).src =  images[ImageIndex_Temp];
                           ImageIndex_Temp = ImageIndex_Temp + 1;
                         }
              }
          if (ImageIndex_BL == intImageCount_BL)
             {
               ImageIndex_BL = 0;
             }
         }
/*End of Bar landing page variables and functions */        
 
/*Club landing page variables and functions */        
//Club landing page functions
var ImageIndex_CL=0;
function MoveImageOneBackward_CL()
         {
           images = new Array();
           images = document.getElementById("strImagePath").value.split('#');
           var intImageCount_CL = document.getElementById("imgCount").value;
           if (ImageIndex_CL!=0)
              {
                ImageIndex_CL = ImageIndex_CL - 1;
              }
           else
              {
                 ImageIndex_CL = intImageCount_CL - 1;
              }
           var ImageIndex_Temp = ImageIndex_CL;
           for(var i=1;i<=10;i++)
              {
                          if (ImageIndex_Temp < intImageCount_CL)
                             {
                              var strImageItemName;
                              var j = i-1;
                              if (j<10)
                                 {
                                  strImageItemName = "rpPhotoGallery_ctl0" + j + "_img1";
                                 }
                              else
                                 {
                                  strImageItemName = "rpPhotoGallery_ctl" + j + "_img1";
                                 }
                              document.getElementById(strImageItemName).src =  images[ImageIndex_Temp];
                              ImageIndex_Temp = ImageIndex_Temp + 1;
                             }
                          else
                             {
                               var strImageItemName;
                               var j = i-1;
                               if (j<10)
                                 {
                                  strImageItemName = "rpPhotoGallery_ctl0" + j + "_img1";
                                 }
                               else
                                 {
                                  strImageItemName = "rpPhotoGallery_ctl" + j + "_img1";
                                 }
                               ImageIndex_Temp = 0;
                               document.getElementById(strImageItemName).src =  images[ImageIndex_Temp];
                               ImageIndex_Temp = ImageIndex_Temp + 1;
                             }
              }
         }
function MoveImageOneForward_CL()
         {
           images = new Array();
           images = document.getElementById("strImagePath").value.split('#');
           var intImageCount_CL = document.getElementById("imgCount").value;
           ImageIndex_CL = ImageIndex_CL + 1;
           var ImageIndex_Temp = ImageIndex_CL;
           for(var i=1;i<=intImageCount_CL;i++)
              {
                     if (ImageIndex_Temp < intImageCount_CL)
                         {
                           var strImageItemName;
                               var j = i-1;
                               if (j<10)
                                 {
                                  strImageItemName = "rpPhotoGallery_ctl0" + j + "_img1";
                                 }
                               else
                                 {
                                  strImageItemName = "rpPhotoGallery_ctl" + j + "_img1";
                                 }
                           document.getElementById(strImageItemName).src =  images[ImageIndex_Temp];
                           ImageIndex_Temp = ImageIndex_Temp + 1;
                         }
                     else
                         {
                           var strImageItemName;
                           var j = i-1;
                           if (j<10)
                               {
                                  strImageItemName = "rpPhotoGallery_ctl0" + j + "_img1";
                               }
                           else
                               {
                                  strImageItemName = "rpPhotoGallery_ctl" + j + "_img1";
                               }
                           ImageIndex_Temp = 0;
                           document.getElementById(strImageItemName).src =  images[ImageIndex_Temp];
                           ImageIndex_Temp = ImageIndex_Temp + 1;
                         }
              }
          if (ImageIndex_CL == intImageCount_CL)
             {
               ImageIndex_CL = 0;
             }
         }

/*End of Club landing page variables and functions */


/*DJ landing page variables and functions */
var ImageIndex_DJL=0;
function MoveImageOneBackward_DJL()
         {
           images = new Array();
           images = document.getElementById("strImagePath").value.split('#');
           var intImageCount_DJL = document.getElementById("imgCount").value;
           if (ImageIndex_DJL!=0)
              {
                ImageIndex_DJL = ImageIndex_DJL - 1;
              }
           else
              {
                 ImageIndex_DJL = intImageCount_DJL - 1;
              }
           var ImageIndex_Temp = ImageIndex_DJL;
           for(var i=1;i<=10;i++)
              {
                          if (ImageIndex_Temp < intImageCount_DJL)
                             {
                              var strImageItemName;
                              var j = i-1;
                              if (j<10)
                                 {
                                  strImageItemName = "rpPhotoGallery_ctl0" + j + "_img1";
                                 }
                              else
                                 {
                                  strImageItemName = "rpPhotoGallery_ctl" + j + "_img1";
                                 }
                              document.getElementById(strImageItemName).src =  images[ImageIndex_Temp];
                              ImageIndex_Temp = ImageIndex_Temp + 1;
                             }
                          else
                             {
                               var strImageItemName;
                               var j = i-1;
                               if (j<10)
                                 {
                                  strImageItemName = "rpPhotoGallery_ctl0" + j + "_img1";
                                 }
                               else
                                 {
                                  strImageItemName = "rpPhotoGallery_ctl" + j + "_img1";
                                 }
                               ImageIndex_Temp = 0;
                               document.getElementById(strImageItemName).src =  images[ImageIndex_Temp];
                               ImageIndex_Temp = ImageIndex_Temp + 1;
                             }
              }
         }
function MoveImageOneForward_DJL()
         {
           images = new Array();
           images = document.getElementById("strImagePath").value.split('#');
           var intImageCount_DJL = document.getElementById("imgCount").value;
           ImageIndex_DJL = ImageIndex_DJL + 1;
           var ImageIndex_Temp = ImageIndex_DJL;
           for(var i=1;i<=intImageCount_DJL;i++)
              {
                     if (ImageIndex_Temp < intImageCount_DJL)
                         {
                           var strImageItemName;
                               var j = i-1;
                               if (j<10)
                                 {
                                  strImageItemName = "rpPhotoGallery_ctl0" + j + "_img1";
                                 }
                               else
                                 {
                                  strImageItemName = "rpPhotoGallery_ctl" + j + "_img1";
                                 }
                           document.getElementById(strImageItemName).src =  images[ImageIndex_Temp];
                           ImageIndex_Temp = ImageIndex_Temp + 1;
                         }
                     else
                         {
                           var strImageItemName;
                           var j = i-1;
                           if (j<10)
                               {
                                  strImageItemName = "rpPhotoGallery_ctl0" + j + "_img1";
                               }
                           else
                               {
                                  strImageItemName = "rpPhotoGallery_ctl" + j + "_img1";
                               }
                           ImageIndex_Temp = 0;
                           document.getElementById(strImageItemName).src =  images[ImageIndex_Temp];
                           ImageIndex_Temp = ImageIndex_Temp + 1;
                         }
              }
          if (ImageIndex_DJL == intImageCount_DJL)
             {
               ImageIndex_DJL = 0;
             }
         }
/*End of DJ landing page variables and functions */
    
function GoToImageGalleryPage()
         {
              mywindow = window.open("PhotoGallery.aspx","PhotoGallery","scrollbar=no,toolbar=no,status=1,resizable=1,width=800,height=800");
              mywindow.moveTo(0,0);
              return false;
         }
function GoToPartnerProfilePage(intUserId, intRoleId)
         {         
		window.location.href="VisitorsPartnerSession.aspx?PartnerId="+intUserId;
//              if (intRoleId==4) //DJ Profile Page
//                 {
//                      mywindow = window.open("DJDetails.aspx?DJId=" + intUserId,"DJDetails" + intUserId,"toolbar=no,status=1,resizable=1,width=800,height=800");
//                      mywindow.moveTo(0,0);
//                      return false;
//                 }
//              else if (intRoleId==6) //Artist Profile Page
//                 {
//                      mywindow = window.open("ArtistDetails.aspx?ArtistId=" + intUserId,"ArtistDetails" + intUserId,"toolbar=no,status=1,resizable=1,width=800,height=800");
//                      mywindow.moveTo(0,0);
//                      return false;
//                 } 
//              else if (intRoleId==5) //Bar Profile Page
//                 {
//                      mywindow = window.open("BarDetails.aspx?BarId=" + intUserId,"BarDetails" + intUserId,"toolbar=no,status=1,resizable=1,width=800,height=800");
//                      mywindow.moveTo(0,0);
//                      return false;
//                 } 
         }
function OpenRatingWindow()
         {
           
           var elem_Rating = document.getElementById("ucRateThisPartner_div_RateContainer");
           //alert('Called');
           if (elem_Rating!=null)
              {
                if (elem_Rating.className == 'div_rate_container_visible')
                   {
                     elem_Rating.className='div_rate_container';
                   }
                else
                   {
                     elem_Rating.className='div_rate_container_visible';
                   }
                //alert("Found");
                return false;
              }
         }
 function OpenRatingWindow_Page()
         {
           
           var elem_Rating = document.getElementById("div_RateContainer");
           //alert('Called');
           if (elem_Rating!=null)
              {
                if (elem_Rating.className == 'div_rate_container_visible')
                   {
                     elem_Rating.className='div_rate_container';
                   }
                else
                   {
                     elem_Rating.className='div_rate_container_visible';
                   }
              }
           //return false;
         }
 function OpenRatingWindowReturnFalse()        
          {
            return false;
          }
 var mywindow;
 function ShowEventProfileTemplatePopup(strImagePath)
             {
               //alert(strImagePath);
               mywindow = window.open(strImagePath, "EventTemplatePopup", 'width=400, height=600, resizable=1, scrollbars=1');
               mywindow.moveTo(0,0);
               
               //Using div (not completed)
               /*var div=document.getElementById("div_ThumpnailBigger");
               if (div)
                   {
                    var img = document.getElementById("img_ThumpnailBigger");
                    if (img)
                       {
                         img.src =strImagePath;
                         img.className = "img_thumpnailbigger_border";
                         div.className = "div_thumpnailbigger_border";
                       }
                   }*/                                 
             }
function HideEventProfileTemplatePopup()
             {
               //alert(strImagePath);
               mywindow.close();
               
               //Using div (not completed)
               /*var div=document.getElementById("div_ThumpnailBigger");
               if (div)
                   {
                    var img = document.getElementById("img_ThumpnailBigger");
                    if (img)
                       {
                         //img.src =strImagePath;
                         img.className = "img_thumpnailbigger";
                         div.className = "div_thumpnailbigger";
                       }
                   }*/                                 
             }
function ChkEntranceFee()
         {
           var chk_elem = document.getElementById("chkNoFee");
           if (chk_elem!=null)
              {
               if (chk_elem.checked)
                  {
                    //alert('Called1');
                    var div_elem = document.getElementById("div_EntranceFee");
                    if (div_elem!=null)
                       {
                         div_elem.style.display="none";
                       }
                  }
               else
                  {
                    //alert('Called2');
                    var div_elem = document.getElementById("div_EntranceFee");
                    if (div_elem!=null)
                       {
                         div_elem.style.display="block";
                       }
                  }
              }
         }
function ChkRecurringInfo()
         {
           var chk_elem = document.getElementById("chkNotOneDayEvent");
           if (chk_elem!=null)
              {
               if (!chk_elem.checked)
                  {
                    //alert('Called1');
                    var div_elem = document.getElementById("div_RecurringInfo");
                    if (div_elem!=null)
                       {
                         div_elem.style.display="none";
                       }
                  }
               else
                  {
                    //alert('Called2');
                    var div_elem = document.getElementById("div_RecurringInfo");
                    if (div_elem!=null)
                       {
                         div_elem.style.display="block";
                       }
                  }
              }
         }
function CheckNoOfPerDays()
         {
           txt_elem = document.getElementById("txtEveryDay");
           if (txt_elem != null)
              {
                //alert('Called1');
                if (txt_elem.value=="")
                   {
                     return;
                   }
                else
                   {
                     var regex=/^\d{1,2}$/;
                     if (txt_elem.value.search(regex)==-1)
                        {
                          alert('Called1_1');
                          var lbl_elem = document.getElementById("revPerDay");
                          var hf_elem = document.getElementById("hfPerDay");
                          if (lbl_elem!=null && hf_elem!=null)
                             {
                               lbl_elem.innerText = hf_elem.value;
                             }
                        }
                     else
                        {
                          var lbl_elem = document.getElementById("revPerDay");
                          if (lbl_elem!=null)
                             {
                               lbl_elem.innerText = "";
                             }
                        }
                   }
              }
           else
              {
                var lbl_elem = document.getElementById("revPerDay");
                if (lbl_elem!=null)
                   {
                     lbl_elem.innerText = "";
                   }
              }
         }
function ChageMenuImage(strMenuName)
         {
           var elem_hf = document.getElementById('Header_User1_hfMenuIndex');
           if (elem_hf !=null)
              {
              }
           else
              {
              }
           alert(strMenuName);
           for (var i=1;i<=13;i++)
               {
                 var strTempName = "Menu" + i;
                 if (strTempName == strMenuName)
                    {
                      alert('Called1');
                      var elem_img = document.getElementById(strMenuName);
                      var src=elem_img.src;
                      src=src.replace("_hover","");
                      src=src.replace(".jpg","_hover.jpg");
                      elem_img.src = src;
                    }
                 else
                    {
                      alert('Called2');
                      var elem_img = document.getElementById(strTempName);
                      var src=elem_img.src;
                      src=src.replace("_hover.jpg",".jpg");
                      elem_img.src = src;
                    }
               }
         }
function GoToEventDetailsPage()
         {
           var elem_HFEventId=document.getElementById("hfEventId");
           if (elem_HFEventId)
              {
                 if (elem_HFEventId.value != "")
                     {
                       if (elem_HFEventId.value.split('-')[1] == "1")
                          {
                            mywindow = window.open("http://partyinfo.com/EventDetails.aspx?EventId=" + elem_HFEventId.value.split('-')[0], "EventTemplatePopup", 'width=400, height=600, resizable=1, scrollbars=1');
                            mywindow.moveTo(0,0);
                          }
                       else if (elem_HFEventId.value.split('-')[1] == "2")
                          {
                            mywindow = window.open("http://partyinfo.com/EventDetails2.aspx?EventId=" + elem_HFEventId.value.split('-')[0], "EventTemplatePopup", 'width=400, height=600, resizable=1, scrollbars=1');
                            mywindow.moveTo(0,0);
                          }
                       else if (elem_HFEventId.value.split('-')[1] == "3")
                          {
                            mywindow = window.open("http://partyinfo.com/EventDetails3.aspx?EventId=" + elem_HFEventId.value.split('-')[0], "EventTemplatePopup", 'width=400, height=600, resizable=1, scrollbars=1');
                            mywindow.moveTo(0,0);
                          }
                     }
              }
         }
function OpenReportOffensiveContent()
         {
           mywindow = window.open("ReportContent.aspx","Report_Offensive_Content","toolbar=no,status=1,resizable=1,width=408,height=380");
           mywindow.moveTo(0,0);
         }
function OpenMonthlyCalendarPopup(strEventIds, strDate)
         {
           //alert(strEventIds);
           intHeight = strEventIds.split("/").length; 
	   if(Number(intHeight)==2 )
	        {	         
             intHeight = Number(intHeight/2) * 150;
	        }
	        else if(Number(intHeight)>=3 )
	        {      
            intHeight = Number(intHeight/3) * 150;
	        }    
		else
		{		
		  intHeight =150;
		}
	  
           //alert(intHeight);
           tb_show(null, 'Monthly_Calendar_popup_2.aspx?Date=' + strDate +'&EventIds=' + strEventIds + '&keepThis=true&TB_iframe=true&height='+intHeight+'&width=240', null);
         }
function OpenMonthlyCalendarMouseOver(strEventId)
         {
           //alert(strEventId);
           tb_show(null, 'Monthly_Calendar_popup_1.aspx?EventId=' + strEventId + '&keepThis=true&TB_iframe=true&height=371&width=234', null);
         }
function ClickCloseDivForPopup_Calendar()
             {
               //alert("Called_Close");
               self.parent.tb_remove();
               //alert("Called_Close_1");
             }
function RedirectToEventDetailsPage(intEventId, intTemplateId)
         {
         }
function OpenMusicDetailsPopup(intMusicId)
         {
           mywindow = window.open("MusicDetails.aspx?MusicId=" + intMusicId,"Music_Details","toolbar=no,status=1,resizable=1,width=400,height=600");
           mywindow.moveTo(0,0);
         }
/*DJ landing page variables and functions */
var ImageIndex_GL=0;
function MoveImageOneBackward_GL()
         {
           images = new Array();
           images = document.getElementById("strImagePath").value.split('#');
           var intImageCount_GL = document.getElementById("imgCount").value;
           if (ImageIndex_GL!=0)
              {
                ImageIndex_GL = ImageIndex_GL - 1;
              }
           else
              {
                 ImageIndex_GL = intImageCount_GL - 1;
              }
           var ImageIndex_Temp = ImageIndex_GL;
           for(var i=1;i<=5;i++)
              {
                          if (ImageIndex_Temp < intImageCount_GL)
                             {
                              var strImageItemName;
                              var j = i-1;
                              if (j<10)
                                 {
                                  strImageItemName = "rp_Thumbnails_ctl0" + j + "_img1";
                                 }
                              else
                                 {
                                  strImageItemName = "rp_Thumbnails_ctl" + j + "_img1";
                                 }
                              alert(strImageItemName);
                              document.getElementById(strImageItemName).src =  images[ImageIndex_Temp];
                              document.getElementById(strImageItemName).removeAttribute("onclick");
                              var srcModified = "return AssignBigImageSrc('" + document.getElementById(strImageItemName).src + "');";
                              document.getElementById(strImageItemName).setAttribute('onclick',srcModified);
                              ImageIndex_Temp = ImageIndex_Temp + 1;
                             }
                          else
                             {
                               var strImageItemName;
                               var j = i-1;
                               if (j<10)
                                 {
                                  strImageItemName = "rp_Thumbnails_ctl0" + j + "_img1";
                                 }
                               else
                                 {
                                  strImageItemName = "rp_Thumbnails_ctl" + j + "_img1";
                                 }
                               ImageIndex_Temp = 0;
                               document.getElementById(strImageItemName).src =  images[ImageIndex_Temp];
                              document.getElementById(strImageItemName).removeAttribute("onclick");
                              var srcModified = "return AssignBigImageSrc('" + document.getElementById(strImageItemName).src + "');";
                              document.getElementById(strImageItemName).setAttribute('onclick',srcModified);
                               ImageIndex_Temp = ImageIndex_Temp + 1;
                             }
              }
         }
function MoveImageOneForward_GL()
         {
           images = new Array();
           images = document.getElementById("strImagePath").value.split('#');
           var intImageCount_GL = document.getElementById("imgCount").value;
           ImageIndex_GL = ImageIndex_GL + 1;
           var ImageIndex_Temp = ImageIndex_GL;
           for(var i=1;i<=intImageCount_GL;i++)
              {
                     if (ImageIndex_Temp < intImageCount_GL)
                         {
                           var strImageItemName;
                               var j = i-1;
                               if (j<10)
                                 {
                                  strImageItemName = "rp_Thumbnails_ctl0" + j + "_img1";
                                 }
                               else
                                 {
                                  strImageItemName = "rp_Thumbnails_ctl" + j + "_img1";
                                 }
                           document.getElementById(strImageItemName).src =  images[ImageIndex_Temp];
                           document.getElementById(strImageItemName).src =  images[ImageIndex_Temp];
                           document.getElementById(strImageItemName).removeAttribute("onclick");
                           var srcModified = "return AssignBigImageSrc('" + document.getElementById(strImageItemName).src + "');";
                           document.getElementById(strImageItemName).setAttribute('onclick',srcModified);
                           ImageIndex_Temp = ImageIndex_Temp + 1;
                         }
                     else
                         {
                           var strImageItemName;
                           var j = i-1;
                           if (j<10)
                               {
                                  strImageItemName = "rp_Thumbnails_ctl0" + j + "_img1";
                               }
                           else
                               {
                                  strImageItemName = "rp_Thumbnails_ctl" + j + "_img1";
                               }
                           ImageIndex_Temp = 0;
                           document.getElementById(strImageItemName).src =  images[ImageIndex_Temp];
                           document.getElementById(strImageItemName).src =  images[ImageIndex_Temp];
                           document.getElementById(strImageItemName).removeAttribute("onclick");
                           var srcModified = "return AssignBigImageSrc('" + document.getElementById(strImageItemName).src + "');";
                           document.getElementById(strImageItemName).setAttribute('onclick',srcModified);
                           ImageIndex_Temp = ImageIndex_Temp + 1;
                         }
              }
          if (ImageIndex_GL == intImageCount_GL)
             {
               ImageIndex_GL = 0;
             }
         }
/*End of DJ landing page variables and functions */

function ShowMediaInPlayer(strMusicTitle, strMusicAuthor, strMusicId, strMusicDesc, strMusicFile)
{
  /*alert(strMusicTitle);
  alert(strMusicAuthor);
  alert(strMusicId);
  alert(strMusicDesc);
  alert(strMusicFile);*/
  
  //Assign values to the controls.
  var elem_Title = document.getElementById("div_MusicTitle");
  if (elem_Title!=null)
     {
       elem_Title.innerHTML = strMusicTitle;
     }
  var elem_Author = document.getElementById("div_MusicAuthor");
  if (elem_Author!=null)
     {
       elem_Author.innerHTML = strMusicAuthor;
     }
  var elem_Id = document.getElementById("hfRatePartner");
  if (elem_Id!=null)
     {
       elem_Id.innerHTML = strMusicId;
     }
  var elem_Desc= document.getElementById("div_MusicDesc");
  if (elem_Desc!=null)
     {
       elem_Desc.innerHTML = strMusicDesc;
     }
     //Assing media player file to play
     var obj = document.getElementById("oplayer");   
     if (!obj)
        {
         obj=document.getElementById("player");
         obj.FileName = strMusicFile;  
	 obj.src =strMusicFile;              
        }
     else
        {        
        obj.src =strMusicFile;             
        }
}
 function ShowMusicListingPopup()
             {
               mywindow = window.open("MusicListing.aspx", "MusicListing", 'width=400, height=600, resizable=1, scrollbars=1');
               mywindow.moveTo(0,0);                                 
             }
function PlayMusic(strFileName)
             {
               //alert(strFileName);
               mywindow = window.open("PlayMusic.aspx?FileName=" + strFileName, "PlayMusic", 'width=475, height=322, resizable=1, scrollbars=1');
               mywindow.moveTo(0,0);                                 
             }
function PlayMusicPageOnload()
         {
          //alert('Called');
          //var frm = document.getElementById("Form1");
		  //var qsParm = new Array();
		  var query = window.location.search.substring(1);
		  var parms = query.split('&');
		  var strMusicFile = "./MusicFiles/" + parms[0].substring(8+1); //The query string title is 'FileName'.
		  //alert(strMusicFile);
		  
		  //Assing media player file to play
          var obj = document.getElementById("oplayer");   
          if (!obj)
             {
              obj=document.getElementById("player");
              obj.FileName = "" + strMusicFile;            
             }
          else
            {        
             obj.src = strMusicFile;             
            }
         }
/* End of functions */

function AssignBigImageSrc(strImagePath)
         {
           //alert(strImagePath);
           var elem_BigImage = document.getElementById("img_BigImage");
           if (elem_BigImage != null)
              {
                elem_BigImage.src=strImagePath;
              }
         }
function OpenEventImageInOriginalSize(strImagePath)
         {
           //alert(strImagePath);
           //mywindow = window.open(strImagePath, "EventImage", 'width=400, height=600, resizable=1, scrollbars=1');
           
           //New code
           var elem_BigImage = document.getElementById("imgEventProfile");
           mywindow = window.open(elem_BigImage.src, "EventImage", 'width=400, height=600, resizable=1, scrollbars=1');
           mywindow.moveTo(0,0); 
         }
function OpenTopMusicListPopup(intContestId)
             {
                 //alert(intContestId);
                 if(intContestId==0)
                    {
                       //alert("1");
                       try
                       {
                       mywindow = window.open("ContestPopup.aspx","ContestAlertPopup", "toolbar=no,status=1,resizable=0,width=582,height=471");
                       mywindow.moveTo(0,0);
                       }
                       catch(err)
                       {
                        //alert(err);
                        return false;
                       }
                       try
                       {
                       window.event.returnValue = false;
                       }
                       catch(err)
                       {
                       }
                       return false;
                    }
                 else
                    {
                       //alert("2");
                       try
                       {
//                       if(!mywindow.closed)
//                          {
//                            mywindow.close();
//                          }
                       mywindow = window.open("ContestPopup.aspx?ContestId=" + intContestId,"ContestAlertPopup", "toolbar=no,status=1,resizable=0,width=582,height=491");
                       mywindow.close();
                       mywindow = window.open("ContestPopup.aspx?ContestId=" + intContestId,"ContestAlertPopup", "toolbar=no,status=1,resizable=0,width=582,height=491");
                       mywindow.moveTo(0,0);
                       }
                       catch(err)
                       {
                        //alert(err);
                        return false;
                       }
                       window.event.returnValue = false;
                       return false;
                    }
             }
function RedirectToContestPage(strTargetPage)
             {
             if(strTargetPage == "login")
             {
               window.opener.location.href = "login.aspx";
               window.close();
             }
             else if(strTargetPage == "contest")
             {
               window.opener.location.href = "Contest.aspx";
               window.close();
             }
             }
function RedirectToContestLandingPage(strTargetPage)
             {
             if(strTargetPage == "login")
             {
               window.opener.location.href = "login.aspx";
               window.close();
             }
             else if(strTargetPage == "ContestLanding")
             {
               window.opener.location.href = "ContestLanding.aspx";
               window.close();
             }
             }             
function SeeOtherSideImage()
         {
          //alert('Called');
          var elem_Current = document.getElementById("hfEventCurrentImage");
          //alert(elem_Current.value);
          var elem_Image = document.getElementById("imgEventProfile");
          if (elem_Current.value == "2")
              {
               var elem_FirstImagePath = document.getElementById("hfEventFirstImage");
               elem_Image.src=elem_FirstImagePath.value;
               elem_Current.value = "1";
               //alert(elem_Current.value);
              }
          else if (elem_Current.value == "1")
              {
               var elem_SecondImagePath = document.getElementById("hfEventSecondImage");
               if (elem_SecondImagePath.value!="")
               {
               elem_Image.src=elem_SecondImagePath.value;
               }
               elem_Current.value ="2";
               //alert(elem_Current.value);
              }
         }
         
         
         
//Code added by Maheswaran for past events gallery Previous, Next functionalities.
var ImageIndex_BL=0;
//Bar landing page functions
function MoveImageOneBackward_PastEvent()
         {
           images = new Array();
           images = document.getElementById("strImagePath").value.split('#');
           var intImageCount_BL = document.getElementById("imgCount").value;
           
           if (ImageIndex_BL!=0)
              {
                ImageIndex_BL = ImageIndex_BL - 1;
              }
           else
              {
                 ImageIndex_BL = intImageCount_BL - 1;
              }
           var ImageIndex_Temp = ImageIndex_BL;
           for(var i=1;i<=intImageCount_BL;i++)
              {
                          if (ImageIndex_Temp < intImageCount_BL)
                             {
                             var strImageItemName;
                             var j = i-1;
                             if (j<10)
                                {
                                
                                 strImageItemName = "rpPhotoGallery_ctl0" + j + "_img1";
                                }
                               else
                                 {
                                  strImageItemName = "rpPhotoGallery_ctl" + j + "_img1";
                                 }
                              document.getElementById(strImageItemName).src =  images[ImageIndex_Temp];
                              ImageIndex_Temp = ImageIndex_Temp + 1;
                              
                              
                           //Set the new onclick value.
//                           var strImageItemName_Old;
//                           if ((j-1)<10)
//                                {
//                                
//                                 strImageItemName_Old = "rpPhotoGallery_ctl0" + (j-1) + "_img1";
//                                }
//                               else
//                                 {
//                                  strImageItemName_Old = "rpPhotoGallery_ctl" + (j-1) + "_img1";
//                                 }
//                           document.getElementById(strImageItemName).setAttribute('onclick',document.getElementById(strImageItemName_Old).getAttribute('onclick'));
                           //End of code.
                           
                           
                             }
                          else
                             {
                               var strImageItemName;
                               var j = i-1;
                               if (j<10)
                                {
                                
                                 strImageItemName = "rpPhotoGallery_ctl0" + j + "_img1";
                                }
                               else
                                 {
                                  strImageItemName = "rpPhotoGallery_ctl" + j + "_img1";
                                 }
                               ImageIndex_Temp = 0;
                               document.getElementById(strImageItemName).src =  images[ImageIndex_Temp];
                               ImageIndex_Temp = ImageIndex_Temp + 1;
                             }
              }
              
              return false;
         }
function MoveImageOneForward_PastEvent()
         {
           images = new Array();
           images = document.getElementById("strImagePath").value.split('#');
           var intImageCount_BL = document.getElementById("imgCount").value;
           //alert(intImageCount_BL);
           ImageIndex_BL = ImageIndex_BL + 1;
           var ImageIndex_Temp = ImageIndex_BL;
           for(var i=1;i<=intImageCount_BL;i++)
              {
                     if (ImageIndex_Temp < intImageCount_BL)
                         {
                           //alert('1');
                           var strImageItemName;
                           var j = i-1;
                           if (j<10)
                                {
                                
                                 strImageItemName = "rpPhotoGallery_ctl0" + j + "_img1";
                                }
                               else
                                 {
                                  strImageItemName = "rpPhotoGallery_ctl" + j + "_img1";
                                 }
                           //alert(strImageItemName);
                           document.getElementById(strImageItemName).src =  images[ImageIndex_Temp];
                           ImageIndex_Temp = ImageIndex_Temp + 1;
                         }
                     else
                         {
                           //alert('2');
                           var strImageItemName;
                           var j = i-1;
                           if (j<10)
                                {
                                
                                 strImageItemName = "rpPhotoGallery_ctl0" + j + "_img1";
                                }
                               else
                                 {
                                  strImageItemName = "rpPhotoGallery_ctl" + j + "_img1";
                                 }
                           ImageIndex_Temp = 0;
                           document.getElementById(strImageItemName).src =  images[ImageIndex_Temp];
                           ImageIndex_Temp = ImageIndex_Temp + 1;
                         }
                         
                         //Set the new onclick value.
                           var strImageItemName_Old;
                           var strImageItemName_New;
                           //alert(i);
                           var intIndex = i-1;
                           if (intIndex<10)
                                {
                                 //alert(i);
                                 strImageItemName_Old = "rpPhotoGallery_ctl0" + intIndex + "_img1";
                                 if (intIndex == 0)
                                 {
                                 strImageItemName_New = "rpPhotoGallery_ctl0" + intIndex + "_img1";
                                 }
                                 else
                                 {
                                 strImageItemName_New = "rpPhotoGallery_ctl0" + intIndex-1 + "_img1";
                                 }
                                }
                               else
                                 {
                                  //alert(i);
                                 strImageItemName_Old = "rpPhotoGallery_ctl" + intIndex + "_img1";
                                 if (intIndex == intImageCount_BL)
                                 {
                                 strImageItemName_New = "rpPhotoGallery_ctl" + intIndex-1 + "_img1";
                                 }
                                 else
                                 {
                                 strImageItemName_New = "rpPhotoGallery_ctl" + intIndex-1 + "_img1";
                                 }
                                 }
                           try
                           {
                           document.getElementById(strImageItemName_New).setAttribute('onclick',document.getElementById(strImageItemName_Old).getAttribute('onclick'));
                           }
                           catch(err)
                           {
                           }
                           //End of code
              }
          if (ImageIndex_BL == intImageCount_BL)
             {
               ImageIndex_BL = 0;
             }
             
             return false;
         }
function ShowPictureOfTheWeekBigImage(strImagePath, imgDescription)
{
  //alert(strImagePath);
  document.getElementById("imgPicOfWeek").src=strImagePath;
  document.getElementById("txtDescription").innerText=imgDescription;
  //alert(document.getElementById("txtDescription").innerText);
  return false;
}



function ShowPictureOfTheWeekBigImageAllDetails(strImagePath,Gallery,EventName,Date,imgDescription)
{
  //alert(strImagePath);
  document.getElementById("imgPicOfWeek").src=strImagePath;
  document.getElementById("imgPicOfWeek").title= Gallery+" - "+EventName;
  document.getElementById("txtGallery").innerText=Gallery;
  document.getElementById("txtEventName").innerText=EventName;  
  document.getElementById("txtDate").innerText=Date;
  document.getElementById("txtDescription").innerText=imgDescription;
  //alert(document.getElementById("txtDescription").innerText);
  return false;
}


function ShowEventPhotoBigImage(strImagePath, strBigImageId)
{
  //alert(strImagePath);
  //alert(strBigImageId);
  if (document.getElementById(strBigImageId)!=null)
      {
        document.getElementById(strBigImageId).src=strImagePath;
      }
  return false;
}
function GoToEventGalleryPage(strEventId)
{
  //alert(strEventId);
  window.location.href = "GalleryListing.aspx?EventId=" + strEventId;
  //mywindow.moveTo(0,0);
  return false;
}
//End of code added by Maheswaran.

//Telerik Functions.

            function addTitle(radUpload, args)
            {
                //alert('Called1');
                var curLiEl = args.get_row();
                var firstInput = curLiEl.getElementsByTagName("input")[0];
                
                //Create a simple HTML template.
                var table = document.createElement("table");
                table.className = 'AdditionalInputs';
                
//                //A new row for a Title field
                  row = table.insertRow(-1);
                  cell = row.insertCell(-1);
                  cell.className = "td_photo_upload_table";
                
                input = CreateInput("Desc", "text");
                input.className = "txt_photo_upload_desc";
                input.id = input.name = radUpload.getID(input.name);
                label = CreateLabel("Description: ",input.id);
                cell.appendChild(label);
                cell = row.insertCell(-1);
                cell.className = "td_photo_upload_table";
                cell.appendChild(input);
                
                //Add a File label in front of the file input
                var fileInputSpan = curLiEl.getElementsByTagName("span")[0];
                var firstNode = curLiEl.childNodes[0];
                label = CreateLabel("* File: ",radUpload.getID());
                curLiEl.insertBefore(label, firstNode);
                
                curLiEl.insertBefore(table, label);
            }
            
            function CreateLabel(text, associatedControlId)
            {
                //alert('Called2');
                var label = document.createElement("label");
                label.innerHTML = text;
                label.setAttribute("for", associatedControlId);
                label.setAttribute("class", "lbl_photo_upload_desc");
                label.style.fontSize = 12;
                
                return label;
            }
            
            function CreateInput(inputName, type)
            {
                //alert('Called3');
                var input = document.createElement("input");
                input.type = type;
                input.name = inputName;
                input.setAttribute("maxlength", "200");
                //input.setAttribute("value", "Max. of 200 characters.");
                //input.setAttribute("onselect", "ClearPhotoDescField(this);");
                
                return input;
            }

//End of Telerik Functions.

function ClearPhotoDescField(objCtrl)
         {
           alert(objCtrl);
           if (objCtrl.value == "Max. of 200 characters.")
           {
              objCtrl.value = "";
           }
         }
function CheckContestUserDetails(strNameCtrlId, strEmailCtrlId, strZipCtrlId, strCellCntrlId)
{
  //alert(strNameCtrlId);
  //alert(strEmailCtrlId);
  //alert(strZipCtrlId);
  var regex=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
  if(document.getElementById(strNameCtrlId).value == "")
     {
      alert(document.getElementById("hfErrorMessage").value);
      return false;
     }
  else if(document.getElementById(strEmailCtrlId).value == "")
     {
      alert(document.getElementById("hfErrorMessage").value);
      return false;
     }
  else if(document.getElementById(strEmailCtrlId).value.search(regex)== -1)
     {
      alert(document.getElementById("hfErrorMessage1").value);
      return false;
     }
  else if(document.getElementById(strZipCtrlId).value == "")
     {
      alert(document.getElementById("hfErrorMessage").value);
      return false;
     }
  else if(document.getElementById(strCellCntrlId).value == "")
     {
      alert(document.getElementById("hfErrorMessage").value);
      return false;
     }
  else
     {
      return true;
     }
}


function EnableSearchType()
{
    var rbSelectAlbum=document.getElementById('rbSelectAlbum');
    var rbNewAlbum=document.getElementById('rbNewAlbum');
    
    if(rbSelectAlbum.checked)
    {
        if(rbNewAlbum.checked)
        {
            rbNewAlbum.checked=false;
        }
        else
        {
            rbNewAlbum.checked=true;
        }
    }
}

function EnableNewAlbum()
{
    var rbSelectAlbum=document.getElementById('rbSelectAlbum');
    var rbNewAlbum=document.getElementById('rbNewAlbum');
    
    if(rbNewAlbum.checked)
    {
        if(rbSelectAlbum.checked)
        {
            rbSelectAlbum.checked=false;
        }
        else
        {
            rbSelectAlbum.checked=true;
        }
    }
}

//Created by Maheswaran on AUG-18-2009.
function ShowContestWinnersPopup(strContestId)
{
 alert(strContestId);
 tb_show(null, 'ContestWinnersPopup.aspx?ContestId=' + strContestId + '&keepThis=true&TB_iframe=true&height=551&width=647', null);
}
function PlayMediaFromMediaApplPage(strMediaFile, strMediaTitle)
{
  //alert(strMediaFile);
  tb_show(null, 'PlayMedia.aspx?MediaFile=' + strMediaFile + '&MediaTitle='+ strMediaTitle +'&keepThis=true&TB_iframe=true&height=325&width=305', null);
  return false;
}
function RemoveMediaFromMediaApplPage(strMediaId, strMediaTitle, strRemoveType)
{
  //alert(strMediaId);
  if(strRemoveType !=null) //Remove from PlayList.
  {
   tb_show(null, 'RemoveMediaAlert.aspx?MediaId=' + strMediaId + '&RemoveType=1&MediaTitle='+ strMediaTitle +'&keepThis=true&TB_iframe=true&height=190&width=305', null);
  }
  else //Remove from Favorite list.
  {
   tb_show(null, 'RemoveMediaAlert.aspx?MediaId=' + strMediaId + '&MediaTitle='+ strMediaTitle +'&keepThis=true&TB_iframe=true&height=190&width=305', null);
  }
  return false;
}
function OpenMediaDetailsFromMediaApplPage(strMediaId)
{
  //alert(strMediaId);
  tb_show(null, 'MediaDetails.aspx?MediaId=' + strMediaId + '&keepThis=true&TB_iframe=true&height=410&width=305', null);
  return false;
}
function ClickCloseDivForPopup_Remove()
             {
               self.parent.tb_remove();
               return false;
             }
function RowSelectedInPlayList(sender, eventArgs)
{
 var intIndex = eventArgs.get_itemIndexHierarchical();


if((intIndex % 2) == 0)
{
 intIndex = parseInt(eventArgs.get_itemIndexHierarchical()) + 4;
}
else
{
 intIndex = parseInt(eventArgs.get_itemIndexHierarchical()) + 5;
}


//rgPlayList_ctl00_ctl06_hfFileUrl
var strCtrlName;
if(intIndex<10)
{
  strCtrlName = "rgPlayList_ctl00_ctl0" + intIndex + "_hfFileUrl";
}
else
{
  strCtrlName = "rgPlayList_ctl00_ctl" + intIndex + "_hfFileUrl";
}

if(document.getElementById(strCtrlName)!=null)
{
        var obj = document.getElementById("player_emd"); 
        if (!obj)
        {
        obj=document.getElementById("player_obj");
        obj.movie = "http://partyinfo.com/PseudoEngine/player_new.swf?v=5&clip=http://partyinfo.com/MusicFiles/" + document.getElementById(strCtrlName).value + "&loop=False&autostart=False&streaming=False"; 
        //alert(obj.movie);
        }
        else
        { 
        obj.src ="http://partyinfo.com/PseudoEngine/player_new.swf?v=5&clip=http://partyinfo.com/MusicFiles/" + document.getElementById(strCtrlName).value + "&loop=False&autostart=False&streaming=False"; 
        //alert(obj.src);
        }
}
}
function ConfirmRemoveFromPlayList()
{
  return confirm("This will remove the track from your playlist. Do you want to continue?");
}
function ConfirmRemoveFromFavorites()
{
  return confirm("This will remove the media from your favorites and playlist. Do you want to continue?");
}

function OpenStatisticsPopup(strBannerId, strEventTitle)
         {
           //alert(strBannerId);
           tb_show(null, 'ViewEventStatistics.aspx?BannerId=' + strBannerId + '&EventTitle='+ strEventTitle + '&keepThis=true&TB_iframe=true&height=325&width=305', null);
           //return false;
         }
function PlayMusicFromMediaApplPage(strMusicFile, strMusicTitle)
{
  //alert(strMediaFile);
  tb_show(null, 'PlayMusic.aspx?MusicFile=' + strMusicFile + '&MusicTitle='+ strMusicTitle +'&keepThis=true&TB_iframe=true&height=185&width=635', null);
  return false;
}

function ConfirmAddToEventFavorites()
{
  return confirm("This will Add the event to your favorites. Do you want to continue?");
}

function ChangePasswordRadPopup()
{    
   
     var oWnd = radopen("ChangePassword.aspx", "rwEventSettings");
     oWnd.center();
     return false;
    
}

 
 
 
 //-------------------------------------------Home Page Javascript--------------------------------------------\\
function ShowLargePictureOfHappyHours(strImagePath,Eventdesc,EventName,Date,Description)
{ 
  document.getElementById("imgHH").src=strImagePath;
  document.getElementById("imgHH").title= EventName;
  try
  {   
   document.getElementById("divHH").innerHTML=document.getElementById("divHH").htmlContent=Description.replace("##","$");;  
   //document.getElementById("divHH").innerText=document.getElementById("divHH").textContent=Description;   
  }
  catch(e)
  {
  }
  try
  {
   document.getElementById("spanHHdtls").innerText=document.getElementById("spanHHdtls").textContent=Eventdesc.replace("##","$");
  }
  catch(e)
  {
  }
  
  try 
  {
   event.returnValue = false;
  }
  catch (e) 
  {
   return false;
  }
  
}

function ShowLargePictureOfPicsofWeek(strImagePath,Eventdesc,EventName,Date,Description)
{
   //alert(EventName);
  document.getElementById("imgPics").src=strImagePath;
  document.getElementById("imgPics").title= EventName; 
  try
  {
   document.getElementById("spanPicName").innerText=document.getElementById("spanPicName").textContent=EventName;
   //document.getElementById("divPicName").innerHtml = document.getElementById("divPicName").textContent=EventName;
  }
  catch (e) 
  {
  }
  
  try 
  {
   event.returnValue = false;
  }
  catch (e) 
  {
   return false;
  }  
}


function Showdiv(link,divTab)
{     
    //alert(document.getElementById(divTab));
    document.getElementById("divTabHip").className='LatesMusic_Tab';
    document.getElementById("divTabTop").className='LatesMusic_Tab';
    document.getElementById("divTabLat").className='LatesMusic_Tab';
    document.getElementById("divTabCar").className='LatesMusic_Tab';
    
    var obj = document.getElementById("divTab1");
    obj.style.display = "none";  
    obj = document.getElementById("divTab2");
    obj.style.display = "none";  
    obj = document.getElementById("divTab3");
    obj.style.display = "none";  
    obj = document.getElementById("divTab4");
    obj.style.display = "none"; 
    
    document.getElementById(divTab).style.display = "block";    
    link.className = 'LatesMusic_Tab_hover';
}
    
function Hidediv()
{   
    divTab1.style.visibility = "hidden";  
    divTab2.style.visibility = "hidden";  
    divTab3.style.visibility = "hidden";  
    divTab4.style.visibility = "hidden";      
    //alert(document.getElementById("divTab1").style.display="visible");
}
    
function ShowLargePictureOfLatestMusic(strImagePath,Eventdesc,EventName,Date,Description)
{
   //alert(EventName);
  document.getElementById("imgLatestMusic").src=strImagePath;
  document.getElementById("imgLatestMusic").title= EventName; 
    //  alert(document.getElementById("spanMusicdtls").innerText);
    //  alert(document.getElementById("spanMusicdtls").innerHtml);
  document.getElementById("spanMusicdtls").innerText=document.getElementById("spanMusicdesc").textContent= EventName;
  
  try
  {
   document.getElementById("spanMusicdesc").innerText=document.getElementById("spanMusicdesc").textContent=Description;
   //document.getElementById("divPicName").innerHtml = document.getElementById("divPicName").htmlContent=EventName;
  }
  catch (e) 
  {
  }
  
  try 
  {
   event.returnValue = false;
  }
  catch (e) 
  {
   return false;
  }  
}

function ShowLargePictureOfLatestMusic(strImagePath,Musicid,EventName,FileUrl,Description)
{
   //alert(EventName);
  document.getElementById("imgLatestMusic").src=strImagePath;
  document.getElementById("imgLatestMusic").title= EventName; 
  document.getElementById("hdMusicfile").value =FileUrl+"#"+EventName;
  //document.getElementById("imgbtnPlayMusic").onclick = function alertbuttonClick{alert('Javascript');};//"javascript:return PlayMediaFromMediaApplPage('./MusicFiles/"+ FileUrl +"', '"+ EventName +"');";
  //alert(document.getElementById("hdMusicfile").value);
    //  alert(document.getElementById("spanMusicdtls").innerText);
    //  alert(document.getElementById("spanMusicdtls").innerHtml);
  document.getElementById("spanMusicdtls").innerText = document.getElementById("spanMusicdesc").textContent= EventName;
  
  try
  {
   document.getElementById("spanMusicdesc").innerText = document.getElementById("spanMusicdesc").textContent=Description;
   //document.getElementById("divPicName").innerHtml = document.getElementById("divPicName").htmlContent=EventName;
  }
  catch (e) 
  {
  }
  
  try 
  {
   event.returnValue = false;
  }
  catch (e) 
  {
   return false;
  }  
}

function PlayMusicHomePage()
{
    //alert("play start");
    var value = document.getElementById("hdMusicfile").value;
    var valuearr = value.split("#");
    var str="";
    //alert(valuearr.length);
    for (var j = 0; j < valuearr.length -1; j++)
    {
        //alert(valuearr[j]);
        str=str+valuearr[j];
    }
    //alert(str);
    var strext=str.split(".flv");
    if(strext.length>=2)
    {
    PlayMediaFromMediaApplPage(str, valuearr[valuearr.length -1]);
    }
    else
    {
    PlayMusicFromMediaApplPage(str, valuearr[valuearr.length -1]);
    }
        
   try 
    {
    event.returnValue = false;
    }
    catch (e) 
    {
    return false;
    }   
}


 function OpenMusicListPopup(MusicId)
   {   

	//alert('1');
      
      try
        {       
                     
        //mywindow = window.open("PlayMusicBackground.aspx?MusicId=" + MusicId,"MusicList", "toolbar=no,status=0,location=0,location=no,resizable=0,width=682,height=401");
        mywindow = window.open("PlayMusicBackground.aspx?MusicId=" + MusicId,"MusicList", "width=682,height=401");     
        }
        catch(err)
        {
         //alert(err);
         return false;
        }
        try
        {
         window.event.returnValue = false;
        }
        catch(err)
        {
        }
        return false;
        
        //alert("2");
    } 

function RowSelectedInMusicPlayList(sender, eventArgs)
{
    var intIndex = eventArgs.get_itemIndexHierarchical();
       
    intIndex = parseInt(eventArgs.get_itemIndexHierarchical()) * 2 + 4;    
           
    //rgPlayList_ctl00_ctl06_hfFileUrl
    var strCtrlName;
    if(intIndex<10)
    {
      strCtrlName = "rgPlayList_ctl00_ctl0" + intIndex + "_hfFileUrl";
    }
    else
    {
      strCtrlName = "rgPlayList_ctl00_ctl" + intIndex + "_hfFileUrl";
    }    
    
    if(document.getElementById(strCtrlName)!=null)
    {
        var obj = document.getElementById("player_emd"); 
        if (!obj)
        {
        obj=document.getElementById("player_obj");
        obj.movie = "http://partyinfo.com/PseudoEngine/player_new.swf?v=5&clip=http://partyinfo.com/MusicFiles/" + document.getElementById(strCtrlName).value + "&loop=False&autostart=False&streaming=False"; 
        //alert(obj.movie);
        }
        else
        { 
        obj.src ="http://partyinfo.com/PseudoEngine/player_new.swf?v=5&clip=http://partyinfo.com/MusicFiles/" + document.getElementById(strCtrlName).value + "&loop=False&autostart=False&streaming=False"; 
        //alert(obj.src);
        }
    }
}

//-------------------------------------------------------------------------------------------------------------\\


function fncInputNumericValuesOnly()
{
    if(!(event.keyCode==45||event.keyCode==46||event.keyCode==48||event.keyCode==49||event.keyCode==50||event.keyCode==51||event.keyCode==52||event.keyCode==53||event.keyCode==54||event.keyCode==55||event.keyCode==56||event.keyCode==57))
	{
	    event.returnValue=false;
	}
}