var dragapproved=false
var minrestore=0
var initialwidth,initialheight
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all
function iecompattest(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function drag_drop(e){
if (ie5&&dragapproved&&event.button==1){
document.getElementById("dwindow").style.left=tempx+event.clientX-offsetx+"px"
document.getElementById("dwindow").style.top=tempy+event.clientY-offsety+"px"
}   
else if (ns6&&dragapproved){
document.getElementById("dwindow").style.left=tempx+e.clientX-offsetx+"px"
document.getElementById("dwindow").style.top=tempy+e.clientY-offsety+"px"
}
}

function initializedrag(e){
offsetx=ie5? event.clientX : e.clientX
offsety=ie5? event.clientY : e.clientY
document.getElementById("dwindowcontent").style.display="none" //extra
tempx=parseInt(document.getElementById("dwindow").style.left)
tempy=parseInt(document.getElementById("dwindow").style.top)

dragapproved=true
document.getElementById("dwindow").onmousemove=drag_drop
}

function loadwindow(url,width,height)
{
    if (!ie5&&!ns6)
    {
        window.open(url,"","width=width,height=height,scrollbars=1")
    }
    else
    {
        //debugger;
        //Added for FireFox compactability
        if(ns6)
        {
             
            document.getElementById("dwindow").style.display=''
            document.getElementById("dwindow").style.width=document.documentElement.offsetWidth + "px"
            document.getElementById("dwindow").style.height=document.documentElement.offsetHeight + "px"
            document.getElementById("dwindow").style.left=document.body.scrollLeft+"px"//"0px"
            document.getElementById("dwindow").style.top=document.body.scrollTop+"px"//"0px"
            document.getElementById("cframe").style.height=initialheight=height+"px"
            document.getElementById("cframe").style.width=initialwidth=width+"px"
             document.getElementById("cframe").src=url
         //  document.getElementById("cframe").style.left = eval((window.screen.availWidth - width)/2)+"px"
           document.getElementById("cframe").style.left =  eval((window.innerWidth - width)/2)+"px"
           document.getElementById("cframe").style.top = eval((window.innerHeight/2)-(height/2))+"px"
           //document.getElementById("cframe").style.top = eval((window.screen.availHeight - height)/2)+"px"
            //document.getElementById("cframe").style.top = eval((document.documentElement.offsetHeight - height)/2)+posy+"px" 
            document.getElementById("cframe").style.backgroundColor='white';
           
            
        }
        else
        {
            document.getElementById("dwindow").style.display=''
            document.getElementById("dwindow").style.width=document.documentElement.offsetWidth + "px"
            document.getElementById("dwindow").style.height=document.documentElement.offsetHeight + "px"
            document.getElementById("dwindow").style.left=document.body.scrollLeft+"px"//"0px"
            document.getElementById("dwindow").style.top=document.body.scrollTop+"px"//"0px"
            document.getElementById("cframe").style.height=initialheight=height+"px"
            document.getElementById("cframe").style.width=initialwidth=width+"px"
            document.getElementById("cframe").style.left = eval((document.documentElement.offsetWidth - width)/2)+"px"
            document.getElementById("cframe").style.top = eval((document.documentElement.offsetHeight - height)/2 + document.documentElement.scrollTop)+"px" 
            document.getElementById("cframe").src=url
            document.getElementById("cframe").style.backgroundColor='white';
         }
    }
}

function maximize(){
if (minrestore==0){
minrestore=1 //maximize window
document.getElementById("maxname").setAttribute("src","restore.gif")
document.getElementById("dwindow").style.width=ns6? window.innerWidth-20+"px" : iecompattest().clientWidth+"px"
document.getElementById("dwindow").style.height=ns6? window.innerHeight-20+"px" : iecompattest().clientHeight+"px"
}
else{
minrestore=0 //restore window
document.getElementById("maxname").setAttribute("src","max.gif")
document.getElementById("dwindow").style.width=initialwidth
document.getElementById("dwindow").style.height=initialheight
}
document.getElementById("dwindow").style.left=ns6? window.pageXOffset+"px" : iecompattest().scrollLeft+"px"
document.getElementById("dwindow").style.top=ns6? window.pageYOffset+"px" : iecompattest().scrollTop+"px"
}

function closeit(){
document.getElementById("cframe").src=''
document.getElementById("dwindow").style.display="none"
}

function stopdrag(){
dragapproved=false;
document.getElementById("dwindow").onmousemove=null;
document.getElementById("dwindowcontent").style.display="" //extra
}


 //function GetChildWindow(strType, strModuleId, strObjectId, strSpecificId,strOperation)
 function GetChildWindow(strType, strModuleId, strObjectId, strSpecificId,strOperation,objName)
    {
    
       if (objName != null && objName !="")
          objName = objName.replace("&", "%26");
        
        //strOperation can be Edit,View
        var strUrl;
        if (strType=="LibraryList")
        {
            strUrl="../common/LibraryListMapping.aspx?ModuleId="+ strModuleId +"&ObjectId=" +strObjectId +"&Op="+strOperation +"&objName="+ objName; 
            loadwindow(strUrl,850,400)
        } 
        if (strType=="DisplayLibraryList")
        {
            strUrl="../common/DisplayLibraryMapping.aspx?Type=?ModuleId="+ strModuleId +"&ObjectId=" +strObjectId +"&Op="+strOperation +"&objName="+ objName; 
            loadwindow(strUrl,850,400)
        }                        
        if (strType=="DescriptionPrivate")
        {               
            strUrl="../common/Description.aspx?Type=private" +"&Op="+strOperation +"&objName="+ objName; 
            loadwindow(strUrl,850,500)
        }     
        if (strType=="DescriptionPublic")
        {               
            strUrl="../common/Description.aspx?Type=public" +"&Op="+strOperation +"&objName="+ objName; 
            loadwindow(strUrl,850,500)
        }    
        if (strType=="ItineraryHeader")
        {        
            strUrl="../common/Description.aspx?Type=ItineraryHeader" +"&Op="+strOperation +"&objName="+ objName; 
            loadwindow(strUrl,850,400)
        }  
          if (strType=="RetailItineraryHeader")
        {        
            strUrl="../common/Description.aspx?Type=RetailItineraryHeader" +"&Op="+strOperation +"&objName="+ objName; 
            loadwindow(strUrl,850,400)
        }    
           if (strType=="DirectUserItineraryHeader")
        {        
            strUrl="../common/Description.aspx?Type=DirectUserItineraryHeader" +"&Op="+strOperation +"&objName="+ objName; 
            loadwindow(strUrl,850,400)
        }    
          if (strType=="ItineraryHeader")
        {        
            strUrl="../common/Description.aspx?Type=ItineraryHeader" +"&Op="+strOperation +"&objName="+ objName; 
            loadwindow(strUrl,850,400)
        }      
        if (strType=="ItineraryFooter")
        {               
            strUrl="../common/Description.aspx?Type=ItineraryFooter" +"&Op="+strOperation +"&objName="+ objName; 
            loadwindow(strUrl,850,400)
        }    
        if (strType=="AgentInvoiceHeader")
        {               
            strUrl="../common/Description.aspx?Type=AgentInvoiceHeader" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }    
        if (strType=="AgentInvoiceFooter")
        {               
            strUrl="../common/Description.aspx?Type=AgentInvoiceFooter" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }   
          if (strType=="DirectUserInvoiceHeader")
        {               
            strUrl="../common/Description.aspx?Type=DirectUserInvoiceHeader" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }    
        if (strType=="DirectUserInvoiceFooter")
        {               
            strUrl="../common/Description.aspx?Type=DirectUserInvoiceFooter" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }    
          if (strType=="RetailInvoiceHeader")
        {               
            strUrl="../common/Description.aspx?Type=RetailInvoiceHeader" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }    
        if (strType=="RetailInvoiceFooter")
        {               
            strUrl="../common/Description.aspx?Type=RetailInvoiceFooter" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }     
        if (strType=="RetailVoucherHeader")
        {               
            strUrl="../common/Description.aspx?Type=RetailVoucherHeader" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }    
        if (strType=="DirectUserVoucherHeader")
        {               
            strUrl="../common/Description.aspx?Type=DirectUserVoucherHeader" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }    
        if (strType=="VoucherHeader")
        {               
            strUrl="../common/Description.aspx?Type=VoucherHeader" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }    
        if (strType=="VoucherFooter")
        {               
            strUrl="../common/Description.aspx?Type=VoucherFooter" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }    
        //By Baljeet on "28-02-2008" for Mst Company Domain.
        if (strType=="AgentBookingConditionText")
        {               
            strUrl="../common/Description.aspx?Type=AgentBookingConditionText" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }
        if (strType=="AgentLatebookingConditionText")
        {               
            strUrl="../common/Description.aspx?Type=AgentLatebookingConditionText" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        } 
        if (strType=="DirectUserBookingConditionText")
        {               
            strUrl="../common/Description.aspx?Type=DirectUserBookingConditionText" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        } 
        if (strType=="DirectUserLateBookingConditionText")
        {               
            strUrl="../common/Description.aspx?Type=DirectUserLateBookingConditionText" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }
         if (strType=="RetailBookingConditionText")
        {               
            strUrl="../common/Description.aspx?Type=RetailBookingConditionText" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        } 
        if (strType=="RetailLateBookingConditionText")
        {               
            strUrl="../common/Description.aspx?Type=RetailLateBookingConditionText" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }
        if (strType=="ABSupplierNotesText")
        {               
            strUrl="../common/Description.aspx?Type=ABSupplierNotesText" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }
        if (strType=="SBSupplierNotesText")
        {               
            strUrl="../common/Description.aspx?Type=SBSupplierNotesText" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }
        if (strType=="FundTransactionInfoText")
        {               
            strUrl="../common/Description.aspx?Type=FundTransactionInfoText" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }
        if (strType=="CreditCardTerms")
        {               
            strUrl="../common/Description.aspx?Type=CreditCardTerms" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }
        if (strType=="CCVHelperText")
        {               
            strUrl="../common/Description.aspx?Type=CCVHelperText" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }
        //End
       if (strType=="GroupVoucherNotes")
        {     
            strUrl="../common/Description.aspx?Type=" + strType;
            loadwindow(strUrl,820,400)
        }    
        if (strType=="Message")
        {
            strUrl="../common/Message.aspx?ModuleId=" + strModuleId + "&ObjectId=" + strObjectId +"&Op="+strOperation +"&objName="+ objName;    
            loadwindow(strUrl,850,450)
        }
        if (strType=="OpenCloseDate")
        {
            strUrl="../common/OpenCloseDate.aspx?ModuleId="+ strModuleId +"&ObjectId=" +strObjectId +"&Op="+strOperation +"&objName="+ objName;  
            loadwindow(strUrl,880,450)
        }    
        if (strType=="AvailableIn")
        {
            strUrl="../common/AvailableIn.aspx?CountryId="+ strSpecificId + "&ModuleId="+ strModuleId +"&ObjectId=" +strObjectId +"&Op="+strOperation +"&objName="+ objName; 
            loadwindow(strUrl,700,400)
        } 
         if (strType=="ProductFacility")
        {
            strUrl="../Product/Product_Facility.aspx?"  +"TYPE="+strType+"&ModuleId="+ strModuleId +"&ObjectId=" +strObjectId+"&Op=" +strOperation +"&objName="+ objName; 
            loadwindow(strUrl,700,400)
        } 
         
        if(strType == "VendorAddress")
        {
            strUrl = "../common/AddressDetails.aspx?Type=Vendor"+"&Op="+strOperation +"&objName="+ objName; 
            loadwindow(strUrl,850,550)
             
        }              
        if(strType == "Holiday")
        {
            strUrl = "../ClientVendor/SupplierBranchHolidays.aspx?RowIdentifier=" + strSpecificId + "&Op="+ strOperation +"&objName="+ objName; 
         //   loadwindow(strUrl,800,500)
         loadwindow(strUrl,900,500)
        }  
        if(strType == "OpHour")
        {
            strUrl = "../ClientVendor/SupplierBranchOperationHours.aspx?RowIdentifier=" + strSpecificId + "&Op="+ strOperation +"&objName="+ objName; 
            //loadwindow(strUrl,800,500)
             loadwindow(strUrl,900,500)
        }  
        //debugger
        if(strType == "BranchAddress")
        {
            strUrl = "../common/AddressDetails.aspx?Address=S&Type=Branch&RowIdentifier=" + strSpecificId + "&Op="+ strOperation +"&objName="+ objName; 
          //  loadwindow(strUrl,910,500) 
           loadwindow(strUrl,850,550)
        }  
         if(strType == "BranchSurchargeDiscount")
        {
            strUrl = "../ClientVendor/BranchSurchargeDiscount.aspx?RowIdentifier=" + strSpecificId + "&Op="+ strOperation +"&objName="+ objName;  
          //  loadwindow(strUrl,910,500) 
           loadwindow(strUrl,900,500)
        }  
        if(strType == "Branch")
        {
        //debugger
        //alert('dd')
            //Changed by vinod to remove the cutt off
            strUrl = "../ClientVendor/SupplierBranch.aspx?Op="+strOperation +"&objName="+ objName; 
            loadwindow(strUrl,900,570) 
        }  
        if(strType == "CurrencyConversionReport")
        {
            strUrl = "../Reports/RptCurrencyConversion.aspx?SeasonId=" + strSpecificId+ "&Op="+ strOperation;
            loadwindow(strUrl,900,550)
        }  
        if(strType == "AllocationInventory")
        {
            strUrl = "../Reports/RptAllocationInventory.aspx?ObjectId=" + strSpecificId+"&objName="+ objName;
            loadwindow(strUrl,900,500)
        } 
 
        if(strType == "ClientAddress")
        {
            strUrl = "../common/AddressDetails.aspx?Type=Client"+"&Op="+strOperation +"&objName="+ objName; 
            loadwindow(strUrl,850,550)
        }
        if(strType == "CommissionPolicy")
        {
            strUrl="../common/CommissionPolicy.aspx?ObjectId=" + strObjectId+"&Op="+strOperation+"&objName="+ objName + "&strPopup=true";
            loadwindow(strUrl,950,550)
        }
        if(strType == "DiscountPolicy")
        {
            strUrl="../common/DiscountPolicy.aspx?ObjectId=" + strObjectId+"&Op="+strOperation+"&objName="+ objName + "&strPopup=true";
            loadwindow(strUrl,950,550)
        }
        if(strType == "PaymentPolicy")
        {
            strUrl="../common/PaymentPolicy.aspx?ObjectId=" + strObjectId+"&Op="+strOperation+"&objName="+ objName + "&strPopup=true";
            loadwindow(strUrl,950,550)
        }
        if(strType == "CancellationPolicy")
        {
            strUrl="../common/CancellationPolicy.aspx?ObjectId=" + strObjectId+"&Op="+strOperation+"&objName="+ objName + "&strPopup=true";
            loadwindow(strUrl,950,550)
        }
        
//////////// Commented by MG        
////////        if(strType == "PaymentPolicyDetail")
////////        {
////////            strUrl="../common/PaymentPolicyDetails.aspx?SpecificId=" + strSpecificId +"&Op="+strOperation;
////////            loadwindow(strUrl,950,500)
////////        }
////////        if(strType == "CancellationPolicyDetail")
////////        {
////////            strUrl="../common/CancellationDetails.aspx?SpecificId=" + strSpecificId +"&Op="+strOperation;
////////            loadwindow(strUrl,800,500)
////////        }
//////////// Commented by MG

        //Added by PreetiK to open ViewPaymentDetails for Accounting Module
        if(strType == "AmountDetails")
        {            
            strUrl="../Accounts/ViewDetails.aspx?ObjectId="+strObjectId+"&ModuleId="+strModuleId;
            loadwindow(strUrl,800,500)
        }
       if(strType == "PaxDetails")
        {            
            strUrl="../Booking/ViewPaxDetails.aspx?ObjectId="+strObjectId;
            loadwindow(strUrl,800,550)
        }
        //Added by rupika for Itinerary Description
        if (strType=="DescriptionItinerary")
        {               
            strUrl="../common/Description.aspx?Type=Itinerary" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,820,500)
        }    
        if (strType=="AddNotes")
        {               
            strUrl="../BookingManagement/BookingNotes.aspx" ;
            loadwindow(strUrl,800,500)
        }  
        if (strType=="AddGroupBookingNotes")
        {               
            strUrl="../GroupBooking/GroupBookingNotes.aspx" ;
            loadwindow(strUrl,900,500)
        }  
       if (strType=="ViewNotes")
        {               
            strUrl="../BookingManagement/BookingNotesView.aspx" ;
            loadwindow(strUrl,800,500)
        }  
        
        if (strType=="ElementDetails")
        {               
            strUrl="../BookingManagement/BookingElementDetails.aspx?Op=" + strOperation + "&ObjectId=" + strSpecificId;
            loadwindow(strUrl,950,587)
        }  
        
       if (strType=="ElementHistory")
        {               
            strUrl="ElementHistory.aspx?ElementType="+strModuleId+"&ObjectId="+strObjectId;
            loadwindow(strUrl,950,600)
        }  
        
        if (strType=="BookingElementDetails")
        {               
            strUrl="BookingElementDetails.aspx?ElementType="+strModuleId+"&ObjectId="+strObjectId;
            loadwindow(strUrl,950,600)
        }  
        
        if (strType=="SendCommunication")
        {               
            strUrl="SendCommunication.aspx?Type="+strModuleId+"&ID="+strObjectId;            
            loadwindow(strUrl,950,700)
        }  
        if (strType=="BookingCurrencySummery")
        {               
            strUrl="CurrencySummary.aspx";
            loadwindow(strUrl,950,700)
        } 
        if (strType=="BookingSummery")
        {               
            strUrl="BookingSummary.aspx";
            loadwindow(strUrl,950,700)
        } 
        if (strType=="GroupElementsRates")
        {
            strUrl="../GroupBooking/GroupBookingElementRates.aspx?Type=" + strModuleId + "&supplierIndex=" + strObjectId + "&Op=" + strOperation + "&ObjectId=" + strSpecificId;
            loadwindow(strUrl,900,400)
        }
        if (strType=="MapPax")
        {
            strUrl="../GroupBooking/GroupBookingElementMapPax.aspx?Type=" + strModuleId + "&supplierIndex=" + strObjectId + "&Op=" + strOperation + "&ObjectId=" + strSpecificId;
            loadwindow(strUrl,920,525)
        }
        if (strType=="BookingPaxDetails")
        {
            strUrl="../BookingManagement/PaxDetails.aspx?ObjectId=" + strObjectId;
            loadwindow(strUrl,950,450)
        }
        if(strType == 'ElementPaxMapping')
        {     
            strUrl="../BookingManagement/ElementPaxMapping.aspx" ;
            loadwindow(strUrl,900,500)
        }
        //Added by vikas gupta for CR
        if(strType == 'TempoFareRulesAndConditionsText')
        {   
            strUrl="../common/Description.aspx?Type=TempoFareRulesAndConditionsText" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }
        if (strType=="GroupBookingHeader")
        {               
            strUrl="../common/Description.aspx?Type=GroupBookingHeader" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }    
        if (strType=="GroupBookingFooter")
        {               
            strUrl="../common/Description.aspx?Type=GroupBookingFooter" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }    
        if (strType=="GroupBookingVoucherHeader")
        {               
            strUrl="../common/Description.aspx?Type=GroupBookingVoucherHeader" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }    
        if (strType=="GroupBookingVoucherFooter")
        {               
            strUrl="../common/Description.aspx?Type=GroupBookingVoucherFooter" +"&Op="+strOperation +"&objName="+ objName;
            loadwindow(strUrl,850,400)
        }  
         //* Name: Rupika
            //* Date: 16-Dec-2009
            //* Issue No: 2780
            //* Description: Added for InvoiceItineraryFooter
            //*************************************************************/
            
        if (strType=="AgentInvoiceItineraryFooter")
        {        
            strUrl="../common/Description.aspx?Type=AgentInvoiceItineraryFooter" +"&Op="+strOperation +"&objName="+ objName; 
            loadwindow(strUrl,850,400)
        }
        if (strType=="RetailInvoiceItineraryFooter")
        {        
            strUrl="../common/Description.aspx?Type=RetailInvoiceItineraryFooter" +"&Op="+strOperation +"&objName="+ objName; 
            loadwindow(strUrl,850,400)
        }
        if (strType=="DirectInvoiceItineraryFooter")
        {        
            strUrl="../common/Description.aspx?Type=DirectInvoiceItineraryFooter" +"&Op="+strOperation +"&objName="+ objName; 
            loadwindow(strUrl,850,400)
        }
        
        //*************end added 2780 ****************  
      return false;   
    } 
    
    
    //********************************************
    // Function name  : GetAccommodationChildWindow
    // Parameter      : strType, strQueryString
    // Return value   : bool
    // Purpose        : Used to open Div in Accomodation Booking Engine
    // Author		  : Kusum Sharma
    // Creation Date  : 
    // Changed By	  : 
    // Changed Date   : 
    //******************************************** 
    function GetAccommodationChildWindow( strType, strQueryString)
    { 
   
        var strUrl;
        // Used to open the rate div from Accomodation Search Result Screen and Room Details Screen
        if (strType == "Rate")
        {
            strUrl="AccomodationRates.aspx?" + strQueryString;
            loadwindow(strUrl,900,550);
        }// Used to open Accommodation Information Div from Accomodation Search Result and Accomodation Room Details Screen
        else if (strType == "Info")
        {
            strUrl="AccommodationSearchDetail.aspx?" + strQueryString;
            loadwindow(strUrl,800,550);               
        } // Used to open Message Div
         else if (strType == "Message")
        {
             strUrl="BookingMessages.aspx?" + strQueryString;
             loadwindow(strUrl,800,550);                   
        }// Used to open Policy screen div
        else if (strType == "SpecialOffer")
        {
             strUrl="BookingDiscountPolicy.aspx?" + strQueryString;
             loadwindow(strUrl,800,550);                   
        }// Used to open Policy screen div
        else if (strType == "Policy")
        {
              strUrl="BookingPolicyInformation.aspx?" + strQueryString;
              loadwindow(strUrl,900,550);              
        }// Used to open Booking Supplement Screen from Accomodation Room Details Screen
        else if (strType == "Supplement")
        {
              strUrl = "BookingSupplement.aspx?" + strQueryString;
              loadwindow(strUrl,800,550);              
        }
        else if (strType == "MandatoryIcon") //Used to show Mandatory Icon on Search Result page.
        {
              strUrl = "MandatorySupplement.aspx?" + strQueryString;
              loadwindow(strUrl,800,550);              
        }     
        //Added by vikas gupta
        else if (strType == "FareRule")
        {
              strUrl = "FlightFareRules.aspx?" + strQueryString;
              loadwindow(strUrl,800,550);              
        }     
         else if (strType == "PrivateDescription")
        {
             strUrl="BookingPrivateDescription.aspx?" + strQueryString;
             loadwindow(strUrl,800,550);                   
        }// Used to open Policy screen div         
          else if (strType == "Image")
        {
             strUrl="ShowImage.aspx?" + strQueryString;
             loadwindow(strUrl,800,550);                   
        } 
        //Added by vikas gupta For Tempo Fare rules and conditions CR
        else if (strType == "TempoFareRule")
        {
              strUrl = "FlightTempoFareRules.aspx?" + strQueryString;
              loadwindow(strUrl,800,550);              
        }          
      return false;
    }
    
    
    
    //********************************************
    // Function name  : GetCruiseChildWindow
    // Parameter      : strType, strQueryString
    // Return value   : bool
    // Purpose        : Used to open Div in Cruise Booking Engine
    // Author		  : Kusum Sharma
    // Creation Date  : 
    // Changed By	  : 
    // Changed Date   : 
    //******************************************** 
    function GetCruiseChildWindow( strType, strQueryString)
    { 
        var strUrl;
        // Used to open the rate div from Cruise Search Result Screen and Cabin Details Screen
        if (strType == "Rate")
        {
            strUrl="CruiseRates.aspx?" + strQueryString;
            loadwindow(strUrl,900,550);
        }// Used to open Cruise Information Div from Cruise Search Result and Cruise Cabin Details Screen
        else if (strType == "Info")
        {
            strUrl="CruiseSearchDetail.aspx?" + strQueryString;
            loadwindow(strUrl,800,550);               
        } // Used to open Message Div
         else if (strType == "Message")
        {
             strUrl="BookingMessages.aspx?" + strQueryString;
             loadwindow(strUrl,800,550);                   
        }// Used to open Policy screen div
        else if (strType == "Policy")
        {
              strUrl="BookingPolicyInformation.aspx?" + strQueryString;
              loadwindow(strUrl,900,550);              
        }// Used to open Booking Supplement Screen from Cruise Cabin Details Screen
        else if (strType == "Supplement")
        {
              strUrl = "BookingSupplement.aspx?" + strQueryString;
              loadwindow(strUrl,800,550);              
        }     
        else if (strType == "Image")
        {
             strUrl="ShowImage.aspx?" + strQueryString;
             loadwindow(strUrl,800,550);                   
        }  
        else if (strType == "MandatoryIcon") //Used to show Mandatory Icon on Search Result page.
        {
              strUrl = "MandatorySupplement.aspx?" + strQueryString;
              loadwindow(strUrl,800,550);              
        }         
      return false;
    }
    
    function GetServiceChildWindow( strType, strQueryString)
    { 
        var strUrl;
        //debugger
        // Used to open the rate div from Cruise Search Result Screen and Cabin Details Screen
        if (strType == "ServiceRates")
        {
            strUrl="ServiceRate.aspx?" + strQueryString;
            loadwindow(strUrl,800,550);
        }// Used to open Cruise Information Div from Cruise Search Result and Cruise Cabin Details Screen
        else if (strType == "Info")
        {
            strUrl="ServiceDetail.aspx?" + strQueryString;
            loadwindow(strUrl,800,550);               
        } 
        else if (strType == "Messages")
        {
             strUrl="BookingMessages.aspx?" + strQueryString;
             loadwindow(strUrl,800,550);                   
        }
        else if (strType == "PrivateDescription")
        {
             strUrl="BookingPrivateDescription.aspx?" + strQueryString;
             loadwindow(strUrl,800,550);                   
        }
         else if (strType == "Image")
        {
             strUrl="ShowImage.aspx?" + strQueryString;
             loadwindow(strUrl,800,550);                   
        }
        else if (strType == "SpecialOffer")
        {
             strUrl="BookingDiscountPolicy.aspx?" + strQueryString;
             loadwindow(strUrl,800,550);                   
        }// Used to open Policy screen div
         else if (strType == "MandatoryIcon") //Used to show Mandatory Icon on Search Result page.
        {
              strUrl = "MandatorySupplement.aspx?" + strQueryString;
              loadwindow(strUrl,800,550);              
        } 
        // Used to open Message Div
      return false;
    }
        //********************************************
    // Function name  : GetPackageChildWindow
    // Parameter      : strType, strQueryString
    // Return value   : bool
    // Purpose        : Used to open Div in Package Booking Engine
    // Author		  : Virender Tomar
    // Creation Date  : 
    // Changed By	  : 
    // Changed Date   : 
    //******************************************** 
    function GetPackageChildWindow( strType, strQueryString)
    { 
   //debugger  
        var strUrl;
        // Used to open the rate div from Cruise Search Result Screen and Cabin Details Screen
        if (strType == "Rate")
        {
            strUrl="PackageRates.aspx?" + strQueryString;
            loadwindow(strUrl,800,550);
        }// Used to open Cruise Information Div from Cruise Search Result and Cruise Cabin Details Screen
        else if (strType == "Info")
        {
            strUrl="PackageElementDetail.aspx?" + strQueryString;
            loadwindow(strUrl,800,550);               
        } // Used to open Message Div
         else if (strType == "Message")
        {
             strUrl="BookingMessages.aspx?" + strQueryString;
             loadwindow(strUrl,800,550);                   
        }// Used to open Policy screen div
        else if (strType == "Policy")
        {
              strUrl="BookingPolicyInformation.aspx?" + strQueryString;
              loadwindow(strUrl,800,550);              
        }// Used to open Booking Supplement Screen from Cruise Cabin Details Screen
        else if (strType == "Supplement")
        {
              strUrl = "BookingSupplement.aspx?" + strQueryString;
              loadwindow(strUrl,800,550);              
        }            
         else if (strType == "PrivateDescription")
        {
             strUrl="BookingPrivateDescription.aspx?" + strQueryString;
             loadwindow(strUrl,800,550);                   
        }// Used to open Policy screen div  
        else if (strType == "SpecialOffer")
        {
             strUrl="BookingDiscountPolicy.aspx?" + strQueryString;
             loadwindow(strUrl,800,550);                   
        }// Used to open Policy screen div
        else if (strType == "MandatoryIcon") //Used to show Mandatory Icon on Search Result page.
        {
              strUrl = "MandatorySupplement.aspx?" + strQueryString;
              loadwindow(strUrl,800,550);              
        }  
      return false;
    }
    
    
    
           //********************************************
    // Function name  : GetPackageChildWindow
    // Parameter      : strType, strQueryString
    // Return value   : bool
    // Purpose        : Used to open Div in Package Booking Engine
    // Author		  : Virender Tomar
    // Creation Date  : 
    // Changed By	  : 
    // Changed Date   : 
    //******************************************** 
    function GetVehicleChildWindow( strType, strQueryString)
    { 
        var strUrl;
        // Used to open the rate div from Cruise Search Result Screen and Cabin Details Screen
        
        if(strType == "Rates")
        {
            strUrl = "VehicleRates.aspx?ContractId="     + strQueryString;
            loadwindow(strUrl,800,550)
        } 
        else if (strType == "Info")
        {
            strUrl="VehicleDetails.aspx?ObjectId=" + strQueryString;
            loadwindow(strUrl,800,550);               
        } // Used to open Message Div
        else if (strType == "Message")
        {
             strUrl="BookingMessages.aspx?" + strQueryString;
             loadwindow(strUrl,800,550);                   
        }// Used to open Policy screen div
        else if (strType == "SupplierVehicleMappingMessage")
        {
             strUrl="BookingMessages.aspx?" + strQueryString;
             loadwindow(strUrl,800,550);                   
        }// Used to open Policy screen div
        else if (strType == "Policy")
        {
              strUrl="BookingPolicyInformation.aspx?" + strQueryString;
              loadwindow(strUrl,800,550);              
        }// Used to open Booking Supplement Screen from Cruise Cabin Details Screen
        else if (strType == "Supplement")
        {
              strUrl = "BookingSupplement.aspx?" + strQueryString;
              loadwindow(strUrl,800,550);              
        }  
        else if (strType == "Image")
        {
             strUrl="ShowImage.aspx?" + strQueryString;
             loadwindow(strUrl,800,550);                   
        }          
        else if (strType == "SpecialOffer")
        {
             strUrl="BookingDiscountPolicy.aspx?" + strQueryString;
             loadwindow(strUrl,800,550);                   
        }// Used to open Policy screen div
         else if (strType == "MandatoryIcon") //Used to show Mandatory Icon on Search Result page.
        {
              strUrl = "MandatorySupplement.aspx?" + strQueryString;
              loadwindow(strUrl,800,550);              
        } 
         else if (strType == "PrivateDescription")
        {
             strUrl="BookingPrivateDescription.aspx?" + strQueryString;
             loadwindow(strUrl,800,550);                   
        }// Used to open Policy screen div  
      return false;
    }
    
       function ShowDetails(elementType,sequenceNo)
                {          
//                    debugger  
                    var strUrl    ;
                    if(elementType=="A")
                    {
                      strUrl="../Booking/AccommodationSearchDetail.aspx?CALLEDFROM=BM&SequenceNo="+sequenceNo;
                    }
                    else if(elementType=="C")
                    {
                       strUrl="../Booking/CruiseSearchDetail.aspx?CALLEDFROM=BM&SequenceNo="+sequenceNo;
                    }
                    else if(elementType=="S")
                    {
                        strUrl="../Booking/ServiceDetail.aspx?CALLEDFROM=BM&SequenceNo="+sequenceNo;
                    }
                    else if(elementType=="P")
                    {
                        strUrl="../Booking/PackageElementDetail.aspx?CALLEDFROM=BM&SequenceNo="+sequenceNo;
                    }
                    else if(elementType=="V")
                    {
                        strUrl="../Booking/VehicleDetails.aspx?CALLEDFROM=BM&SequenceNo="+sequenceNo;
                    }
                    else if(elementType=="F")
                    {
                        return;
                    }
                    
                    loadwindow(strUrl,800,550); 
                }
function LoadCustomizedWindow(url,width,height,e)
{   
    var posx ;
    var posy;   
    //debugger         
    if (!e) var e = window.event;   
    
    if (e.pageX || e.pageY)   
     { posx = e.pageX;   
       posy = e.pageY;      
     }       
    else if (e.clientX || e.clientY)     
     {
        posx = e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;
        posy = e.clientY+document.body.scrollTop+document.documentElement.scrollTop;  
     } 
     posy = posy/2
     
     if(url == 'AddNotes')
     {
        url = '../BookingManagement/BookingNotes.aspx';
     }
     else if(url == 'ViewNotes')
     {
        url="../BookingManagement/BookingNotesView.aspx" ;
        posy = 100;
     }
     else if(url == 'ElementPaxMapping')
     {
     
        url="../BookingManagement/ElementPaxMapping.aspx" ;
        //posy = 100;
     }
    if (!ie5&&!ns6)
        window.open(url,"","width=width,height=height,scrollbars=1")
    else
    {
        //document.getElementById("overlay").style.visibility = "visible";
        document.getElementById("dwindow").style.display=''
       // document.getElementById("dwindow").style.width=window.screen.availWidth + "px"
        document.getElementById("dwindow").style.height=document.documentElement.offsetHeight + "px"
        document.getElementById("dwindow").style.left=document.body.scrollLeft+"px"//"0px"
        document.getElementById("dwindow").style.top=document.body.scrollTop+"px"//"0px"
        document.getElementById("cframe").style.height=initialheight=height+"px"
        document.getElementById("cframe").style.width=initialwidth=width+"px"
       document.getElementById("cframe").style.left = eval((window.screen.availWidth - width)/2)+"px"
        document.getElementById("cframe").style.top = eval((document.documentElement.offsetHeight - height)/2)+posy+"px" 
        document.getElementById("cframe").src=url
    }
}