$(function(){

/*	DROP DOWN MENUS
------------------------------------------------------------------------------ */
	if(document.getElementById('m-league') && document.getElementById('m-online')){

		var mainNav = new Array($('#m-league'), $('#m-online'));	// main nav li's

		// proper function
		
		if($.browser.msie){
			for(i=0; i<=1; i++){
				$(mainNav[i]).hover(
					function(){
						var drop = $(this).find('ol');
						if(drop.length){
							if($('#header .h-menu ol:visible').length){
								$('#header .h-menu ol:visible').css({display: 'none'}, function(){
									$(drop).css('display', 'block');
								});
							}
							else{
								$(drop).css('display', 'block');
							}
						}
					},
					function(){
						$('#header .h-menu ol:visible').css('display', 'none');
					}
				);	// end "hover"
			}	// end "for"
		}	// end if msie
		
		else{
			for(i=0; i<=1; i++){
				$(mainNav[i]).hover(
					function(){
						var drop = $(this).find('ol');
						if(drop.length){
							if($('#header .h-menu ol:visible').length){
								$('#header .h-menu ol:visible').fadeOut(50, function(){
									$(drop).fadeIn(150);
								});
							}
							else{
								$(drop).fadeIn(150);
							}
						}
					},
					function(){
						$('#header .h-menu ol:visible').fadeOut(50);
					}
				);	// end "hover"
			}	// end "for"
		}	// end other browser

	}	// end Drop down menus "if"

/*	FOCUS / BLUR ON FORMS
------------------------------------------------------------------------------ */
		// define fields array
		var collect = document.getElementsByTagName('input');
		var fields = new Array();
		for(i=0; i<=collect.length; i++){
			fields[i] = collect[i];
		}
		// define values of fields
		var vals = new Array();
		for(i=0; i<=fields.length; i++){
			vals[i] = $(fields[i]).attr('value');
		}	
		// define indexOf() for IE
		if(!Array.indexOf){
			Array.prototype.indexOf = function(obj){
				for(i=0; i<=this.length; i++){
					if(this[i]==obj){
						return i;
					}
				}
				return -1;
			}
		}
		// functions
		for(i=0; i<=fields.length; i++){
			$(fields[i]).focus(function(){
				pos = fields.indexOf(this);
				if($(this).attr('value') == vals[pos]){
					if($(this).attr('type') != 'submit' && $(this).attr('type') != 'button'){
						$(this).attr('value', '');
					}
				}
			});
			$(fields[i]).blur(function(){
				pos = fields.indexOf(this);
				if($(this).attr('value') == ''){
					$(this).attr('value', vals[pos]);
				}
			});
		} // end form focus

/*	SEARCH BOX SUBMIT
------------------------------------------------------------------------------ */
	if(document.getElementById('search-box')){
		$('#search-box .submit').hide();
		$('#search-box input:text').click(function(){
			if($(this).attr('value') != ''){
				$('#search-box .submit').trigger('click');
			}
		});
	} // end search box submit

/*	LOST PASS FORM
------------------------------------------------------------------------------ */
	if($('#content-holder .lostpass form')){
		$('#content-holder .lostpass form label').hide();
	}

/*	HOME PES TV TITLE FIX
------------------------------------------------------------------------------ */
	if(document.getElementById('pes-tv')){ $('#pes-tv a').attr('title','') }

/*	PES TV HOVER EFFECT
------------------------------------------------------------------------------ */
/*
	if(document.getElementById('boxes')){
		var conts = document.getElementById('boxes').getElementsByTagName('ul');
		$(conts).each(function(){
			$('li', conts).hover(
				function(){ $(this).addClass('hov'); },
				function(){ $(this).removeClass('hov'); }
			);
		});
	}
*/

}); // end main function