// <![CDATA[
/******************************************************************************************
* Module: siworks.loadpopups.js
* Version: 1.0
* Created: 20090414
* Description: We are now going to further extend the DOM via prototype.js much
* more effective way of doing things, we bind everything together this way
* @copyright		2009 SI-Works, All rights reserved
* @author			$Author: peter $
* @email			<support@siworks.co.za>
* @link				http://www.siworks.co.za
* @version			$Revision: 148 $
* $Id: siworks.entention.js 148 2009-03-19 08:36:42Z peter $
* 
* Copyright:  SI Works internet var year = new Date(); year.getFullYear();
* 
* Email:  support@siworks.co.za
* Author: Greg Shiers, Jarratt Ingram
******************************************************************************************/
/**
* These methods add custom effects through the why trade in website
**/

document.observe ( "dom:loaded" , function ( e ) {
	var thepath = location.pathname.split('/')[1];
	var newpath = location.pathname;
	if (thepath == 'about_why_trade_in') {
		if ( !$('dialog') ) {
			Element.createDialogWindow( 532 , 'About us', '/about_why_trade_in/ajax/' );
		}
	}

	if (newpath == '/index.php') {
		if ( !$('dialog') ) {
			Element.createDialogWindow( 532 , 'Hot news & Testimonials', '/index.php'+location.search );
		}
	}
	if (thepath == 'hot_news') {
		if ( !$('dialog') ) {
			Element.createDialogWindow( 532 , 'Hot news & Testimonials', '/hot_news/ajax/' );
		}
	}
	if (thepath == 'view_vehicle') {
		if ( !$('dialog') ) {
			Element.createDialogWindow( 724 , 'Make an offer', location.pathname+'/ajax/' );
		}
	}
	if (thepath == 'seller_tips') {
		if ( !$('dialog') ) {
			Element.createDialogWindow( 532 , 'Seller tips', '/seller_tips/ajax/' );
		}
	}
	if (thepath == 'forgot_password') {
		if ( !$('dialog') ) {
			Element.createDialogWindow( 532 , 'Forgot password', '/forgot_password/ajax/' );
		}
	}
	if (thepath == 'vehicle') {
		if ( !$('dialog') ) {
			Element.createDialogWindow( 724 , 'List your vehicle', '/vehicle/ajax/' );
		}
	}
	if (thepath == 'verify') {
		if ( !$('dialog') ) {
			//alert(location.pathname);
		}
	}

//	if (thepath == 'tradein') {
//		if ( !$('dialog') ) {
//			Element.createDialogWindow( 724 , 'List your vehicle', '/vehicle/ajax/' );
//		}
//	}
	if (thepath == 'whytradein_insurance') {
		if ( !$('dialog') ) {
			Element.createDialogWindow( 734 , 'whytradeInsurance', '/whytradein_insurance/ajax/' );
		}
	}
	if (thepath == 'private_vehicle_finance') {
		if ( !$('dialog') ) {
			Element.createDialogWindow( 734 , 'Private Vehicle Finance', '/private_vehicle_finance/ajax//' );
		}
	}
	if (thepath == 'register') {
		if ( !$('dialog') ) {
			Element.createDialogWindow( 538 , 'Dealer registration', '/register/ajax/' );
		}
	}
	if (thepath == 'contact') {
		if ( !$('dialog') ) {
			Element.createDialogWindow( 357 , 'Contact us', '/contact/ajax/' );
		}
	}
})
// ]]>

