// Preload Two arrows
var imgArray= new Array();
imgArray[0] = new Image();
imgArray[0].src = 'http://img.123greetings.com/events/images/chrarrup.gif';
imgArray[1] = new Image();
imgArray[1].src = 'http://img.123greetings.com/events/images/chrarrdw.gif';
//------------ END 

function open_menu(obj,d,link_url,cap){
	var str="";

	var link_array = link_url.split(','); // holds link array
	var caption_array = cap.split(','); // holds caption array
			
	// shifts any blank cell at the first element of the array
	if (link_array[0] == '') link_array.shift();
	if (caption_array[0] == '') caption_array.shift();	

	if(document.getElementById(d).style.display=='none'){
		document.getElementById(d).style.display='block';
		var strHTML = new Array();
		strHTML[strHTML.length] = "<table border=0 cellspacing=0 cellpadding=0 width='100%'>";
		
		for(i=0, j = caption_array.length; i < j; i++){
			strHTML[strHTML.length] ='<TR VALIGN=TOP><td width=2 style="font-size:7px">&nbsp;</td><td width=8 align="left" VALIGN=BASELINE class="q1">&#183</td><td class="q1" VALIGN=BASELINE><a href="' + link_array[i] + '" class="q1" title="' + caption_array[i] + '">' + caption_array[i] + '</a></td></tr>';
		}
		strHTML[strHTML.length] = '</table>';
		
		obj.src = imgArray[1].src;
		obj.title = 'Click to collapse';
		obj.style.cursor = 'pointer';
		 
		document.getElementById(d).innerHTML = strHTML.join('');
	 }else{	
		 obj.src = imgArray[0].src;
		 obj.title = 'Click to expand';
		 obj.style.cursor = 'pointer';
		 document.getElementById(d).style.display='none';
	 }
}