	// JavaScript Document

(function($){  
    $.fn.extend({
        oneShowHide: function(options) {  
        
            //Set the default values, use comma to separate the settings 
            var defaults = {  
                numShown: 10,  
                showText : 'Show More Links',  
                hideText : 'Hide Links'  
            }  
            
            var options =  $.extend(defaults, options);  
                        
            return this.each(function() {  
                var o = options;  
                var obj = $(this);

                // Determine the length of items here and calculate the number hidden
                var pLength = obj.children().length;
                var numHidden = pLength - o.numShown;
                var pList = obj.children();
                
                // Setup Show/Hide Link
                var shLink = "<a href='#' class='shview'>" + o.showText + "</a>";
                
                if (pLength > o.numShown) {
                    jQuery(shLink).insertAfter(obj); 
                }
                
                pList.each(function(index){
				    if (index < o.numShown) {
				        //alert('test');
				        jQuery(pList[index]).show(); 
				    }		
				    else {
				        jQuery(pList[index]).hide();
                        jQuery(pList[index]).addClass('hidden');
				    }    
				});

                
                // This is where I toggle the text
                jQuery("a.shview").live("click", function(e){
    
                    if (jQuery(this).text()==o.showText) {
                    	jQuery(this).text(o.hideText);
					}
					else {
						jQuery(this).text(o.showText);
					}
					jQuery('.hidden').slideToggle(500);
					return false;
               });                
              
            });  
        } 
    }); 
})(jQuery);

function popup(url,n,h,w) {
	hp = 0;
	vp = 0;
	if(screen){
		hp = (screen.width-w) / 2;
		vp = (screen.height-h) / 2;
	}
	winname=window.open(url, n,'width='+w+',height='+h+',left='+hp+',top='+vp+',scrollbars=yes,toolbar=no,menubar=no,resizable=no,statusbar=yes');
	windowstatus = 1;
	if (window.focus) { winname.focus(); }
}

