var fullURL = getFullURL();
var jsPath = '/ekmps/shops/vickydavies/resources/Other/';
var showPageQuery = '?function=WEBPAGE';//had to seperate because & doesn't validate

var resultArr = getIsHomeAndPageURL();
var isHome  = resultArr[0];
var pageURL = resultArr[1];
var showIntro = resultArr[2];


writeJSToPage( jsPath + 'jquery-1.5.1.min.js' );

if( !showIntro )
{
	writeJSToPage( jsPath + 'nav-html-generator.js' );
	writeJSToPage( jsPath + 'animate-side-nav.js' );
}


if( isHome   ||   fullURL.indexOf( '-p.asp' ) != -1 )  // home or projects pages
{
	if( !showIntro )
	{
		writeJSToPage( jsPath + 'cloud-zoom.1.0.2.min.js' );
		writeJSToPage( jsPath + 'image-gallery-html-generator.js' );
	}
}

if( isHome )  // home page
{
	if( showIntro )
	{
		writeJSToPage( jsPath + 'intro-page.js' );
	}
	else
	{
		writeJSToPage( '/ekmps/designs/templates/46000/js/jquery.fadeshow.js' );
		writeJSToPage( jsPath + 'main-page-gallery.js' );
	}
	
	writeJSToPage( jsPath + 'main-page.js' );
}


if( fullURL.indexOf( '-p.asp' ) != -1 )  // projects pages
{
	writeJSToPage( jsPath + 'project-page.js');
}


if( fullURL.indexOf( '-c.asp' ) != -1 )  // projects pages
{
	writeJSToPage( jsPath + 'category-page.js');
}


if( fullURL.indexOf( 'page=12' ) != -1 )  // dev commissions page
{
	writeJSToPage( jsPath + 'commissions-page.js');
	writeJSToPage( jsPath + 'image-gallery-html-generator.js' );
}


if( pageURL.indexOf(showPageQuery) != -1   &&   pageURL.indexOf('page=13') != -1 ) // wholesale
{
	writeJSToPage( 'http://www.vickydavies.co.uk/wp-includes/js/tw-sack.js?ver=1.6.1' );
	writeJSToPage( jsPath + 'wholesale.js' );
	writeJSToPage( 'http://www.vickydavies.co.uk/wp-content/plugins/ajax-login-widget/ajax_login_widget.js' );
}

