var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();

function findPosX(obj){
var curleft=0
if(obj.offsetParent){
while(obj.offsetParent){
curleft+=obj.offsetLeft
obj=obj.offsetParent}}
return curleft}

function findPosY(obj){
var curtop=0
if(obj.offsetParent){
while(obj.offsetParent){
curtop+=obj.offsetTop
obj=obj.offsetParent}}
return curtop+18}

function createRequestObject(){
var req
if(BrowserDetect.version == 312 || BrowserDetect.version == 312.6 || BrowserDetect.version == 85.8 || BrowserDetect.version == 412.5){
}else if(window.XMLHttpRequest){
req=new XMLHttpRequest()
}else if(window.ActiveXObject){
req=new ActiveXObject("Microsoft.XMLHTTP")
}else{
alert(BrowserDetect.version)}
return req}


var http=createRequestObject()


function sendCatSearchRequest(q){
if(q.length>0){
http.open('get','/xcart1/skin1/searchcat.php?q='+q)
http.onreadystatechange=handleCatSearchResponse
http.send(null)}
else{
document.getElementById("catsearch").style.display="none"}}



function handleCatSearchResponse(){
if(http.readyState==4&&http.status==200){
var response=http.responseText
if(response){
//document.getElementById("catsearch").style.left=findPosX(document.getElementById('q'))+"px"
//document.getElementById("catsearch").style.top=findPosY(document.getElementById('q'))+"px"
document.getElementById("catsearch").style.display="block"
document.getElementById("catsearch").innerHTML=response
setTimeout(document.getElementById("catsearch"),10000)
}
else{
setTimeout(document.getElementById("catsearch"),10000)
document.getElementById("catsearch").style.display="none"}}}



function sendRequest(q){
if(q.length>0){
http.open('get','/xcart1/skin1/suggest.php?q='+q)
http.onreadystatechange=handleResponse
http.send(null)}
else{
document.getElementById("searchResults").style.display="none"}}


function sendBrowseRequest(q){
if(q){
document.getElementById("browseproduct").options.length=0
document.getElementById("browseproduct").options[0]=new Option('Select a product','')
document.getElementById("browseproduct").disabled=true
Effect.SlideDown('modelPanel', { duration: 1.0 });
http.open('get','/xcart1/skin1/browsecat.php?q='+q)
http.onreadystatechange=handleBrowseResponse
http.send(null)}
else{
document.getElementById("browsecategory").options.length=0
document.getElementById("browsecategory").options[0]=new Option('Select a category','')
document.getElementById("browsecategory").disabled=true
document.getElementById("browseproduct").options.length=0
document.getElementById("browseproduct").options[0]=new Option('Select a product','')
document.getElementById("browseproduct").disabled=true}}


function handleBrowseResponse(){
if(http.readyState==4&&http.status==200){
var response=http.responseText
if(response){
document.getElementById("browseselect2").innerHTML=response}}}


function sendProductRequest(q){
if(q){
http.open('get','/xcart1/skin1/browseproduct2.php?q='+q)
http.onreadystatechange=handleProductResponse
http.send(null)}
else{
document.getElementById("browseproduct").options.length=0
document.getElementById("browseproduct").options[0]=new Option('Select a product','')
document.getElementById("browseproduct").disabled=true}}


function handleProductResponse(){
if(http.readyState==4&&http.status==200){
var response=http.responseText
if(response){
document.getElementById("browseselect3").innerHTML=response}}}

function sendHomeBrowseRequest(q){
	if(q){
		http.open('get','/xcart1/skin1/browsecathome.php?q='+q)
		http.onreadystatechange=handleHomeBrowseResponse
		http.send(null)
	}
	else{
		document.getElementById("homelivesearch").innerHTML='<div style="padding:10px 0px 0px 50px;"><h2><i>What We Do:</i></h2><div id="mediaspace">This text will be replaced</div></div>';
		var flashvars = {};
		flashvars.file = "http://www.powerbookmedic.com/Manuals/promo2.m4v";
		flashvars.image = "http://www.powerbookmedic.com/xcart1/skin1/images/imagesv3/snapsnap.jpg";
		var params = {};
		params.allowfullscreen = "true";
		params.wmode = "opaque";
		var attributes = {};
		swfobject.embedSWF("/xcart1/skin1/javascript/player-flash10.swf", "mediaspace","380", "233", "9","/xcart1/skin1/javascript/expressInstall.swf",flashvars,params,attributes);
	}
}

function handleHomeBrowseResponse(){
	if(http.readyState==4&&http.status==200){
		var response=http.responseText
		if(response){
			document.getElementById("homelivesearch").innerHTML=response;
		}
	}
}

function sendHomeBrowseProductRequest(q){
	if(q){
		http.open('get','/xcart1/skin1/browseproducthome2.php?q='+q)
		http.onreadystatechange=handleHomeBrowseProductResponse
		http.send(null)
	}
}

function handleHomeBrowseProductResponse(){
	if(http.readyState==4&&http.status==200){
		var response=http.responseText
		if(response){
			document.getElementById("homelivesearch-results").innerHTML=response;
		}
	}
}

function handleResponse(){
if(http.readyState==4&&http.status==200){
var response=http.responseText
if(response){
	if(document.getElementById("searchResults").style.display=="none"){
		jQuery("#searchResults").fadeIn("fast");
		document.getElementById('searchResults').style.display = 'block';
		document.getElementById("searchResults").style.opacity = '0.95';
		document.getElementById("searchResults").style.top = '100px';
		document.getElementById("searchResultsFrame").innerHTML=response;}
	else{
		if(document.getElementById("searchResults").style.opacity == '0'){
			jQuery("#searchResults").fadeIn("fast");
			document.getElementById('searchResults').style.display = 'block';
			document.getElementById("searchResults").style.opacity = '0.95';
			document.getElementById("searchResults").style.top = '100px';
			document.getElementById("searchResultsFrame").innerHTML=response;
		}
		document.getElementById("searchResultsFrame").innerHTML=response;}}
else{
document.getElementById("searchResults").style.display="none"}}}


function sendMemRequest(q){
if(q){
var target = "/xcart1/home.php?cat="+q
window.location=target}}

function sendMemRequest2(q){
if(q){
http.open('get','/xcart1/skin1/browsemem.php?q='+q)
http.onreadystatechange=handleMemResponse
http.send(null)}
else{
document.getElementById("browsemem2").options.length=0
document.getElementById("browsemem2").options[0]=new Option('Select your memory...','')
document.getElementById("browsemem2").disabled=true}}



function handleMemResponse(){
if(http.readyState==4&&http.status==200){
var response=http.responseText
if(response){
document.getElementById("browseselectmem2").innerHTML=response}}}


function sendHomeSearch(q){
	if(q.length>0){
		http.open('get','/xcart1/skin1/suggesthome.php?q='+q)
		http.onreadystatechange=handleHomeResponse
		http.send(null)}
	else{
		document.getElementById("homelivesearch").innerHTML='<div style="padding:10px 0px 0px 50px;"><h2><i>What We Do:</i></h2><div id="mediaspace">This text will be replaced</div></div>';
	}
}

function handleHomeResponse(){
	if(http.readyState==4&&http.status==200){
		var response=http.responseText;
		if(response){
			document.getElementById("homelivesearch").innerHTML=response;
		}
	}
}

function sendHomeModelSearch(q){
	if(q.length>0){
		http.open('get','/xcart1/skin1/identifyhome.php?modelsearch='+q)
		http.onreadystatechange=handleHomeResponse
		http.send(null)}
	else{
		document.getElementById("homelivesearch").innerHTML='<div style="padding:10px 0px 0px 50px;"><h2><i>What We Do:</i></h2><div id="mediaspace">This text will be replaced</div></div>';
	}
}

//Model Search Ajax on Home Page
function getModel(data) {
	if(data.length > 0) {
		jQuery.get("/xcart1/skin1/identifyhome.php", { modelsearch: data},function(html){
				jQuery("#homelivesearch").html(html);
		});
	}
	else {
		jQuery("#homelivesearch").html('<div style="padding:10px 0px 0px 50px;"><h2><i>What We Do:</i></h2><div id="mediaspace">This text will be replaced</div></div>');
	}
}
//End Model Search Ajax on Home Page

function reposition(){
document.getElementById("searchResults").style.left=findPosX(document.getElementById('q'))+"px"
document.getElementById("searchResults").style.top=findPosY(document.getElementById('q'))+"px"
}


function setDropBox(modeltype){}


function jump(url){
window.location=url}


function cursorevent(e){
if(window.event){
keynum=e.keyCode}
else if(e.which){
keynum=e.which}
if(keynum==63223){
document.getElementById("searchResults").focus()}}



function getPosition(e){
e=e || window.event
var cursor={x:0,y:0}
if(e.pageX || e.pageY){
cursor.x=e.pageX
cursor.y=e.pageY}
else{
var de=document.documentElement
var b=document.body
cursor.x=e.clientX+
(de.scrollLeft || b.scrollLeft)-(de.clientLeft || 0)
cursor.y=e.clientY+
(de.scrollTop || b.scrollTop)-(de.clientTop || 0)}
return cursor}


function chooseBox(dropboxID){
selected=(document.getElementById(dropboxID)).value
pbdiv=document.getElementById("pbchecklist")
ipoddiv=document.getElementById("ipodchecklist")
if(selected=="pb"){
pbdiv.style.display="block"
ipoddiv.style.display="none"}
else{
pbdiv.style.display="none"
ipoddiv.style.display="block"}}


function movelayer()
{
	if (BrowserDetect.browser == 'Firefox')
	{
		document.getElementById("searchResults").style.right=findPosX(document.getElementById('q'))+500+"px"
		document.getElementById("modelPanel").style.left=findPosX(document.getElementById('nav'))+263+"px"
	}
	else if (BrowserDetect.browser == 'Opera')
	{
		document.getElementById("searchResults").style.right=findPosX(document.getElementById('q'))+500+"px"
		document.getElementById("modelPanel").style.left=findPosX(document.getElementById('nav'))+266+"px"
	}
	else if (BrowserDetect.browser == 'Explorer')
	{
		document.getElementById("searchResults").style.right=findPosX(document.getElementById('q'))+500+"px"
		document.getElementById("modelPanel").style.left=findPosX(document.getElementById('nav'))+262+"px"
	}
	else
	{
		document.getElementById("searchResults").style.right=findPosX(document.getElementById('q'))+500+"px"
		document.getElementById("modelPanel").style.left=findPosX(document.getElementById('nav'))+264+"px"
	}
}

function toggleDiv(id,id2)
{
	if (document.getElementById(id).style.display == 'none') {
		document.getElementById(id).style.display = 'block';
		document.getElementById(id).style.left = findPosX(document.getElementById(id2))+5+"px";
		document.getElementById(id).style.top = findPosY(document.getElementById(id2))+"px";
	}
	else {
		document.getElementById(id).style.display = "none";
	}
}

function togglePanel(source,target)
{
	document.getElementById(source).style.opacity=0;
	document.getElementById(target).style.opacity=0;
	document.getElementById(target).innerHTML=document.getElementById(source).innerHTML;
	new Effect.Opacity(target, { from: 0.0, to: 1.0, duration: 1.5, delay: 0.5 });
}

function chooseDomestic()
{
	document.getElementById("creditcardinfo").style.display = "none";
	document.getElementById("schedulesubmit").style.display = "none";
	document.getElementById("contactinformation-international").style.display = "none";
	document.getElementById("shippingaddress-international").style.display = "none";
	document.getElementById("shippingoptions-international").style.display = "none";
	
	jQuery("#contactinformation-domestic").fadeIn(1000);
	jQuery("#shippingaddress-domestic").fadeIn(1000);
	jQuery("#shippingoptions-domestic").fadeIn(1000);
	jQuery("#creditcardinfo").fadeIn(1000);
	jQuery("#schedulesubmit").fadeIn(1000);
	
	document.schedule_form.order_type[0].checked = true;
}

function chooseInternational()
{
	document.getElementById("creditcardinfo").style.display = "none";
	document.getElementById("schedulesubmit").style.display = "none";
	document.getElementById("contactinformation-domestic").style.display = "none";
	document.getElementById("shippingaddress-domestic").style.display = "none";
	document.getElementById("shippingoptions-domestic").style.display = "none";
	
	jQuery("#contactinformation-international").fadeIn(1000);
	jQuery("#shippingaddress-international").fadeIn(1000);
	jQuery("#shippingoptions-international").fadeIn(1000);
	jQuery("#creditcardinfo").fadeIn(1000);
	jQuery("#schedulesubmit").fadeIn(1000);
	
	document.schedule_form.order_type[4].checked = true;
}

//Live Search Ajax on Home Page
function getLiveSearchResultsHome(data) {
	if(data.length > 0) {
		jQuery.get("/xcart1/skin1/suggesthome.php", { q: data},function(html){
				jQuery("#homelivesearch").html(html);
		});
	}
	else {
		jQuery("#homelivesearch").html('<div style="padding:10px 0px 0px 50px;"><h2><i>What We Do:<\/i><\/h2><div id="mediaspace">This text will be replaced<\/div><\/div>');
		var flashvars = {};
		flashvars.file = "http://www.powerbookmedic.com/Manuals/promo2.m4v";
		flashvars.image = "http://www.powerbookmedic.com/xcart1/skin1/images/imagesv3/snapsnap.jpg";
		var params = {};
		params.allowfullscreen = "true";
		params.wmode = "opaque";
		var attributes = {};
		swfobject.embedSWF("/xcart1/skin1/javascript/player-flash10.swf", "mediaspace","380", "233", "9","/xcart1/skin1/javascript/expressInstall.swf",flashvars,params,attributes);
	}
}
//End Live Search Ajax on Home Page

//Live Search Ajax
function getLiveSearchResults(data) {
	if (jQuery("#searchResults").is(":hidden")) {
		jQuery.get("/xcart1/skin1/suggest.php", { q: data},function(html){
			if (html) {
				jQuery("#searchResultsFrame").html(html);
				jQuery("#searchResults").fadeIn("fast");
			}
			else
				document.getElementById('searchResults').style.display = 'none';
		});
	}
	else {
		jQuery.get("/xcart1/skin1/suggest.php", { q: data},function(html){
			if (html)
				jQuery("#searchResultsFrame").html(html);
			else
				document.getElementById('searchResults').style.display = 'none';
		});
	}
}
//End Live Search Ajax

//Close Live Search Animation
function closeSearchPanel()
{
	//document.getElementById('searchResults').style.display = 'none';
	jQuery("#searchResults")
		.animate({top:"-400px",opacity:"0"},1000, function(){
			document.getElementById('searchResults').style.display = 'none';
			document.getElementById("searchResults").style.opacity = '0.95';
			document.getElementById("searchResults").style.top = '100px';
		});
}
//End Close Live Search Animation
var tooltip=function(){
	var id = 'tt';
	var top = -130;
	var left = -150;
	var maxw = 250;
	var speed = 15;
	var timer = 20;
	var endalpha = 95;
	var alpha = 0;
	var tt,t,c,b,h;
	var ie = document.all ? true : false;
	return{
		show:function(v,w){
			if(tt == null){
				tt = document.createElement('div');
				tt.setAttribute('id',id);
				t = document.createElement('div');
				t.setAttribute('id',id + 'top');
				c = document.createElement('div');
				c.setAttribute('id',id + 'cont');
				b = document.createElement('div');
				b.setAttribute('id',id + 'bot');
				tt.appendChild(t);
				tt.appendChild(c);
				tt.appendChild(b);
				document.body.appendChild(tt);
				tt.style.opacity = 0;
				tt.style.filter = 'alpha(opacity=0)';
				document.onmousemove = this.pos;
			}
			tt.style.display = 'block';
			c.innerHTML = v;
			tt.style.width = w ? w + 'px' : 'auto';
			if(!w && ie){
				t.style.display = 'none';
				b.style.display = 'none';
				tt.style.width = tt.offsetWidth;
				t.style.display = 'block';
				b.style.display = 'block';
			}
			if(tt.offsetWidth > maxw){tt.style.width = maxw + 'px'}
			h = parseInt(tt.offsetHeight) + top;
			clearInterval(tt.timer);
			tt.timer = setInterval(function(){tooltip.fade(1)},timer);
		},
		pos:function(e){
			var u = ie ? event.clientY + document.documentElement.scrollTop : e.pageY;
			var l = ie ? event.clientX + document.documentElement.scrollLeft : e.pageX;
			tt.style.top = (u - h) + 'px';
			tt.style.left = (l + left) + 'px';
		},
		fade:function(d){
			var a = alpha;
			if((a != endalpha && d == 1) || (a != 0 && d == -1)){
				var i = speed;
				if(endalpha - a < speed && d == 1){
					i = endalpha - a;
				}else if(alpha < speed && d == -1){
					i = a;
				}
				alpha = a + (i * d);
				tt.style.opacity = alpha * .01;
				tt.style.filter = 'alpha(opacity=' + alpha + ')';
			}else{
				clearInterval(tt.timer);
				if(d == -1){tt.style.display = 'none'}
			}
		},
		hide:function(){
			clearInterval(tt.timer);
			tt.timer = setInterval(function(){tooltip.fade(-1)},timer);
		}
	};
}();
	
function currency_converter(amount,id) {
	var copt = id;
	if(id == 5) {
		jQuery("#new_currency").html("");
		document.cookie = "pbmcurrency=; expires=Thu, 01-Jan-70 00:00:01 GMT" + "; path=/"; 
	}
	else {
		jQuery.get("/xcart1/currency.php", { currency_id: id },function(id){
			if(id) {
				var q = "1USD=?" + id;
				jQuery.get("/xcart1/currency.php", { google: 'yes', q: q },function(rate){
					if (rate) {
						var rate = rate.split(',');
						rate = rate[1].split('"');
						rate = rate[1].split(' ');
						rate = rate[0].split(',');
						var value = rate*amount;
						value = Math.round(value*100)/100;
						jQuery.get("/xcart1/currency.php", { to_currency: copt },function(symbol){
							jQuery("#new_currency").html("<center>Estimated currency: <b>" + symbol + value + "</b></center>");
						},"html");
					}
					else {
						alert("Conversion error");
					}
				},"html");
				var exdate = new Date();
				exdate.setDate(exdate.getDate()+365);
				document.cookie="pbmcurrency="+escape(copt)+"; path=/" + ((exdate == null) ? "" : "; expires=" + exdate);
			}
		});
	}
}

var cssdropdown={
disappeardelay: 250, //set delay in miliseconds before menu disappears onmouseout
dropdownindicator: '', //specify full HTML to add to end of each menu item with a drop down menu
enablereveal: [true, 5], //enable swipe effect? [true/false, steps (Number of animation steps. Integer between 1-20. Smaller=faster)]
enableiframeshim: 1, //enable "iframe shim" in IE5.5 to IE7? (1=yes, 0=no)

//No need to edit beyond here////////////////////////

dropmenuobj: null, asscmenuitem: null, domsupport: document.all || document.getElementById, standardbody: null, iframeshimadded: false, revealtimers: {},

getposOffset:function(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;
},

css:function(el, targetclass, action){
	var needle=new RegExp("(^|\\s+)"+targetclass+"(jQuery|\\s+)", "ig")
	if (action=="check")
		return needle.test(el.className)
	else if (action=="remove")
		el.className=el.className.replace(needle, "")
	else if (action=="add" && !needle.test(el.className))
		el.className+=" "+targetclass
},

showmenu:function(dropmenu, e){
	if (this.enablereveal[0]){
		if (!dropmenu._trueheight || dropmenu._trueheight<10)
			dropmenu._trueheight=dropmenu.offsetHeight
		clearTimeout(this.revealtimers[dropmenu.id])
		dropmenu.style.height=dropmenu._curheight=0
		dropmenu.style.overflow="hidden"
		dropmenu.style.visibility="visible"
		this.revealtimers[dropmenu.id]=setInterval(function(){cssdropdown.revealmenu(dropmenu)}, 10)
	}
	else{
		dropmenu.style.visibility="visible"
	}
	this.css(this.asscmenuitem, "selected", "add")
},

revealmenu:function(dropmenu, dir){
	var curH=dropmenu._curheight, maxH=dropmenu._trueheight, steps=this.enablereveal[1]
	if (curH<maxH){
		var newH=Math.min(curH, maxH)
		dropmenu.style.height=newH+"px"
		dropmenu._curheight= newH + Math.round((maxH-newH)/steps) + 1
	}
	else{ //if done revealing menu
		dropmenu.style.height="auto"
		dropmenu.style.overflow="hidden"
		clearInterval(this.revealtimers[dropmenu.id])
	}
},

clearbrowseredge:function(obj, whichedge){
	var edgeoffset=0
	if (whichedge=="rightedge"){
		var windowedge=document.all && !window.opera? this.standardbody.scrollLeft+this.standardbody.clientWidth-15 : window.pageXOffset+window.innerWidth-15
		var dropmenuW=this.dropmenuobj.offsetWidth
		if (windowedge-this.dropmenuobj.x < dropmenuW)  //move menu to the left?
			edgeoffset=dropmenuW-obj.offsetWidth
	}
	else{
		var topedge=document.all && !window.opera? this.standardbody.scrollTop : window.pageYOffset
		var windowedge=document.all && !window.opera? this.standardbody.scrollTop+this.standardbody.clientHeight-15 : window.pageYOffset+window.innerHeight-18
		var dropmenuH=this.dropmenuobj._trueheight
		if (windowedge-this.dropmenuobj.y < dropmenuH){ //move up?
			edgeoffset=dropmenuH+obj.offsetHeight
			if ((this.dropmenuobj.y-topedge)<dropmenuH) //up no good either?
				edgeoffset=this.dropmenuobj.y+obj.offsetHeight-topedge
		}
	}
	return edgeoffset
},

dropit:function(obj, e, dropmenuID){
	if (this.dropmenuobj!=null) //hide previous menu
		this.hidemenu() //hide menu
	this.clearhidemenu()
	this.dropmenuobj=document.getElementById(dropmenuID) //reference drop down menu
	this.asscmenuitem=obj //reference associated menu item
	this.showmenu(this.dropmenuobj, e)
	this.dropmenuobj.x=this.getposOffset(obj, "left")
	this.dropmenuobj.y=this.getposOffset(obj, "top")
	this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"
	this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+1+"px"
	this.positionshim() //call iframe shim function
},

positionshim:function(){ //display iframe shim function
	if (this.iframeshimadded){
		if (this.dropmenuobj.style.visibility=="visible"){
			this.shimobject.style.width=this.dropmenuobj.offsetWidth+"px"
			this.shimobject.style.height=this.dropmenuobj._trueheight+"px"
			this.shimobject.style.left=parseInt(this.dropmenuobj.style.left)+"px"
			this.shimobject.style.top=parseInt(this.dropmenuobj.style.top)+"px"
			this.shimobject.style.display="block"
		}
	}
},

hideshim:function(){
	if (this.iframeshimadded)
		this.shimobject.style.display='none'
},

isContained:function(m, e){
	var e=window.event || e
	var c=e.relatedTarget || ((e.type=="mouseover")? e.fromElement : e.toElement)
	while (c && c!=m)try {c=c.parentNode} catch(e){c=m}
	if (c==m)
		return true
	else
		return false
},

dynamichide:function(m, e){
	if (!this.isContained(m, e)){
		this.delayhidemenu()
	}
},

delayhidemenu:function(){
	this.delayhide=setTimeout("cssdropdown.hidemenu()", this.disappeardelay) //hide menu
},

hidemenu:function(){
	this.css(this.asscmenuitem, "selected", "remove")
	this.dropmenuobj.style.visibility='hidden'
	this.dropmenuobj.style.left=this.dropmenuobj.style.top="-1000px"
	this.hideshim()
},

clearhidemenu:function(){
	if (this.delayhide!="undefined")
		clearTimeout(this.delayhide)
},

addEvent:function(target, functionref, tasktype){
	if (target.addEventListener)
		target.addEventListener(tasktype, functionref, false);
	else if (target.attachEvent)
		target.attachEvent('on'+tasktype, function(){return functionref.call(target, window.event)});
},

startmenu:function(){
	if (!this.domsupport)
		return
	this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
	for (var ids=0; ids<arguments.length; ids++){
		var menuitems=document.getElementById(arguments[ids]).getElementsByTagName("a")
		for (var i=0; i<menuitems.length; i++){
			if (menuitems[i].getAttribute("rel")){
				var relvalue=menuitems[i].getAttribute("rel")
				var asscdropdownmenu=document.getElementById(relvalue)
				this.addEvent(asscdropdownmenu, function(){cssdropdown.clearhidemenu()}, "mouseover")
				this.addEvent(asscdropdownmenu, function(e){cssdropdown.dynamichide(this, e)}, "mouseout")
				this.addEvent(asscdropdownmenu, function(){cssdropdown.delayhidemenu()}, "click")
				try{
					menuitems[i].innerHTML=menuitems[i].innerHTML+" "+this.dropdownindicator
				}catch(e){}
				this.addEvent(menuitems[i], function(e){ //show drop down menu when main menu items are mouse over-ed
					if (!cssdropdown.isContained(this, e)){
						var evtobj=window.event || e
						cssdropdown.dropit(this, evtobj, this.getAttribute("rel"))
					}
				}, "mouseover")
				this.addEvent(menuitems[i], function(e){cssdropdown.dynamichide(this, e)}, "mouseout") //hide drop down menu when main menu items are mouse out
				this.addEvent(menuitems[i], function(){cssdropdown.delayhidemenu()}, "click") //hide drop down menu when main menu items are clicked on
			}
		} //end inner for
	} //end outer for
	if (this.enableiframeshim && document.all && !window.XDomainRequest && !this.iframeshimadded){ //enable iframe shim in IE5.5 thru IE7?
		document.write('<IFRAME id="iframeshim" src="about:blank" frameBorder="0" scrolling="no" style="left:0; top:0; position:absolute; display:none;z-index:90; background: transparent;"></IFRAME>')
		this.shimobject=document.getElementById("iframeshim") //reference iframe object
		this.shimobject.style.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)'
		this.iframeshimadded=true
	}
} //end startmenu

}	