var px ="px";
var content1_index = 0;
var content2_index = 0;
var pagecount_index = 0;
var header_index = 0;

function ajaxManager()
	{
	var args = ajaxManager.arguments;
	var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP"): new XMLHttpRequest();
	
	switch (args[0])
		{
		case "array_setup":
			content1Array = new Array();
			content1Array[0] = "leatherhandbags.php";
			break;
		case "load_page":
			if (x) {
				x.onreadystatechange = function() {
					if (x.readyState == 4 && x.status == 200) {
						el = document.getElementById(args[2]);
						el.innerHTML = x.responseText;
					}
				}
				x.open("POST", args[1], true);
				x.send(null);
			}
			break;
		case "load_js":
			if (x) {
				x.onreadystatechange = function() {
					if (x.readyState == 4 && x.status == 200) {
						var getheadTag = document.getElementsByTagName('head')[0];
						setjs = document.createElement('script');
						setjs.setAttribute('type', 'text/javascript');
						getheadTag.appendChild(setjs);
						setjs.text = x.responseText;
					}
				}
				x.open("POST", args[1], true);
				x.send(null);
			}
			break;
		case "display_info":
			document.getElementById(args[2]).innerHTML = args[1];		
			break;

		case "start_up":
			ajaxManager('array_setup');
			ajaxManager('load_page', content1Array[content1_index], 'contentColumn');
			break;
		}
	}
	
function loadContent(dir) {
	var contentVariableThing = dir ;
	ajaxManager('load_page', contentVariableThing,'contentColumn');
}

function loadTitle(dir) {
	ajaxManager('load_page', dir, 'titleArea');
}

function loadPrice(dir) {
	ajaxManager('load_page', dir, 'priceArea');
}
function changeColor(dir) {
	ajaxManager('load_page', dir, 'paypalInformation');
}

function popUp(strURL,strType,strHeight,strWidth) {
	var strOptions="";
	if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
	if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
	if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
	window.open(strURL, 'newWin', strOptions);
	newWin.focus();
}

function categorySwitcher(form){
	var URL = document.category.sections.options[document.category.sections.selectedIndex].value;
	window.location.href = URL ;
}

function categorySwitcher2(categoriesyay){
	var URL = "/cms/action/edit_category.php?" + categoriesyay ;
	window.location.href = URL ;
}