function productsDivChange(objCell,TripID)
    {

        var strProductID = TripID
        var objDivCopy = document.getElementById("divProductInfo");
        var strID = objCell.id;
        objDivCopy.innerHTML = ASP.ProductDisplay.PopulateDiv(strID,TripID).value;
    }
    
    
    function queryString(val)
    {
        var q = unescape(location.search.substr(1)).split('&');
        for(var i=0; i<q.length; i++)
        {
            var t=q[i].split('=');
            if(t[0].toLowerCase()==val.toLowerCase()) 
                return t[1];
        }
        return '';
    }

    var cX = 0; 
    var cY = 0;
    
    function UpdateCursorPosition(e)
    {   
        cX = e.pageX; cY = e.pageY;
    }
    
    function UpdateCursorPositionDocAll(e)
    {   
        cX = event.clientX; cY = event.clientY;
    }

    function AssignPosition(d) 
    {
        d.style.left = (cX+10) + "px";
        d.style.top = (cY+10) + "px";
    }
    
    function HideContent(d) 
    {
        if(d.length < 1) 
        { return; }
        document.getElementById(d).style.display = "none";
    }

    

    function ReverseContentDisplay(d) 
    {
        if(d.length < 1) 
            { return; }
            var dd = document.getElementById(d);
            AssignPosition(dd);
            if(dd.style.display == "none") 
                { dd.style.display = "block"; }
            else 
                { dd.style.display = "none"; }
    }
    
    
    
    function init(strProd)
    {
        var strTemp = document.getElementById('tblProductsNavUsage');
        productsDivChange(strTemp,strProd); 
		//productsDivChange(strTemp); 
		document.getElementById("divNavTripSummary").style.display = "none";
		document.getElementById("divNavTripSummaryOn").style.display = "inline";
		//
		document.getElementById("divNavItinerary").style.display = "block";
		document.getElementById("divNavItineraryOn").style.display = "none";
		//Restore
		//document.getElementById("divNavTripSummary").style.display = "block";
		//document.getElementById("divNavTripSummaryOn").style.display = "none";
		document.getElementById("divNavWhyDCXP").style.display = "block";
		document.getElementById("divNavWhyDCXPOn").style.display = "none";
		document.getElementById("divNavFitnessExperience").style.display = "block";
		document.getElementById("divNavFitnessExperienceOn").style.display = "none";
		document.getElementById("divNavDatesPriceIncludes").style.display = "block";
		document.getElementById("divNavDatesPriceIncludesOn").style.display = "none";
	
        if(document.all) 
        {   
            document.onmousemove = UpdateCursorPositionDocAll; 
        }
        else 
        {   
            document.onmousemove = UpdateCursorPosition; 
        }
    }

		function popUpBookingsTrip(trekID,tripID)
        {
            //var strLink = 'https://www.chesselladventures.com/dcxp/bookingscc.aspx?trekID=' + trekID + '&tripID=' + tripID;
            var strLink = 'https://www.chesselladventures.com/2010/bookings/login.aspx?trekID=' + trekID + '&tripID=' + tripID;
           window.open(strLink,'popExtra','titlebar=no,directories=no,location=no,resize=yes,width=790,height=590,scrollbars=yes,left=0,top=0');
        }
		
        function popUpBookings(trekID)
        {
            //var strLink = 'https://www.chesselladventures.com/dcxp/bookingscc.aspx?trekID=' + trekID;
            var strLink = 'https://www.chesselladventures.com/2010/bookings/login.aspx?trekID=' + trekID;
            window.open(strLink,'popExtra','titlebar=no,directories=no,location=no,resize=yes,width=790,height=590,scrollbars=yes,left=0,top=0');
        }
		function popUpTestimonials(trekID)
        {
            var strLink = 'testimonials_pop.aspx?trekID=' + trekID;
            window.open(strLink,'popExtra','titlebar=no,directories=no,location=no,resize=yes,width=780,height=590,scrollbars=yes,left=0,top=0');
        }
		function popUpImages(trekID)
        {
            var strLink = 'images.aspx?trekID=' + trekID;
            window.open(strLink,'popExtra','titlebar=no,directories=no,location=no,resize=yes,width=600,height=590,scrollbars=yes,left=0,top=0');
        }
		function popUpReports(trekID)
        {
            var strLink = 'reports.aspx?trekID=' + trekID;
            window.open(strLink,'popExtra','titlebar=no,directories=no,location=no,resize=yes,width=780,height=590,scrollbars=yes,left=0,top=0');
        }
		function popUpSendPage(PageID,trekID)
        {
            var strLink = 'sendpage.aspx?trekID=' + trekID + '&PageID=' + PageID;
			//var strLink = 'sendpage.aspx?trekID=' + trekID + '&PageID=' + tripID;
            window.open(strLink,'popExtra','titlebar=no,directories=no,location=no,resize=yes,width=780,height=590,scrollbars=yes,left=0,top=0');
        }
		function popUpSendPageSingle(PageID)
        {
            var strLink = 'sendpage_single.aspx?PageID=' + PageID;
			//var strLink = 'sendpage.aspx?trekID=' + trekID + '&PageID=' + tripID;
            window.open(strLink,'popExtra','titlebar=no,directories=no,location=no,resize=yes,width=780,height=590,scrollbars=yes,left=0,top=0');
        }
		function popUpFitness()
        {
            var strLink = 'preparation.aspx#fitness';
			//var strLink = 'sendpage.aspx?trekID=' + trekID + '&PageID=' + tripID;
            window.open(strLink,'popExtra','titlebar=no,directories=no,location=no,resize=yes,width=780,height=590,scrollbars=yes,left=0,top=0');
        }
		function popUpDifficulty()
        {
            var strLink = 'preparation.aspx#difficulty';
			//var strLink = 'sendpage.aspx?trekID=' + trekID + '&PageID=' + tripID;
            window.open(strLink,'popExtra','titlebar=no,directories=no,location=no,resize=yes,width=780,height=590,scrollbars=yes,left=0,top=0');
        }



// print function
var gAutoPrint = true; // Tells whether to automatically call the print function

function printSpecial()
{
if (document.getElementById != null)
{
var html = '<HTML>\n<HEAD>\n';

if (document.getElementsByTagName != null)
{
var headTags = document.getElementsByTagName("head");
if (headTags.length > 0)
html += headTags[0].innerHTML;
}

html += '\n</HEAD>\n<BODY>\n';

//pageHeading
var printReadyElemHead = document.getElementById("divProductPreviewNav");
var printReadyElem = document.getElementById("divProductPreviewNav");

if (printReadyElem != null)
{
html += '<div id="blankpage"><h1>' + printReadyElemHead.innerHTML + '</h1><br>';
html += printReadyElem.innerHTML + '</div>';
}
else
{
alert("Could not find the printReady function");
return;
}

html += '\n</BODY>\n</HTML>';

var printWin = window.open("","printSpecial");
printWin.document.open();
printWin.document.write(html);
printWin.document.close();
if (gAutoPrint)
printWin.print();
}
else
{
alert("The print ready feature is only available if you are using an browser. Please update your browswer.");
}
}


