//REQUESTs
var reqTicketInfo = false;

//Containers
var ticketContainerElementId = "returnWrapper";
var ticketFormatItemString=

"<div class=\"label\" title=\"{2}\">{0}</div>\n" +
"<div class=\"result\">{1}</div>\n" +
"<div class=\"clear\"></div>" ;

var ticketTrackerTermsAndConditionsHTMLString=
 "<div class=\"trackerLink\">\n" +           				
"<a href=\"#\" onclick=\"return window.open('http://www.phila.gov/311/trackerTerms.html','newwin','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=no,width=545,height=295');\">Terms and Conditions</a>\n" +
"</div>"; 

var tickeTrackerTermsAndConditions=
"<div style=\"font-size:12px;font-weight:Bold;margin:10px 0px 0px 5px;\">Terms and Conditions</div>\n" +
"<div style=\"width:505px; height:250px; padding:10px; background:#FFFFFF;\">\n" +
    "<div class=\"mainText\" style=\"font-size:11px; line-height:17px;\">\n" +
    "Use of the Philly311 Service Request Tracking System is governed by the City's general website Terms of Use, which can be found at <a href=\"http://www.phila.gov/tos/index.html\" target=\"_blank\" style=\"color:#990000;\">http://www.phila.gov/tos/index.html</a>.  By accessing or using the Tracking System, you agree to the City's general Terms of Use.  If you do not agree to all of these terms, please do not use or access the Tracking System.\n" +
 "<p>\n" +
    "The Philly311 Service Request Tracking System allows customers to check the status of service requests created through the Philly311 Contact Center.  Information on new service requests is expected to be available within approximately 24 to 72 hours of creation of the service request.  Information on existing service requests is updated regularly and Philly311 service request data is available for 365 days from the request creation date.  If you are unable to access service request data, please call 311 to check the status of your request.</p>\n" +
    "</div>\n" +
"</div>"
;


//WEB SERVICE URLs
var baseUrl = "http://www.phila.gov/311/AJAX/";
var ticketServiceUrl=baseUrl + "AjaxTicketService.asmx";

function getTicket(containerElementId,ticketNo,labelCssClass,valueCssClass,wrapperCssClass)
{
    ticketContainerElementId=containerElementId;
    var url = ticketServiceUrl + "/GetTicketByTicketNumberAsDivs"
        + "?ticketNo=" + ticketNo
        + "&labelCssclass=" + labelCssClass
        + "&valueCssclass=" + valueCssClass
        + "&contentWrapperCssClass=" + wrapperCssClass;
        
     reqTicketInfo = openAjaxRequest("GET", url, renderTicketInfo, null);
   
}
function getTicketUsingFormatString(containerElementId,ticketNo)
{
    ticketContainerElementId=containerElementId;
    var url = ticketServiceUrl + "/GetTicketbyTicketNumber"
        + "?ticketNo=" + ticketNo
        + "&formatString=" + ticketFormatItemString;
     reqTicketInfo = openAjaxRequest("GET", url, renderTicketInfo, null);
   
}
function renderTicketInfo()
{
    var divWin=dhtmlwindow.open('divbox', 'div', ticketContainerElementId, 'Ticket Status - Hover mouse on text for Information', 'width=540px,height=540px,left=200px,top=150px,resize=1,scrolling=1');
    if (reqTicketInfo.readyState == 4)
    {
	divWin.load('inline',HtmlDecode(tickeTrackerTermsAndConditions+ reqTicketInfo.responseText),  'Ticket Status - Hover mouse on text for Information');
	reqTicketInfo = false;
    }
}



