function showNextImg(x) {
		var prev, current;
		var stopCycling = false;
		lightboxImageLinks.each(function() {
			if (!stopCycling) {
				prev = current; 
				current = $(this);
				if (typeof prev != 'undefined') {
					if ( (x > 0 && prev.css('display') != 'none') || (x < 0 && current.css('display') != 'none') ) {
						prev.toggle();
						current.toggle();
						var currentPhoto = $('.current-photo');
						if (x > 0) currentPhoto.html( parseInt(currentPhoto.html())+1 );
						else currentPhoto.html( parseInt(currentPhoto.html())-1 );
						stopCycling = true;
					}
				}
			}
		});
	}

function zoomgalleryimage(cat,catId,imgId) {
		w = 600;
		h = parseInt(document.img_preview.maxBHeight.value) + 45;
		var W = (screen.width - w) / 2;
		var H = (screen.height - h) / 2;
		zoom_img = window.open("zoomgalleryimage.php?cat="+cat+"&catId="+catId+"&imgId="+imgId+"&title="+document.img_preview.title.value,"zoomimg","resizable=no,scrollbars=no,toolbar=no,menubar=no,location=no,status=no,height="+h+",width="+w+",top="+H+",left="+W);
	}

function visainfo(vid) {
		w = 600;
		h = 600
		var W = (screen.width - w) / 2;
		var H = (screen.height - h) / 2;
		visa_info = window.open("visainfo.php?vid="+vid,"visa_info","resizable=no,scrollbars=yes,toolbar=no,menubar=no,location=no,status=no,height="+h+",width="+w+",top="+H+",left="+W);
	}

function paymentinfo(sid) {
		w = 600;
		h = 600
		var W = (screen.width - w) / 2;
		var H = (screen.height - h) / 2;
		payment_info = window.open("paymentinfo.php?sid="+sid,"payment_info","resizable=no,scrollbars=yes,toolbar=no,menubar=no,location=no,status=no,height="+h+",width="+w+",top="+H+",left="+W);
	}

function transportinfo(sid) {
		w = 600;
		h = 600
		var W = (screen.width - w) / 2;
		var H = (screen.height - h) / 2;
		transport_info = window.open("transportinfo.php?sid="+sid,"transport_info","resizable=no,scrollbars=yes,toolbar=no,menubar=no,location=no,status=no,height="+h+",width="+w+",top="+H+",left="+W);
	}

function postAQuestionWin(pid,sid,tid,oid) {
		w = 600;
		h = 500
		var W = (screen.width - w) / 2;
		var H = (screen.height - h) / 2;
		postaquestion = window.open("postaquestion.php?pid="+pid+"&sid="+sid+"&tid="+tid+"&oid="+oid,"postaquestion","resizable=no,scrollbars=yes,toolbar=no,menubar=no,location=no,status=no,height="+h+",width="+w+",top="+H+",left="+W);
	}
