function toggleDisplay(div) {
	// This location will have to be changed to the correct location at launch time
	if( parent.location == 'http://www.stellaeventdesign.com/services.html') {
		
		if(div.style.display == 'none' ) {
			document.getElementById('BasicWedding').style.display='none';
			document.getElementById('DecorSetup').style.display='none';
			document.getElementById('UltimateWedding').style.display='none';
			document.getElementById('WeddingDayManagement').style.display='none';
			document.getElementById('Consulting').style.display='none';
		
			div.style.display='block';
		} else {
			div.style.display='none';
		}		
	} else {
		if(div.style.display == 'none' ) {
			div.style.display='block';
		} else {
			div.style.display='none';
		}
	}
}

function toggleText(div) {
	if( div.innerHTML == '<img src="arrow_right_sm.gif" alt="+" title="Click To Expand" />' ) {
		
		div.innerHTML = '<img src="arrow_down_sm.gif" alt="-" title="Click To Close" />';
		div.title = "Click To Hide";
	} else {
		div.innerHTML = '<img src="arrow_right_sm.gif" alt="+" title="Click To Expand" />';
		div.title = "Click To Expand";
	}
}

function toggleText(div) {
	if( div.alt == '+' ) {
		//div.src = 'arrow_down_sm.gif';
		//div.title = "Click To Close";
		//div.alt = '-';
		
	} else {
		//div.src = 'arrow_right_sm.gif';
		//div.title = "Click To Expand";
		//div.alt = '+';
	}
}

// Mouse Position Code
var IE = document.all?true:false
                                
if (!IE) document.captureEvents(Event.MOUSEMOVE)

// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;
                                
// Temporary variables to hold mouse x-y pos.s
var mouseLocationX = 0
var mouseLocationY = 0
                                
function getMouseXY(e) {
	if (IE) { // grab the x-y pos.s if browser is IE
	                                        
		mouseLocationX = event.clientX + document.body.scrollLeft
		mouseLocationY = event.clientY + 
		document.body.scrollTop
	} else {  // grab the x-y pos.s if browser is NS
	                                       
		mouseLocationX = e.pageX
		mouseLocationY = e.pageY
	}
	                                      
	// catch possible negative values in NS4
	if (mouseLocationX < 0){mouseLocationX = 0}
	if (mouseLocationY < 0){mouseLocationY = 0}  
		
	return true
}

function moveElementToCursor(div) {
	document.getElementById(div).style.position = "absolute";
	document.getElementById(div).style.top = mouseLocationY;
	document.getElementById(div).style.left = mouseLocationX;
}

// RGB To Hex 
// Found from http://kourbatov.com/faq/rgbtohex.htm
function RGBtoHex(R,G,B) {return toHex(R)+toHex(G)+toHex(B)}

function toHex(N) {
 if (N==null) return "00";
 N=parseInt(N); if (N==0 || isNaN(N)) return "00";
 N=Math.max(0,N); N=Math.min(N,255); N=Math.round(N);
 return "0123456789ABCDEF".charAt((N-N%16)/16)
      + "0123456789ABCDEF".charAt(N%16);
}

// Popup code
function popUp(URL, w, h) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+w+',height='+h+',left = 460,top = 392');");
}