/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* this notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="http://www.namhaflorist.com/productsByCategory.asp?intCatalogID=1&strCatalogNAME=Anniversary">Anniversary</a>'
menu1[1]='<a href="http://www.namhaflorist.com/productsByCategory.asp?intCatalogID=2&strCatalogNAME=Baskets">Baskets</a>'
menu1[2]='<a href="http://www.namhaflorist.com/productsByCategory.asp?intCatalogID=3&strCatalogNAME=Birthday">Birthday</a>'
menu1[3]='<a href="http://www.namhaflorist.com/productsByCategory.asp?intCatalogID=4&strCatalogNAME=Love+%26+Romance">Love & VALENTINE</a>'
menu1[4]='<a href="http://www.namhaflorist.com/productsByCategory.asp?intCatalogID=20&strCatalogNAME=Orchids">Orchids</a>'
menu1[5]='<a href="http://www.namhaflorist.com/productsByCategory.asp?intCatalogID=5&strCatalogNAME=Special+Occasions">Special Occasions</a>'
menu1[6]='<a href="http://www.namhaflorist.com/productsByCategory.asp?intCatalogID=6&strCatalogNAME=Sympathy">Sympathy</a>'

//Contents for menu 2
var menu2=new Array()
menu2[0]='<a href="http://www.namhaflorist.com/productsByCategory.asp?intCatalogID=11&strCatalogNAME=New+Year">TET - Lunar New Year</a>'
menu2[1]='<a href="http://www.namhaflorist.com/productsByCategory.asp?intCatalogID=22&strCatalogNAME=Beauty">Beauty & Style</a>'
menu2[2]='<a href="http://www.namhaflorist.com/productsByCategory.asp?intCatalogID=10&strCatalogNAME=Cakes">Cakes</a>'
menu2[3]='<a href="http://www.namhaflorist.com/productsByCategory.asp?intCatalogID=16&strCatalogNAME=Chocolates">Chocolates</a>'
menu2[4]='<a href="http://www.namhaflorist.com/productsByCategory.asp?intCatalogID=15&strCatalogNAME=Formulas">Formulas</a>'
menu2[5]='<a href="http://www.namhaflorist.com/productsByCategory.asp?intCatalogID=7&strCatalogNAME=Fruits">Fruits Baskets</a>'
menu2[6]='<a href="http://www.namhaflorist.com/productsByCategory.asp?intCatalogID=8&strCatalogNAME=Gifts">Other Gifts</a>'
menu2[7]='<a href="http://www.namhaflorist.com/productsByCategory.asp?intCatalogID=14&strCatalogNAME=Perfumes">Perfumes</a>'
menu2[8]='<a href="http://www.namhaflorist.com/productsByCategory.asp?intCatalogID=21&strCatalogNAME=Restaurants">Restaurant Vouchers</a>'
menu2[9]='<a href="http://www.namhaflorist.com/productsByCategory.asp?intCatalogID=13&strCatalogNAME=Teddy+Bears">Teddy Bears</a>'
menu2[10]='<a href="http://www.namhaflorist.com/productsByCategory.asp?intCatalogID=9&strCatalogNAME=Wines">Wines</a>'
menu2[11]='<a href="http://www.namhaflorist.com/request.asp">Your Special Request</a>'

//Contents for menu 3
var menu3=new Array()
menu3[0]='<a href="http://www.namhaflorist.com/moreinfo.asp">About Us</a>'
menu3[1]='<a href="http://www.namhaflorist.com/contact.asp">Contact Us</a>'
menu3[2]='<a href="http://www.namhaflorist.com/delivery.asp">Delivery Info</a>'
menu3[3]='<a href="http://www.namhaflorist.com/faq.asp">FAQs</a>'
menu3[4]='<a href="http://www.namhaflorist.com/feedback.asp">Feedback</a>'
menu3[5]='<a href="http://www.namhaflorist.com/comment5.asp">Testimonials</a>'
menu3[6]='<a href="http://www.namhaflorist.com/choseus.asp">Why Choose Us?</a>'
menu3[7]='<a href="http://www.namhaflorist.blogspot.com">NamHaFlorist Blog</a>'
		
var menuwidth='165px' //default menu width
var menubgcolor='lightyellow'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu


/*****************************************\
||       Fade Script Version 4.0         ||
||   http://anarchos.xs.mw/fade.phtml    ||
||            (c) July 2001              ||
|| _____________________________________ ||
|| Created by:                           ||
|| Anarchos    > anarchos.xs.mw          ||
|| _____________________________________ ||
|| auto-startColor by Mike West          ||
|| mike@westman.org                      ||
|| _____________________________________ ||
|| uniqueID upgrade by DubMatrix         ||
|| http://www.princefari.com             ||
|| _____________________________________ ||
|| Color conversion from decimal to      ||
|| hex (dehexize function) by:           ||
|| Litejet > litejet@hotmail.com         ||
|| _____________________________________ ||
|| Fade, hex, setColor functions by:     ||
|| Dak Phoenix > phoenix-archetypes.com  ||
|| _____________________________________ ||
|| domouseover/out based on scripts by   ||
|| The Shadow  > www.icon.co.za/~andrewk ||
||                                       ||
|| _____________________________________ ||
|| Netscape v4+ support added by         ||
|| tk102 > zxcvbnm6012@yahoo.com         ||
|| Mar 24, 2004                          ||
\*****************************************/

// This part is configurable
//------------------------------------------------
startColor = "#246000"; // MouseOut link color
endColor = "#8fbf00"; // MouseOver link color
stepIn = 17; // delay when fading in
stepOut = 25; // delay when fading out
autoFade = false;
sloppyClass = true;
//------------------------------------------------

hexa = new makearray(16);
for(var i = 0; i < 10; i++)
hexa[i] = i;
hexa[10]="a"; hexa[11]="b"; hexa[12]="c";
hexa[13]="d"; hexa[14]="e"; hexa[15]="f";

var version = parseInt(navigator.appVersion)
var appName = navigator.appName
var ns4 = version>=4 && appName=="Netscape"

if (ns4) { //Netscape 4+
	document.onmouseover = doN4mouseover;
	document.onmouseout = doN4mouseout;
} else { //other
	document.onmouseover= domouseover;
	document.onmouseout= domouseout;
}

startColor = dehexize(startColor.toLowerCase());
endColor = dehexize(endColor.toLowerCase());
var fadeId = new Array();

function dehexize(Color){
	var colorArr = new makearray(3);
	for (i=1; i<7; i++){
		for (j=0; j<16; j++){
			if (Color.charAt(i) == hexa[j]){
				if (i%2 !=0)
					colorArr[Math.floor((i-1)/2)]=eval(j)*16;
				else
					colorArr[Math.floor((i-1)/2)]+=eval(j);
			}
		}
	}
	return colorArr;
}

function domouseover() {
	if(document.all){
		var srcElement = event.srcElement;
		if ((srcElement.tagName == "A" && autoFade) || srcElement.className == "fade" || (sloppyClass && srcElement.className.indexOf("fade") != -1))
			fade(startColor,endColor,srcElement.uniqueID,stepIn);
	}
}

function domouseout() {
	if (document.all){
		var srcElement = event.srcElement;
		if ((srcElement.tagName == "A" && autoFade) || srcElement.className == "fade" || (sloppyClass && srcElement.className.indexOf("fade") != -1))
			fade(endColor,startColor,srcElement.uniqueID,stepOut);
	}
}
function doN4mouseover(event) {
	var srcElement=event.target;
	if ((srcElement.tagName == "A" && autoFade) || srcElement.className == "fade" || (sloppyClass && srcElement.className.indexOf("fade") != -1))
		nfade(startColor,endColor,srcElement,stepIn);
}

function doN4mouseout(event) {
		var srcElement = event.target; 
		if ((srcElement.tagName == "A" && autoFade) || srcElement.className == "fade" || (sloppyClass && srcElement.className.indexOf("fade") != -1))
		 nfade(endColor,startColor,srcElement,stepOut);
}

function makearray(n) {
	this.length = n;
	for(var i = 1; i <= n; i++)
	this[i] = 0;
	return this;
}

function hex(i) {
	if (i < 0)
		return "00";
	else if (i > 255)
		return "ff";
	else
		return "" + hexa[Math.floor(i/16)] + hexa[i%16];
}

function setColor(r, g, b, element) {
	var hr = hex(r);
	var hg = hex(g);
	var hb = hex(b);
	element.style.color = "#"+hr+hg+hb;
}


function fade(s,e, element,step){
	var sr = s[0];
	var sg = s[1];
	var sb = s[2];

	var er = e[0];
	var eg = e[1];
	var eb = e[2];

	if (fadeId[0] != null && fade[0] != element){  //check have we already faded this?
		setColor(sr,sg,sb,eval(fadeId[0]));   // no, set the first color
		var i = 1;
		while(i < fadeId.length){             //get ready to fade
			clearTimeout(fadeId[i]);
			i++;
		}
	}
        //MSIE must setup timeouts using strings        
	for(var i = 0; i <= step; i++) { //timeouts fall like dominos
		fadeId[i+1] = setTimeout("setColor(Math.floor(" +sr+ " *(( " +step+ " - " +i+ " )/ " +step+ " ) + " +er+ " * (" +i+ "/" +
		step+ ")),Math.floor(" +sg+ " * (( " +step+ " - " +i+ " )/ " +step+ " ) + " +eg+ " * (" +i+ "/" +step+
		")),Math.floor(" +sb+ " * ((" +step+ "-" +i+ ")/" +step+ ") + " +eb+ " * (" +i+ "/" +step+ ")),"+element+");",i*step);
	}
	fadeId[0] = element; // oneshot
}
function nfade(s,e, element,step){ 
	var sr = s[0];
	var sg = s[1];
	var sb = s[2];

	var er = e[0];
	var eg = e[1];
	var eb = e[2];

	if (fadeId[0] != null && fade[0] != element){  //check have we already faded this?
		setColor(sr,sg,sb,eval(fadeId[0]));   // no, set the first color
		var i = 1;
		while(i < fadeId.length){             //get ready to fade
			clearTimeout(fadeId[i]);
			i++;
		}
	}
        //Netscape can call SetTimeout using objects, making for more readable code
	for(var i = 0; i <= step; i++) { 
		fadeId[i+1] = setTimeout(
					setColor,
					i*step,
					Math.floor(sr*((step-i)/step) + er*(i/step)),
					Math.floor(sg*((step-i)/step) + eg*(i/step)),
					Math.floor(sb*((step-i)/step) + eb*(i/step)),
					element
					);
	}
	fadeId[0] = element; //oneshot
}

/* Highlight menu effect script: By Dynamicdrive.com */
function borderize(what,color){
what.style.borderColor=color
}
function borderize_on(e){
if (document.all)
source3=event.srcElement
else if (document.getElementById)
source3=e.target
if (source3.className=="menulines"){
borderize(source3,"#246000")
}
else{
while(source3.tagName!="TABLE"){
source3=document.getElementById? source3.parentNode : source3.parentElement
if (source3.className=="menulines")
borderize(source3,"#246000")
}
}
}
function borderize_off(e){
if (document.all)
source4=event.srcElement
else if (document.getElementById)
source4=e.target
if (source4.className=="menulines")
borderize(source4,"white")
else{
while(source4.tagName!="TABLE"){
source4=document.getElementById? source4.parentNode : source4.parentElement
if (source4.className=="menulines")
borderize(source4,"white")
}
}
}