// Global Variables
var APP_CALENDAR_OBJECT;
// Is Object & Valid
function IS_OBJ(o) {
	return(typeof(o)!="undefined"&&o!=null&&o!=undefined);
}
// Open PDF Popup
function APP_PDF_VIEWER(jpeg) {
	window.open(APP_WEBROOT + 'svg/basket.pdfpreview.php?jpg='+jpeg,'appPDFViewer','status=0,toolbar=0,menubar=0,menubar=0,directories=0,scrollbars=1,resizable=0,height=800,width=600');
}
// Open SVG Popup
function APP_SVG_VIEWER(basketID) {
	window.open(APP_WEBROOT + 'basket.svgpreview.php?basketID='+basketID,'appSVGViewer','status=0,toolbar=0,menubar=0,menubar=0,directories=0,scrollbars=1,resizable=0,height=500,width=500');
}
// Open Image Popup
function APP_IMAGE_VIEWER(idlist) {
	window.open(APP_WEBROOT + 'popup.php?id='+idlist,'appImageViewer','status=0,toolbar=0,menubar=0,menubar=0,directories=0,scrollbars=1,resizable=0,height=500,width=500');
}
// Open Calendar Popu
function APP_CALENDAR_POPUP(formOBJ) {
	APP_CALENDAR_OBJECT = formOBJ;
	window.open(APP_WEBROOT + 'calendar_popup.php','appCalendar','status=0,toolbar=0,menubar=0,menubar=0,directories=0,scrollbars=0,resizable=0,height=260,width=284');
}
// Receive Return
function APP_CALENDAR_PICKDATE(date) {
	if(APP_CALENDAR_OBJECT) APP_CALENDAR_OBJECT.value = date;
}
// Change Display Of Element
function CHANGE_DISPLAY(e,d) {
	o = document.getElementById(e);
	if(IS_OBJ(o)) o.style.display=d;
	if(typeof(HideArray)!="undefined"&&IS_OBJ(HideArray)) {
		// Reverse Display
		if(d=="none") d = "visible"; else d = "hidden";
		for(i=0;i<HideArray.length;i++) {
			H_OBJ = document.getElementById(HideArray[i]);
			if(IS_OBJ(H_OBJ)) H_OBJ.style.visibility = d;
		}
	}
}
// Toggle Display Of Element
function TOGGLE_DISPLAY(e) {
	o = document.getElementById(e);
	if(IS_OBJ(o)) {
		if(o.style.display==""||o.style.display=="hidden"||o.style.display=="none") {
			o.style.display = "block";
		} else {
			o.style.display = "none";
		}
	}
}


function VIEW_TUTORIAL(src) {
	
	window.open(APP_WEBROOT + "tutorial.php?src="+src,'tutorial','status=0,toolbar=0,menubar=0,menubar=0,directories=0,scrollbars=0,resizable=0,height=634,width=730');
}
