$.noConflict();
jQuery(document).ready(function($){
$(document).ready(function(){
	
			// add last-child class to footnav to remove border
			
			$('.topnav li a').last().addClass("last-child");	
			
			$('.footnav li').first().next().next().next().addClass("last-child");	
			
			$('.footnav li').last().addClass("last-child");	

//Email Popup
$('#email-form-border').hide();

$('#updated h4').click(function(){
	$('#email-form-border').slideToggle("fast");
	return false;
})

$('#email-form-close').click(function(){
	$('#email-form-border').slideToggle("fast");
	return false;
})

			
			
//Product Behaviors
	$('.product-popup-details').hide();
	
	$('tr.product-image').click(function(){
		$(this).siblings('.product-popup-details').slideToggle("fast");
	})
	
	$('tr.product-title').click(function(){
		$(this).siblings('.product-popup-details').slideToggle("fast");
	})
	
	$('.popup-close-btn').click(function(){
		$(this).parent('.product-popup-details').slideToggle("fast");
		return false;
	})
	
	//if( !($(event.target).parents(".indiv-product")[0]) ){
	//	if( $('.product-popup-details').is(':visible') ){
	//		$('.product-popup-details').slideToggle("fast");
	//	}
	//} 
	
	
	
//Church Structure Tooltip Stuff

$.fn.qtip.styles.globalstyle = {
	color:'#8e8d74',
	width:600,
	padding:20,
	tip: {
		corner:'topMiddle',
		color:'#fff',
		size: {
			x:30,
			y:10
		}
	}
}

$('#mm-dev-staff[title]').qtip({
		show:{
			when: {
				event:'mouseover'
			},
			effect: {
				type:'slide',
				length:150
			}			
		},
		hide: {
			when: {
				event:'mouseout'
			},
			effect: {
				type:'slide',
				length:150
			},
		},
		style:{
			width:535,
			tip: {
				corner:'leftMiddle',
				color:'#fff',
				size: {
					x:10,
					y:30
				}
			},
			name:'globalstyle'
		},
		position: {
			corner: {
				target: 'rightMiddle',
				tooltip: 'leftMiddle'
			}
		}
})

$('#staff-champion[title]').qtip({
		show:{
			when: {
				event:'mouseover'
			},
			effect: {
				type:'slide',
				length:150
			}			
		},
		hide: {
			when: {
				event:'mouseout'
			},
			effect: {
				type:'slide',
				length:150
			},
		},
		style:'globalstyle',
		position: {
			corner: {
				target: 'bottomMiddle',
				tooltip: 'topMiddle'
			}
		}
})

$('#ministry-coordinators[title]').qtip({
		show:{
			when: {
				event:'mouseover'
			},
			effect: {
				type:'slide',
				length:150
			}			
		},
		hide: {
			when: {
				event:'mouseout'
			},
			effect: {
				type:'slide',
				length:150
			},
		},
		style:'globalstyle',
		position: {
			corner: {
				target: 'bottomMiddle',
				tooltip: 'topMiddle'
			}
		}
})

$('#prayer-team[title]').qtip({
		show:{
			when: {
				event:'mouseover'
			},
			effect: {
				type:'slide',
				length:150
			}			
		},
		hide: {
			when: {
				event:'mouseout'
			},
			effect: {
				type:'slide',
				length:150
			},
		},
		style:{
			width:535,
			tip: {
				corner:'rightMiddle',
				color:'#fff',
				size: {
					x:10,
					y:30
				}
			},
			name:'globalstyle'
		},
		position: {
			corner: {
				target: 'leftMiddle',
				tooltip: 'rightMiddle'
			}
		}
})

$('#support-coordinator[title]').qtip({
		show:{
			when: {
				event:'mouseover'
			},
			effect: {
				type:'slide',
				length:150
			}			
		},
		hide: {
			when: {
				event:'mouseout'
			},
			effect: {
				type:'slide',
				length:150
			},
		},
		style:{
			tip: {
				corner:'bottomMiddle',
				color:'#fff',
				size: {
					x:30,
					y:10
				}
			},
			name:'globalstyle'
		},
		position: {
			corner: {
				target: 'topMiddle',
				tooltip: 'bottomMiddle'
			}
		}
})

$('#mentor-icons[title]').qtip({
		show:{
			when: {
				event:'mouseover'
			},
			effect: {
				type:'slide',
				length:150
			}			
		},
		hide: {
			when: {
				event:'mouseout'
			},
			effect: {
				type:'slide',
				length:150
			},
		},
		style:{
			width:640,
			tip: {
				corner:'bottomMiddle',
				color:'#fff',
				size: {
					x:30,
					y:10
				}
			},
			name:'globalstyle'
		},
		position: {
			corner: {
				target: 'topMiddle',
				tooltip: 'bottomMiddle'
			}
		}
})

$('#mentee-icons[title]').qtip({
		show:{
			when: {
				event:'mouseover'
			},
			effect: {
				type:'slide',
				length:150
			}			
		},
		hide: {
			when: {
				event:'mouseout'
			},
			effect: {
				type:'slide',
				length:150
			},
		},
		style:{
			width:640,
			tip: {
				corner:'bottomMiddle',
				color:'#fff',
				size: {
					x:30,
					y:10
				}
			},
			name:'globalstyle'
		},
		position: {
			corner: {
				target: 'topMiddle',
				tooltip: 'bottomMiddle'
			}
		}
})



//Resources Tooltip Script

$('#mentor-journal[title]').qtip({
		show:{
			when: {
				event:'mouseover'
			},
			effect: {
				type:'slide',
				length:150
			}			
		},
		hide: {
			when: {
				event:'mouseout'
			},
			effect: {
				type:'slide',
				length:150
			},
		},
		style:{
			width:440,
			tip: {
				corner:'bottomLeft',
				color:'#fff',
				size: {
					x:30,
					y:10
				}
			},
			name:'globalstyle'
		},
		position: {
			corner: {
				target: 'topMiddle',
				tooltip: 'bottomLeft'
			}
		}
})

$('#resource-guide[title]').qtip({
		show:{
			when: {
				event:'mouseover'
			},
			effect: {
				type:'slide',
				length:150
			}			
		},
		hide: {
			when: {
				event:'mouseout'
			},
			effect: {
				type:'slide',
				length:150
			},
		},
		style:{
			width:350,
			tip: {
				corner:'bottomMiddle',
				color:'#fff',
				size: {
					x:30,
					y:10
				}
			},
			name:'globalstyle'
		},
		position: {
			corner: {
				target: 'topMiddle',
				tooltip: 'bottomMiddle'
			}
		}
})

$('#devoted-study-guide[title]').qtip({
		show:{
			when: {
				event:'mouseover'
			},
			effect: {
				type:'slide',
				length:150
			}			
		},
		hide: {
			when: {
				event:'mouseout'
			},
			effect: {
				type:'slide',
				length:150
			},
		},
		style:{
			width:340,
			tip: {
				corner:'bottomMiddle',
				color:'#fff',
				size: {
					x:30,
					y:10
				}
			},
			name:'globalstyle'
		},
		position: {
			corner: {
				target: 'topMiddle',
				tooltip: 'bottomMiddle'
			}
		}
})

$('#mentee-journal[title]').qtip({
		show:{
			when: {
				event:'mouseover'
			},
			effect: {
				type:'slide',
				length:150
			}			
		},
		hide: {
			when: {
				event:'mouseout'
			},
			effect: {
				type:'slide',
				length:150
			},
		},
		style:{
			width:440,
			tip: {
				corner:'bottomRight',
				color:'#fff',
				size: {
					x:30,
					y:10
				}
			},
			name:'globalstyle'
		},
		position: {
			corner: {
				target: 'topMiddle',
				tooltip: 'bottomRight'
			}
		}
})

$('#communication-hats[title]').qtip({
		show:{
			when: {
				event:'mouseover'
			},
			effect: {
				type:'slide',
				length:150
			}			
		},
		hide: {
			when: {
				event:'mouseout'
			},
			effect: {
				type:'slide',
				length:150
			},
		},
		style:{
			width:540,
			tip: {
				corner:'bottomMiddle',
				color:'#fff',
				size: {
					x:30,
					y:10
				}
			},
			name:'globalstyle'
		},
		position: {
			corner: {
				target: 'topMiddle',
				tooltip: 'bottomMiddle'
			}
		}
})
			
})

});

