// JavaScript Document  http://portal.utpa.edu/utpa_main/2010_template

		$(document).ready(function(){
			

$.getJSON('http://utpa.edu/lib/json-content.cfc?method=remoteGetWeather&callback=?', function(data){
			//var res = 'Name: '+data.WEATHER;
			$("#weather img").attr("src","http://utpa.edu/images/weather-images/"+data.ICON+".png");
			$("#weather img").attr("alt",data.ALT);
			$("#weather img").attr("class","ie6-png");
			$("#weather div").html(data.WEATHER+"&deg;F");
 });


			
			
			
			//// PANE CONTENT CONTAINER
			var opener = "";
			function top(caller, name){

			        if($("#pane").css("top") == '-2px' && opener == caller){
					$("#pane-content").css("display","none");
					$("#close-icon").css("display","none");
					$("#pane").animate({ top:"-191px"}, 400, function(){
						$("#close-icon").css("display","none");
						$("#pane").css("z-index","8888");
						$("#weather-search").css("z-index","9998");
					});
					
				}else{
					opener = caller;
					
					$("#pane-content").css("display","block");
					$("#close-icon").css("display","block");
					$("#pane").animate({ top:"-2px"}, 400);
					$("#pane").css("z-index","9998");
					$("#weather-search").css("z-index","8888");
					$("#pane-content").html("");
				}
			};

			
			
			
			
			function tclose(){
				//$("#pane-content").empty();
				$("#pane-content").css("display","none");
				$("#pane").animate({ top:"-191px"}, 400, function(){
					$("#close-icon").css("display","none");
					$("#pane").css("z-index","8888");
					$("#weather-search").css("z-index","9998");
				});
			};
			 
			
			<!-- content($(this).attr("rel")) -->
			$("#close-icon").click( function(){ tclose(); } );
			$("#news-events").click( function(){ top("news",$(this).attr("id")); newsevents(); });
			$("#az-index").click( function(){ top("index",$(this).attr("id")); azindex(); } );
			$("#directory").click( function(){ top("dir",$(this).attr("id")); directory(); } );
			$("#quick-links").click( function(){ top("links",$(this).attr("id")); quicklinks(); } );
			
			
			function directory(){
				
				$("#pane-content").append('<div id="directory-div"> </div>');
            	$("#directory-div").append('<div class="left-cell"><h4 class="title">Directory</h4><div class="textbox-directory"></div><div class="right-align"><a href="http://www.utpa.edu/directory/">View Full Page</a></div>');
				
				$(".textbox-directory").append('<input type="text" id="my_input" onkeyup="startQueryManager(this.value, 10)" onfocus="resetDirectorySearch(this)" name="my_input" value="Search Faculty / Staff" /><label for="my_input" class="lbl-search">Search Faculty / Staff</label>');
				
				$(".textbox-directory").append('<div class="banner-cell-card" style="height: 118px; width: 406px; background: none; margin: 0px; overflow: hidden;"><div style="overflow: hidden;"><div class="directory_response"><div style="width: 100%; text-align: center;"><br /><br />Please type the name of the Faculty,<br />Staff that you are looking for.</div></div></div></div>');
				
				
				$("#directory-div").append('<div class="right-cell"><h4 class="title">Important Phone Numbers</h4><div class="banner-cell"><table id="directory-phone-numbers" cellpadding="3" cellspacing="0"><tr><td><a href="http://www.utpa.edu/admissions">Admissions</a></td><td>956-665-2999</td></tr><tr><td><a href="http://www.utpa.edu/finaid">Student Financial Services</a></td><td>956-665-2501</td></tr><tr><td><a href="http://portal.utpa.edu/utpa_main/dess_home/dos_home/shs_home">Student Health Services</a></td><td>956-665-2511</td></tr><tr><td style="width: 60%;"><a href="http://www.utpa.edu/emergency/">Emergency Information Updates</a></td><td style="width: 40%;">956-665-7233</td></tr><tr><td>Emergency</td><td>911</td></tr><tr><td><a href="http://www.utpa.edu/police">University Police</a></td><td>956-665-7151</td></tr><tr><td><a href="http://portal.utpa.edu/utpa_main/dba_home/safety_home">Environmental Health and Safety</a></td><td>956-665-3690</td></tr></table></div><div class="right-align"><a href="http://www.utpa.edu/directory/departments/">View / Search Complete Listing</a></div></div>');
								
				}
				
				
			function azindex(){
				$("#pane-content").append('<div id="az-index-div"></div>');
				$("#az-index-div").append('<div class="left-cell"></div>');
				$("#az-index-div").append('<div class="right-cell"></div>');
				
				$(".left-cell").append('<h4 class="title">A-Z Index</h4><div><div class="textbox-directory"><input type="text" id="my_input" onkeyup="retrive_siteindex(this.value);" onfocus="resetazindex(this)" name="my_input" value="Search Index" /><div id="test"><div id="az-index-div-content" class="banner-cell" style="height:106px; width: 98%; overflow:hidden; position:relative; float:left; clear: both;"><div id="content-slider" style="position:absolute; top:0px;"><ul class="az-index-list"></ul></div></div> </div> </div>');
				
				
				/* //$(".left-cell").append('<div class="right-align"><a href="./az-index/">View Full Page</a></div>'); */
				$.ajax({ url: "http://www.utpa.edu/lib/json-content.cfc?method=getIndex&callback=?",dataType: "jsonp", success: 
							function(data){
								//$("#content-slider ul").append(data.DATA.length);
								$.each(data.DATA,function(i,data){ $("#content-slider ul").append("<li><a href='"+data[1]+"'>" +data[0]+"</a></li>"); });
								scrollbarf();
							}
				});
				$('#az-index-div-content').append('<div id="slider-vertical" style="height:86px; width:5px; float:right; margin: 6px 5px 6px 5px;"></div>');
				$(".right-cell").append('<h4 class="title">Colleges</h4><div class="banner-cell"><ul class="event-items"><li><a href="http://coah.utpa.edu/">College Of Arts and Humanities</a></li><li><a href="http://coba.utpa.edu/">College Of Business Administration</a></li><li><a href="http://www.utpa.edu/colleges/coe/">College Of Education</a></li><li><a href="http://portal.utpa.edu/utpa_main/daa_home/coecs_home">College Of Engineering and Computer Science</a></li><li><a href="http://www.utpa.edu/hshs/">College Of Health Sciences and Human Services</a></li><li><a href="http://portal.utpa.edu/utpa_main/daa_home/cosm_home">College Of Science and Mathematics</a></li><li><a href="http://portal.utpa.edu/utpa_main/daa_home/csbs_home">College Of Social and Behavioral Sciences</a></li></ul></div>');
			
			}
			
			// <div class="right-align"><a href="./az-index/">View Full Page</a></div>
			
			
			
			function newsevents(){
			
				$("#pane-content").append("<div id='news-events-div'>");
					
					<!-- UTPA NEWS CELL-->
					$("#pane-content").append('<div class="third-cell"> <h4 class="title">UTPA News</h4> <div class="banner-cell"><div class="news-item-title" id="news-items-top-content">');
						$.ajax({ url: "http://www.utpa.edu/lib/json-content.cfc?method=getnews&callback=?",dataType: "jsonp", success: 
							function(data){
								$.each(data.DATA,function(i,data){ 
														  if(data[2] == 1){
														  
														  	$("#news-items-top-content").append("<span class='new-item'><a href='http://www.utpa.edu/news/index.cfm?newsid="+data[1]+"'>" +data[0]+"</a></span>"); 
														  
														  }else{
															
															$("#news-items-top-content").append("<span><a href='http://www.utpa.edu/news/index.cfm?newsid="+data[1]+"'>" +data[0]+"</a></span>");
															
														  }
														  
														  });
														  
							}
							 });
					$(".third-cell").append('<div class="right-align"><a href="http://www.utpa.edu/news/">View More</a></div>');
					$("#pane-content").append('</div></div></div>');
				 
				 	<!-- TODAYS EVENT CELL-->
				 	$("#pane-content").append(
					'<div class="third-cell"><h4 class="title">Todays Events</h4><div class="banner-cell"></div><div class="right-align"><a href="http://www.utpa.edu/calendar/">View More</a></div></div>');
					//$(".third-cell").append('<div class="right-align"><a href="http://www.utpa.edu/calendar/">View More</a></div>');
				 	$(".banner-cell").append('<ul id="todayevents" class="contentUL event-ul"></ul>');
				 	$.ajax({ url: "http://www.utpa.edu/lib/json-content.cfc?method=getevents&callback=?",dataType: "jsonp", success: 
							function(data){
								if(data.DATA.length > 0){
									$.each(data.DATA,function(i,data){ $(".event-ul").append("<li><a href='http://www.utpa.edu/calendar/?id="+data[1]+"'>" +data[0]+"</a></li>"); });
								}else{
									$(".contentUL").append("<li>No events are listed for today.</li>");
								}
							}
							 });

				  <!-- ACADEMIC CALENDAR CELL-->
				  $("#pane-content").append(
				   '<div class="third-cell"> <h4 class="title">Academic Calendar</h4><div id="calendarcell" class="banner-cell"></div><div class="right-align"><a href="http://www.utpa.edu/calendar/academic-calendar/">View More</a></div></div>');
				  //$(".third-cell").append('<div class="right-align"><a href="http://www.utpa.edu/calendar/academic-calendar/">View More</a></div>');
				  
				  $.ajax({ url: "http://www.utpa.edu/lib/json-content.cfc?method=getcalendar&callback=?",dataType: "jsonp", success: 
							function(data){
									$.each(data.DATA,function(i,data){ 
										$("#calendarcell").append(
				'<div class="aca-cal-item"> <div class="newsitem-date"> <div class="newsitem-month">'+data[1]+'</div> <div class="newsitem-day">'+data[0]+'</div> </div> <div>'+data[2]+'</div></div>'); });
							}
							 });
				 
				$("#pane-content").append("</div>");
				
			};
			
			
			
			function quicklinks(){
				
				$("#pane-content").append('<div id="quick-links-div"></div>');
				$("#quick-links-div").append('<div id="quick-links-top" style="width: 100%; clear: both; overflow: hidden;"> </div>');
				
				$("#quick-links-div").append('<div class="third-cell"><ul class="event-items"><li><a href="http://portal.utpa.edu/utpa_main/dba_home/police_home/pd_ep">In Case of Emergency</a></li><li><a href="http://www.utpa.edu/emergency/">Bronc Alert</a></li><li><a href="http://www.utpa.edu/hop/">Handbook of Operating Procedures</a></li><li><a href="http://portal.utpa.edu/utpa_main/dba_home/hr_home">Human Resources</a></li><li><a href="http://portal.utpa.edu/utpa_main/dess_home/admissions_home/admissions_visit">Visiting Campus</a></li></ul> </div>');
				
				$("#quick-links-div").append('<div class="third-cell"> <ul class="event-items"><li><a href="http://portal.utpa.edu/utpa_main/dess_home/admissions_home/admissions_orient">Orientation</a></li><li><a href="http://utpa.edu/courseinfo">Course & Instructor Information</a></li><li><a href="http://www.utpa.edu/catalog/">University Catalogs</a></li><li><a href="http://portal.utpa.edu/utpa_main/dess_home/sfs_home">Financial Aid/Scholarships</a></li></ul></div>');
				
				$("#quick-links-div").append('<div class="third-cell"><ul class="event-items"><li><a href="http://portal.utpa.edu/portal/page/portal/utpa_main/dess_home/registrar_home/registrar_files/Transcript.pdf">Request a Transcript</a></li><li><a href="http://www.panamericanonline.com/"><em>The Pan American</em> Online</a></li><li><a href="http://www.utpa.edu/broncradiotv"><em>Bronc Radio & TV</em></a></li><li><a href="http://www.utpa.edu/helpdesk/">IT Service Desk</a></li><li><a href="http://www.utpa.edu/safetynet">Concerns About a Student?</a></li></ul></div>');
				
				$("#quick-links-div").append('<div style="clear: both; overflow: hidden; width: 100%; margin: 0px auto; padding-top: 10px;" class="clear"><table id="ql-icons" cellpadding="0" cellspacing="1"><tr><td><a href="http://my.utpa.edu"><img src="http://utpa.edu/images/ql-blackboard-4.png" alt="Blackboard" class="ie6-png" /><br />Blackboard</a></td><td><a href="http://assist.utpa.edu"><img src="http://utpa.edu/images/ql-assist-4.png" alt="ASSIST" class="ie6-png" /><br />ASSIST</a></td><td><a href="http://lib.utpa.edu"><img src="http://utpa.edu/images/ql-library-4.png" alt="Library" class="ie6-png" /><br />Library</a></td><td><a href="http://utpa.edu/bookstore"><img src="http://utpa.edu/images/ql-bookstore-4.png" alt="Bookstore" class="ie6-png" /><br />Bookstore</a></td><td><a href="http://www.utpa.edu/calendar/"><img src="http://utpa.edu/images/ql-calendar-2.png" alt="Calendar" class="ie6-png" /><br />Calendars</a><//td><td><a href="http://outlook.utpa.edu"><img src="http://utpa.edu/images/ql-employee-email-4.png" alt="Employee Email" class="ie6-png" /><br />Employee Email</a><//td><td><a href="http://my.utpa.edu"><img src="http://utpa.edu/images/ql-oracle247-4.png" alt="Oracle 24/7" class="ie6-png" /><br />Oracle 24/7</a><//td><td><a href="http://www.utpabroncs.com/"><img src="http://utpa.edu/images/ql-athletics-4.png" alt="Athletics" class="ie6-png" /><br />Athletics</a></td><td><a href="http://askrio.utpa.edu"><img src="http://utpa.edu/images/ql-ask-rio-4.png" alt="Ask RIO" class="ie6-png" /><br />Ask RIO</a><//td><td><a href="http://www.utpa.edu/maps"><img src="http://utpa.edu/images/ql-campus-map-5.png" alt="Campus Map" class="ie6-png" /><br />Campus Map</a><//td></tr></table></div>');
				
			}
			

		});
						 



/**
			INTERNAL FUNCTIONS WORKING!!
		**/
		
		function resetazindex(textFieldObj){textFieldObj.value='';}
		

				var directory_state = 0;
		var currentQuery = '';
		var dirTimeoutid = '';
		var dirTimeoutInterval = 100;
		
		/**
			puts queries on a short delay so they can be cancelled if a new query is made  within the timeout window
		**/
		function startQueryManager(query, numResultsRequested)
		{
			cancelPreviousQuery();
			if(numResultsRequested < 0 )
			{
			dirTimeoutid = setTimeout(function(){retrive_directory(query)},dirTimeoutInterval);
			} else {
			dirTimeoutid = setTimeout(function(){retrive_directory_incomplete(query)},dirTimeoutInterval);
			}
		}
		
		/**
			Cancels query currently queued so that only the newest query is used
		**/
		function cancelPreviousQuery()
		{
			try{
			clearTimeout(dirTimeoutid);
			} catch(err) {
				// fall through, no special handling needed
				}
		}
		
		/**
			Resets the text field, search instructions, and current query obj
		**/		
		function resetDirectorySearch(textFieldObj)
		{
			if( textFieldObj.value == "Search Faculty / Staff" ){textFieldObj.value='';}

			if( textFieldObj.length < 2 )
			{$(".directory_response").html('<div style="text-align:center; width: 100%;"><br /><br />Please type the name of the Faculty,<br /> Staff that you are looking for.</div>');}
			
			currentQuery='';

			//textFieldObj.value='';
//			currentQuery='';
//			$(".directory_response").html('<div style="text-align:center; width: 100%;"><br /><br />Please type the name of the Faculty,<br /> Staff that you are looking for.</div>');
			
		}		
				
		
		function retrive_directory(query){
				
				query = $.trim(query);
				if(currentQuery == query)
				{
					return;	// don't perform a new request if the query has not changed
					}
					currentQuery = query;
				if(query.length > 1 ){
					directory_state = 1;  
					$.ajax({ url: "http://www.utpa.edu/lib/json-content.cfc?method=Directory&key="+query+"&callback=?",dataType: "jsonp", success: 
        			function(data){

				if(currentQuery != query)
				{
					return;	// don't perform a new write if the query has changed since this was requested
					}

					if(data.DATA.length > 1){
						$(".directory_response").html('<br />');
						$.each(data.DATA,function(i,data){ $(".directory_response").append("<div><a href='javascript:retrive_directory_usr("+'"'+data[0]+'"'+");'>" +data[1]+"</a></div>"); });
					}else if(data.DATA.length == 1){
						
						$.each(data.DATA,function(i,data){
												  
						var card = '<table border="1" cellpadding="0" cellspacing="0" style=" width: 406px; height: 118px; background: transparent url(http://www.utpa.edu/images/business-card.png) 0px 0px no-repeat !important; margin: 1px auto; color:#444"><tr><td style="width: 175px; margin: 0 0 0 8px; padding-top: 12px; vertical-align: top;"><div style="width: 166px; height: 61px; float: left; margin-left: 8px;"><span style="font-size: 14px; font-weight: bold;">'+data[1]+'</span><br /><span style="font-size: 10px; font-weight: normal; margin-top: 4px;">'+data[6]+'</span></div></td><td style="padding-top: 12px; margin-right: 6px;"><div class="vcard-rightcol" style="width: 210px; height: 92px; float: right; font-weight: normal; font-size: 11px;">'+data[4]+'<br />';
						
						if(data[10].length > 0){ card = card + data[10];}
						card = card + "<br />Dept. "+data[11];
						if(data[11] != data[8] ){ card = card + "<br />Office. " +data[8];}
						if(data[12].length > 0){ card = card + "<br />Fax. " +data[12];}
						
						var email = data[0];
						
						if(email == 'nelsen'){ email = 'president'}
						
						card = card + '<br /><a style="color:#444 !important;" href="mailto:' + email + '@utpa.edu">' +email+'@utpa.edu</a></div>'						
						
						$(".directory_response").html(card);
						
						});																	
					}else{
						$(".directory_response").html("<br />No user was found.");
					}	
					directory_state = 0;
        		  } });									
				}else{
					$(".directory_response").html(" ");
					if(query == ""){$(".directory_response").html('<div style="text-align:center; width: 100%;"><br /><br />Please type the name of the Faculty,<br /> Staff that you are looking for.</div>');} 
				}
			
										

		};
		
		function retrive_directory_incomplete(query){
				//alert(query);
				query = $.trim(query);
				if(currentQuery == query)
				{
					return;
					}
					currentQuery = query;
				if(query.length > 1 ){
					directory_state = 1;  
					$.ajax({ url: "http://www.utpa.edu/lib/json-content.cfc?method=DirectoryInc&key="+query+"&callback=?",dataType: "jsonp", success: 
        			function(data){
						
				if(currentQuery != query)
				{
					return;	// don't perform a new write if the query has changed since this was requested
					}						
						
					if(data.DATA.length > 1){
						$(".directory_response").html('<br />');
						$.each(data.DATA,function(i,data){ $(".directory_response").append("<div><a href='javascript:retrive_directory_usr("+'"'+data[0]+'"'+");'>" +data[1]+"</a></div>"); });
						if(data.DATA.length > 9)
						{
							$(".directory_response").append('<div style="padding-left:50px; line-height:20px; text-decoration:underline;"><a href="/directory/?results='+query+'">View complete List</a></div>')
						}
					}else if(data.DATA.length == 1){
						
						$.each(data.DATA,function(i,data){
												  
						var card = '<table border="1" cellpadding="0" cellspacing="0" style=" width: 406px; height: 118px; background: transparent url(http://www.utpa.edu/images/business-card.png) 0px 0px no-repeat !important; margin: 1px auto; color:#444"><tr><td style="width: 175px; margin: 0 0 0 8px; padding-top: 12px; vertical-align: top;"><div style="width: 166px; height: 61px; float: left; margin-left: 8px;"><span style="font-size: 14px; font-weight: bold;">'+data[1]+'</span><br /><span style="font-size: 10px; font-weight: normal; margin-top: 4px;">'+data[6]+'</span></div></td><td style="padding-top: 12px; margin-right: 6px;"><div style="width: 210px; height: 92px; float: right; font-weight: normal; font-size: 11px;">'+data[4]+'<br />';
						
						if(data[10].length > 0){ card = card + data[10];}
						card = card + "<br />Dept. "+data[11];
						if(data[11] != data[8] ){ card = card + "<br />Office. " +data[8];}
						if(data[12].length > 0){ card = card + "<br />Fax. " +data[12];}
						
						var email = data[0];
						
						if(email == 'nelsen'){ email = 'president'}
						
						card = card + '<br /><a style="color:#444" href="mailto:' + email + '@utpa.edu">' +email+'@utpa.edu</a></div>'
						
						$(".directory_response").html(card);
						
						});					
						
						
					}else{
						$(".directory_response").html("<br />No user was found.");
					}	
					directory_state = 0;
        		  } });
					
				
				}else{
					$(".directory_response").html(" ");
					if(query == ""){$(".directory_response").html('<div style="text-align:center; width: 100%;"><br /><br />Please type the name of the Faculty,<br /> Staff that you are looking for.</div>');} 
				}
		};
		
				function retrive_directory_usr(query){ 
				
		$.ajax({ url: "http://www.utpa.edu/lib/json-content.cfc?method=Directoryusr&key="+query+"&callback=?",dataType: "jsonp", success: function(data){
						 
						$.each(data.DATA,function(i,data){
															  
									var card = '<table border="1" cellpadding="0" cellspacing="0" style=" width: 406px; height: 118px; background: transparent url(http://www.utpa.edu/images/business-card.png) 0px 0px no-repeat !important; margin: 1px auto; color:#444"><tr><td style="width: 175px; margin: 0 0 0 8px; padding-top: 12px; vertical-align: top;"><div style="width: 166px; height: 61px; float: left; margin-left: 8px;"><span style="font-size: 14px; font-weight: bold;">'+data[1]+'</span><br /><span style="font-size: 10px; font-weight: normal; margin-top: 4px;">'+data[6]+'</span></div></td><td style="padding-top: 12px; margin-right: 6px;"><div style="width: 210px; height: 92px; float: right; font-weight: normal; font-size: 11px;">'+data[4]+'<br />';
									
									if(data[10].length > 0){ card = card + data[10];}
									card = card + "<br />Dept. "+data[11];
									if(data[11] != data[8] ){ card = card + "<br />Office. " +data[8];}
									if(data[12].length > 0){ card = card + "<br />Fax. " +data[12];}
									
									
									var email = data[0];
						
									if(email == 'nelsen'){ email = 'president'}
									
									card = card + '<br /><a style="color:#444" href="mailto:' + email + '@utpa.edu">' +email+'@utpa.edu</a></div>'
									
									
									
									$(".directory_response").html(card);
									
									});	
						
		} });			
	
	
		//$.get("http://www.utpa.edu/lib/directory.cfm", { usr: query }, function(data){ $(".directory_response").html(data);});		
  		
		};

		
		function retrive_siteindex(query){
								
				$.ajax({ url: "http://www.utpa.edu/lib/json-content.cfc?method=getIndex&key="+query+"&callback=?",dataType: "jsonp", success: 
							function(data){
								//alert(query);
								$("#content-slider ul").html("");
								$.each(data.DATA,function(i,data){ $("#content-slider ul").append("<li><a href='"+data[1]+"'>" +data[0]+"</a></li>"); });
								s = parseInt(document.getElementById('content-slider').offsetHeight)-100;
								st = (s/100);
								
							}
				});
				
				
			
				
  		};
		
		function utpacalendar(config){

				var cal = config.calendar || 'general';
				var f = config.firstday || '';
				var l = config.lastday || '';
				var c = config.count || 10;
								
				var desc = config.elements.desc || false;
				var date = config.elements.date || false;
				var place = config.elements.place || false;
				var location = config.elements.location || false;
				var links = config.elements.links || false;
				var fee = config.elements.fee || false;
				var contact = config.elements.contact || false;
				var line = '';
				//if(f != null && c != null){
				
				//}
				
				this.returndata = function(data){ //
						
						$.each(data.DATA,function(i,data){												
							
							line = line + '<li><div class="calendar-title"><a href="http://utpa.edu/calendar?id='+data[4]+'">'+data[9]+'</a></div>'; // Title LINK 
							 
							
							if(date){ 
								line = line + '<div class="calendar-date">';
							   
							    line = line + '<label class="calendar-start-date-label label" rel="calendar-start-date">Date:</label><div class="calendar-start-date">' + data[0] + '</div>'; 
								
								if(data[1] != '' && data[1] != null){ 
									line = line + '<label class="calendar-start-time-label label" rel="calendar-start-time">Time:</label><div class="calendar-start-time">' +  data[1]+ '</div>'; 
								}
								
								line = line + '<label class="calendar-end-date-label label" rel="calendar-end-date">Date:</label><div class="calendar-end-date">' + data[3] + '</div>';
							    
								if(data[2] != '' && data[2] != null){ 
										line = line + '<label class="calendar-end-time-label label" rel="calendar-end-time">Time:</label><div class="calendar-end-time">' + data[2]+ '</div>'; 
								}
								
								line = line + '</div>';
							
							}
							
							if(desc){ line = 
							line + '<label class="calendar-description-label label" rel="calendar-description">Description:</label><div class="calendar-description">' + 
							 data[11]+ '</div>'  }
							
							if(place && data[10] != ''){ line = line + '<label class="calendar-place-label label" rel="calendar-place">Place:</label><div class="calendar-place">' 
							+ data[10]+ '</div>'  }
												
							if(location && data[17] != ''){ line = line + '<label class="calendar-location-label label" rel="calendar-location">Location:</label><div class="calendar-location">'
							+ data[17]+ '</div>'  }
							
							if(links && data[7] != ''){ line = line + '<label class="calendar-link-label label" rel="calendar-link">URL:</label><div class="calendar-link"><a href="'+data[7]+'">' + data[7]+ '</a></div>'  }
							
							if(fee && data[6] != ''){ line = line + '<label class="calendar-fee-label label" rel="calendar-fee">Fee:</label><div class="calendar-fee">' + data[6]+ '</div>'  }
							
							if(contact && data[14] != ''){ line = line + '<label class="calendar-contact-label label" rel="calendar-contact">Calendar:</label><div class="calendar-contact">' + data[14]+ '</div>'  }
														
							line = line +'</li>';
						
						});
						
						
					$(config.object).append(line);
				}
				
				this.getData =function(_oFunction){
					$.ajax({ 
						  dataType: "json", async: false,
						  url: "http://www.utpa.edu/lib/json-content.cfc?method=utpacalendar&callback=?", 
						  data: {calendar: cal, fday: f.day, fmonth: f.month, fyear: f.year, lday: l.day, lmonth: l.month, lyear: l.year, count: c  } ,
						  success: _oFunction, 
						  error: function(data) { return 'error loading' },
						  complete: function(data){ }
						  })
				
			     }
				
				return this.getData(this.returndata);
				
			}
		
		
		function utpablog(config){
				var line = "";
				var _msBlogPath = config.blog;
				var _mnCount = config.count || 5;
				var short = config.short || false;
				var date = config.date || false;
				var content = config.content || false;
				var author = config.auhot || false;
				var element = config.element || '#blog';
				
				this.returndata = function(data){ //
							
				
						$.each(data.posts,function(i,data){				
							 				   
							line = line + '<li><a href="'+data['url']+'">'+data['title_plain']+'</a>';
							
							if(short){ line = line + '<p class="blog-post-desc">' + data['excerpt']+ '</p>'  }
							
							if(content){ line = line + '<p class="blog-post-contet">' + data['content']+ '</p>'  }
							
							if(date){ line = line + '<div class="blog-post-date">' + data['date']+ '</div>'  }
							
							if(author){ line = line + '<div class="blog-post-desc">' + data['author']+ '</div>'  }
														
							line = line +'</li>';
							
						});
					$(element).html(line);
				}
				
				this.getData =function(_oFunction){
					$.ajax({ 
						  dataType: "json", async: false,
						  url: "http://blogs.utpa.edu/"+_msBlogPath+"?json=get_recent_posts&callback=?", data: {count: _mnCount} ,
						  success: _oFunction, 
						  error: function(data) { return 'error loading' },
						  complete: function(data){ }
						  })
			     }
				
				return this.getData(this.returndata);
			}
		
		var s = 0;
		var st = (s/100);
		function scrollbarf(){
			        
					//var d = document.getElementById("content-slider");
					//alert('dd');
					//var s = 6000;
					s = parseInt(document.getElementById('content-slider').offsetHeight); 
					s = s - 100;
					 //var s = d.clientHeight;
					st = (s/100);

					var headerElem = $("#content-slider");

					
						//alert("DD");
						$("#slider-vertical").slider({
							orientation: "vertical",
							range: "min",
							min: 0,
							max: 100,
							value: 100,
							slide: function(event, ui) {
								 
								$("#content-slider").css("top",(s-ui.value*st)*-1);
							}
						});
					
						



					
			}
