// var retVal=-1;
var jobsDocPath = '/PRIJobDocs/';
var userAgent = navigator.userAgent;
var userAgentLC = navigator.userAgent.toLowerCase();
var iPhone=false;
var curDate = new Date();
/* See if this is what is not working in IE7/8
localStorage.lastVisit = curDate.getMonth() + 1 + '/' + curDate.getDate() + '/' + curDate.getFullYear();
localStorage.lastVisitFullDate = curDate;
*/
//--------
if(userAgentLC.indexOf('iphone') > -1)
{
	iPhone = true;
//	alert('You have and iPhone');
}
if (iPhone != true)
{
	// Use the line below to redirect non iPhone users
	//	window.location = 'http://www.hutten.us';
	// window.scrollTo(0,0);
	// resizeTo(320,600);
}
//
$(document).ready(function(){
	// establishDB();
	var thisPageURL = $(location).attr('href');
    if (thisPageURL.indexOf('/base/jobs/') > 0)
     {
	//	alert('document ready - URL: '+thisPageURL);
		loadPageContent(thisPageURL);
     }
});
function loadPageContent(url)
{
	var i = url.lastIndexOf('/');
	var docName = url.substring(i+1);
	// alert("docName="+docName);
	var newDocPath = jobsDocPath + docName;
    var element = ' #content';
  //  $('#dynamicContent').append('<h3>Dynamically Changed ' + newDocPath + '</h3>');
    $('#dynamicContent').load(newDocPath + element);
}
function errorHandler(transaction, error) {
    alert('Oops. Error was '+error.message+' (Code '+error.code+')');
    return true;
}
