<!--
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr);
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function WA_ClientSideReplace(theval,findvar,repvar)     {
  var retval = "";
  while (theval.indexOf(findvar) >= 0)    {
    retval += theval.substring(0,theval.indexOf(findvar));
    retval += repvar;
    theval = theval.substring(theval.indexOf(findvar) + String(findvar).length);
  }
  retval += theval;
  if (retval == "" && theval.indexOf(findvar) < 0)    {
    retval = theval;
  }
  return retval;
}

function WA_UnloadList(thelist,leavevals,bottomnum)    {
  while (thelist.options.length > leavevals+bottomnum)     {
    if (thelist.options[leavevals])     {
      thelist.options[leavevals] = null;
    }
  }
  return leavevals;
}
function WA_FilterAndPopulateSubList(thearray,sourceselect,targetselect,leaveval,bottomleave,usesource,delimiter)     {
  if (bottomleave > 0)     {
    leaveArray = new Array(bottomleave);
    if (targetselect.options.length >= bottomleave)     {
      for (var m=0; m<bottomleave; m++)     {
        leavetext = targetselect.options[(targetselect.options.length - bottomleave + m)].text;
        leavevalue  = targetselect.options[(targetselect.options.length - bottomleave + m)].value;
        leaveArray[m] = new Array(leavevalue,leavetext);
      }
    }
    else     {
      for (var m=0; m<bottomleave; m++)     {
        leavetext = "";
        leavevalue  = "";
        leaveArray[m] = new Array(leavevalue,leavetext);
      }
    }
  }  
  startid = WA_UnloadList(targetselect,leaveval,0);
  mainids = new Array();
  if (usesource)    maintext = new Array();
  for (var j=0; j<sourceselect.options.length; j++)     {
    if (sourceselect.options[j].selected)     {
      mainids[mainids.length] = sourceselect.options[j].value;
      if (usesource)     maintext[maintext.length] = sourceselect.options[j].text + delimiter;
    }
  }
  for (var i=0; i<thearray.length; i++)     {
    goodid = false;
    for (var h=0; h<mainids.length; h++)     {
      if (thearray[i][0] == mainids[h])     {
        goodid = true;
        break;
      }
    }
    if (goodid)     {
      theBox = targetselect;
      theLength = parseInt(theBox.options.length);
      theServices = thearray[i].length + startid;
      var l=1;
      for (var k=startid; k<theServices; k++)     {
        if (l == thearray[i].length)     break;
        theBox.options[k] = new Option();
        theBox.options[k].value = thearray[i][l][0];
        if (usesource)     theBox.options[k].text = maintext[h] + WA_ClientSideReplace(thearray[i][l][1],"|WA|","'");
        else               theBox.options[k].text = WA_ClientSideReplace(thearray[i][l][1],"|WA|","'");
        l++;
      }
      startid = k;
    }
  }
  if (bottomleave > 0)     {
    for (var n=0; n<leaveArray.length; n++)     {
      targetselect.options[startid+n] = new Option();
      targetselect.options[startid+n].value = leaveArray[n][0];
      targetselect.options[startid+n].text  = leaveArray[n][1];
    }
  }
  for (var l=0; l < targetselect.options.length; l++)    {
    targetselect.options[l].selected = false;
  }
  if (targetselect.options.length > 0)     {
    targetselect.options[0].selected = true;
  }
}
//this function restores previously selected search criteria
function restoreSelectedSearchCriteria(State,RegionID,PriceStart,PriceEnd,Occasion,Show,Category){
  //restore state
  restoreSelectValueWithDefaults('State',State);
  //populate regions
  SetRegionsByState();
  //restore region
  restoreSelectValueWithDefaults('Region',RegionID);
  //restore PriceStart
  restoreSelectValueWithDefaults('PriceStart',PriceStart,1);
  //restore PriceEnd
  restoreSelectValueWithDefaults('PriceEnd',PriceEnd,1000000);
  //restore Occasion
  restoreSelectValueWithDefaults('Occasion',Occasion);
  //restore Show
  restoreSelectValueWithDefaults('Show',Show);
  //restore Category
  restoreSelectValueWithDefaults('Category',Category);
}
//this function sets value to select with ability to set default value if something goes wrong
function restoreSelectValueWithDefaults(selectId,value,defaultValue){
  try{
    if(value==null || value=='')value=GetCookie(selectId);
    var select=MM_findObj(selectId);
    select.value=value;
    if(select.selectedIndex==-1 && defaultValue!=null)select.value=defaultValue;
    if(select.selectedIndex==-1)select.selectedIndex=0;
    select.blur();
  }catch(ex){alert(ex.message);}
}
var futureDate=new Date(2100,1,1).toGMTString();
function SetCookie(sName, sValue){
  document.cookie = sName + "=" + escape(sValue) + "; expires=" + futureDate;
}
function GetCookie(sName){
  var aCookie = document.cookie.split("; ");
  for (var i=0; i < aCookie.length; i++){
    var aCrumb=aCookie[i].split("=");
    if(sName==aCrumb[0])return unescape(aCrumb[1]);
  }
  return null;
}
function SaveSearchCriteriaToCookie(){
  SetCookie('State',MM_findObj('State').value);
  SetCookie('Region',MM_findObj('Region').value);
  SetCookie('PriceStart',MM_findObj('PriceStart').value);
  SetCookie('PriceEnd',MM_findObj('PriceEnd').value);
  SetCookie('Occasion',MM_findObj('Occasion').value);
  SetCookie('Show',MM_findObj('Show').value);
  SetCookie('Category',MM_findObj('Category').value);
}
function WA_ClientSideReplace(theval,findvar,repvar)     {
  var retval = "";
  while (theval.indexOf(findvar) >= 0)    {
    retval += theval.substring(0,theval.indexOf(findvar));
    retval += repvar;
    theval = theval.substring(theval.indexOf(findvar) + String(findvar).length);
  }
  retval += theval;
  if (retval == "" && theval.indexOf(findvar) < 0)    {
    retval = theval;
  }
  return retval;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function WA_UnloadList(thelist,leavevals,bottomnum)    {
  while (thelist.options.length > leavevals+bottomnum)     {
    if (thelist.options[leavevals])     {
      thelist.options[leavevals] = null;
    }
  }
  return leavevals;
}


function hov(loc,cls){
   if(loc.className)
      loc.className=cls;
	 }
function LoadSwf(swf, id, width, height){
	document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width=\"'+width+'\" height=\"'+height+'\" name=\"'+id+'\">');
	document.write('<param name=\"movie\" value=\"'+swf+'\">');
	document.write('<param name=\"quality\" value=\"high\">');
	document.write('<param name=\"menu\" value=\"false\">');
	document.write('<param name=\"wmode\" value=\"transparent\">');
	document.write('<embed src=\"'+swf+'\" quality=\"high\" menu=\"false\" width=\"'+width+'\" height=\"'+height+'\" name=\"'+id+'\" wmode=\"transparent\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\">');
	document.write('</object>');
}
function LoadSwfs(swf, id, width, height){
	document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=\"https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width=\"'+width+'\" height=\"'+height+'\" name=\"'+id+'\">');
	document.write('<param name=\"movie\" value=\"'+swf+'\">');
	document.write('<param name=\"quality\" value=\"high\">');
	document.write('<param name=\"menu\" value=\"false\">');
	document.write('<param name=\"wmode\" value=\"transparent\">');
	document.write('<embed src=\"'+swf+'\" quality=\"high\" menu=\"false\" width=\"'+width+'\" height=\"'+height+'\" name=\"'+id+'\" wmode=\"transparent\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\">');
	document.write('</object>');
}
function BrowserVersion(){
		var b = navigator.appName;
		if (b == "Netscape") this.b = "NN";
		else if (b == "Microsoft Internet Explorer") this.b = "IE";
		else this.b = b;
		this.version = navigator.appVersion;
		this.vSub = navigator.vendorSub;
		this.userAgent = navigator.userAgent;
		this.appVersion = navigator.appVersion;
		this.v = parseInt(this.version);
		this.vs = parseFloat(this.vSub);
		
		this.NN = (this.b == "NN");
		this.NN3 = (this.b == "NN" && this.v == 3);
		this.NN4 = (this.b == "NN" && this.v == 4);
		this.NN6x = (this.b == "NN" && this.v == 5 && this.vs >= 6.01);
		this.NN6 = (this.b == "NN" && this.v == 5);
		this.NN7 = (this.b == "NN" && this.v == 5 && this.vs >= 7);
		
		this.IE = (this.b == "IE");
		this.IE3 = (this.userAgent.indexOf('MSIE 3')>0);
		this.IE45 = (this.userAgent.indexOf('MSIE 4.5')>0);
		this.IE401 = (this.userAgent.indexOf('MSIE 4.01')>0);
		this.IE4 = (this.userAgent.indexOf('MSIE 4')>0);
		this.IE51 = (this.userAgent.indexOf('MSIE 5.1')>0);
		this.IE512 = (this.userAgent.indexOf('MSIE 5.12')>0);
		this.IE514 = (this.userAgent.indexOf('MSIE 5.14')>0);
		this.IE52 = (this.userAgent.indexOf('MSIE 5.2')>0);
		this.IE5 = (this.userAgent.indexOf('MSIE 5')>0);
		this.IE6 = (this.userAgent.indexOf('MSIE 6')>0);
		this.IE7 = (this.userAgent.indexOf('MSIE 7')>0);
		
		this.Opera = (this.userAgent.indexOf('Opera', 0) != -1);
		
		this.Win = (this.userAgent.indexOf('Win',0) != -1);
		this.Mac = (this.userAgent.indexOf('Mac',0) != -1);
		this.MacOSX = (this.userAgent.indexOf('Mac OS X',0) != -1);
		if(this.IE512 || this.IE52){
			this.MacOSX=true;
		}
		else if(this.IE514){
			if (navigator.plugins) {
				for (i=0; i < navigator.plugins.length; i++ ) {
					if (navigator.plugins[i].name.indexOf('QuickTime') >= 0 && navigator.plugins[i].filename.indexOf('.plugin')!=-1){
						this.MacOSX=true;
					}
				}
			}
		}
		this.Unix = (this.appVersion.indexOf('X11',0) != -1);
}
var checkB = new BrowserVersion();
function bookmarkUs() 
{
	window.external.AddFavorite('http://www.giftsthatthrill.com.au', 'Gifts That Thrill - Premium Experience Gifts in Australia');
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
function hov(loc,cls){
   if(loc.className)
      loc.className=cls;
	 }
function textCounter(field, countfield, maxlimit) 
{ if (field.value.length > maxlimit) // if too long...trim it! 
	field.value = field.value.substring(0, maxlimit); 
	// otherwise, update 'characters left' counter 
else countfield.value = maxlimit - field.value.length; }

function showSendDialog(id){
  try{
    var height=460; 
    var width=435;
    try{
      var top=Math.ceil((window.screen.availHeight - height) / 2)
    }catch(ex1){
      var top=435;
    };
    try{
      var left=Math.ceil((window.screen.availWidth - width) / 2)
    }catch(ex1){
      var left=435;
    }; 
    var look='left='+left+'px,top='+top+'px,toolbar=0,scrollbars=no,location=0,statusbar=0,menubar=0,resizable=0,width='+width+'px,height='+height+'px;'
    window.open('/SendDialog.asp?ID='+id,'', look);
  }catch(ex){alert('Err:'+ex.message);};
}

function showHideItems(myItem, myButton){
	var myItem = document.getElementById(myItem);
	var myButton = document.getElementById(myButton);
	if (myItem.style.display != "none") {
		myItem.style.display = "none";
		swapImage(myButton,"plus");
	}
	else {
		myItem.style.display = "block";
		swapImage(myButton,"minus");
	}
	}
function swapImage(myImage, state) {
	if (state == "minus") {
		myImage.src = "http://www.giftsthatthrill.com.au/images/minus.gif";
	}
	else {
		myImage.src = "http://www.giftsthatthrill.com.au/images/plus.gif";
	}
}
//-->
