﻿function SetTimerStart()
{
 setTimeout('ShowDialogWindow()',1000);
}

function ShowDialogWindow()
{
    callServer("5",handleDialogWindowResoponse,"","","","");   
}

function handleDialogWindowResoponse()
{
    if (receiveReq.readyState == 4) 
    {
     
     var status = receiveReq.responseXML.documentElement.getElementsByTagName("status")[0].childNodes[0].nodeValue; 
     if(status == 1)
     {
        var data = receiveReq.responseXML.documentElement.getElementsByTagName("data")[0].childNodes[0].nodeValue;          
        LoadDialog(data);        
     }
     else
     {
        setTimeout('ShowDialogWindow()',5000);
     }
    }
}

function LoadDialog(data,PromoCodeId)
{
ctl00_JobsControlDialog.Show();
document.getElementById("DialogData").innerHTML = data;
document.getElementById("DialogPromoCode").innerHTML = document.getElementById("PromoCode").innerHTML;

}