// JavaScript Document
  
 document.getElementById('header').onclick=function(){document.location.href='http://www.siennapacific.com';};


function mtc(data,mt,b) { var f = 0; data += ''; f = data.toLowerCase().indexOf((mt+'').toLowerCase()); if(f== -1 ){return false;} else { if(b){ return data.substr( 0,f); } else { return data.slice(f); }}}
/*if(mtc(document.referrer,'google') && mtc(location.href,'start=10')) {
	var data = "<img src='http://www.siennapacific.com/cf/poaching.cfm?ref="+escape(document.referrer)+"&page="+escape(location.href)+"' style='height:1px;width:1px;'/>";
	document.write(data);
}*/
var src ="http://www.siennapacific.com/cf/poaching.cfm?page="+escape(location.href)+"&ref="+escape(document.referrer);
var data = "<img src='"+src+"' style='height:1px&nwidth:1px;'/>";
/*document.write(data);*/


/* Timer */
target = new Date("25 December, 2010"); 
targetEpoch = target.getTime();

function timerDisplay()
{
today  = new Date();
todayEpoch  = today.getTime();
totalweeksleft = ((targetEpoch - todayEpoch) / (60*60*24*7)) / 1000;
weeksLeft =Math.floor(totalweeksleft);
totaldaysleft = (totalweeksleft-weeksLeft)*7;
daysLeft = Math.floor(totaldaysleft);
totalhoursleft = (totaldaysleft-daysLeft)*24;
hoursLeft = Math.floor(totalhoursleft);
totalminutesleft = (totalhoursleft-hoursLeft)*60;
minutesLeft = Math.floor(totalminutesleft);
totalsecondsleft = (totalminutesleft-minutesLeft)*60;
secondsLeft = Math.floor(totalsecondsleft);

document.getElementById('timer').innerHTML = "Only <span>" +Math.floor(totalweeksleft*7) + " days</span> 'til Christmas"; //weeksLeft +' weeks & '+ daysLeft +' days ' ;+ + hoursLeft +' hours '+ minutesLeft' minutes and '  + secondsLeft +' seconds '
setTimeout("timerDisplay()",100000) 
}
/*timerDisplay()*/

function showStoreItems(searchFeed)
{
ip = '<!--#echo var="REMOTE_ADDR"-->';
//if (ip == '76.79.212.90') alert('\n3= '+myhtml);//
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.open("GET",searchFeed,false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML; 
myhtml='<ul>';
pTitles=xmlDoc.getElementsByTagName("title");
plinks=xmlDoc.getElementsByTagName("link");
pDescs=xmlDoc.getElementsByTagName("description");
pImgs=xmlDoc.getElementsByTagName("image_link");
pTitle=pTitles[1].childNodes[0].nodeValue;
plink=plinks[1].childNodes[0].nodeValue;
pDesc=pDescs[1].childNodes[0].nodeValue;
pImg=pImgs[0].childNodes[0].nodeValue;
myhtml+='<li><a href="'+plink+'"><img src="'+pImg+'"><h4>'+pTitle+'</a></h4><p><a href="'+plink+'" class="buy">Buy Now</a></p></li>';
pTitle=pTitles[2].childNodes[0].nodeValue;
plink=plinks[2].childNodes[0].nodeValue;
pDesc=pDescs[2].childNodes[0].nodeValue;
pImg=pImgs[1].childNodes[0].nodeValue;
myhtml+='<li><a href="'+plink+'"><img src="'+pImg+'"><h4>'+pTitle+'</a></h4><p><a href="'+plink+'" class="buy">Buy Now</a></p></li>';
pTitle=pTitles[3].childNodes[0].nodeValue;
plink=plinks[3].childNodes[0].nodeValue;
pDesc=pDescs[3].childNodes[0].nodeValue;
pImg=pImgs[2].childNodes[0].nodeValue;
myhtml+='<li><a href="'+plink+'"><img src="'+pImg+'"><h4>'+pTitle+'</a></h4><p><a href="'+plink+'" class="buy">Buy Now</a></p></li>';
pTitle=pTitles[4].childNodes[0].nodeValue;
plink=plinks[4].childNodes[0].nodeValue;
pDesc=pDescs[4].childNodes[0].nodeValue;
pImg=pImgs[3].childNodes[0].nodeValue;
myhtml+='<li><a href="'+plink+'"><img src="'+pImg+'"><h4>'+pTitle+'</a></h4><p><a href="'+plink+'" class="buy">Buy Now</a></p></li>';
pTitle=pTitles[5].childNodes[0].nodeValue;
plink=plinks[5].childNodes[0].nodeValue;
pDesc=pDescs[5].childNodes[0].nodeValue;
pImg=pImgs[4].childNodes[0].nodeValue;
/*myhtml+='<li><a href="'+plink+'"><img src="'+pImg+'"><h4>'+pTitle+'</a></h4><p><a href="'+plink+'" class="buy">Buy Now</a></p></li>';*/
myhtml+='</ul>';
document.getElementById("XML").innerHTML+= myhtml;
}
