/***********************************************
* Image w/ description tooltip- By Dynamic Web Coding (www.dyn-web.com)
* Copyright 2002-2007 by Sharon Paine
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* IMPORTANT: Put script after tooltip div or 
	 put tooltip div just before </BODY>. */

var dom = (document.getElementById) ? true : false;
var ns5 = (!document.all && dom || window.opera) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ie4 && !ie5 && !dom) ? true : false;

var origWidth, origHeight;

// avoid error of passing event object in older browsers
if (nodyn) { event = "nope" }

///////////////////////  CUSTOMIZE HERE   ////////////////////
// settings for tooltip 
// Do you want tip to move when mouse moves over link?
var tipFollowMouse= true;	
// Be sure to set tipWidth wide enough for widest image
var tipWidth= 260;
var offX= 20;	// how far from mouse to show tip
var offY= 12; 
var tipFontFamily= "Verdana, arial, helvetica, sans-serif";
var tipFontSize= "8pt";
// set default text color and background color for tooltip here
// individual tooltips can have their own (set in messages arrays)
// but don't have to
var tipFontColor= "#000000";
var tipBgColor= "#DDECFF"; 
var tipBorderColor= "#a5733b";
var tipBorderWidth= 3;
var tipBorderStyle= "ridge";
var tipPadding= 4;

// tooltip content goes here (image, description, optional bgColor, optional textcolor)
var messages = new Array();
// multi-dimensional arrays containing: 
// image and text for tooltip
// optional: bgColor and color to be sent to tooltip
// Descriptions for POP-UPS - GO HERE:
messages[0] = new Array('images/trans.gif',
'Salon O’s Customized Facial<br><br>60 minutes <br><br>Customized for your skin type, this relaxing treatment is our most popular facial which includes cleansing, toning and exfoliation to improve skin tone and texture. Add either of the following services to further customize this facial.',"#FFFFFF");
messages[1] = new Array('images/trans.gif',
'*Derm Renewal Clinical <br><br> A deep exfoliating treatment that combines a high technology patented complex, offering the full benefits of AHAs without the discomfort. Glycolic acids, lactic acids, and amino acids promote skin renewal and moisturization, giving you a brightened and more radiant complex.',"#FFFFFF");
messages[2] = new Array('images/trans.gif',
'*Algomask <br><br> This cooling seaweed and organic silicon mask provides instant radiance by hydrating, soothing, decongesting and minimizing redness. A great treatment after a day in the sun and for sensitive skin!',"#FFFFFF");
messages[3] = new Array('images/trans.gif',
'Puracne Clinical Treatment <br><br>60 minutes <br><br> This 5-step treatment formulated with BHA, AHAs and Probiotics is designed to clear skin congestion, detoxify, control acne and normalize skin. This extraordinary facial also revitalizes fatigued, stressed and dull skin.A series of one service a week for 5 weeks is recommended.',"#FFFFFF");
messages[4] = new Array('images/trans.gif',
'Therapeutic Back Treatment<br><br>45 minutes <br><br> This treatment assists in balancing troubled skin through deep pore cleansing, exfoliation to remove surface impurities, toning to balance and revitalize, and a correcting masque to improve and refine.',"#FFFFFF");
messages[5] = new Array('images/trans.gif',
'Collagen 90-II<br><br>70 minutes <br><br> Exclusive to GM Collin, this intensive anti-aging treatment hydrates, rejuvenates, tightens and reconfigures the skin’s surface to reduce the visible signs of aging – without surgery! This facial is unequalled for skin renewal. A series of one service a week for 5 weeks is recommended.',"#FFFFFF");
messages[6] = new Array('images/trans.gif',
'Hydrolifting Anti-Aging Facial<br><br>60 minutes <br><br> This beautiful 5-phase anti-aging treatment exfoliates, intensely hydrates, restores, lifts and firms the skin. This immediate non-surgical lift is great for mothers-of-the-bride or class reunions. Benefits: Immediate lifting and intense skin moisturizing. Formulated to exfoliate, deeply re-hydrate, restore, lift and firm the skin for instant radiance and enhanced skin tone. A series of one service a week for 5 weeks is recommended.',"#FFFFFF");
messages[7] = new Array('images/trans.gif',
'Botinol<br><br>70 minutes <br><br> This innovative, clinically proven anti-aging treatment combines five peptides with Vitamin A for a Botox-like effect – without the pain and worry! After just one treatment fine lines and wrinkles are relaxed and smoothed; the skin appears plumper and is exquisitely rejuvenated.',"#FFFFFF");
messages[8] = new Array('images/trans.gif',
'Oxygen Clinical Treatment<br><br>60 minutes <br><br> With this revolutionary treatment, formulated with a unique oxygen concept using peptides and vitamins, the skin becomes luminous, moisture-balanced and younger looking. Through intense hydration the skin’s natural radiance and glow is rejuvenated. This treatment is especially beneficial for those who smoke. A series of one service a week for 5 weeks is recommended.',"#FFFFFF");
messages[9] = new Array('images/trans.gif',
'Teenager’s Corrective Facial<br><br>45 minutes <br><br> Specifically for teens, this  facial addresses the special needs of the teen’s skin, treating and caring for breakout, oiliness and sensitivity. Allow our estheteican to educate your teen on how to properly care for their special skin concerns.',"#FFFFFF");
messages[10] = new Array('images/trans.gif',
'<strong><u>Treat  Your Hair</u></strong><br />Treatments  transform hair with immediate, visible results.<br /><br /><strong><em><u>The Instant Treatment- </u></em></strong><em>(takes 5 minutes):</em>It is a  concentrated dosage of the most advanced technologies. It instantly penetrates  the hair, leaving it transformed.</p>
<p><strong><em><u>The Intense Treatment-</u></em></strong><em><u> </u></em><em>(takes 10 minutes): </em>It is a 2-step, dual-action treatment that delivers  dramatic results to the hair and/or scalp that need extra care. <em><u></u></em></p><p><strong><em><u>The Indulgent Treatment-</u></em></strong><em><u> </u></em><em>(takes  5 minutes): </em>It is an ultra-nourishing  masque treatment that is carefully applied to the hair. Accompanied by an  expert massage, this treatment will leave you completely relaxed and your hair  transformed. ',"#FFFFFF");
/*messages[10] = new Array('images/trans.gif',
'<b>Treat Your Hair</b><br><br><b>Express Hair Treatments</b> are a <b>quick way to moisturize</b>, add shine, and help repair breakage without having to sit for 30 minutes.  The treatment is done at the sink either before a haircut, or after color and takes approximately seven minutes.<br><br> <b>Deluxe Hair Treatments</b> are a <b>deep conditioning</b> treatment for dry, damaged hair.  This treatment <b>includes a scalp and shoulder massage.</b><br><br> <b>Signature Hair Treatments</b> are an <b>intense repair treatment</b> for someone whose hair needs more shine, volume, and repair damaged hair.  This treatment will revitalize the hair so the hair feels and looks healthy and vibrant.  Also <b>included is a scalp and shoulder massage.</b><br><br>',"#FFFFFF");*/
/*messages[11] = new Array('images/trans.gif',
'<b>Straighten up</b><br><br>The Hair Straightening at Salon O just got better - <b>now formaldehyde FREE.</b>  You’ve heard of other straightening methods such as The Japanese Thermal Conditioning or The Brazilian Straightening – Keratin Complex Hair Therapy by COPPOLA is superior to all of these.<br><br> This new, revolutionary system chemically and scientifically relaxes hair — without formaldehyde. This is the breakthrough product the beauty industry has been waiting for. <br><br> With each treatment, the build-up of Keratin makes the hair: · Softer and silkier · Straighter and shinier · Faster and easier to blow-dry and style · Low-maintenance (practically maintenance-free!) Hair is basically Keratin – so, when Keratin is re-infused into the hair shaft, you are providing “skin care for your hair.” <b>The more you treat the hair, the healthier it becomes.</b>',"#FFFFFF");*/
messages[11] = new Array('images/trans.gif',
'Celebrities´ secret to beautiful,  shiny, frizz-free hair. In just 90 minutes and no down time, lose frizz without  losing body. The Brazilian Blowout is the most innovative and effective  professional smoothing treatment in the world! Through the use of a Brazilian  super nutrient complex and a proprietary system, the Brazilian Blowout actually  improves the condition of the hair by creating a protective protein layer  around the hair shaft to eliminate frizz and smooth the cuticle.,"#FFFFFF");
/*messages[11] = new Array('images/trans.gif',
'<b>It&acute;s finally here!</b><br><br>Celebrities&acute; secret to beautiful, shiny, frizz-free hair. In just 90 minutes and no down time, lose frizz without losing body. The Brazilian Blowout is the most innovative and effective professional smoothing treatment in the world! Throught the use of a Brazilian super nutrient complex and a proprietary system, the Brazilian Blowout actually improves the condition of the hair by creating a protective protein layer around the hair shaft to eliminate frizz and smooth the cuticle. Results last up to 12 weeks!  Cost $350',"#FFFFFF");*/
messages[12] = new Array('images/trans.gif',
'Bridal<br><br>There is nothing more beautiful than a bride on the day of her wedding. Let the creative team at Salon O help you decide the perfect look for your big day! Whether it is a beautiful Up do, or the simple details of make-up and nail color we have the right person for you.<br><br> An advance trial appointment will help to ensure that your day will be nothing short of spectacular.',"#FFFFFF");
messages[13] = new Array('images/trans.gif',
'Artist-On-Location <br><br>Salon O offers all of our In-Salon services in the convenience of your own home or at any on-site location. <br><br>For prices, and to book an appointment please call us at (203) 531-3000.',"#FFFFFF");
messages[14] = new Array('images/trans.gif',
'<strong><u>Great  Lengths Extensions</u></strong><br /><br />A staple of Hollywood  Glamour at Salon O, Great Lengths 100% Human Hair Extensions. 100% of the hair  sourced for Great Lengths is from the Temples of India. This is the finest  source of virgin hair available in the marketplace that is most compatible with  Caucasian and European hair textures. The quality of our hair is unmatched.  Great Lengths has graced the heads of Hollywood's most elite style icons,  including: Sienna Miller, Jenny McCarthy, Drew Barrymore and Charlize Theron.  For further details please schedule a consultation with Marisa @ 203-531-3000.<strong><u></u></strong>',"#FFFFFF");
messages[15] = new Array('images/trans.gif',
'<strong><u>Airbrush  Spray Tan </u></strong><br /><br />Airbrush  spray tanning is the easiest way to give your-self a complete makeover in just  minutes. This sunless spray tan adds beautiful natural-looking color to your  skin without sun exposure. It's provides a sun – kissed glow!',"#FFFFFF");


////////////////////  END OF CUSTOMIZATION AREA  ///////////////////

// preload images that are to appear in tooltip
// from arrays above
if (document.images) {
	var theImgs = new Array();
	for (var i=0; i<messages.length; i++) {
  	theImgs[i] = new Image();
		theImgs[i].src = messages[i][0];
  }
}

// to layout image and text, 2-row table, image centered in top cell
// these go in var tip in doTooltip function
// startStr goes before image, midStr goes between image and text
var startStr = '<table width="' + tipWidth + '"><tr><td align="center" width="100%"><img src="';
var midStr = '" border="0"></td></tr><tr><td valign="top">';
var endStr = '</td></tr></table>';

////////////////////////////////////////////////////////////
//  initTip	- initialization for tooltip.
//		Global variables for tooltip. 
//		Set styles
//		Set up mousemove capture if tipFollowMouse set true.
////////////////////////////////////////////////////////////
var tooltip, tipcss;
function initTip() {
	if (nodyn) return;
	tooltip = (ie4)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;
	tipcss = tooltip.style;
	if (ie4||ie5||ns5) {	// ns4 would lose all this on rewrites
		tipcss.width = tipWidth+"px";
		tipcss.fontFamily = tipFontFamily;
		tipcss.fontSize = tipFontSize;
		tipcss.color = tipFontColor;
		tipcss.backgroundColor = tipBgColor;
		tipcss.borderColor = tipBorderColor;
		tipcss.borderWidth = tipBorderWidth+"px";
		tipcss.padding = tipPadding+"px";
		tipcss.borderStyle = tipBorderStyle;
	}
	if (tooltip&&tipFollowMouse) {
		document.onmousemove = trackMouse;
	}
}

window.onload = initTip;

/////////////////////////////////////////////////
//  doTooltip function
//			Assembles content for tooltip and writes 
//			it to tipDiv
/////////////////////////////////////////////////
var t1,t2;	// for setTimeouts
var tipOn = false;	// check if over tooltip link
function doTooltip(evt,num) {
	if (!tooltip) return;
	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
	tipOn = true;
	// set colors if included in messages array
	if (messages[num][2])	var curBgColor = messages[num][2];
	else curBgColor = tipBgColor;
	if (messages[num][3])	var curFontColor = messages[num][3];
	else curFontColor = tipFontColor;
	if (ie4||ie5||ns5) {
		var tip = startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr;
		tipcss.backgroundColor = curBgColor;
	 	tooltip.innerHTML = tip;
	}
	if (!tipFollowMouse) positionTip(evt);
	else t1=setTimeout("tipcss.visibility='visible'",100);
}

var mouseX, mouseY;
function trackMouse(evt) {
	standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
	mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
	mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
	if (tipOn) positionTip(evt);
}

/////////////////////////////////////////////////////////////
//  positionTip function
//		If tipFollowMouse set false, so trackMouse function
//		not being used, get position of mouseover event.
//		Calculations use mouseover event position, 
//		offset amounts and tooltip width to position
//		tooltip within window.
/////////////////////////////////////////////////////////////
function positionTip(evt) {
	if (!tipFollowMouse) {
		standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
		mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
		mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
	}
	// tooltip width and height
	var tpWd = (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
	var tpHt = (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
	// document area in view (subtract scrollbar width for ns)
	var winWd = (ns5)? window.innerWidth-20+window.pageXOffset: standardbody.clientWidth+standardbody.scrollLeft;
	var winHt = (ns5)? window.innerHeight-20+window.pageYOffset: standardbody.clientHeight+standardbody.scrollTop;
	// check mouse position against tip and window dimensions
	// and position the tooltip 
	if ((mouseX+offX+tpWd)>winWd) 
		tipcss.left = mouseX-(tpWd+offX)+"px";
	else tipcss.left = mouseX+offX+"px";
	if ((mouseY+offY+tpHt)>winHt) 
		tipcss.top = winHt-(tpHt+offY)+"px";
	else tipcss.top = mouseY+offY+"px";
	if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
	if (!tooltip) return;
	t2=setTimeout("tipcss.visibility='hidden'",100);
	tipOn = false;
}

document.write('<div id="tipDiv" style="position:absolute; visibility:hidden; z-index:100"></div>')

