var VT_scriptPath = '/images/11327//custom/js/';

function VT_bodyOnLoad() {
	if (document.getElementById) { // Function supported.
		if (document.getElementById('op_preview')) { // On listing page.
			LazyLoad.js([
				VT_scriptPath + 'jquery-1.4.2.min.js', // Load jQuery framework.
				VT_scriptPath + 'VT_addListingDetails2.js', // Load function to add listing details to listing 'Preview' tab.
				VT_scriptPath + 'VT_openWindowCentered1.js', // Load function to make links open in new, centered windows.
				VT_scriptPath + 'VT_openVTourInNew2.js' // Load function to get v-tour iframe URL and convert tab link to open in new window.
				], VT_lazyLoaded // Function to run when functions loaded.
			);
		}
	}
}

function VT_lazyLoaded() {
	if ($('#op_preview').hasClass('selected')) { // 'Preview' tab is currently selected.
		VT_addListingDetails(); // Run function to add listing details to listing 'Preview' tab.
	}
	
	if (!$('#op_videoTour').hasClass('selected')) { // 'Visual Tour' tab is not currently selected.
		VT_openVTourInNew(); // Run function to get v-tour iframe URL and convert tab link to open in new window.
	}
	
	if (!$('#op_bookaShowing').hasClass('selected')) { // 'Book Showing' tab is not currently selected.
		// Modify the "Comments:" caption in the "Property Information Request Form".
		var commentsTd = $('textarea[name="io_contact_comments"]').closest('td').prev(); // Get TD with "Comments:" caption.
		commentsTd.attr('valign', 'top'); // Align content at top.
		commentsTd.find('p:contains("Comments:")').html('<b>I Need to Know:</b>'); // Replace the existing caption.
	}
}

window.onload = VT_bodyOnLoad;

