//------------------------------------------
//function to load Login Details
//Setup document, bind ajax requests

//Contenders ready...

$(document).ready(function(){

$('#LoginSection').html('<img src="../imagesv3/ajax-loader.gif" style="position:relative; top:60px;left:190px">');

//assign all CGI params to page request DEV NOTE: could this be changed to bound form event instead?
	myURL = $("[name=book]").val()+'.dll?page=Registration.pgLogin';
		
	$.ajax({
	url: myURL,
	cache: false,
	success: function(html){
		if(html.indexOf(page)>-1)
		{
			html = "<p>An error has occured loading content...</p>";
		}
		else if(html.indexOf('Registration.pgPageLogin')!=-1){
			document.forms[0].submit();
		}
		else
		{
			var ind = html.toUpperCase().indexOf('FORM')-1;
			var ind2 = html.toUpperCase().lastIndexOf('/FORM>')+6;
			myhtml = html.substring(ind,ind2);
		}
	$('#LoginSection').html(myhtml);

		}
	});

});
