var liveinfo = 'no';
/////////////////////////////////////////////


//
var bikky = document.cookie;
var today = new Date();
var expireDate = new Date(today.getTime() +  24 * 60 * 60 * 1000); // plus 24 hours            
//var expireDate = new Date(today.getTime() +  2 * 60 * 1000); // plus 2 minutes            
var width=100;
var pos=1-width;
//****************************************
function OpenCertDetails() { thewindow = window.open('https://secure.hammocks.co.uk/geotrust_validate.html', 'anew', config='height=300,width=275,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=yes'); } 
//****************************************


//****************************************
function bottie(){
document.write('<p class="footer">!! SUMMER SALE !!');
}
//****************************************
function type(){
    var strLen=scrlStr.length;
    var type = "";                
    pos++;                          
    if(pos==strLen)              
       pos=1-width;            
    if(pos<0){                   
       for(var i=1;i<=Math.abs(pos);i++)
           type=type+"";  
      type=type+scrlStr.substring(0,width-i+1);
    }
    else
       type=type+scrlStr.substring(pos,pos+width);
    window.status=type;         
    setTimeout("type()",80);    
}
//****************************************
function newWindow(content){
contentWindow = window.open(content, 'contentWin', 'width=590, height=530, scrollbars=yes toolbar=no, location=no');
contentWindow.focus()
}
//****************************************
function gomain(){
	self.location="mexican-hammocks-about-us.htm";		
	}
//****************************************
function womad(){
	RecWindow=window.open('http://www.womad.org/reading/','RecWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=600,height=400');		
	}
//****************************************
function priv(){
	PrivWindow=window.open('privacy4.htm','PrivWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=300,height=400');		
	}
//****************************************
function jute(){
	PrivWindow=window.open('jute_bag.htm','JuteWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=300,height=400');		
	}
//****************************************
function which(){
	WhichWindow=window.open('which.htm','WhichWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=300,height=400');		
	}
//****************************************
function referrer() {
	var fromwhere = getCookie("Referrer");
	var frompage = getCookie("EntryPage");
    	if (fromwhere == null || fromwhere == ""){
		var fromwhere=document.referrer;
		setCookie("Referrer",fromwhere);
	}
    	if (frompage == null || frompage == ""){
		var frompage=favurl;
		setCookie("EntryPage",frompage);
	}
}
//****************************************
function referrertestindex() {
	var fromwhere = getCookie("Referrer");
	var frompage = getCookie("EntryPage");
	capable = 'no';
	linkURL = "mexican-hammocks-about-us.htm";
	if (parent.document.URL) {

		callingURL = parent.document.URL;
			if (callingURL.indexOf('?') != -1) {

				if (callingURL.indexOf('$') != -1 && callingURL.indexOf('&') != -1) {
				linkURL = callingURL.substring(callingURL.indexOf('&')+1,callingURL.length);
				}else{
				linkURL = callingURL.substring(callingURL.indexOf('?')+1,callingURL.length);
				}
			}

	}
    	if (fromwhere == null || fromwhere == ""){
		if (parent.document.URL) {
			callingURL = parent.document.URL;
			if (callingURL.indexOf('?') != -1) {
				if (callingURL.indexOf('$') != -1 && callingURL.indexOf('&') != -1) {
				fromwhere = callingURL.substring(callingURL.indexOf('$')+1,callingURL.indexOf('&'));
				linkURL = callingURL.substring(callingURL.indexOf('&')+1,callingURL.length);
				}else{
				fromwhere = document.referrer;
				linkURL = callingURL.substring(callingURL.indexOf('?')+1,callingURL.length);
				}
			}
		frompage = linkURL;
		}else{
			fromwhere = document.referrer;
			linkURL = "mexican-hammocks-about-us.htm";
			frompage = "TESTINDEX5.HTM";
		}
		if (fromwhere == null || fromwhere == ""){
			fromwhere = "NONE FOUND AT TESTINDEX.HTM";
		}
		setCookie("Referrer",fromwhere);
		setCookie("EntryPage",frompage);
	}
}
//****************************************
function referrerindex() {
	var fromwhere = getCookie("Referrer");
	var frompage = getCookie("EntryPage");
	if (fromwhere == null || fromwhere == ""){
		if (parent.document.URL) {
			callingURL = parent.document.URL;
			if (callingURL.indexOf('?') != -1) {
				fromwhere = callingURL.substring(callingURL.indexOf('?')+1,callingURL.length);
			}else{
				fromwhere = document.referrer;
			}
		}else{
			fromwhere = document.referrer;
		}
		if (fromwhere == null || fromwhere == ""){
			fromwhere = "NONE FOUND AT INDEX.HTM";
		}
	setCookie("Referrer",fromwhere);
	}
	if (frompage == null || frompage == ""){
		frompage="INDEX.HTM";
		setCookie("EntryPage",frompage);
	}
}
//****************************************
function user() {
	if (username != "" && username != null){
	document.writeln('<TABLE WIDTH=518 CELLPADDING=\"0\" CELLSPACING=\"0\" BORDER=\"0\">');
	document.writeln('<tr><td bgcolor=\"#68AE6C\" height=\"35\" align=center><font color=\"#000000\"><P><strong><font face=\"Arial\" size=\"2\">You are logged in as: ' + username + '</font></strong> </font></td></tr>');			
	document.writeln('<\/TABLE>');
	}
}
//****************************************
//****************************************
function formHandler(form) {
	if (form.site.options[form.site.selectedIndex].value == "privacy4.htm"){
	priv()
	} else {
	var URL = form.site.options[form.site.selectedIndex].value;
//	URL="testindex5.htm?" + URL;
	top.location.href = URL;
	}
}
//****************************************
function navformHandler(form) {
	if (form.site.options[form.site.selectedIndex].value == "privacy4.htm"){
	priv()
	}
 else {
	var URL = form.site.options[form.site.selectedIndex].value;
//	parent.frames["main"].location.href = URL;
//	self.location="navtop3.htm";
	self.location=URL;
	}
}
//****************************************
function catmenu(menu){
if(parent.left){
if(parent.left.navloaded==1){
	parent.left.change();
	parent.left.uplink(menu);
	parent.left.popUp('catalogueKick',true);

}else{
	setTimeout("catmenu('"+menu+"')",100);
}
}else{
	setTimeout("catmenu('"+menu+"')",100);
}
}
//****************************************
function convert(){
	MyWindow=window.open('convertgrand.htm','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=320');		
	}
//****************************************
function choose_card(cardname) {

                index=document.cookie.indexOf('ThePurchases');
                countbegin=(document.cookie.indexOf('=',index)+1);
                countend=document.cookie.indexOf(';',index);
                if(countend==-1) {
                    countend=document.cookie.length;
                }
	cardpos=document.cookie.indexOf('Gift Wrapping');

               document.cookie='ThePurchases='+document.cookie.substring(countbegin,cardpos)+'Gift Wrapping With Card '+cardname+document.cookie.substring(cardpos+13,countend)+'; expires=' + expireDate.toGMTString();
self.location="purchases.htm";
}
//****************************************
no_wrp_ban=12;
wrp_ban = new Array(no_wrp_ban);
wrp_ban[0]="Mexican Hammock Stand";
wrp_ban[1]="Family Swing Stand (white)";
wrp_ban[2]="Guyed Post Stand (single end)";
wrp_ban[3]="Guyed Post Stand (complete)";
wrp_ban[4]="Gothic Chimenea (Green)";
wrp_ban[5]="Gothic Chimenea (Brown)";
wrp_ban[6]="Rustic Chimenea (Green)";
wrp_ban[7]="Rustic Chimenea (Brown)";
wrp_ban[8]="Mariposa Hammock Stand";
wrp_ban[9]="Hammock Chair (natural cream)";
wrp_ban[10]="Mariposa Stand (sky silver)";
wrp_ban[11]="Mariposa Stand (fern green)";



function wrapit(newItem, newPrice, newTaxable, newWeight, newURL, newQuantity) {
//		confirm('wrp_banned = '+wrp_banned);
	if(wrp_banned != -1){
		confirm('Sorry - We can\'t Gift Wrap this order due to the '+wrp_ban[wrp_banned]);
	}else{
		wrap_text="Gift Wrap This Order For £2.75 ?";
		if (confirm(wrap_text)) {
               		countbegin=(document.cookie.indexOf('=',index)+1);
                	countend=document.cookie.indexOf(';',index);
                	if(countend==-1) {
                    		countend=document.cookie.length;
                	}
                	document.cookie='ThePurchases='+document.cookie.substring(countbegin,countend)+'['+newItem+'|'+newPrice+'|'+newTaxable+'|'+newWeight+'|'+newURL+'|'+newQuantity+']; expires=' + expireDate.toGMTString();
            	}
	}
}
//****************************************
function buyItem(newItem, newPrice, newTaxable, newWeight, newURL, newQuantity) {
	if(newQuantity<=0) {
		rc = alert('The quantity entered is incorrect');
	} else {
		if (confirm('Add '+newQuantity+' x '+newItem+' to basket? ')) {
			index=document.cookie.indexOf('ThePurchases');
			countbegin=(document.cookie.indexOf('=',index)+1);
			countend=document.cookie.indexOf(';',index);
			if(countend==-1) {
				countend=document.cookie.length;
			}
			document.cookie='ThePurchases='+document.cookie.substring(countbegin,countend)+'['+newItem+'|'+newPrice+'|'+newTaxable+'|'+newWeight+'|'+newURL+'|'+newQuantity+']; expires=' + expireDate.toGMTString();
		}
// strip out Wrapping if banned item
				wrp_banned=0;
				for(var wrp_i=0;wrp_i<=no_wrp_ban;wrp_i++) {
					if(newItem == wrp_ban[wrp_i]){
						wrp_banned++;
					}
				}

		if(wrp_banned != 0 && document.cookie.indexOf('Gift Wrapping') != -1){
// remove wrapping & notify
			index = document.cookie.indexOf('ThePurchases');
			countbegin=(document.cookie.indexOf('=',index)+1);
			countend=document.cookie.indexOf(';',index);
			if (countend==-1) {
				countend=document.cookie.length;
			}
			fulllist=document.cookie.substring(countbegin,countend);
			newItemList=null;
			thisitem=0;
			for(var i=0; i<=fulllist.length;i++) {
				if(fulllist.substring(i,i+1)=='[') {
					itemstart=i+1;
				}else if (fulllist.substring(i,i+1)==']') {
					itemend=i;
					theitem = fulllist.substring(itemstart,itemend);
					if(theitem.indexOf('Gift Wrapping') ==-1){
						newItemList = newItemList+'['+fulllist.substring(itemstart,itemend)+']';
					}else{
						rc = alert('We\'ve removed your Gift Wrapping selection as we can\'t Gift Wrap this item.');
					}
				}
			}
			document.cookie='ThePurchases='+newItemList+'; expires=' + expireDate.toGMTString();
		}
        	}
   }
//****************************************
function getCookie(name) { // use: getCookie("name");
	var index = bikky.indexOf(name + "=");
	if (index == -1) return null;
	index = bikky.indexOf("=", index) + 1;
	var endstr = bikky.indexOf(";", index);
	if (endstr == -1) endstr = bikky.length;
	return unescape(bikky.substring(index, endstr));
}
//****************************************
function setCookie(name, value) {
    if (value != null && value != ""){
	document.cookie=name + "=" + escape(value) + ";expires=" + expireDate.toGMTString();
	bikky = document.cookie;
		}
	}
//****************************************
function protect() {
var message="This material is protected by International Copyright Legislation";
function mind(z) {
	if (document.all) {
		if (event.button == 2) {
		alert(message);
		return false;
		}
	} else {
		if (z.which == 3) {
		alert(message);
		return false;
		}
	}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=mind;
}
//****************************************
function basketbutton() {
document.writeln('<P>&nbsp\;<center><TABLE CELLPADDING=\"0\" CELLSPACING=\"0\" BORDER=\"0\"><TR><TD align=center colspan=3><TABLE CELLPADDING=\"0\" CELLSPACING=\"0\" BORDER=\"2\" BGCOLOR=\"#32CA32\"><TR><TD align=\"center\"><font face=\"Arial\" size=\"1\"><A HREF=\"purchases.htm\">VIEW YOUR BASKET<\/A><\/td><\/TR><\/TABLE><\/TD><\/TR><\/TABLE><\/center>')
}
//****************************************
function catbutton() {
document.writeln('<P>&nbsp\;<center><TABLE CELLPADDING=\"0\" CELLSPACING=\"0\" BORDER=\"0\"><TR><TD align=center colspan=3><TABLE CELLPADDING=\"0\" CELLSPACING=\"0\" BORDER=\"2\" BGCOLOR=\"#32CA32\"><TR><TD align=\"center\"><font face=\"Arial\" size=\"1\"><A HREF=\"catindex.htm\">ENTER THE CATALOGUE<\/A><\/td><\/TR><\/TABLE><\/TD><\/TR><\/TABLE><\/center>')
}
//****************************************
function backtocatbutton() {
document.writeln('<P>&nbsp\;<center><TABLE CELLPADDING=\"0\" CELLSPACING=\"0\" BORDER=\"0\"><TR><TD align=center colspan=3><TABLE CELLPADDING=\"0\" CELLSPACING=\"0\" BORDER=\"2\" BGCOLOR=\"#32CA32\"><TR><TD align=\"center\"><font face=\"Arial\" size=\"1\"><A HREF='+ backurl +'>BACK TO THE CATALOGUE<\/A><\/td><\/TR><\/TABLE><\/TD><\/TR><\/TABLE><\/center>')
}
//****************************************
function navcombo() {
document.write('<STYLE>');
document.write('P.ethical {font-size:8pt\; font-weight:normal\; color:black\; text-decoration:none\; background-color: #FFFFFF}');
document.write('<\/STYLE>');
document.write('<TABLE CELLPADDING=\"0\" CELLSPACING=\"0\" BORDER=\"0\">');
document.write('<TR><TD align=center colspan="3">&nbsp;<\/TD><\/TR>');

document.write('<TR><TD align="center" colspan="3"><TABLE border=0><TR><TD align=\"right\">');


document.write('<!-- GeoTrust QuickSSL [tm] Smart Icon tag. Do not edit. -->');
document.write('<SCRIPT LANGUAGE="JavaScript" TYPE="text\/javascript" SRC="\/\/smarticon.geotrust.com\/si.js"><\/SCRIPT>');
document.write('<!-- end GeoTrust Smart Icon tag -->');

document.write('<\/TD><TD align=\"center\"><IMG SRC=\"hands1-65bw.jpg\" width=\"132\" height=\"65\" VSPACE=\"5\" BORDER=\"1\" ALT=\"Supporting fair trade in rural Mexico since 1983\"><\/TD><TD align=\"left\">');

document.write('<!-- GeoTrust QuickSSL [tm] Smart Icon tag. Do not edit. -->');
document.write('<SCRIPT LANGUAGE="JavaScript" TYPE="text\/javascript" SRC="\/\/smarticon.geotrust.com\/si.js"><\/SCRIPT>');
document.write('<!-- end GeoTrust Smart Icon tag -->');

document.write('<\/TD><\/TR><TR><TD colspan=3><br><a href=\"http:\/\/www.ethical-junction.org\/member\/org-6057.html\" target=\"new.window\"><img SRC=\"ethicaljunction1b-600.PNG\" alt=\"a member of ethical junction\" border=\"0\"><\/A></TD></TR><\/TABLE><\/TD><\/TR>');


document.write('<tr><td align=center colspan="3">&nbsp\;<\/td><\/tr>');
document.write('<tr><td align=center><FORM name = \"form\">');
document.write('<SELECT NAME=\"site\" SIZE=1 onChange =\"formHandler(this.form)\">');
document.write('<OPTION VALUE=\"\">Catalogue ..........');
document.write('<OPTION VALUE=\"index.htm\">Home');
document.write('<OPTION VALUE=\"hammocks.htm\">Hammocks');
document.write('<OPTION VALUE=\"hammock-stands.htm\">Hammock Stands');
document.write('<OPTION VALUE=\"hammock-chairs.htm\">Hammock Chairs');
document.write('<OPTION VALUE=\"mexican-chimeneas.htm\">Chimeneas');
document.write('<OPTION VALUE=\"mexican-mirrors.htm\">Tile Mirrors');
document.write('<OPTION VALUE=\"mexican-tiles.htm\">Mexican Tiles');
document.write('<OPTION VALUE=\"mexican-citrus-juicers.htm\">Citrus Juicers');
document.write('<OPTION VALUE=\"mexican-rugs-blankets.htm\">Blankets & Rugs');
document.write('<OPTION VALUE=\"mexican-pottery.htm\">Ceramics');
//document.write('<OPTION VALUE=\"sombreros.htm\">Sombreros');
document.write('<OPTION VALUE=\"mexican-ponchos.htm\">Ponchos');
document.write('<OPTION VALUE=\"mexican-wobblies.htm\">Wobblies & Salsa');
document.write('<OPTION VALUE=\"mexican-greetcards.htm\">Greeting Cards');
//document.write('<OPTION VALUE=\"mexican-hammocks-giftpacks.htm\">Gift Packs');
//document.write('<OPTION VALUE=\"voucher\/voucher.html\">Gift Vouchers');
document.write('<OPTION VALUE=\"mexican-hammocks-specials.htm\">Special Offers');
document.write('<\/SELECT><\/FORM><\/td><td align=center><FORM name = \"form\">');
document.write('<SELECT NAME=\"site\" SIZE=1 onChange =\"formHandler(this.form)\">');
document.write('<OPTION VALUE=\"\">Hammock Info ....');
document.write('<OPTION VALUE=\"mexican-hammocks-about-us.htm\">About Us');
document.write('<OPTION VALUE=\"about-hammocks.htm\">About Hammocks');
document.write('<OPTION VALUE=\"mexican-hammocks-why-buy-from-us.htm\">Why Buy From Us');
document.write('<OPTION VALUE=\"compare-hammocks.htm\">Compare Hammocks');
document.write('<OPTION VALUE=\"hammock-gifts.htm\">Hammock Gifts');
document.write('<OPTION VALUE=\"hanging-a-hammock.htm\">Hanging A Hammock');
document.write('<OPTION VALUE=\"getting-in-a-hammock.htm\">Getting In');
document.write('<OPTION VALUE=\"hammock-care.htm\">Care & Handling');
document.write('<OPTION VALUE=\"garden-hammocks.htm\">Garden Hammocks');
document.write('<OPTION VALUE=\"beach-hammocks.htm\">Beach Hammocks');
document.write('<OPTION VALUE=\"hammocks-for-stress-relief.htm\">Stress Relief');
document.write('<OPTION VALUE=\"poolside-hammocks.htm\">By The Pool');
document.write('<OPTION VALUE=\"garden-hammocks-2.htm\">Garden Ideas');
document.write('<OPTION VALUE=\"hammock-history.htm\">Hammock History');
document.write('<\/SELECT><\/FORM><\/td><td align=center><FORM name = \"form\">');
document.write('<SELECT NAME=\"site\" SIZE=1 onChange =\"formHandler(this.form)\">');
document.write('<OPTION VALUE=\"\">Ordering Info ......');
document.write('<OPTION VALUE=\"hammock-delivery.htm\">Delivery Times');
document.write('<OPTION VALUE=\"hammock-payment.htm\">Payment Types');
document.write('<OPTION VALUE=\"hammock-guarantee.htm\">Our Guarantee');
document.write('<OPTION VALUE=\"hammock-security.htm\">Site Security');
document.write('<OPTION VALUE=\"trading-code.htm\">Our Trading Code');
document.write('<OPTION VALUE=\"hammocks-contact.htm\">Contact Details');
document.write('<OPTION VALUE=\"hammock-enquiry.htm\">Enquiry Form');
document.write('<OPTION VALUE=\"hammocks-location.htm\">Where Are We?');
// document.write('<OPTION VALUE=\"press-hammocks.htm\">Press Info');
document.write('<OPTION VALUE=\"converter.htm\">£/$ Converter');
document.write('<OPTION VALUE=\"affiliateinfo.htm\">Affiliates');
document.write('<\/SELECT><\/FORM><\/td><\/tr><\/table>');
}
//****************************************
function footer() {
document.writeln('<TABLE width=100% CELLPADDING=\"0\" CELLSPACING=\"0\" BORDER=\"0\">');
document.writeln('<TR><TD align=center><P align=center><FONT SIZE=\"-1\" FACE=\"Arial\" COLOR=\"#527B10\"><MARQUEE BEHAVIOR=scroll DIRECTION=left HEIGHT=\"10\" LOOP=infinite SCROLLAMOUNT=10 SCROLLDELAY=\"150\">');
document.writeln('The Mexican Hammock Company (Hamacas Mexicanas), Bristol UK - Handwoven Mexican Hammocks, Chair Hammocks, Garden Furniture, Mexican Tiles, Mexican Mirrors, Mexican Pottery, Mexican Blankets, Mexican Rugs, Millenium Bugs and other unique items for the house and garden. Supporting Fair Trade and Self-Motivated Development for Village Communities in Central America since 1983.');
document.writeln('<\/MARQUEE><\/FONT><\/CENTER>');
document.writeln('<\/TD><\/TR><\/TABLE>');
}
//****************************************
function pagefoot1() {
basketbutton();
navcombo();
addtofav();
postcard();
footer();
protect();
}
//****************************************
function pagefoot2() {
catbutton();
navcombo();
addtofav();
postcard();
footer();
protect();
}
//****************************************
now=new Date;
datei=now.getDate();
monthi=now.getMonth()+1;
houri=now.getHours();
thisYr=now.getYear();
	if(thisYr<1900){
	thisYr=thisYr+1900
	}
nextYr=thisYr+1;

//TODAY 15/11 input 10,15
//XMAS DAY 25/12 input 11,25
//FATHERS DAY 17/06 input 5,17
mother=new Date(thisYr,11,25);
	if (mother.getTime() < now.getTime()){
	mother.setYear(nextYr)
	}
post=new Date(thisYr,11,18);
	if (post.getTime() < now.getTime()){
	post.setYear(nextYr)
	}
nyr=new Date(nextYr,0,1)
	if (nyr.getTime() < now.getTime()){
	nyr.setYear(nextYr)
	}



///////////////////////////////////////////////////////////////
p_message="";

if (daysTill(mother)<=40 || daysTill(mother)>=3) {
	if (daysTill(mother)>=13) {
		if (daysTill(mother)==13) {
			if (houri < 12) {
				p_message="N.B. With the help of Santa\'s elves we will do our best to ensure that all UK orders placed during the sale are delivered in time for Christmas<br>&nbsp\;";
			}else{
				p_message="N.B. With the help of Santa\'s elves we will do our best to ensure that all UK orders placed before 10am on December 21st are delivered in time for Christmas<br>&nbsp\;";
			}
		}else{
//				p_message="N.B. With the help of Santa\'s elves we will do our best to ensure that all UK orders placed during the sale are delivered in time for Christmas<br>&nbsp\;";
				p_message="";
		}
	}else if (daysTill(mother)>=3) {
		if (daysTill(mother)==3) {
			if (houri < 10) {
				p_message="N.B. With the help of Santa\'s elves we will do our best to ensure that all UK orders placed by 10am today are delivered in time for Christmas. If two or more UK Shipping Methods show the same estimated Delivery Date please choose the lowest price option.<br>&nbsp\;";
			}else{
				p_message="";
			}
		}else if (daysTill(mother)<=11){
				p_message="N.B. With the help of Santa\'s elves we will do our best to ensure that all UK orders placed before 10am on December 21st are delivered in time for Christmas. If two or more UK Shipping Methods show the same estimated Delivery Date please choose the lowest price option.<br>&nbsp\;";
		}else{
				p_message="N.B. With the help of Santa\'s elves we will do our best to ensure that all UK orders placed before 10am on December 21st are delivered in time for Christmas<br>&nbsp\;";
		}
	}else{
				p_message="";
	}
}
/////////////////////////////////////////////////////////////////////////////////








function getdate(){
	document.write('<script src=\"dates'+monthi+'.js\"><\/script>');
}
/////////////////////////
function count() {
if (daysTill(nyr)<12) {
document.theForm.countdown.value = secsTill(nyr);
setTimeout("count()",1000)
}
}
/////////////////////////

/////////////////////////
function dayToDays(inTime) {
return (Math.floor(inTime.getTime() / (1000 * 60 * 60 * 24)))
}
/////////////////////////

/////////////////////////
function daysTill(inDate) {
return dayToDays(inDate) - dayToDays(now)
}
/////////////////////////

/////////////////////////
function secToDays(inTime) {
return (Math.floor(inTime.getTime() / (1000)))
}
/////////////////////////

/////////////////////////
function secsTill(inDate) {
now=new Date;
thisYr=now.getYear();
if(thisYr<1900){
	thisYr=thisYr+1900
}
return secToDays(inDate) - secToDays(now)
}
/////////////////////////

