// #####################################################################
// defines the browser DOM
// #####################################################################

userAgent = navigator.userAgent;
var NN=0;
var IE=0;
var DOM=0;
if (userAgent.search('MSIE')>=0) {
	IE=1;
} else {
	NN = 1; 
	if (parseInt(navigator.appVersion)>4) {
  		NN=0;IE=1;DOM=1;
	};
};

// #####################################################################
// makes a hidden div layer visible
// #####################################################################

var openDiv = '';

function showMe(div) {
	if (openDiv) {
		hideMe(openDiv);
	}
	openDiv = div;
	if (DOM) {
		document.getElementById(div).style.visibility = 'visible';
		document.getElementById(div).style.display = 'block';
	} else if (IE) {
		document.all[div].style.visibility = 'visible';
		document.all[div].style.display = 'block';
	} else if (NN) {
	    document.div.visibility = 'show';
		document.div.display = 'block';
	}
} // end function
	
// #####################################################################
// hides a visible div layer
// ####################################################################
function hideMe(div) {
	if (DOM) {
		document.getElementById(div).style.visibility = 'hidden';
		document.getElementById(div).style.display = 'none';
	} else if (IE) {
		document.all[div].style.visibility = 'hidden';
		document.all[div].style.display = 'none';
	} else if (NN) {
		document.div.visibility = 'hide';
		document.div.display = 'none';
	}
} // end function



// #####################################################################
// highlights the active table row
// #####################################################################
function clrRow(src, newColor) {
	src.bgColor = newColor;
}

function showOrders(URL) {
	window.location = URL;
}

function thisEmpty() {

}



function thisPopup(URL, name, left, top, width, height, scrollbars) {
	var standardSetting = 'toolbar=0, location=0, directories=0, status=0, scrollbars=' + scrollbars;
	var customSetting = 'menubar=1, resizable=1, width=' + width + ', height=' + height;
	var positioning = 'left=' + left + ', top =' + top;
	// create window
	closePopup();
	oxl_win = window.open(URL, name, + '\'' + standardSetting + ', ' + customSetting + ', ' + positioning + '\'');
	oxl_win.focus();
}


function closePopup() {
	if (window.oxl_win) {
		window.oxl_win.close();
	}
}



// pop up to define which shopping list item is placed in
function historyOrder(order_id) {
	var left = 50;
	var top = 50;
	var URL = "history_order.php?order_id="+order_id;
	var width = 650;
	var height = 550;
	var scrollbars = 1;
	thisPopup(URL, name, left, top, width, height, scrollbars);
}


function paypalWindow() {
	var left = 50;
	var top = 50;
	var URL = '';
	var width = 800;
	var height = 580;
	var scrollbars = 1;
	thisPopup(URL, 'paypal', left, top, width, height, scrollbars);
	document.forms["paypalCheckout"].submit();
	return false;	
}


function sslWindow() {
	var left = 50;
	var top = 50;
	var URL = '';
	var width = 520;
	var height = 570;
	var scrollbars = 1;
	thisPopup(URL, 'ssl', left, top, width, height, scrollbars);
	document.forms["sslCheckout"].submit();
	return false;	
}


function closePaypalWindow() {
	opener.location.href = "index.php?fcall=paypalEnd";
	self.close();
}


function zoomImage(URL, width, height, scrollbars) {
	var left = 100;
	var top = 50;
	thisPopup(URL, 'oxl_win', left, top, width, height, scrollbars);
}




 
 
