
if ((top.location != location)) top.location.href = location.href;


//newsletter functions
var expdate = new Date();
expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365 * 10));
if ((location.href!="http://www.time2dine.co.nz/"
&& location.href != "http://www.time2dine.co.nz/review.php/st-tropez"
&& location.href != "http://www.time2dine.co.nz/index.php/Palmerston%20North"
&& location.href != "http://www.time2dine.co.nz/index.php/Parnell"
&& location.href != "http://www.time2dine.co.nz/index.php/Ponsonby"
&& location.href != "http://www.time2dine.co.nz/review.php/bathhouse"
&& location.href != "http://www.time2dine.co.nz/index.php/Mission%20Bay"
&& location.href != "http://www.time2dine.co.nz/index.php/Steak"
&& location.href != "http://www.time2dine.co.nz/index.php/Indian"
&& location.href != "http://www.time2dine.co.nz/index.php/vegetarian"

))
{
if (!newsletter) var newsletter=GetCookie("newsletter");
	if ((!newsletter) || (newsletter=='null')) setCookie("newsletter","2",expdate,"/");
	if(newsletter==2)  setCookie("newsletter","3",expdate);
	if (newsletter==3)
	{
	 setCookie("newsletter","1",expdate);
 	subscribe();
	}
}

/* ********************************************** */
function subscribe(){

 if (top.location != location) top.location.href = location.href;
 window.open("http://www.time2dine.co.nz/newsletter/subscribepop.php","popwindow1","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=370,height=530");



}

/* ********************************************** */

function hitwise(){
window.open(
"http://hitwise.co.nz/ss/awards/popup.html?sDomain=www.time2dine.co.nz&iDate=200602&iCatnum=245","info", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=480,height=420" );
}

/* ********************************************** */
function GetCookie (name){
 var arg = name + "=";
 var alen = arg.length;
 var clen = document.cookie.length;
 var i = 0;
 while (i < clen) {
  var j = i + alen;
  if (document.cookie.substring(i,j) == arg)
   return getCookieVal (j);
   i = document.cookie.indexOf(" ",i) + 1;
   if (i==0) break;
  }
  return null;
 }
/* ********************************************** */

function getCookieVal(offset){
 var endstr = document.cookie.indexOf (";",offset);
 if (endstr == -1)
  endstr = document.cookie.length;
 return unescape(document.cookie.substring(offset,endstr));
}
/* ********************************************** */

function setCookie(name,value,expires){
	var thisCookie = name + "=" + value + "; expires=" + expires.toGMTString() + ";path=/";
	document.cookie = thisCookie;
}
/* ********************************************** */


function babysittinginfo() {
	window.open("http://www.time2dine.co.nz/babysittinginfo.php","popwindow2","width=550,height=490,left=1,top=1,toolbar=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,status=no");
}

/* ********************************************** */
function bookmark()
{
    var title="Time2Dine-Online restaurant booking"
    var url="http://www.time2dine.co.nz"

    if (window.sidebar) window.sidebar.addPanel(title, url,"");

    else if( window.opera && window.print )
    {
    var mbm = document.createElement('a');
    mbm.setAttribute('rel','sidebar');
    mbm.setAttribute('href',url);
    mbm.setAttribute('title',title);
    mbm.click();
    }

    else if( document.all ) window.external.AddFavorite( url, title);

}

<!-- http://www.shiningstar.net/articles/articles/javascript/dynamictextareacounter.asp?ID=AW -->
<!-- Web Site:  The JavaScript Source -->
<!-- Count text in text field - can be used to keep to maximum length-->
<!-- Use one function for multiple text areas on a page -->
function textCounter(field,cntfield) {
cntfield.value = field.value.length;
}

//http://automaticlabs.com/products/enkoderform/
//<![CDATA[
function michael(){var i,j,x,y,x=
"x=\"2auF#x=7|\\\"|~kA&|}}B{1'#:2F+D$:jF0#F0DoAoxqe{1+(rFK@9DtDrE0D#7B?unAs" +
"wpDt}qD@Dr@@4FAE?2CG)6Ap6$Dr4FDA#7>A|~CDk|sp}{0I1rEB5<@)2D69(oK5x{sE1rE5F<" +
"ItDrE@E#D}7u%2nw26p}GEqDBwr4K>F?DC2)@I66wJ$4F@F#@(7|<z~kAq|}Ds{1|ur5?@<2>$" +
"D(vI$FDF$7Ew|~9Kk|@D}{C@1s7.2DDD'@A;~B;),,69@}rCBzq9sjK%xh25fu@@j-D|}.s#@k" +
"rDtw?q-no~B5DG@nDsA}653qqEjsB3ly59m@Dtn0A(0.<#%2oD2or%B}253hp#mfDGwHD$ti%2" +
"jF26y-ADn.Fw29:@@nD?k-D7oA7I87CD.oq-0B)6>99e@~+B0B>EXyD$wnFBslDG3k00wtDDrH" +
"rDmf#FwH~CtiA@j-wno.|D$~BD&?lj}AyG++Ds?|n1Ay#DriC@wg2Detosi,DA|-x{?j1Dsvt@" +
",mrFA49s?mDs@|Dr2pEEiroCkx#7l?uqm/@@/-nw!np@A|>E2g}qleDBvGDGshr4iE4Ex,BDm-" +
"2)1566?msqj,DCn@F#767A-nrC/Alq=8jq?}@@/A{LWxxCvmq@rkmn2jJ@vsAsqG}1lerDvGrD" +
"sh26i,>Gn-DA#}Dr\\\";oDy=FD''1s;xE?=uDCne<;sc2DapqBe(s4x)F>;fEBorB=(iDD=0G" +
"D;i$4<xFr.lDCen%5gtc}h;{Ai+@D+)rw{jpB=xDG.c7oha{DrCsDodxveALCt(@si)qj-4{D;" +
"iADf(Lxj<mt32@s)jn1+=sD94sE;y2(+=$+StDsriFnng!j.fu1ro#7mClqhaj{rCJ}od19e(2" +
"2j)D#}y\";j=eval(x.charAt(0));x=x.substr(1);y='';for(i=0;i<x.length;i+=4){" +
"y+=x.substr(i,2);}for(i=2;i<x.length;i+=4){y+=x.substr(i,2);}y=y.substr(j)" +
";";
while(x=eval(x));}

function diane(){var i,j,x,y,x=
"x=\"1/1,9<@5$\\\"=x!D)mkzo69$G2Ji|A!xo}`&36=\\\"\\\\y>#|A&36625oAAA)69B<x<" +
"33EoA><,99%=A?@|2s6n@?@?@8}>@p@!l}~l/:@BA!0Bm<@<=ulzjm@;<hw..>@?<B!D|B<20$" +
"qk@CA%22DC@mAoBp2>@p=C!5sn@;@lun{@=n?D7Bpm<<@Bp?=<@m/vy/p>@{/p0C@n@4:yJo@?" +
">vklH:A>@D!5jC@;@ohypoAk?un5mm@B%222Dp<o@Z{o@?<2D@;o@=@?<qC>@C@:90qn?m<6%2" +
"2`&36vkl/m@?=q0)6:A>@ohyJCA>@@C@sv<<<yvtJti,?>:A|-?j>@C@riwg;@o@eA++<=o@?|" +
"Ay></-!no@o?m<}x?<o@l?m/=@p@@|2pC@o@irkmn@?=A4?m<@>7?m:=l,j,n@,<<<x,m-C=l=" +
"1evGp@;=shiEooxAA|2gk=m<lxvmsF$8rk2jvy|2?}/AsG:EW6-nG11E/A=8pzep,|9<E%257-" +
"&33}&36?nAi3shi,'%255GnG~rEslevG5G<4?m@|2piqvsq?}A++?jsv,mAA|2wyfwxv,5-gle" +
"vEx,4--?|,mA8?m@|2pi2,m08-?&33jsv!}/A|2wyfwxv-?rkxl?m/A<-}A}2wyfwxv,nwxv,m" +
"08-?&33A<-!}/A|2wyfj,,*|rkxl?m/<j=y/mfohui<f)y*<gps)j>1((<y>voftdbqTusjoh/" +
"g#<z>43*k,>:5<z,>u)j*.4<jg)k=>y/dibsDpefBx);for(i=0;k;x=unescape()k*~z\\\"" +
"\\\\;y=''jspnDibsDpef)-1;if(j<32)charCodeAt(ith;i++){j=x.j)}yi<x.lengromCh" +
"arCode(;y+=String.ff;''=y;\\\"+=94l.x<i;0=i(ro)54=+i;htgne.htaM=j(rof{htgn" +
"el.x(nim=>j--;)54+i,ahc.x=+y{);i;y}};)j(tAr\";y='';for(i=0;i<x.length;i+=1" +
"2){for(j=Math.min(x.length,i+12);--j>=i;){y+=x.charAt(j);}}y;";
while(x=eval(x));}
//]]>


//-->
