// FORMS
/*function initializeSearch(){
	Event.observe('formSearch','submit',submitSearch);
}

function submitSearch(event) {
	Event.stop(event);
	location.href = "index.php#div=content&page=srclist&ftype=3&srcval=" + document.getElementById('srcval').value;
	document.getElementById('srcval').value = "";
}
*/
if (!window.loadPage){
	function loadPage() {
		new Ajax.Request(
						 'lib/clientFunc.php?'+currentHash,
			{ method: 'get',
				onComplete: function(xhr){
					var xmldoc = xhr.responseText;
					var parsed = xmldoc.split(String.fromCharCode(30), 2)
					var destDiv = document.getElementById(parsed[0]);
					
					window.scroll(0,0);
					destDiv.innerHTML = parsed[1];
				}
			}
		);
	}}
	
$(function() {
	// Use this example, or...
	//$('a[@rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
	// This, or...
	$('#viewstyles a').lightBox(); // Select all links in object with gallery ID
	// This, or...
	//$('a.lightbox').lightBox(); // Select all links with lightbox class
	// This, or...
	//$('a').lightBox(); // Select all links in the page
	// ... The possibility are many. Use your creative or choose one in the examples above
});

var defaultdiv='content';
function setLinks() {
	//store
	prepareLinks("nav","content");
	prepareLinks("subnav","content");
	prepareLinks("storePolicy","content");
	prepareLinks("formItem","content");
	prepareLinks("relitemlink","content");
	prepareLinks("category_menu","content");
	prepareLinks("items_menu","content");
	prepareLinks("smCart","content");
	prepareLinks("minicart","content");
	prepareLinks("fullcart","content");
	prepareLinks("lp_instruct","content");
	prepareLinks("ftr_info","content");
	prepareLinks("registerFooter","content");
	//prepareForm("formItem","smCart","modules/shop/cart.php");
	prepareForm("formItem","minicartContainer","modules/shop/minicart.php");
	prepareForm("registerform","content","modules/shop/fullcart.php");
	prepareForm("accountform","content","modules/shop/account.php");
	prepareForm("editshipping","content","modules/shop/fullcart.php");
	//prepareFormClass("content","editcoupons","content","modules/shop/fullcart.php");
	prepareFormClass("content","formRemove","content","modules/shop/fullcart.php");
	$('#viewstyles a').lightBox();
	//prepareForm("formSearch","content","search.php");
	setInterval('checkHash()', 250);
}

function toggle_sw(id, checkbox, status){
	var obj=document.getElementById(id);
	status=(checkbox.checked==status) ?  0:1;
	if(status){
		//alert(obj.nodeName);
		obj.style.display="none";
		obj.style.visibility="hidden";
	}else{
		obj.style.display="block";
		obj.style.visibility="visible";
	}
}
function ajaxPreloadStart(){
}
function ajaxPreloadStop(){
}
function postInit(){
}
function runBefore_prepareFormClass(){
}
function runBefore_prepareFormClassAuto(){
}

function runBeforeContentLoad(id){
}

function runAfterContentLoad(id){
}
