// Gore.com  Specific Javascript for ALL PAGE BUT THE HOME PAGE. (unless there is image Enlarge, Text alignment for image caption in 'document' DIV or H2,H3 top margin problems) 

(function () {
				
				// Zoom  Panels  (enlarge image)
                
				var zoomLinks = YAHOO.util.Dom.getElementsByClassName("zoom");
				
                  var zoomPanel = new YAHOO.widget.Panel("zoomPanel", {
                  		constraintoviewport: true, 
						underlay:"shadow", 
						close:true, 
						visible:false, 
						draggable:false,
						fixedcenter:true, 
						modal:true
						
				});
                
                 zoomPanel.render(document.body);
                
				// Loop over zoom links and wire up to panel
				for (var i = 0; zoomLinks[i]; i += 1) {
                		
                        
                    // Create a panel to display zoom image
                    zoomLinks[i].id = 'imagetoenlarge'+i;
                   
					zoomLinks[i].onclick = function (e) {
                    	
                        
                       
                       
						e = e || event;
						zoomPanel.setHeader(this.title);
						YAHOO.util.Dom.theZoomPanel =  zoomPanel;
						YAHOO.util.Dom.closeTheWindow = function(){
							YAHOO.util.Dom.theZoomPanel.hide();
							document.getElementById("showframe").style.display="none";
							document.getElementById("closeLinnk").style.display="none";
						}
						
						//alert(" ID " + this.id.indexOf('more_info'));
						if(this.href.indexOf('more_info') > -1){
							zoomPanel.setBody("<a href=\"javascript:YAHOO.util.Dom.closeTheWindow()\" class=\"gray_close\" id=\"closeLinnk\" ><img src=\"images/btn-close.gif\"></a><br /><iframe id=\"showframe\" src=" + this.href + " width=740 height=400 scrolling=\"no\" frameborder=0 />" );}
						else{
							zoomPanel.setBody("<a href=\'javascript:YAHOO.util.Dom.closeTheWindow()\' class=\"purple_close\" id=\"closeLinnk\"><img src=\"images/btn-close-2.gif\"></a><br /><iframe id=\"showframe\" src=" + this.href + " width=200 height=600 scrolling=\"no\" frameborder=0 />" );
							
						}
                        
                        
                       
                      

                     
                         		
                              zoomPanel.render(document.body);
							  zoomPanel.show();
							  
    
                        
                        
						YAHOO.util.Event.preventDefault(e);
                        
                       
					};
                   
				}
			})();
           	(function () {
				
				// Text alignment(caption) for "document" tag with image.
                
				var allDocuments = YAHOO.util.Dom.getElementsByClassName("document");
				
				
				for (var i = 0; allDocuments[i]; i += 1) {
                		// FF
				if (typeof window.innerWidth != 'undefined')
                         {
                             
					
  					imageSRC = allDocuments[i].childNodes[1].getAttribute('src');
 					
 				
                         }
                         
                        // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
                        
                         else if ( typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth !='undefined' && document.documentElement.clientWidth != 0)
                         {
                              imageSRC = allDocuments[i].childNodes[0].getAttribute('src');
                         }					
				
                         else
                         {
                               imageSRC = allDocuments[i].childNodes[1].getAttribute('src');
                         }

				var newImg = new Image();
				newImg.src = imageSRC;
			
				var thewidth = newImg.width;
				if (thewidth != 0){
				for (var j = 0; allDocuments[i].childNodes[j]; j += 1) {
					if (allDocuments[i].childNodes[j].nodeType == 1){
						if (allDocuments[i].childNodes[j].className == 'pdf' || allDocuments[i].childNodes[j].className == 'zip' || allDocuments[i].childNodes[j].className == 'enlarge' ){
							allDocuments[i].childNodes[j].style.width = thewidth - 21 +"px";
						} else { 
							allDocuments[i].childNodes[j].style.width = thewidth +"px";
						}
						
					}
				}
				 
				}

				
               }
                
			})();
			
  		(function () {
				
				// Share this page POPUP
                
				var sendToFriendLinks = YAHOO.util.Dom.getElementsByClassName("sharePage");
				
                  var sendToFriend = new YAHOO.widget.Panel("sendToFriend", {
                  		constraintoviewport: true, 
						underlay:"shadow", 
						close:true, 
						visible:false, 
						draggable:false,
						fixedcenter:true,
						width:"450px",
						modal:true
						
				});
                
                 sendToFriend.render(document.body);
                
				// Loop over zoom links and wire up to panel
				for (var i = 0; sendToFriendLinks[i]; i += 1) {
                		
                        
                   
					sendToFriendLinks[i].onclick = function (e) {
                    	
                        
                     e = e || event;
                        
			
                         		
                              sendToFriend.render(document.body);
							  sendToFriend.show();
							
						
     
						YAHOO.util.Event.preventDefault(e);
                        
                       
					};
                   
				}
			})();
          