// JavaScript Document

max_recent=3
var expDays=30
var exp=new Date()
exp.setTime(exp.getTime()+(expDays*24*60*60*1000))
function getCookieVal(offset){
var endstr=document.cookie.indexOf(";",offset)
if(endstr==-1)endstr=document.cookie.length
return unescape(document.cookie.substring(offset,endstr))
}
function swap(){
	var a1= document.getElementById('t1').value;
	var res = (Number(a1) * 2);
	document.qtyform.vwquantity.value=Math.round(res);
}

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 SetCookie(name,value){
var argv=SetCookie.arguments
var argc=SetCookie.arguments.length
var expires=(argc>2)?argv[2]:null
var path=(argc>3)?argv[3]:null
var domain=(argc>4)?argv[4]:null
var secure=(argc>5)?argv[5]:false
document.cookie=name+"="+escape(value)+((expires==null)?"":("; expires="+expires.toGMTString()))+((path==null)?"":("; path="+path))+((domain==null)?"":("; domain="+domain))+((secure==true)?"; secure":"")
}
function set_recent(v){
var r=new Array()
var i=1,j=1
while((r[i]=GetCookie('recent'+j))!=null&&r[i]!=""&&j++<=max_recent)
if(r[i]!=v)
i++
if(i>max_recent)
i=max_recent
SetCookie('recent'+i,v,exp,'/')
j=i
while(++j<=max_recent)
SetCookie('recent'+j,"",exp,'/')
j=0
if(i==max_recent&&r[i]!=null&&r[i]!="")
j=1
while(--i>0)
SetCookie('recent'+i,r[i+j],exp,'/')
}
function recent_items(bf,sp,bh){
var i=1,t="",n=""
if((n=GetCookie('recent'+i))!=null&&n!="")
t+=n
while(++i<=max_recent)
if((n=GetCookie('recent'+i))!=null&&n!="")
t+=sp+n
if(t!="")
document.write(bf+t+bh)
} 
/*function curryear()
 {
    var now = new Date();
	function fourdigits(number)	{
      return (number < 1000) ? number + 1900 : number;
	  }
       today = fourdigits(now.getYear());
	   document.getElementById("date").value=today;

  }*/
function addbookmark()
{
	var IE = navigator.appName.match(/(Microsoft Internet Explorer)/gi),
    NS = navigator.appName.match(/(Netscape)/gi),
    OP = navigator.appName.match(/(Opera)/gi),
    BK = document.getElementById('bookmark');
	
    BK.onmouseout = function()
	{

   	   window.status = '';
    }
    if(IE && document.uniqueID)
	{
		var bookmarkurl="http://www.everythingfragrant.com"
		var bookmarktitle="Welcome to Everything Fragrant.com"
		window.external.AddFavorite(bookmarkurl,bookmarktitle)
    }
    else if(OP || IE && !document.uniqueID)
	{
       alert('Your browser requires that you\nPress Ctrl & T to Bookmark this page.');              
    }
    else if(NS)
	{
       alert('Your browser requires that you\nPress Ctrl & D to Bookmark this page.');     
    }
    else{ BK.innerHTML = '' }
}

function CaricaFoto(img, name, wid, hi){
  foto1= new Image();
  foto1.src=(img);
  viewFotos(img, name, wid, hi);
}

function viewFotos(img, name, wid, hi){

 features = 
    "toolbar=no,location=no,directories=no,status=no,menubar=no," +
    "scrollbars=yes,resizable=no,width=" + wid + ",height=" + hi;
 dlg = window.open ("","Details",features);
 dlg.document.write("<html><head><title>" + name + " Zoom</title></head>");
 dlg.document.write("<body bgcolor=white><center>");
 dlg.document.write("<table width=100% height=100%>");
 dlg.document.write("<tr><td align=center valign=middle>");
 dlg.document.write("<font size=2 font color=black face=verdana>" + name + "</font><br><font size=1 font color=black face=verdana>(click image to close window)</font></a><br><br>");
 dlg.document.write("<a href=# onClick=window.close();>");
 dlg.document.write("<img src=" + img + " border=\"0\">");
 dlg.document.write("</td></tr>");
 dlg.document.write("<tr><td align=center valign=middle>");
 dlg.document.write("<a href=# onClick=window.close();>");
 dlg.document.write("<font size=1 font color=black face=verdana>(close window)</font></a>");
 dlg.document.write("</td></tr>");
 dlg.document.write("</table></body></html>");
 dlg.document.close();
}
