jQuery.noConflict();
jQuery(document).ready(function(){
	
	/* start  ---   videolink*/
	
	jQuery('.videolink').hover(
	  function () {
			var href = jQuery(this).attr('href');
			jQuery("a#player").attr('href', href);// "http://vod01.netdna.com/vod/demo.flowplayer/flowplayer-700.flv"
			
			var player; 
			var mydomain=window.location.hostname;

			if(mydomain == 'localhost'){
				player = jQuery("a#player").flowplayer("/golfclub/web/js/flowplayer-3.2.2.swf");
			}else{
				player = jQuery("a#player").flowplayer("/js/flowplayer-3.2.2.swf");
			}
			jQuery("a[rel]").overlay({
				
				effect: 'apple',
			
				onLoad: function() {
					player.load();
				},
				onClose: function() {
					player.unload();
				},
				expose: {
					color: '#000',
					loadSpeed: 200,
					opacity: 0.5
				},
				closeOnClick: true

			});
			
	  },
	  function () {
	    //$(this).removeClass("hover");
	  }
	);
	jQuery('.videolink').click(function(){
		
		var href = jQuery(this).attr('href');
		jQuery("a#player").attr('href', href);// "http://vod01.netdna.com/vod/demo.flowplayer/flowplayer-700.flv"
		
		var player; 
		var mydomain=window.location.hostname;

		if(mydomain == 'localhost'){
			player = jQuery("a#player").flowplayer("/golfclub/web/js/flowplayer-3.2.2.swf");
		}else{
			player = jQuery("a#player").flowplayer("/js/flowplayer-3.2.2.swf");
		}
		jQuery("a[rel]").overlay({
			
			effect: 'apple',
		
			onLoad: function() {
				player.load();
			},
			onClose: function() {
				player.unload();
			},
			expose: {
				color: '#000',
				loadSpeed: 200,
				opacity: 0.5
			},
			closeOnClick: true

		});
	});
	
	
	
	
	/* end  ---   videolink*/
	
	
	jQuery('.webcam').hover(
	function (e) {
		jQuery('.tooltip').css({ 'display': 'block' });
		//alert('hjo');
	},
	function () {
		jQuery('.tooltip').css({ 'display': 'none' });
		//jQuery(this).removeClass("hover");
	});
	
	
	jQuery('.webcam').mousemove(function(e){
		//if (jQuery.browser.msie) {
		//	jQuery('.tooltip').css({ 'left': e.pageX+10, 'top': e.pageY-20});
		//}else{
			jQuery('.tooltip').css({ 'left': e.pageX+15, 'top': e.pageY-20});
		//}
	});
	
	jQuery('.webcam').click(function() {
		if(jQuery('.tooltip').hasClass('tooltip_play')){
			jQuery('.tooltip').addClass('tooltip_pause').removeClass('tooltip_play');
		}else{
			jQuery('.tooltip').addClass('tooltip_play').removeClass('tooltip_pause');
		}
	});

	
	var highlight_string = jQuery.url.param('query');
	var highlight_input = jQuery('#searchtext').val();
	//box first_box single full
	//blockr article
	// highlight in articles
	if(highlight_string){
		jQuery('.blockr').highlight(highlight_string);
	}else{
		if(highlight_input){
			jQuery('.blockr').highlight(highlight_input);
		}
	}


	// removing link in left calendar
/*	elem = jQuery('.notlink');
	
	jQuery('.notlink').each(function(){
		if (!elem.hasClass ('b')) {
		    var $t = jQuery(this);
		    $t.after($t.text());
		    $t.remove();
		}
	});
	*/
	// removing link in main calendar
	jQuery('.calend_tab a[href*="gameContent"]').addClass('badlink');
	jQuery('a.badlink').each(function(){
		elm = jQuery(this);
		if (elm.hasClass ('duple')) {
			jQuery(this).addClass('badlinkjs');
		}else{
			var $a = jQuery(this);
		    $a.after('<span>'+$a.text()+'</span>');
		    $a.remove();
		}

	});
	
	
	jQuery('.badlinkjs').click(function() {
		return false;
	});
	
	
	// hiding tr if tournament already past, but we have no results
	jQuery('span.hide_tr').parent().parent().remove();
	
	

});