function dbg(ob){
	var str = ''+ob , count=0;
	for(prop in ob){
		str+="\n"+prop;
		if(++count>30){
			alert(str);
			str='';
			count=0;
		}
	}
	alert(str);
}

var Oj = {
	
	init : function() {
	    try {
		    
		} catch(e) {
			alert('Error');
		}
	},
	
	getBrowser : function() {
		var browserName=navigator.appName; 
		if (browserName=="Netscape") { 
			return 'netscape';
		} else { 
			if (browserName=="Microsoft Internet Explorer") {
				return 'ie';
			} else {
				return 'unknown';
			}
		}
	},

	/* Essential oils cell button */
	greyEssentialBathingTable : function() {
		//new Effect.Highlight($('essential-link'), {startcolor:'#ff6600', endcolor:'#333333', restorecolor:'#333333', duration: 0.5});
		$('essential-link').style.backgroundColor = '#333333';
	},
	orangeEssentialBathingTable : function() {
		//new Effect.Highlight($('essential-link'), {startcolor:'#333333', endcolor:'#ff6600', restorecolor:'#ff6600', duration: 0.5});
		$('essential-link').style.backgroundColor = '#ff6600';
	},
	/* Replenishing cell button */
	greyReplenishingTable : function() {
		//new Effect.Highlight($('replenishing-link'), {startcolor:'#ff6600', endcolor:'#333333', restorecolor:'#333333', duration: 0.5});
		$('replenishing-link').style.backgroundColor = '#333333';
	},
	orangeReplenishingTable : function() {
		//new Effect.Highlight($('replenishing-link'), {startcolor:'#333333', endcolor:'#ff6600', restorecolor:'#ff6600', duration: 0.5});
		$('replenishing-link').style.backgroundColor = '#ff6600';
	},
	/* Hydrating cell button */
	greyHydratingTable : function() {
		//new Effect.Highlight($('hydrating-link'), {startcolor:'#ff6600', endcolor:'#333333', restorecolor:'#333333', duration: 0.5});
		$('hydrating-link').style.backgroundColor = '#333333';
	},
	orangeHydratingTable : function() {
		//new Effect.Highlight($('hydrating-link'), {startcolor:'#333333', endcolor:'#ff6600', restorecolor:'#ff6600', duration: 0.5});
		$('hydrating-link').style.backgroundColor = '#ff6600';
	},
	/* Parfum cell button */
	greyParfumTable : function() {
		//new Effect.Highlight($('parfum-link'), {startcolor:'#ff6600', endcolor:'#333333', restorecolor:'#333333', duration: 0.5});
		$('parfum-link').style.backgroundColor = '#333333';
	},
	orangeParfumTable : function() {
		//new Effect.Highlight($('parfum-link'), {startcolor:'#333333', endcolor:'#ff6600', restorecolor:'#ff6600', duration: 0.5});
		$('parfum-link').style.backgroundColor = '#ff6600';
	},
	/* Eau Parfum cell button */
	greyEauParfumTable : function() {
		//new Effect.Highlight($('eau-link'), {startcolor:'#ff6600', endcolor:'#333333', restorecolor:'#333333', duration: 0.5});
		$('eau-link').style.backgroundColor = '#333333';
	},
	orangeEauParfumTable : function() {
		//new Effect.Highlight($('eau-link'), {startcolor:'#333333', endcolor:'#ff6600', restorecolor:'#ff6600', duration: 0.5});
		$('eau-link').style.backgroundColor = '#ff6600';
	},
	/* Parfum Naturel cell button */
	greyParfumNaturelTable : function() {
		//new Effect.Highlight($('naturel-link'), {startcolor:'#ff6600', endcolor:'#333333', restorecolor:'#333333', duration: 0.5});
		$('naturel-link').style.backgroundColor = '#333333';
	},
	orangeParfumNaturelTable : function() {
		//new Effect.Highlight($('naturel-link'), {startcolor:'#333333', endcolor:'#ff6600', restorecolor:'#ff6600', duration: 0.5});
		$('naturel-link').style.backgroundColor = '#ff6600';
	},
	/* Large Candles cell button */
	greyLargeCandlesTable : function() {
		//new Effect.Highlight($('large-link'), {startcolor:'#ff6600', endcolor:'#333333', restorecolor:'#333333', duration: 0.5});
		$('large-link').style.backgroundColor = '#333333';
	},
	orangeLargeCandlesTable : function() {
		//new Effect.Highlight($('large-link'), {startcolor:'#333333', endcolor:'#ff6600', restorecolor:'#ff6600', duration: 0.5});
		$('large-link').style.backgroundColor = '#ff6600';
	},
	/* Mini Candles cell button */
	greyMiniCandlesTable : function() {
		//new Effect.Highlight($('mini-link'), {startcolor:'#ff6600', endcolor:'#333333', restorecolor:'#333333', duration: 0.5});
		$('mini-link').style.backgroundColor = '#333333';
	},
	orangeMiniCandlesTable : function() {
		//new Effect.Highlight($('mini-link'), {startcolor:'#333333', endcolor:'#ff6600', restorecolor:'#ff6600', duration: 0.5});
		$('mini-link').style.backgroundColor = '#ff6600';
	}
	
	
	/* Function below not used
	cellButtons : function() {
		var eL = document.getElementsByClassName('oj-ob-cell-link');
		//alert('length = ' + eL.length);
		var i = 0;
		for(i=0;i<eL.length;i++) {
			//dbg(eL[i].id);

			// fade unwanted buttons
			//new Effect.Fade(eL[i].id, { duration : 0.3 });
			// load wanted buttons
			//var eL2 = document.getElementsByClassName('chem-more-news-button-2');
			//var j = 0;
			//for (j=0;j<eL2.length;j++) {
			//	new Effect.Appear(eL2[i].id, { duration : 0.3 });
			//}
		}
	}*/
}


/***********************************************
* Drop Down/ Overlapping Content- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

function getposOffset(overlay, offsettype){
var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
var parentEl=overlay.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function overlay(curobj, subobjstr, opt_position){
if (document.getElementById){
var subobj=document.getElementById(subobjstr)
subobj.style.display=(subobj.style.display!="block")? "block" : "none"
var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0)
var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
subobj.style.left=xpos+"px"
subobj.style.top=ypos+"px"
return false
}
else
return true
}

function overlayclose(subobj){
document.getElementById(subobj).style.display="none"
}

