
/*
Count down until any date script-
By JavaScript Kit (www.javascriptkit.com)
Over 200+ free scripts here!
*/


//change the text below to reflect your own,
var before="we leave!"
var current="We are on our way! Don't forget to check for updates on our progress."
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")

function countdown(yr,m,d){
	var today=new Date()
	var todayy=today.getYear()
	if (todayy < 1000)
		todayy+=1900
		var todaym=today.getMonth()
		var todayd=today.getDate()
		var todaystring=montharray[todaym]+" "+todayd+", "+todayy
		var futurestring=montharray[m-1]+" "+d+", "+yr
		var difference=(Math.round((Date.parse(futurestring)-Date.parse(todaystring))/(24*60*60*1000))*1)
	if (difference<1)
	document.write("<span style=\"color: #ff0000;\">" + current + "</span>")
	else if (difference>0)
	document.write("Only "+difference+" day until "+before)
}
//enter the count down date using the format year/month/day


function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  } 
}



function file_name_only(str) {
var slash = '/'
if (str.match(/\\/)) {
     slash = '\\'
}
var sURL = str.substring(str.lastIndexOf(slash) + 1, str.lastIndexOf('.'))
return sURL
}

function viewFullSize(image){
	var URL = "/images/ebay/full/" + file_name_only(image.src) + ".jpg";
	window.open(URL, 'image', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600,left = 0,top = 0');
}