/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
var specialofferXSL = null;
var specialShowAllXSL = null;
var selectedSTmagning = null
var specialShowAllEventXSL = null;
var specialofferShowAllEventPromoXSL = null
var specialofferShowAllEventPromoAloneXSL = null

function closeSOPromo()
{
  //alert("closeSOPromo");
  var el = document.getElementById("LayerTilbudShowAll");
  if (el != null)
  {
    //var vis = el.style.visibility;
    //el.style.visibility="hidden";
    el.style.zIndex="10";

  }
  //hideBlackShade();

  el = document.getElementById("LayerTilbud");
  if (el != null)
  {
    el.style.zIndex="1";

  }
  el = document.getElementById("LayerTilbudShowAllEvent");
  if (el != null)
  {
    //var vis = el.style.visibility;
    //el.style.visibility="hidden";
    el.style.zIndex="10";

  }
  

  el = document.getElementById("LayerPromotionEvent");
  if (el != null)
  {
    el.style.visibility="hidden";

  }

}

function closeSOPromoAlone()
{

  var el = document.getElementById("LayerTilbudShowAll");
  if (el != null)
  {
    //var vis = el.style.visibility;
    //el.style.visibility="hidden";
    el.style.zIndex="10";

  }
  hideBlackShade();

  el = document.getElementById("LayerTilbudShowAllEvent");
  if (el != null)
  {
    //var vis = el.style.visibility;
    //el.style.visibility="hidden";
    el.style.zIndex="10";

  }
  el = document.getElementById("LayerTilbud");
  if (el != null)
  {
    el.style.zIndex="1";

  }

  el = document.getElementById("LayerPromotionEvent");
  if (el != null)
  {
    el.style.visibility="hidden";

  }

}


function loadSpecialofferXSL(stylesheet)
{
  var xsl = null;
  if(window.ActiveXObject)
  {


    // Load XSL
    xsl = new ActiveXObject("MSXML2.DOMDocument");
    xsl.async = false
    xsl.load(stylesheet)

  }
  if(document.implementation && document.implementation.createDocument)
  {

    // load the xslt file
    var myXMLHTTPRequest = new XMLHttpRequest();
    myXMLHTTPRequest.open("GET", stylesheet, false);
    myXMLHTTPRequest.send(null);

    xsl = myXMLHTTPRequest.responseXML;
  // alert(myXMLHTTPRequest.responseText);
  }

  this.specialofferXSL = xsl;
  loadSpecialoffer();

}

function loadSpecialoffer()
{
  //  new net.ContentLoader('barreltasting/functions/getTasting.php?&date ='+new Date(),parseSpecialoffers);
  new net.ContentLoader('specialoffer/functions/getSpecialOfferFormat.php?&date ='+new Date(),parseSpecialoffers);
  new net.ContentLoader('specialoffer/xsl/specialofferShowAll.xsl?&date ='+new Date(),parseSpecialofferShowAllXSL);
  new net.ContentLoader('specialoffer/xsl/specialofferOverlay.xsl?&date ='+new Date(),parseSpecialofferShowAllEventXSL);
  new net.ContentLoader('specialoffer/xsl/specialofferOverlay.xsl?&date ='+new Date(),parseSpecialofferShowAllEventXSL);
  new net.ContentLoader('specialoffer/xsl/specialofferOverlayPromo.xsl?&date ='+new Date(),parseSpecialofferPromoXSL);
  new net.ContentLoader('specialoffer/xsl/specialofferOverlayPromoAlone.xsl?&date ='+new Date(),parseSpecialofferPromoAloneXSL);
}

function parseSpecialofferPromoXSL()
{
  var res = this.req.responseXML;
  // alert(this.req.responseText);
  specialofferShowAllEventPromoXSL=  res;
}

function parseSpecialoffers()
{
  //alert(this.req.responseText);
  var xmlDoc = this.req.responseXML;
  var el = document.getElementById('LayerTilbud');
  //alert(tastingXSL);
  if (specialofferXSL != null)
  {
    if (window.ActiveXObject)
    {
      el.innerHTML = xmlDoc.transformNode(specialofferXSL);
    // alert(el.innerHTML);
    }
    else
    {
      var xsltProcessor = new XSLTProcessor();
      xsltProcessor.importStylesheet(specialofferXSL);
      var fragment = xsltProcessor.transformToFragment(xmlDoc,document);

      el.innerHTML='';
      el.appendChild(fragment);
    //  alert(el.innerHTML);

    }
  }

//var el = document.getElementById("TastingScroller");
//scroller = new jsScroller(el, 400, 200);
//scrollbar = new jsScrollbar (document.getElementById("TastingScrollbar-Container"), scroller, true, scrollbarEvent);


// el.innerHTML="";
}

function parseSpecialofferAllEventShow()
{
  var el = document.getElementById('LayerTilbudShowAllEvent');
  if (el != null)
  {
    el.innerHTML=this.req.responseText;
  }
}
function parseSpecialofferAllEventShow2()
{
  //alert(this.req.responseText);
  var xmlDoc = this.req.responseXML;
  var el = document.getElementById('LayerTilbudShowAllEvent');
  // alert("XSL:"+specialShowAllEventXSL);

  if (specialShowAllEventXSL != null)
  {
    if (window.ActiveXObject)
    {
      el.innerHTML = xmlDoc.transformNode(specialShowAllEventXSL);
    // alert(el.innerHTML);
    }
    else
    {
      var xsltProcessor = new XSLTProcessor();
      xsltProcessor.importStylesheet(specialShowAllEventXSL);
      var fragment = xsltProcessor.transformToFragment(xmlDoc,document);

      el.innerHTML='';
      el.appendChild(fragment);
    //  alert(el.innerHTML);

    }
  }
  el.style.visibility = "visible";
  
}

function parseSpecialofferAllEventPromoShow()
{
  var xmlDoc = this.req.responseXML;
  var el = document.getElementById('LayerPromotionEvent');
  //alert(tastingXSL);

  if (specialofferShowAllEventPromoXSL != null)
  {
    if (window.ActiveXObject)
    {
      el.innerHTML = xmlDoc.transformNode(specialofferShowAllEventPromoXSL);
    // alert(el.innerHTML);
    }
    else
    {
      var xsltProcessor = new XSLTProcessor();
      xsltProcessor.importStylesheet(specialofferShowAllEventPromoXSL);
      var fragment = xsltProcessor.transformToFragment(xmlDoc,document);

      el.innerHTML='';
      el.appendChild(fragment);
    //  alert(el.innerHTML);

    }
  }
  el.style.visibility = "visible";
}

function parseSpecialofferAllEventPromoShowAlone()
{
  var xmlDoc = this.req.responseText;
  var el = document.getElementById('LayerPromotionEvent');
  if (el != null)
  {
    el.innerHTML = xmlDoc;
  }
}
function parseSpecialofferAllEventPromoShowAlone2()
{
  var xmlDoc = this.req.responseXML;
  var el = document.getElementById('LayerPromotionEvent');
  //alert(tastingXSL);

  if (specialofferShowAllEventPromoAloneXSL != null)
  {
    if (window.ActiveXObject)
    {
      el.innerHTML = xmlDoc.transformNode(specialofferShowAllEventPromoAloneXSL);
    // alert(el.innerHTML);
    }
    else
    {
      var xsltProcessor = new XSLTProcessor();
      xsltProcessor.importStylesheet(specialofferShowAllEventPromoAloneXSL);
      var fragment = xsltProcessor.transformToFragment(xmlDoc,document);

      el.innerHTML='';
      el.appendChild(fragment);
    //  alert(el.innerHTML);

    }
  }
  el.style.visibility = "visible";
}

function parseSpecialofferAllEvent()
{
  //alert(this.req.responseText);
  var xmlDoc = this.req.responseXML;
  var el = document.getElementById('LayerTilbudShowAll');
  //alert(specialShowAllXSL);
  if (specialShowAllXSL != null)
  {
    if (window.ActiveXObject)
    {
      el.innerHTML = xmlDoc.transformNode(specialShowAllXSL);
    // alert(el.innerHTML);
    }
    else
    {
      var xsltProcessor = new XSLTProcessor();
      xsltProcessor.importStylesheet(specialShowAllXSL);
      var fragment = xsltProcessor.transformToFragment(xmlDoc,document);

      el.innerHTML='';
      el.appendChild(fragment);
    //  alert(el.innerHTML);

    }
  }
  var selected = xmlDoc.getElementsByTagName("selected");
  for (i=0;i<selected.length;i++)
  {
    var eid = selected[i].getAttribute("eid");
    var ttable = document.getElementById('specialofferScroller-Container');
    if (ttable != null)
    {
      var currentIdx = 0;

      var trs = ttable.childNodes;
      //    alert(currentIdx);
      for(i=0 ; i < trs.length ; i++)
      {
        var row = trs[i];
        //      alert("nodeType:"+row.nodeType);
        if (row.nodeType == 1)
        {
          //       alert(row.getAttribute("event_id"));
          if (row.getAttribute("event_id") == eid)
          {
            currentIdx = i;
          }
        }
      }
      //alert(currentIdx);
      
      var selEl = trs[currentIdx];
      //alert(selEl);
      if (selEl != null)
      {
        // alert("event_id:"+selEl.getAttribute("id"));
        var failed = false;
        try{
          showSpecialofferAllEvent(selEl.getAttribute("id"));

        }
        catch(err){ 
          failed = true;
        }
        if (failed)
        {
          showSpecialofferAllEvent(eid);
        }
      }
    }
  }

}



function parseSpecialofferXSL()
{
  var res = this.req.responseXML;
  // alert(this.req.responseText);
  specialofferXSL=  res;
  //  new net.ContentLoader('barreltasting/functions/getTasting.php?&date ='+new Date(),parseSpecialoffers);
  new net.ContentLoader('admin/functions/getPromotionTest.php?&date ='+new Date(),parseSpecialoffers);
}
function parseSpecialofferEventXSL()
{
  var res = this.req.responseXML;
  // alert(this.req.responseText);
  tastingEventXSL=  res;
}

function parseSpecialofferShowAllXSL()
{
  var res = this.req.responseXML;
  // alert(this.req.responseText);
  specialShowAllXSL=  res;
}
function parseSpecialofferShowAllEventXSL()
{
  var res = this.req.responseXML;
  // alert(this.req.responseText);
  specialShowAllEventXSL=  res;
}
function parseSpecialofferShowAllEventPromoXSL()
{
  var res = this.req.responseXML;
  // alert(this.req.responseText);
  tastingShowAllEventPromoXSL=  res;
}
function parseSpecialofferPromoAloneXSL()
{
  var res = this.req.responseXML;
  // alert(this.req.responseText);
  specialofferShowAllEventPromoAloneXSL=  res;
}

function showSpecialofferAllEvent(idx)
{
  //alert(idx);
  var el = document.getElementById("LayerTilbudShowAllEvent");
  if (el != null)
  {
    // var vis = el.style.visibility;
    el.style.left="434px";
    el.innerHTML="";
    el.style.visibility="visible";
    el.style.zIndex = "10";
  }
  if (selectedSTmagning != null && selectedSTmagning.id.startsWith("STevent_") && selectedSTmagning.getAttribute("type")=="EVENT")
  {
    selectedSTmagning.style.background="white";
  }
  
  var tdEl= document.getElementById(idx);
  if (tdEl != null)
  {
    if (idx.startsWith("STevent_") && tdEl.getAttribute("type")=="EVENT")
    {
      tdEl.style.background="#CCCCCC";
    }
    new net.ContentLoader('specialoffer/functions/getSpecialOfferEvent2.php?eventid='+tdEl.getAttribute("event_id")+'&date ='+new Date(),parseSpecialofferAllEventShow);

  }

  selectedSTmagning = tdEl;
}
function showSpecialofferPromoEvent(idx,alone)
{
  var el = document.getElementById("LayerTilbudShowAll");
  if (el != null)
  {
    //var vis = el.style.visibility;
    //el.style.visibility="hidden";
    el.style.zIndex="2";

  }
  //hideBlackShade();

  el = document.getElementById("LayerTilbudShowAllEvent");
  if (el != null)
  {
    //var vis = el.style.visibility;
    //el.style.visibility="hidden";
    el.style.zIndex="2";

  }
  el = document.getElementById("LayerPromotionEvent");
  if (el != null)
  {
    el.style.left="221px";
    var elheight=el.offsetHeight;
    el.innerHTML="<center><img class=\"va\" src=\"images/wait26trans.gif\" style=\"position:relative;top:"+((elheight/2)-30)+"px;\" /></center>";
    el.style.visibility="visible";
  }

  if (selectedSTmagning != null)
  {
    selectedSTmagning.style.background="white";
  }
  if (alone)
  {
    new net.ContentLoader('barreltasting/functions/getPromotionEvent2.php?cf=closeSOPromoAlone&eventid='+idx+'&date ='+new Date(),parseSpecialofferAllEventPromoShowAlone);

  }
  else
  {
    new net.ContentLoader('barreltasting/functions/getPromotionEvent2.php?cf=closeSOPromo&eventid='+idx+'&date ='+new Date(),parseSpecialofferAllEventPromoShowAlone);
  }
  setBlackShade();
  

  selectedSTmagning = null;
}

function showSpecialoffer(idx)
{
  //new net.ContentLoader('barreltasting/functions/getTasting.php?&date ='+new Date(),parseTastingEvent);
  showAllSpecialoffer(idx);
  //showTastingAllEvent(idx);
  /*
  var el = document.getElementById("LayerTastingShow");
  if (el != null)
  {
    var vis = el.style.visibility;
    el.style.visibility="visible";

  }
  */
  if (selectedSTmagning != null)
  {
    selectedSTmagning.style.background="white";
  }
  /*
  el = document.getElementById("LayerTasting");
  if (el != null)
  {
    el.style.zIndex="10";

  }
  */

  setBlackShade();
  
  if (selectedSTmagning != null)
  {
    selectedSTmagning.style.background="white";
  }
  var tdEl= document.getElementById(idx);
  if (tdEl != null)
  {
    tdEl.style.background="#CCCCCC";
  }

  selectedSTmagning = tdEl;
}

function closeSpecialoffer()
{
  var el = document.getElementById("LayerTastingShow");
  if (el != null)
  {
    var vis = el.style.visibility;
    el.style.visibility="hidden";

  }
  el = document.getElementById("LayerTilbudShow");
  if (el != null)
  {
    var vis = el.style.visibility;
    el.style.visibility="hidden";

  }
  el = document.getElementById("LayerTilbudShow");
  if (el != null)
  {
    var vis = el.style.visibility;
    el.style.visibility="hidden";

  }

  hideBlackShade();

  
  el = document.getElementById("LayerTasting");
  if (el != null)
  {
    el.style.zIndex="1";

  }
  if (selectedSTmagning != null)
  {
    selectedSTmagning.style.background="white";
    selectedSTmagning = null;
  }
}

function closeSpecialofferShowAll()
{
  var el = document.getElementById("LayerTilbudShowAll");
  if (el != null)
  {
    var vis = el.style.visibility;
    el.style.visibility="hidden";

  }
  hideBlackShade();
  
  el = document.getElementById("LayerTilbud");
  if (el != null)
  {
    el.style.zIndex="1";

  }
  el = document.getElementById("LayerTilbudShowAllEvent");
  if (el != null)
  {
    var vis = el.style.visibility;
    el.style.visibility="hidden";

  }
  el = document.getElementById("LayerPromotionEvent");
  if (el != null)
  {
    var vis = el.style.visibility;
    el.style.visibility="hidden";

  }
  el = document.getElementById("editPopups");
  if (el != null)
  {
    var vis = el.style.visibility;
    el.style.visibility="hidden";

  }
}
function closeSpecialofferShowAllEvent()
{
        
  el = document.getElementById("LayerTilbudShowAllEvent");
  if (el != null)
  {
    var vis = el.style.visibility;
    el.style.visibility="hidden";

  }
}

function selectNextSpecialofferShowAll(direction)
{

  if (selectedSTmagning != null)
  {

    //var children = document.getElementById('TastingScroller-Container').childNodes;
    //alert(children.length);

    var ttable = document.getElementById('specialofferScroller-Container');
    if (ttable != null)
    {
      var currentIdx = -1;

      var trs = ttable.childNodes;
      for(i=0 ; i < trs.length ; i++)
      {
        var row = trs[i];
        if (row.nodeType == 1)
        {
          if (row.id == selectedSTmagning.id)
          {
            currentIdx = i;
          }
        }
      }
      if (currentIdx >= 0)
      {
        if (currentIdx ==0 && direction < 0)
        {
          this.showSpecialofferAllEvent("STevent_1");
        }
        //else if (currentIdx ==1 && direction <0)
        //  {
        //  this.showSpecialofferAllEvent("STevent_1");
        // }
        else
        {
          var selEl = trs[currentIdx+direction];
          while (selEl != null && selEl.nodeType != 1)
          {
            currentIdx+=direction;
            selEl = trs[currentIdx+direction];
          }
          if (selEl != null)
          {
            //  alert(selEl.getAttribute("STevent_id"));
            if (selEl.getAttribute("event_id") != null)
            {
              this.showSpecialofferAllEvent(selEl.id);
            }
            else
            {
              this.showSpecialofferAllEvent("STevent_1");
            }
          }
        }
      }
      else if (currentIdx == -1 && direction>0)
      {
        var selID = selectedSTmagning.id;
        var iCount = selID.substring(selID.indexOf("_")+1);
        //alert("event_"+(parseInt(iCount)+1));
        if (parseInt(iCount) > ttable.childNodes.length)
        {
          this.showSpecialofferAllEvent("STevent_1");
        }
        else{
          this.showSpecialofferAllEvent("STevent_"+(parseInt(iCount)+1));
        }
      }

      else if (currentIdx == -1 && direction < 0)
      {
        this.showSpecialofferAllEvent("STevent_1");
      }

    }
  }
}
function selectNextSpecialoffer(direction)
{
  if (selectedSTmagning != null)
  {

    var ttable = document.getElementById("tastingtable");
    if (ttable != null)
    {
      var currentIdx = 0;

      var trs = ttable.getElementsByTagName("tr");
      for(i=0 ; i < trs.length ; i++)
      {
        var row = trs[i];
        if (row.id == selectedSTmagning.id)
        {
          currentIdx = i;
        }
      }
      var selEl = trs[currentIdx+direction];
      if (selEl != null)
      {
        this.showTasting(selEl.id);
        //selEl.scrollIntoView();
        var elll = document.getElementById("divts_2");
        if (elll != null)
        {
          alert(elll.style.top);
        }
      }
    }
  }
}
function showAllLoaded()
{
  alert("showAllLoaded");
}

function showAllSpecialoffer(idx)
{
  //  alert(idx);
  closeFunction =  closeSpecialofferShowAll
  if (idx)
  {
    // url,onload,onerror,method,params,contentType,notify
    new net.ContentLoader('specialoffer/functions/getSpecialOfferOrder.php?eid='+idx+'&date ='+new Date(),parseSpecialofferAllEvent);
  }
  else
  {
    new net.ContentLoader('specialoffer/functions/getSpecialOfferOrder.php?&date ='+new Date(),parseSpecialofferAllEvent);
  }

  var el = document.getElementById("LayerTilbudShowAll");
  //alert(el);
  if (el != null)
  {
    var vis = el.style.visibility;
    //if (vis == "hidden")
    {
      var elheight=el.offsetHeight;
      el.innerHTML="<center><img class=\"va\" src=\"images/wait26trans.gif\" style=\"position:relative;top:"+((elheight/2)-30)+"px;\" /></center>";
      
      el.style.visibility="visible";
      el.style.zIndex = "10";
    }
  //else
  // {
  //  el.style.visibility="hidden";
  //}
  }
  /*
  el = document.getElementById("LayerTasting");
  if (el != null)
  {
    el.style.zIndex="10";

  }
  */

  setBlackShade();
  
}


//{@event_id},'{@comp}',{@comppost},'{@description}'
function mailSTTasting(id,comp,post,etid)
{
  //alert(id+"_"+comp+"_"+post+"_"+description);
  this.sendBackofBlackST();
  var el = document.getElementById("editPopups");
  // alert(encodeURIComponent('Tøndesmagning,'+comp+','+post));
  loadWholePage("mail/mail.php?eid="+id+"&etid="+etid+"&comp=Slagtilbud"+encodeURIComponent(','+comp+','+post)+"&post="+post+"&closefunction=closeSTemailWindow","editPopups","");
  var w = 316;
  var h = 340;
  el.style.width=(w)+"px";
  el.style.height=(h)+"px";
  //el.style.border="1px solid #8CC63F";
  el.className ="thinborder";
  // alert(screen.height);
  el.style.top = (screen.availHeight/2-(h/2))+"px";
  el.style.left = (screen.width/2-(w/2))+"px";
  el.style.visibility="visible";
//el.innerHTML = mail.innerHTML;
}

function sendBackofBlackST()
{
  var el = document.getElementById("LayerTilbudShowAll");
  if (el != null)
  {
    //var vis = el.style.visibility;
    //el.style.visibility="hidden";
    el.style.zIndex="1";

  }
  el = document.getElementById("LayerTilbudShowAllEvent");
  if (el != null)
  {
    //var vis = el.style.visibility;
    //el.style.visibility="hidden";
    el.style.zIndex="1";

  }
}

function sendFrontofBlackST()
{
  var el = document.getElementById("LayerTilbudShowAll");
  if (el != null)
  {
    //var vis = el.style.visibility;
    //el.style.visibility="hidden";
    el.style.zIndex="10";

  }
  el = document.getElementById("LayerTilbudShowAllEvent");
  if (el != null)
  {
    //var vis = el.style.visibility;
    //el.style.visibility="hidden";
    el.style.zIndex="10";

  }
}


function mailnotusedCalendarTasting(id,comp,post)
{
  //alert(id+"_"+comp+"_"+post+"_"+description);
  var el = document.getElementById("editPopups");
  // alert(encodeURIComponent('Tøndesmagning,'+comp+','+post));
  loadWholePage("mail/mailCalendar.php?eid="+id+"&comp=T%C3%B8ndesmagning"+encodeURIComponent(','+comp+','+post)+"&post="+post+"&company_name="+comp+"&closefunction=closeSTemailWindow","editPopups","");
  var w = 316;
  var h = 340;
  el.style.width=(w)+"px";
  el.style.height=(h)+"px";
  //el.style.border="1px solid #8CC63F";
  el.className ="thinborder";
  // alert(screen.height);
  el.style.top = (screen.availHeight/2-(h/2))+"px";
  el.style.left = (screen.width/2-(w/2))+"px";
  el.style.visibility="visible";
//el.innerHTML = mail.innerHTML;
}

function closeSTemailWindow()
{
  //alert("closeSTemailWindow");
  this.sendFrontofBlackST();
  var el = document.getElementById("editPopups");
  if (el != null)
  {
    el.style.visibility = "hidden";
  }
}






function printSTSpecial(id,comp,post,desc,logo,comp,address,web,jpg)
{
  //alert(id+"_"+comp+"_"+post+"_"+desc+"_"+logo);
  new net.ContentLoader('print/print.php?desc='+encodeURIComponent(desc)+'&logo='+logo+'&comp='+encodeURIComponent(comp)+'&town='+encodeURIComponent(address)+'&web='+encodeURIComponent(web)+'&jpg='+encodeURIComponent(jpg)+'&date ='+new Date(),parsePrintSpecial);

}
function sendSTAppointment(id,comp,post,desc,logo,comp,address,web,jpg)
{
  //alert(id+"_"+comp+"_"+post+"_"+desc+"_"+logo);
  new net.ContentLoader('mail/printCalendar.php?desc='+encodeURIComponent(desc)+'&logo='+logo+'&comp='+encodeURIComponent(comp)+'&town='+encodeURIComponent(address)+'&web='+encodeURIComponent(web)+'&jpg='+encodeURIComponent(jpg)+'&date ='+new Date(),parseMailCalendar);

}

function parseSTPrintSpecial()
{
//alert("parsePrintSpecial");
//if (document.getElementById != null)
{
  var html = '<HTML>\n<HEAD>\n';

  //		if (document.getElementsByTagName != null)
  html+="<link rel=\"stylesheet\" type=\"text/css\" href=\"css/aov.css\"/>\n";
  {
    var headTags = document.getElementsByTagName("head");
    if (headTags.length > 0)
      html += headTags[0].innerHTML;
  }

  html += '\n</HE' + 'AD>\n<BODY>\n';
        
  html+= this.req.responseText;
  html += '\n</BO' + 'DY>\n</HT' + 'ML>';

  var printWin = window.open("","printSpecial");
  printWin.document.open();
  printWin.document.write(html);
  printWin.document.close();
//if (gAutoPrint)
//	printWin.print();
}
/*
	else
	{
		alert("Sorry, the print ready feature is only available in modern browsers.");
	}
    */
}



function showAllSpecialofferNext(startoffset,maxevents)
{
  //alert(startoffset);
  if (startoffset >= 0 && startoffset <= maxevents)
  {
    new net.ContentLoader('specialoffer/functions/getSpecialOfferOrder.php?startoffset='+startoffset+'&date ='+new Date(),parseSpecialofferAllEvent);
  }
}


