//	eShox 3 OS
//	http://www.eshox.com/

//	Copyright (c) 2003, Secure.cc, Inc.

//	Released under the GNU General Public License

var popupwindow = null;

if (!document.cookie || document.cookie == '') alert('Please enable Cookies in your web browser preferences.');

function makeWindow(url, width, height, centerx, centery) {
  realwidth = self.outerWidth - self.innerWidth + width;
  realheight = self.outerHeight - self.innerHeight + height;
  method = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=' + realwidth + ',height=' + realheight;
  if (!document.popupwindow) {
    method += ',screenX=' + centerx + ',screenY=' + centery + ',left=' + centerx + ',top=' + centery;
  }
  document.popupwindow = window.open(url,'popupwindow',method);
  document.popupwindow.focus();
}

function removeWindow() {
  if (document.popupwindow) document.popupwindow.close();
}

function popupWindow(url) {
  url += '?' + thepics;
  makeWindow(url, 320, 240, ((window.screen.width/2) - 160), ((window.screen.height/2) - 120));
}

function popupUpload(fieldname, image) {
  url = 'popup_upload.php?field=' + fieldname;
  if (image) url += '&action=change&pngimage=' + image;
  makeWindow(url, 240, 330, ((window.screen.width/2) - 160), ((window.screen.height/2) - 90));
}

function popupOption(fieldname, product_id) {
  url = 'popup_option.php?field=' + fieldname + '&products_id=' + product_id;
  makeWindow(url, 320, 480, 20, ((window.screen.height/2) - 240));
}

function popupQTWindow(url) {
  makeWindow(url, 480, 276, ((window.screen.width/2) - 240), ((window.screen.height/2) - 138));
}

function toggle_vis(elementID) {
  if ($('#' + elementID)) {
    if ($('#' + elementID).style.display == '') $('#' + elementID).style.display = 'block';
    else $('#' + elementID).style.display = '';
  }
}

function payment_is_checked(elementID) {
	for (x in pay_types) {
		if ($(pay_types[x])) {
			if (pay_types[x] == elementID) $('#' + pay_types[x]).show();
			else $('#' + pay_types[x]).hide();
		} 
	}
}

function colorFlash(element_name) {
	var bgColor = $('#' + element_name).css('background-color');
	$('#' + element_name).css('background-color', '#ffff00');
	$('#' + element_name).fadeTo(3000, 0.1, function() {
		$('#' + element_name).css('background-color', bgColor);
	});
	$('#' + element_name).fadeTo(1000, 1);
}



