
function GetXmlHttpObject()

{

var xmlHttp=null;

try

  {

  // Firefox, Opera 8.0+, Safari

  xmlHttp=new XMLHttpRequest();

  }

catch (e)
  {  // Internet Explorer  
  //alert(e.description);
  try
    {    
	//xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    
	// check for IE version
				var msobj = new Array("Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.7.0","Msxml2.XMLHTTP.2.0",
				"Msxml2.XMLHTTP.4.0",
				"Msxml2.XMLHTTP.3.0",
				"Msxml2.XMLHTTP",
				"Microsoft.XMLHTTP");
				var x, len = msobj.length;
				for(x=0; x<len; ++x) { // try each MS ActiveX object in turn
				try {
				xmlHttp = new ActiveXObject(msobj[x]);
				break;
				} catch (err) {};
				}

	///
	}
  catch (e)
    {    
	alert(e.description);
	try
      {      
	  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");      
	  }
    catch (e)
      {
	     alert("Your browser does not support AJAX!");      
	  	 return false;      
	  }
	}
  }
return xmlHttp;

}

var before="End Deal!"
var current="Today is Christmas. Merry Christmas!"
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")

var tc=new Date();
// getting server time through ajax
function getdateinfo()
{
//alert('hello');
var da_day;

  xmlHttp=GetXmlHttpObject();
  xmlHttp.onreadystatechange=function()
    {
	if(xmlHttp.readyState==4)
      {
	 
		
		da_day = xmlHttp.responseText; //this is used
		tc=da_day;
		//alert(tc);
	
	  }
    }
 
 xmlHttp.open("GET", "date_day.php", true);
 xmlHttp.send(null); 


//xmlHttp.open("GET", "ajax.php?task="+task + "&searchWords="+searchwords, true);
// xmlHttp.send(null); 

/////////////////
}
////////////////////////////////////////////////
function countdown1(yr,m,d,fh,fm,fs)
{ //alert('c1');
		getdateinfo();
		
		currenttime=tc;
		//alert(currenttime);
		theyear=yr;themonth=m;theday=d
		var countbox=countbox;
		var today=new Date(currenttime)
		var todayy=today.getYear()  
		if (todayy < 1000)
		todayy+=1900
		
		var todaym=today.getMonth()
		var todayd=today.getDate()
		var todayh=today.getHours()
		var todaymin=today.getMinutes()
		var todaysec=today.getSeconds()
		var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
		//futurestring=montharray[m-1]+" "+d+", "+yr
		futureHour=fh;
		futureMinute=fm;
		futureSeconds=fs;
		futurestring=montharray[m-1]+" "+d+", "+yr+" "+futureHour+":"+futureMinute+":"+futureSeconds
		
		dd=Date.parse(futurestring)-Date.parse(todaystring)
		dday=Math.floor(dd/(60*60*1000*24)*1)
		dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
		dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
		dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
		
		
		
	
		if (dhour < 10)
		  dhour = "0" + dhour;
		if (dmin < 10)
		  dmin = "0" + dmin;
		  
		if (dsec < 10)
		  dsec = "0" + dsec;
		if(dday < 0)
		{	//alert(dday);
			document.getElementById('count1').value='Deal End';
			document.getElementById('txt1').style.display='none';
			document.getElementById('apply1').style.display='none';
		}
		else
		{
			document.getElementById('count1').value=dday+":"+dhour+":"+dmin+":"+dsec;
		}
		
		//alert(fh);
		fh1=fh;
		fm1=fm;
		fs1=fs;
		//alert(fs1);
		setTimeout("countdown1(theyear,themonth,theday,fh1,fm1,fs1)",1000)
}

function countdown2(yr,m,d,fh,fm,fs){ 
getdateinfo();
		//alert(tc);
		currenttime=tc;
theyear2=yr;themonth2=m;theday2=d
var today=new Date(currenttime)
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
//futurestring=montharray[m-1]+" "+d+", "+yr
		futureHour=fh;
		futureMinute=fm;
		futureSeconds=fs;
		futurestring=montharray[m-1]+" "+d+", "+yr+" "+futureHour+":"+futureMinute+":"+futureSeconds
		
		dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)

if (dhour < 10)
  dhour = "0" + dhour;
if (dmin < 10)
  dmin = "0" + dmin;
  
if (dsec < 10)
  dsec = "0" + dsec;
if(dday < 0)
{
	document.getElementById('count2').value='Deal End';
	document.getElementById('txt2').style.display='none';
	document.getElementById('apply2').style.display='none';
}
else
{
	document.getElementById('count2').value=dday+":"+dhour+":"+dmin+":"+dsec;
}

fh2=fh;
fm2=fm;
fs2=fs;
//alert(fs2);
setTimeout("countdown2(theyear2,themonth2,theday2,fh2,fm2,fs2)",1000)
}



function countdown3(yr,m,d,fh,fm,fs){ 
getdateinfo();
		//alert(tc);
		currenttime=tc;
theyear3=yr;themonth3=m;theday3=d
var today=new Date(currenttime)
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
//futurestring=montharray[m-1]+" "+d+", "+yr
		futureHour=fh;
		futureMinute=fm;
		futureSeconds=fs;
		futurestring=montharray[m-1]+" "+d+", "+yr+" "+futureHour+":"+futureMinute+":"+futureSeconds
		
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
if(dday==0&&dhour==0&&dmin==0&&dsec==1){
var tbox2 = document.getElementById('count23');
tbox2.value=current;
return
}
{
if (dhour < 10)
  dhour = "0" + dhour;
if (dmin < 10)
  dmin = "0" + dmin;
  
if (dsec < 10)
  dsec = "0" + dsec;
if(dday < 0)
{
	document.getElementById('count3').value='Deal End';
	document.getElementById('txt3').style.display='none';
	document.getElementById('apply3').style.display='none';
}
else
{
	document.getElementById('count3').value=dday+":"+dhour+":"+dmin+":"+dsec;
}


}
fh3=fh;
fm3=fm;
fs3=fs;
setTimeout("countdown3(theyear3,themonth3,theday3,fh3,fm3,fs3)",1000)
}



function countdown4(yr,m,d,fh,fm,fs){ 
getdateinfo();
		//alert(tc);
		currenttime=tc;
theyear4=yr;themonth4=m;theday4=d
var today=new Date(currenttime)
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
//futurestring=montharray[m-1]+" "+d+", "+yr
		futureHour=fh;
		futureMinute=fm;
		futureSeconds=fs;
		futurestring=montharray[m-1]+" "+d+", "+yr+" "+futureHour+":"+futureMinute+":"+futureSeconds
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
if(dday==0&&dhour==0&&dmin==0&&dsec==1){
var tbox2 = document.getElementById('count23');
tbox2.value=current;
return
}
{
if (dhour < 10)
  dhour = "0" + dhour;
if (dmin < 10)
  dmin = "0" + dmin;
  
if (dsec < 10)
  dsec = "0" + dsec;


if(dday < 0)
{
	document.getElementById('count4').value='Deal End';
	document.getElementById('txt4').style.display='none';
	document.getElementById('apply4').style.display='none';
}
else
{
	document.getElementById('count4').value=dday+":"+dhour+":"+dmin+":"+dsec;
}


}
fh4=fh;
fm4=fm;
fs4=fs;
setTimeout("countdown4(theyear4,themonth4,theday4,fh4,fm4,fs4)",1000)
}



function countdown5(yr,m,d,fh,fm,fs){ 
getdateinfo();
		//alert(tc);
		currenttime=tc;
theyear5=yr;themonth5=m;theday5=d
var today=new Date(currenttime)
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
//futurestring=montharray[m-1]+" "+d+", "+yr
		futureHour=fh;
		futureMinute=fm;
		futureSeconds=fs;
		futurestring=montharray[m-1]+" "+d+", "+yr+" "+futureHour+":"+futureMinute+":"+futureSeconds

dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
if(dday==0&&dhour==0&&dmin==0&&dsec==1){
var tbox2 = document.getElementById('count23');
tbox2.value=current;
return
}
{
if (dhour < 10)
  dhour = "0" + dhour;
if (dmin < 10)
  dmin = "0" + dmin;
  
if (dsec < 10)
  dsec = "0" + dsec;
if(dday < 0)
{
	document.getElementById('count5').value='Deal End';
	document.getElementById('txt5').style.display='none';
	document.getElementById('apply5').style.display='none';
}
else
{
	document.getElementById('count5').value=dday+":"+dhour+":"+dmin+":"+dsec;
}


}
fh5=fh;
fm5=fm;
fs5=fs;
setTimeout("countdown5(theyear5,themonth5,theday5,fh5,fm5,fs5)",1000)
}



function countdown6(yr,m,d,fh,fm,fs){ 
getdateinfo();
		//alert(tc);
		currenttime=tc;
theyear6=yr;themonth6=m;theday6=d

var today=new Date(currenttime)
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
//futurestring=montharray[m-1]+" "+d+", "+yr
		futureHour=fh;
		futureMinute=fm;
		futureSeconds=fs;
		futurestring=montharray[m-1]+" "+d+", "+yr+" "+futureHour+":"+futureMinute+":"+futureSeconds
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
if(dday==0&&dhour==0&&dmin==0&&dsec==1){
var tbox2 = document.getElementById('count23');
tbox2.value=current;
return
}
{
if (dhour < 10)
  dhour = "0" + dhour;
if (dmin < 10)
  dmin = "0" + dmin;
  
if (dsec < 10)
  dsec = "0" + dsec;
if(dday < 0)
{
	document.getElementById('count6').value='Deal End';
	document.getElementById('txt6').style.display='none';
	document.getElementById('apply6').style.display='none';
}
else
{
	document.getElementById('count6').value=dday+":"+dhour+":"+dmin+":"+dsec;
}


}
fh6=fh;
fm6=fm;
fs6=fs;
setTimeout("countdown6(theyear6,themonth6,theday6,fh6,fm6,fs6)",1000)
}



function countdown7(yr,m,d,fh,fm,fs){ 
getdateinfo();
		//alert(tc);
		currenttime=tc;
theyear7=yr;themonth7=m;theday7=d

var today=new Date(currenttime)
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
//futurestring=montharray[m-1]+" "+d+", "+yr
		futureHour=fh;
		futureMinute=fm;
		futureSeconds=fs;
		futurestring=montharray[m-1]+" "+d+", "+yr+" "+futureHour+":"+futureMinute+":"+futureSeconds
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
if(dday==0&&dhour==0&&dmin==0&&dsec==1){
var tbox2 = document.getElementById('count23');
tbox2.value=current;
return
}
{
if (dhour < 10)
  dhour = "0" + dhour;
if (dmin < 10)
  dmin = "0" + dmin;
  
if (dsec < 10)
  dsec = "0" + dsec;
if(dday < 0)
{
	document.getElementById('count7').value='Deal End';
	document.getElementById('txt7').style.display='none';
	document.getElementById('apply7').style.display='none';
}
else
{
	document.getElementById('count7').value=dday+":"+dhour+":"+dmin+":"+dsec;
}

}
fh7=fh;
fm7=fm;
fs7=fs;
setTimeout("countdown7(theyear7,themonth7,theday7,fh7,fm7,fs7)",1000)
}



function countdown8(yr,m,d,fh,fm,fs){ 
getdateinfo();
		//alert(tc);
		currenttime=tc;
theyear8=yr;themonth8=m;theday8=d

var today=new Date(currenttime)
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
//futurestring=montharray[m-1]+" "+d+", "+yr
		futureHour=fh;
		futureMinute=fm;
		futureSeconds=fs;
		futurestring=montharray[m-1]+" "+d+", "+yr+" "+futureHour+":"+futureMinute+":"+futureSeconds
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
if(dday==0&&dhour==0&&dmin==0&&dsec==1){
var tbox2 = document.getElementById('count23');
tbox2.value=current;
return
}
{

if (dhour < 10)
  dhour = "0" + dhour;
if (dmin < 10)
  dmin = "0" + dmin;
  
if (dsec < 10)
  dsec = "0" + dsec;
if(dday < 0)
{
	document.getElementById('count8').value='Deal End';
	document.getElementById('txt8').style.display='none';
	document.getElementById('apply8').style.display='none';
}
else
{
	document.getElementById('count8').value=dday+":"+dhour+":"+dmin+":"+dsec;
}


}
fh8=fh;
fm8=fm;
fs8=fs;
setTimeout("countdown8(theyear8,themonth8,theday8,fh8,fm8,fs8)",1000)
}

function countdown9(yr,m,d,fh,fm,fs){
	getdateinfo();
		//alert(tc);
		currenttime=tc;
theyear9=yr;themonth9=m;theday9=d

var today=new Date(currenttime)
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
//futurestring=montharray[m-1]+" "+d+", "+yr
		futureHour=fh;
		futureMinute=fm;
		futureSeconds=fs;
		futurestring=montharray[m-1]+" "+d+", "+yr+" "+futureHour+":"+futureMinute+":"+futureSeconds
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
if(dday==0&&dhour==0&&dmin==0&&dsec==1){
var tbox2 = document.getElementById('count23');
tbox2.value=current;
return
}
{


if (dhour < 10)
  dhour = "0" + dhour;
if (dmin < 10)
  dmin = "0" + dmin;
  
if (dsec < 10)
  dsec = "0" + dsec;

if(dday < 0)
{
	document.getElementById('count9').value='Deal End';
	document.getElementById('txt9').style.display='none';
	document.getElementById('apply9').style.display='none';
}
else
{
	document.getElementById('count9').value=dday+":"+dhour+":"+dmin+":"+dsec;
}


}
fh9=fh;
fm9=fm;
fs9=fs;
setTimeout("countdown9(theyear9,themonth9,theday9,fh9,fm9,fs9)",1000)
}




function countdown10(yr,m,d,fh,fm,fs){
	getdateinfo();
		//alert(tc);
		currenttime=tc;
theyear10=yr;themonth10=m;theday10=d

var today=new Date(currenttime)
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
//futurestring=montharray[m-1]+" "+d+", "+yr
		futureHour=fh;
		futureMinute=fm;
		futureSeconds=fs;
		futurestring=montharray[m-1]+" "+d+", "+yr+" "+futureHour+":"+futureMinute+":"+futureSeconds
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
if(dday==0&&dhour==0&&dmin==0&&dsec==1){


var tbox2 = document.getElementById('count23');
tbox2.value=current;
return
}
{

if (dhour < 10)
  dhour = "0" + dhour;
if (dmin < 10)
  dmin = "0" + dmin;
  
if (dsec < 10)
  dsec = "0" + dsec;
 

if(dday < 0)
{
	document.getElementById('count10').value='Deal End';
	document.getElementById('txt10').style.display='none';
	document.getElementById('apply10').style.display='none';
	
}
else
{
	document.getElementById('count10').value=dday+":"+dhour+":"+dmin+":"+dsec;
}


}
fh10=fh;
fm10=fm;
fs10=fs;
setTimeout("countdown10(theyear10,themonth10,theday10,fh10,fm10,fs10)",1000)

}


