// Sets CSS to display or hide the share links module
function showShareLinks() {
	var showModule = document.getElementById("DPCelebrationShareSocialLinksModule");
	var showFB = document.getElementById("DPCelebrationFacebookLink");
	var showMS = document.getElementById("DPCelebrationMySpaceLink");
	var showTW = document.getElementById("DPCelebrationTwitterLink");
	var buttonTAF = document.getElementById("DPCelebrationTellFriendButtonMedia");
	document.getElementById("URLLinkLabel").readOnly = true; 
	
	if(showModule.style.visibility == "visible"){
		showModule.style.visibility = "hidden";
		showFB.style.visibility = "hidden";
		showTW.style.visibility = "hidden";
		showMS.style.visibility = "hidden";
		buttonTAF.style.visibility = "hidden";
		//alert('showModvis');
	}
	else{
		trackLink("landing_tellafriend");
		showModule.style.visibility = "visible";
		showFB.style.visibility = "visible";
		showTW.style.visibility = "visible";
		showMS.style.visibility = "visible";
		buttonTAF.style.visibility = "visible";
		//alert('else');
	}
}


// will render a grey out background for the popup
WDPRO_LOADER.require("event");
WDPRO_LOADER.require("container");
WDPRO_LOADER.require("wdprodom");

WDPRO_LOADER.addCallback(
	function() {
		var $D = WDPRO.util.Dom;
		var $E = YAHOO.util.Event;
			
		obj = document.getElementById("DPCelebrationShareSocialLinksModule");
			//alert(obj.id);
		obj2 = document.getElementById("DPCelebrationTellFriendButtonMedia");
			//alert(obj2.id);
			
		//Create dynamic divs to create the alpha-layer
		objDiv1 = document.createElement("div");
		objDiv1.className="bd";
		objDiv1.appendChild(obj2);
			//alert(objDiv1.appendChild(obj2).className);	// "inactive" = 
		objDiv1.appendChild(obj);
			//alert(objDiv1.appendChild(obj).className);	// "generalTextBlock" = 
		
		
		objDiv3 = document.createElement("div");
		objDiv3.id ="centerModule";
		objDiv3.appendChild(objDiv1);
			//alert(objDiv3.appendChild(objDiv1).className);	// "bd" = 
		
		objDiv2 = document.createElement("div");
		objDiv2.id ="myPanel";
		objDiv2.appendChild(objDiv3);
			//alert(objDiv2.appendChild(objDiv3).id);	// "centerModule" = 
			
		document.body.appendChild(objDiv2);
			//alert(document.body.appendChild(objDiv2).id);	// "myPanel" = 
		
		
		myDialog = new YAHOO.widget.Dialog("myPanel", { fixedcenter: false
								, visible: false
								, draggable: false
								, close: false
								, constraintoviewport: true
								, modal:true
								, zIndex:10001
								, effect:{effect:YAHOO.widget.ContainerEffect.FADE, duration:0.5}
								}
							);
				
					myDialog.render();
					
					YAHOO.util.Event.addListener("GADGADSubNavShareSearchLink", "click", function() {
						myDialog.show();
					  });
					  
					  //GADGADSubNavShareLink
					  //GADGADSubNavShareSearchLink
					  
					  YAHOO.util.Event.addListener("subNavShareThankYou", "click", function() {
						myDialog.show();
					  });
					 
					  YAHOO.util.Event.addListener("DPCelebrationCloseMedia", "click", function() {					      
						myDialog.hide();
					  });
					  
					  YAHOO.util.Event.addListener("DPCelebrationFacebookLink", "click", function() {
							trackLink("GADGADShareFacebook_link");					    
					  });
					  
					  YAHOO.util.Event.addListener("DPCelebrationTwitterLink", "click", function() {
							trackLink("GADGADShareTwitter_link");					      					    
					  });
					  
					  YAHOO.util.Event.addListener("DPCelebrationMySpaceLink", "click", function() {
							trackLink("GADGADShareMyspace_link");
											
					  });
					      
			}
			
		);