////
// Document Ready
//
$(document).ready(function() {
	
	
	
	////
	// form hint for EOI
	//
	$('#eoi input.text').focus(function() {
		//console.log('tik');
		if($(this).attr('value')=='enter e-mail')
		{
			$(this).attr('value', '');
			$(this).removeClass('init');
		}
		if($(this).attr('value')=='enter full name')
		{
			$(this).attr('value', '');
			$(this).removeClass('init');
		}
		
	});
	
	$('#eoi input.text').blur(function() {
		//console.log('tok');
		if($(this).attr('value')=='')
		{	
			if($(this).attr('name')=='email'){
				$(this).attr('value', 'enter e-mail');
			}
			
			if($(this).attr('name')=='name'){
				$(this).attr('value', 'enter full name');
			}
			
			$(this).addClass('init');
		}
		
	});
	
	
	////
	// validate EOI
	//
	$("#eoi form").validate();
	
	
	////
	// add '_blank' to external links
	//
	$('a[href^="http"]:not([href*="'+location.hostname+'"])').each(function() {
		var orgTitle = $(this).attr("title");
		
		$(this).attr({'target': "_blank", 'title': orgTitle+" [new window]"});
		$(this).append('<span class="out">^</span>');
	});
	
	////
	// add 'target="_blank"' to links to PDFs
	//
	$('a[href$=".pdf"]').each(function() {
		var orgTitle = $(this).attr("title");
		
		$(this).attr({'target': "_blank", 'title': orgTitle+" [.PDF]"});
		$(this).addClass('pdf');
	});
	
	
	////
	// hide and reveal div more text ei. long speaker bios
	$('.readmore').hide();
	
	$('.speakerbox .more').click(function() {
		$(this).parents().children('.readmore').slideToggle('fast');
		$(this).slideToggle('fast');
		});
		
		
	$('.speakerbox .hidebtn').click(function() {
		$(this).parents().children('.readmore').slideToggle('fast');
		$(this).parents('.speakerbox').children().children('.more').slideToggle('fast');
		});
		
		
		
		
		/////
		// google maps
		
//		$('#map_canvas').goMap({ 
//		        markers: [{  
//		                    address: 'Melbourne Cricket Ground, Victoria, Australia',
//		                    title: 'Melbourne Cricket Ground',
//                            icon: 'pixels/Pin-Blue.png',
//		                    html: { 
//	                            content: '<strong>Melbourne Cricket Ground</strong> (MCG)<br />The Conference Venue',
//	                            popup:true
//                            }
//		                },{ 
//		                    address: '133 Jolimont Rd East Melbourne VIC 3002, Australia', 
//		                    title: 'Mantra On Jolimont',
//                            icon: 'pixels/Accommodation.png',
//		                    html: '<strong>Mantra On Jolimont</strong><br /><a href="http://www.mantraonjolimont.com.au/">www.mantraonjolimont.com.au</a>'
//		                },{
//		                    address: '48 Wellington Parade East Melbourne VIC 3002, Australia', 
//		                    title: 'Quest East Melbourne',
//		                    icon: 'pixels/Accommodation.png',
//		                    html: '<strong>Quest East Melbourne</strong><br /><a href="http://www.questeastmelbourne.com.au/">www.questeastmelbourne.com.au</a>'
//		                },{
//		                    address: '192 Wellington Parade Melbourne VIC 3002, Australia',
//		                    title: 'Hilton on the Park Melbourne',
//		                    icon: 'pixels/Accommodation.png',
//		                    html: '<strong>Hilton on the Park Melbourne</strong><br /><a href="http://www1.hilton.com/en_US/hi/hotel/MELHITW-Hilton-On-The-Park-Melbourne/index.do">Hilton on the Park Melbourne</a>' 
//		                },{
//		                	address: 'Yarra Park Melbourne Victoria 3000, Australia',
//		                	title: 'Yarra Park (Parking)',
//		                	icon: 'pixels/parking_icon2.png',
//		                	html: '<strong>Yarra Park</strong> (Parking)'
//		                }], 
//		                
//		        zoom: 15, 
//		        maptype: 'ROADMAP'
//		    });
//		
});
