/* javascript fiiles for CZAR site
*
* October 2008, Steve Fleischer
*
*/


/* ADMIN gets the id of the body tag, appends ".php" and searches the menu to see which link to highlight */
  $(document).ready(function(){
		var getpage;
		getpage = $('body')[0]['id'] + '.php';
     $('#adminmenu a[@href$="' + getpage + '"]').attr('class', 'selected');	
 });	
  
/* PUBLIC gets the id of the body tag, appends ".php" and searches the menu to see which link to highlight */
  $(document).ready(function(){
		var getpage;
		getpage = $('body')[0]['id'] + '.php';
     $('#mainmenu a[@href$="' + getpage + '"]').attr('class', 'selected');	
 });  
  
/* determines filename and sets the correct menu item as selected (FOR ADMIN SECTION ONLY)

 $(function(){
   var path = location.pathname;
	var splitpath = new Array();
	splitpath = path.split("admin/"); 
	 thisfilename = splitpath[1]; 
   if ( thisfilename )
     $('#adminmenu a[@href$="' + thisfilename + '"]').attr('class', 'selected');
 });   */

 /* determines filename and sets the correct menu item as selected (FOR PUBLIC SECTION ONLY) */

 $(function(){
   var path = location.pathname;
	var splitpath = new Array();
	splitpath = path.split("/"); 
	 thisfilename = splitpath[2]; 
   if ( thisfilename )
     $('#mainmenu a[@href$="' + thisfilename + '"]').attr('class', 'selected');
 }); 
 
 /*  stripes a table with an id listTable - alternate style is .alt; mouseoverstyle  is .over */
 
  $(document).ready(function(){
   $("#listTable tr").mouseover(function(){$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");});
   $(".#listTable tr:even").addClass("alt");
 });
  
 /*  stripes a table with an class listingTable - alternate style is .alt; mouseoverstyle  is .over */
 
  $(document).ready(function(){
   $(".listingTable tr").mouseover(function(){$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");});
   $(".listingTable tr:even").addClass("alt");
 }); 
  
 /*  stripes a table with an id formTable - alternate style is .alt */
 
  $(document).ready(function(){
   $("#formTable tr:even").addClass("alt");
 });   
  
  /* adds/removes a class to form inputs and textareas */
  
  $(document).ready(function(){
	$("input").focus(function() {
		$(this).addClass("curFocus")
	});
	$("input").blur(function() {
		$(this).removeClass("curFocus")
	});
	$("textarea").focus(function() {
		$(this).addClass("curFocus")
	});
	$("textarea").blur(function() {
		$(this).removeClass("curFocus")
	});	
});
  
 /* TEST */ 
   $(document).ready(function(){
   $(".#tblDetails tr:even").addClass("alt");
 }); 