jQuery.noConflict(); 
var jq_=jQuery;

var mljump='';  //my location jump (current location hash)
var currenthash = '';
var l_prefix = 'http://'+window.location.hostname;//"http://74.205.13.18";
var content_div = 'main';//id
var loading_div = 'margin';//id
var navigation_div = 'navigation';//id


// PageLoad function
// This function is called when:
// 1. after calling jq_.historyInit();
// 2. after calling jq_.historyLoad();
// 3. after pushing "Go Back" button of a browser
function pageload(hash) {
	// hash doesn't contain the first # character.
	if( previousPageLUrl == hash ) return; //no change (must be jump nav such as #faq.q1
	else if(typeof(expandSection)=='function')expandSection({href:(hash.substr(1)).replace('//','?')},0,1);
	//showLoadingScreen();
	//jq_("#"+content_div).load(hash + ".php?isAjaxRequest=true",'',onLoadedCallback);
	previousPageLUrl=hash;
}
//thse are both URL in HASH format (no .php?)...
var origionalPageUrl=''; //store the start page (blank initially to detect first visit)
var previousPageLUrl='';//another good one... helps us track (if on faq for example) if its unnecessary to reload since the major page has not changed (jump hash, not load hash)... previous page loaded url

function setCurrentPageURL(u){
	u=('/'+u).replace(l_prefix,'').replace('?','//');
	//u=escape(u);
	previousPageLUrl=u;
	if( jq_.historyCurrentHash == '#'+u )return;
	jq_.historyLoad(u);
	//window.location.hash=u;
}

jq_(document).ready(function(){
	
	var elem = document.getElementById('featureditems');
	if(elem && typeof(updateNavEvents)=='function') updateNavEvents(elem);

	// Initialize history plugin.
	// The callback is called at once by present location.hash. 
	jq_.historyInit(pageload);
	//setNewAjaxLinkClickEvents();
	
	});

//necessary functions
function openEFWindow(id){
window.open('emailfriend.asp?id='+id,'email_friend','menubar=no, scrollbars=no, width=400, height=400, directories=no,location=no,resizable=yes,status=no,toolbar=no')
}
function subformid(tid){
	var tform=document.getElementById('ectform'+tid);
	if(tform.onsubmit())tform.submit();
	return(false);
}
function formvalidator0(f){return true}
function formvalidator1(f){return true}
function formvalidator2(f){return true}
function formvalidator3(f){return true}
function formvalidator4(f){return true}
function formvalidator5(f){return true}
function formvalidator6(f){return true}
function formvalidator7(f){return true}
function formvalidator8(f){return true}

function toggleAdvancedSearch(){
	var a=document.getElementById('advancedsearch');
	if( a.style.display!="none" && a.style.display!='' ){
		a.style.display="none"
	}else{
		a.style.display="inline-table"
	}
}
