<?php
		include ("config.php");
		include ("style.css");
		//include ("responsive.css");
		if (isset($_SESSION['s_username'])) {
                    
			ini_set('session.gc_maxlifetime', 3600);
			//echo "<center><b><font color=\"#293b74\" style=\"text-align:left\">Welcome to the Communicator! Your are logged in as </FONT><font color=\"#AE0011\"> " . $_SESSION['s_username'] . " </FONT></b></center>";
			//<form><input align=\"right\" type=\"button\" value=\"Make Backup\" onclick=window.location.replace(\"http://www.amityaari.com/backup/index.php\")></form>
		} else {
		
			@header("Location:login.php");
			//    $redirect = $_SERVER['REQUEST_URI'];
			//    header("Location: login.php?redirect=$redirect");
		}
                
                $org = $_SESSION['organization'];
		$user = $_SESSION['s_username'];
		$userType = $_SESSION['userType'];
		$userId = $_SESSION["ORGID"];
		$pOrg = $_SESSION['parent_org'];
		$query = "SELECT * FROM `users` WHERE `username` = '$user' LIMIT 1;";
		//echo $query;
		$result = mysql_query($query, $db);
		while ($myrow = mysql_fetch_array($result)) {
			$organization = $myrow['organization'];
		}
		//echo "The user organization is " . $organization . "<br>";
		/*echo "highlightDevId: " . $_SESSION["highlightDevId"] . "<br>";
		 echo "highlightIdQuote: " . $_SESSION["highlightIdQuote"] . "<br>";
		 echo "highlightIdMsgOrder: " . $_SESSION["highlightIdMsgOrder"] . "<br>";
		 echo "highlightId: " . $_SESSION["highlightId"] . "<br>";
		 echo "highlightIdQuote: " . $_SESSION["highlightIdQuote"] . "<br>";
		 echo "highlightIdSpecial: " . $_SESSION["highlightIdSpecial"] . "<br>";
		 echo "highlightIdMsgSpecial: " . $_SESSION["highlightIdMsgSpecial"] . "<br>";*/
		?>
		<html>
		<head>
			<meta http-equiv="expires" content="0">
			<meta http-equiv="pragma" content="no-cache">
			<title> <?php echo $title; ?> </title>
			<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
			<link href='http://fonts.googleapis.com/css?family=Roboto:400,500,700,300' rel='stylesheet' type='text/css'>
			
			<!--[if IE 9]> <html class="ie9"> <![endif]-->
			
			
		<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
			
			<script>
				jQuery(document).ready(function() {
					jQuery(".mobile-menu").click(function() {
						//alert(222)
						jQuery(".nav").slideToggle("slow");
					});
				}); 
				
				jQuery(document).ready(function() {
					jQuery(".mobile-search").click(function() {
						
						if(jQuery(".help-sec").css('visibility')=='hidden')
						{
						    jQuery(".help-sec").css('visibility','visible');	
						}
						else{
							jQuery(".help-sec").css('visibility','hidden');
						}
						
					});
					
					
					jQuery('.nav li a').click(function(){
						
						var txt=jQuery(this).text();
						jQuery('.mobile-menu').find('span').fadeIn().text(txt);
					});
					
					
				}); 
		</script>
			
		<SCRIPT LANGUAGE="javascript">
			function changePicture() {
				var selection = document.orderline.partid.selectedIndex;
				//grabs what user selected
				document.pic.src = document.orderline.partid.options[selection].id;
				//adds 'selection' to grab 'id'
			}
		
			function changePicture2() {
		
				var selection = document.orderline.partno.selectedIndex;
				//grabs what user selected
		
				document.pic.src = document.orderline.partno.options[selection].id;
				//adds 'selection' to grab 'id'
		
			}
		
			function changeDiv(the_div, the_change) {
		
				var the_style = getStyleObject(the_div);
		
				if (the_style != false) {
		
					the_style.display = the_change;
		
				}
		
			}
		
			function hideAll() {
		
				changeDiv("fix_request", "none");
		
				changeDiv("approved", "none");
		
			}
		
			function getStyleObject(objectId) {
		
				if (document.getElementById && document.getElementById(objectId)) {
		
					return document.getElementById(objectId).style;
		
				} else if (document.all && document.all(objectId)) {
		
					return document.all(objectId).style;
		
				} else {
		
					return false;
		
				}
		
			}
		
			// adding rows to quotes - Last updated 2009-10-21
		
			function addRowToTable() {
		
				var tbl = document.getElementById('tblQuote');
		
				var lastRow = tbl.rows.length;
		
				// if there's no header row in the table, then iteration = lastRow + 1
		
				var iteration = lastRow - 1;
		
				var row = tbl.insertRow(lastRow);
		
				// left cell
		
				var cellLeft = row.insertCell(0);
		
				var textNode = document.createTextNode(iteration);
		
				cellLeft.appendChild(textNode);
		
				// SIZE cell
		
				var cellRight = row.insertCell(1);
		
				var el = document.createElement('input');
		
				el.type = 'text';
		
				el.name = 'size' + iteration;
		
				el.id = 'size' + iteration;
		
				el.size = 10;
		
				//el.onkeypress = keyPressTest;
		
				cellRight.appendChild(el);
		
				// QUOTE HAND cell
		
				var cellRight2 = row.insertCell(2);
		
				var el2 = document.createElement('input');
		
				el2.type = 'text';
		
				el2.name = 'quoteHand' + iteration;
		
				el2.id = 'quoteHand' + iteration;
		
				el2.size = 10;
		
				//el.onkeypress = keyPressTest;
		
				cellRight2.appendChild(el2);
		
				// QUOTE PRINT cell
		
				var cellRight3 = row.insertCell(3);
		
				var el3 = document.createElement('input');
		
				el3.type = 'text';
		
				el3.name = 'quotePrint' + iteration;
		
				el3.id = 'quotePrint' + iteration;
		
				el3.size = 10;
		
				//el.onkeypress = keyPressTest;
		
				cellRight3.appendChild(el3);
		
			}
		
			function addRowToTableShip() {
		
				var tbl = document.getElementById('tblQuote');
		
				var lastRow = tbl.rows.length;
		
				// if there's no header row in the table, then iteration = lastRow + 1
		
				var iteration = lastRow - 1;
		
				var row = tbl.insertRow(lastRow);
		
				// left cell
		
				var cellLeft = row.insertCell(0);
		
				var textNode = document.createTextNode(iteration);
		
				cellLeft.appendChild(textNode);
		
				// WEIGHT cell
		
				var cellRight = row.insertCell(1);
		
				var el = document.createElement('input');
		
				el.type = 'text';
		
				el.name = 'weight' + iteration;
		
				el.id = 'weight' + iteration;
		
				el.size = 10;
		
				//el.onkeypress = keyPressTest;
		
				cellRight.appendChild(el);
		
				// CARRIER cell
		
				var cellRight2 = row.insertCell(2);
		
				var el2 = document.createElement('input');
		
				el2.type = 'text';
		
				el2.name = 'carrier' + iteration;
		
				el2.id = 'carrier' + iteration;
		
				el2.size = 10;
		
				//el.onkeypress = keyPressTest;
		
				cellRight2.appendChild(el2);
		
				// QUOTE AIR cell
		
				var cellRight3 = row.insertCell(3);
		
				var el3 = document.createElement('input');
		
				el3.type = 'text';
		
				el3.name = 'quoteAir' + iteration;
		
				el3.id = 'quoteAir' + iteration;
		
				el3.size = 10;
		
				//el.onkeypress = keyPressTest;
		
				cellRight3.appendChild(el3);
		
				// QUOTE SEA cell
		
				var cellRight4 = row.insertCell(4);
		
				var el4 = document.createElement('input');
		
				el4.type = 'text';
		
				el4.name = 'quoteSea' + iteration;
		
				el4.id = 'quoteSea' + iteration;
		
				el4.size = 10;
		
				//el.onkeypress = keyPressTest;
		
				cellRight4.appendChild(el4);
		
			}
		
			function addRowToTablePayment() {
		
				var tbl = document.getElementById('tblpayment');
		
				var lastRow = tbl.rows.length;
		
				// if there's no header row in the table, then iteration = lastRow + 1
		
				var iteration = lastRow - 1;
		
				var row = tbl.insertRow(lastRow);
		
				// left cell
		
				var cellLeft = row.insertCell(0);
		
				var textNode = document.createTextNode(iteration);
		
				cellLeft.appendChild(textNode);
		
				// paymentamt cell
		
				var cellRight = row.insertCell(1);
		
				var el = document.createElement('input');
		
				el.type = 'text';
		
				el.name = 'paymentamt' + iteration;
		
				el.id = 'paymentamt' + iteration;
		
				el.size = 10;
		
				//el.onkeypress = keyPressTest;
		
				cellRight.appendChild(el);
		
				// paymentdate cell
		
				var cellRight2 = row.insertCell(2);
		
				var el2 = document.createElement('input');
		
				el2.type = 'text';
		
				el2.name = 'paymentdate' + iteration;
		
				el2.id = 'paymentdate' + iteration;
		
				el2.size = 10;
		
				//el.onkeypress = keyPressTest;
		
				cellRight2.appendChild(el2);
		
				// paypalid cell
		
				var cellRight3 = row.insertCell(3);
		
				var el3 = document.createElement('input');
		
				el3.type = 'text';
		
				el3.name = 'paypalid' + iteration;
		
				el3.id = 'paypalid' + iteration;
		
				el3.size = 10;
		
				//el.onkeypress = keyPressTest;
		
				cellRight3.appendChild(el3);
		
			}
		
			function addRowToTableBox() {
		
				var tbl = document.getElementById('tblBox');
		
				var lastRow = tbl.rows.length;
		
				// if there's no header row in the table, then iteration = lastRow + 1
		
				var iteration = lastRow - 1;
		
				var row = tbl.insertRow(lastRow);
		
				// left cell
		
				var cellLeft = row.insertCell(0);
		
				var textNode = document.createTextNode(iteration);
		
				cellLeft.appendChild(textNode);
		
				// Carton cnt cell
		
				var cellRight = row.insertCell(1);
		
				//var el = document.createElement('input');
		
				var selector = document.createElement('select');
		
				//selector.type = 'text';
		
				selector.name = 'carton_id' + iteration;
		
				selector.id = 'carton_id' + iteration;
		
				//selector.size = 10;
		
				//el.onkeypress = keyPressTest;
		
				//cellRight.appendChild(el);
		
				cellRight.appendChild(selector);
		
				for ( i = 1; i < 100; i++) {
		
					var option = document.createElement('option');
		
					option.value = i;
		
					option.appendChild(document.createTextNode(i));
		
					selector.appendChild(option);
		
				}
		
				// Qty cell
		
				var cellRight2 = row.insertCell(2);
		
				var el2 = document.createElement('input');
		
				el2.type = 'text';
		
				el2.name = 'qty' + iteration;
		
				el2.id = 'qty' + iteration;
		
				el2.size = 10;
		
				//el.onkeypress = keyPressTest;
		
				cellRight2.appendChild(el2);
		
			}
		
			function removeRowFromTable() {
		
				var tbl = document.getElementById('tblQuote');
		
				var lastRow = tbl.rows.length;
		
				if (lastRow > 2)
					tbl.deleteRow(lastRow - 1);
		
			}
		
			function removeRowFromTableShip() {
		
				var tbl = document.getElementById('tblQuote');
		
				var lastRow = tbl.rows.length;
		
				if (lastRow > 2)
					tbl.deleteRow(lastRow - 1);
		
			}
		
			function removeRowFromTablePayment() {
		
				var tbl = document.getElementById('tblpayment');
		
				var lastRow = tbl.rows.length;
		
				if (lastRow > 2)
					tbl.deleteRow(lastRow - 1);
		
			}
		
			function removeRowFromTableBox() {
		
				var tbl = document.getElementById('tblBox');
		
				var lastRow = tbl.rows.length;
		
				if (lastRow > 2)
					tbl.deleteRow(lastRow - 1);
		
			}
		
			function openInNewWindow(frm) {
		
				// open a blank window
		
				var aWindow = window.open('', 'TableAddRowNewWindow', 'scrollbars=yes,menubar=yes,resizable=yes,toolbar=no,width=400,height=400');
		
				// set the target to the blank window
		
				frm.target = 'TableAddRowNewWindow';
		
				// submit
		
				frm.submit();
		
			}
		
			function validateRow(frm) {
		
				var tbl = document.getElementById('tblQuote');
		
				var lastRow = tbl.rows.length - 2;
		
				var i;
		
				for ( i = 1; i <= lastRow; i++) {
		
					var aRow = document.getElementById('size' + i);
		
					if (aRow.value.length <= 0) {
		
						alert('Size ' + i + ' is empty');
		
						return;
		
					}
		
					var aRow2 = document.getElementById('quoteHand' + i);
		
					if (aRow2.value.length <= 0) {
		
						alert('Quote Hand ' + i + ' is empty');
		
						return;
		
					}
		
					var aRow3 = document.getElementById('quotePrint' + i);
		
					if (aRow3.value.length <= 0) {
		
						alert('Quote Print ' + i + ' is empty');
		
						return;
		
					}
		
				}
		
				frm.submit();
		
			}
		
			function validateRowShip(frm) {
		
				var tbl = document.getElementById('tblQuote');
		
				var lastRow = tbl.rows.length - 2;
		
				var i;
		
				for ( i = 1; i <= lastRow; i++) {
		
					var aRow = document.getElementById('weight' + i);
		
					if (aRow.value.length <= 0) {
		
						alert('Weight ' + i + ' is empty');
		
						return;
		
					}
		
					var aRow2 = document.getElementById('carrier' + i);
		
					if (aRow2.value.length <= 0) {
		
						alert('Carrier ' + i + ' is empty');
		
						return;
		
					}
		
					var aRow3 = document.getElementById('quoteAir' + i);
		
					if (aRow3.value.length <= 0) {
		
						alert('Quote Air ' + i + ' is empty');
		
						return;
		
					}
		
					var aRow4 = document.getElementById('quoteSea' + i);
		
					if (aRow4.value.length <= 0) {
		
						alert('Quote Sea ' + i + ' is empty');
		
						return;
		
					}
		
				}
		
				frm.submit();
		
			}
		
			function validateRowPayment(frm) {
		
				var tbl = document.getElementById('tblpayment');
		
				var lastRow = tbl.rows.length - 2;
		
				var i;
		
				for ( i = 1; i <= lastRow; i++) {
		
					var aRow = document.getElementById('paymentamt' + i);
		
					if (aRow.value.length <= 0) {
		
						alert('Payment Amount ' + i + ' is empty');
		
						return;
		
					}
		
					/* var aRow2 = document.getElementById('paymentdate' + i);
		
					 if (aRow2.value.length <= 0) {
		
					 alert('Payment Date ' + i + ' is empty');
		
					 return;
		
					 }
		
					 var aRow3 = document.getElementById('paypalid' + i);
		
					 if (aRow3.value.length <= 0) {
		
					 alert('PayPal ID ' + i + ' is empty');
		
					 return;
		
					 }*/
		
				}
		
				frm.submit();
		
			}
		
			function validateRowBox(frm) {
		
				var tbl = document.getElementById('tblBox');
		
				var lastRow = tbl.rows.length - 2;
		
				var i;
		
				for ( i = 1; i <= lastRow; i++) {
		
					var aRow = document.getElementById('carton_id' + i);
		
					if (aRow.value.length <= 0) {
		
						alert('Carton # ' + i + ' is empty');
		
						return;
		
					}
		
					var aRow2 = document.getElementById('qty' + i);
		
					if (aRow2.value.length <= 0) {
		
						alert('Qty ' + i + ' is empty');
		
						return;
		
					}
		
				}
		
				frm.submit();
		
			}
		
			function removeComm(id) {
		
				if (!confirm('are you sure you want to discontinue ' + id + '?'))
					return false;
		
				new Ajax.Request('deletePart.php', {
		
					method : 'get',
		
					/*onCreate: function(){ confirm('are you sure you want to discontinue ' +  id + '?') }, */
		
					parameters : 'comm_id=' + id,
		
					onSuccess : function() {
						alert('part has been marked discontinued!')
					}
				});
		
			}
		
			function reAddComm(id) {
		
				if (!confirm('are you sure you want to add this item back ' + id + '?'))
					return false;
		
				new Ajax.Request('reAddPart.php', {
		
					method : 'get',
		
					/*onCreate: function(){ confirm('are you sure you want to add this item back ' +  id + '?') }, */
		
					parameters : 'comm_id=' + id,
		
					onSuccess : function() {
						alert('part has been re-added to system!')
					}
				});
		
			}
		
			function checkAll(formname, checktoggle) {
		
				var checkboxes = new Array();
		
				checkboxes = document[formname].getElementsByTagName('input');
		
				for (var i = 0; i < checkboxes.length; i++) {
		
					if (checkboxes[i].type == 'checkbox') {
		
						checkboxes[i].checked = checktoggle;
		
					}
		
				}
		
			}
		
		</SCRIPT>
		
		
		
		
		
		<script language="JavaScript">
		
					<!--
		        LinkArray1=new Array();i=-1
		
				i++;LinkArray1[i]=new Array('New Order', 'add.php?op=addorder')
		
				i++;LinkArray1[i]=new Array('New Painting', 'add.php?op=addpart')
		
				i++;LinkArray1[i]=new Array('New Accessory', 'add.php?op=addacces')
		
				i++;LinkArray1[i]=new Array('New Special Order', 'add.php?op=addspecialorder')
		
				i++;LinkArray1[i]=new Array('New Art Order', 'newProducts.php')
		
				i++;LinkArray1[i]=new Array('New Vendor', 'add.php?op=addvendor')
		
				i++;LinkArray1[i]=new Array('New Development', 'add.php?op=adddev')
		
		
		
			LinkArray2=new Array();i=-1
		
				i++;LinkArray2[i]=new Array('Open Orders', 'index.php?opstatus=Open')
		
				i++;LinkArray2[i]=new Array('Closed Orders', 'index.php?opstatus=Completed')
		
				i++;LinkArray2[i]=new Array('All Orders', 'index.php?opstatus=All')
		
				i++;LinkArray2[i]=new Array('Open Special Orders', 'index.php?opstatus=Special')
		
				i++;LinkArray2[i]=new Array('Closed Special Orders', 'index.php?opstatus=SCompleted')
		
		
		
			LinkArray3=new Array();i=-1
		
				i++;LinkArray3[i]=new Array('Search Orders', 'search.php?op=searchorder')
		
				i++;LinkArray3[i]=new Array('Special Orders', 'search.php?op=searchspecialorder')
		
				i++;LinkArray3[i]=new Array('Search Shipments', 'search.php?op=shipsearch')
		
				i++;LinkArray3[i]=new Array('Part Number', 'search.php?op=searchpart')
		
				i++;LinkArray3[i]=new Array('Part Number China', 'search.php?op=searchpnchina')
		
				i++;LinkArray3[i]=new Array('Painting Name', 'search.php?op=searchname')
		
				i++;LinkArray3[i]=new Array('Artist Name', 'search.php?op=searchartist')
		
		
		
			LinkArray4=new Array();i=-1
		
				i++;LinkArray4[i]=new Array('Ship Manager', 'index.php?opstatus=shipmanager')
		
				i++;LinkArray4[i]=new Array('Completed Shipments', 'index.php?opstatus=shipmanagerc')
		
				i++;LinkArray4[i]=new Array('Create Shipment', 'packinglist.php')
		
				i++;LinkArray4[i]=new Array('Returns to CN', 'index.php?opstatus=returnmanager')
		
		i++;LinkArray4[i]=new Array('Completed Returns', 'index.php?opstatus=returnmanagerc')		
		
				i++;LinkArray4[i]=new Array('Create Return', 'packinglist-return.php')
		
		
		
				
		
				/*i++;LinkArray4[i]=new Array('FAQ', 'help/help3.php')*/
		
		
		
			LinkArray5=new Array();i=-1
		
				/*i++;LinkArray5[i]=new Array('Shipped Report', 'report_shipped.php')*/
		
				i++;LinkArray5[i]=new Array('Booked Report', 'report_booked.php')
		
				i++;LinkArray5[i]=new Array('Not on Site Report', 'notonsite-inv-excel.php')
		
				i++;LinkArray5[i]=new Array('Backorder Report', 'backorder-report.php')
		
				i++;LinkArray5[i]=new Array('On Event Report', 'eventItems.php')
		
				i++;LinkArray5[i]=new Array('Discontinued Report', 'report_closeout.php')
		
				i++;LinkArray5[i]=new Array('Demand Planning', 'demand1_new.php')
		
				i++;LinkArray5[i]=new Array('Demand Weekly Sales', 'demand1_weekly.php')
		
				i++;LinkArray5[i]=new Array('Demand Planning Frames', 'demand-current-frame.php')
		
				i++;LinkArray5[i]=new Array('Demand by Month', 'pn-monthly.php')
		
				i++;LinkArray5[i]=new Array('Aging Report', 'aging.php')
		
				i++;LinkArray5[i]=new Array('Status Report', 'status-report.php')
		
				i++;LinkArray5[i]=new Array('Status Report Special', 'status-report-special.php')
		
				i++;LinkArray5[i]=new Array('Vendor Report', 'vendor-report.php'),
		
				i++;LinkArray5[i]=new Array('Vendor Report Special', 'vendor-report-special.php')
		
				i++;LinkArray5[i]=new Array('Best Sellers by Title', 'best-seller.php')
		
				i++;LinkArray5[i]=new Array('Urgent Report', 'urgent-report.php')
		
				i++;LinkArray5[i]=new Array('Time to Deliver Report', 'special-order-time-report.php')
		
				
		
			LinkArray6=new Array();i=-1
		
				i++;LinkArray6[i]=new Array('Existing Inventory', 'parts.php')
		
				i++;LinkArray6[i]=new Array('Bulk Product Update', 'productBulkUpdate.php')
		
				i++;LinkArray6[i]=new Array('Bulk Image Upload', 'productImageUpload.php')
		
				i++;LinkArray6[i]=new Array('Development Queue', 'viewdetail-dev-all.php')
		
				i++;LinkArray6[i]=new Array('Load Molding Qty', 'demand_moldings.php')
		
				i++;LinkArray6[i]=new Array('Load Part Timeline', 'part_timeline.php')
		
				i++;LinkArray6[i]=new Array('Update US/China Part Numbers', 'us-china-update.php')
		
				i++;LinkArray6[i]=new Array('Update Manuafacturing Days', 'manufacturing-days-upload.php')
		
				i++;LinkArray6[i]=new Array('Load Sams Club Lookup', 'samsclub.php')
		
				i++;LinkArray6[i]=new Array('Load Closeout Lookup', 'closeoutids.php')
		                
		                
		         LinkArray7=new Array();i=-1
		
				i++;LinkArray7[i]=new Array('Request for Supplier', 'manageSupplierRequest.php')
		                i++;LinkArray7[i]=new Array('Add New User', 'manageNewUser.php')
		                i++;LinkArray7[i]=new Array('Renew Plan', 'manageRenewPlan.php')
		
				
		                
		//////////////////////////////////////////////////////////////////////////////////////////////////
		
		// Misc Variables
		
			var timer;       			// holds the current timer value
		
			Menu_Over = null 			// Menu currently highlighted 
		
			MouseOver_bgColor ="#99B3CC"// Color of the cell when mouse is over it
		
			OffsetMenuTop = 15 			// Offset Menu Top the height of the cell so it's top is at the cell bottom
		
		//////////////////////////////////////////////////////////////////////////////////////////////////
		
		//////////////////////////////////////////////////////////////////////////////////////////////////
		
		// This is the bit that does it all.
		
		
		
		function ShowMenu(elem,HTML){
		
			if(Menu_Over!=null){if(!document.layers){Menu_Over.className='DropDownHeader'}}
		
			Menu_Over = elem
		
			if(!document.layers){elem.className='DropDownHeaderOver'}
		
		
		
			var HTMLCode = ''
		
			HTMLelem = eval(HTML)
		
			if(HTMLelem.length>0){
		
				HTMLCode += '<ul class="DropDownOutBox"> <li>'
		
				HTMLCode += '<ul class="DropDownSubBox">'
		
						for(i=0;i<HTMLelem.length;i++){
		
								//if(i!=0){HTMLCode += '</td>'}
		
								clearTimeout(timer)
		
								HTMLCode += '<li class="DropDownSubText" onmouseover="javascript:style.background=\'' +
		
								    MouseOver_bgColor + '\'\;  clearTimeout(timer); " onclick="self.location.href=\'' +
		
								    HTMLelem[i][1] + '\'" onmouseout=\"javascript:style.background=\'transparent\'; timer=setTimeout(\'HideDiv()\',500); ">'
		
								HTMLCode += '<nobr>'+ HTMLelem[i][0] +'</nobr><br></li>'
		
						}
		
				HTMLCode += '</ul></li></ul>'
		
		
		
			}
		
				if(document.layers){
		
					document.OptionListDiv.left = findPosX(elem) 
		
					document.OptionListDiv.top = findPosY(elem)  + OffsetMenuTop 
		
					document.OptionListDiv.document.write(HTMLCode); document.layers['OptionListDiv'].document.close();
		
				}
		
				if(document.all){
		
					OptionListDiv.style.left = findPosX(elem)
		
					OptionListDiv.style.top = findPosY(elem) + OffsetMenuTop 
		
					OptionListDiv.innerHTML = HTMLCode
		
				}
		
				if(!document.all && document.getElementById){
		
					document.getElementById('OptionListDiv').style.left = findPosX(elem)
		
					document.getElementById('OptionListDiv').style.top = findPosY(elem) + OffsetMenuTop 
		
					document.getElementById('OptionListDiv').innerHTML = HTMLCode
		
				}
		
		
		
		}
		
		
		
		//////////////////////////////////////////////////////////////////////////////////////////////////
		
		// find the Left position
		
		function findPosX(obj){
		
			var curleft=0;
		
				if(document.getElementById||document.all){while(obj.offsetParent){curleft+=obj.offsetLeft;obj=obj.offsetParent;}}
		
				else if(document.layers){curleft+=obj.x;}
		
			return curleft;
		
		}
		
		
		
		//////////////////////////////////////////////////////////////////////////////////////////////////
		
		// find the top position
		
		function findPosY(obj){
		
			var curtop=0;
		
				if(document.getElementById||document.all){while(obj.offsetParent){curtop+=obj.offsetTop;obj=obj.offsetParent;}}
		
				else if(document.layers){curtop+=obj.y;}
		
			return curtop;
		
		}
		
		
		
		//////////////////////////////////////////////////////////////////////////////////////////////////
		
		// set the mouse click mouseup event
		
		if(document.layers)document.captureEvents(Event.MOUSEMOVE);document.onmouseup=HideDiv;
		
		
		
		//////////////////////////////////////////////////////////////////////////////////////////////////
		
		// hide the menu
		
		function HideDiv(){
		
			if(Menu_Over!=null){
		
				if(!document.layers){Menu_Over.className='DropDownHeader'}
		
			}
		
			if(document.layers){document.OptionListDiv.top = -999}
		
			if(document.all){OptionListDiv.style.top = -999}
		
			if(!document.all && document.getElementById){document.getElementById('OptionListDiv').style.top = -999}
		
		}
		
		//////////////////////////////////////////////////////////////////////////////////////////////////
		
		//Confirmation Boxes
		
		function go_there()
		
		{
		
		 var where_to= confirm("Do you really want to delete this order?");
		
		 if (where_to == true)
		
		 {
		
		   window.location="delete.php?op=deleteorder&orderid=<? echo $myrow["orderid"]; ?>
			"
			;
		
			}
		
			}
		
			//function startDateFunc()
		
			//{
		
			//  //extracting the start date
		
			//var startDate = document.order.startdate.value;
		
			//
		
			////extracting date, month, year from string - startDate. notice that substring() and
		
			////substr() are different methods
		
			//var date = startDate.substr(8);
		
			//var month = startDate.substring(5, 7);
		
			//var year = startDate.substring(0, 4);
		
			//
		
			////creating the end date
		
			//var endDate = new Date();
		
			//
		
			////setting endDate with the start date
		
			//endDate.setFullYear(year, month--, date);
		
			//
		
			////setting endDate 6 weeks ahead (42 days)
		
			//endDate.setDate(endDate.getDate() + 42);
		
			//
		
			////setting enddate text field. maybe you will need to use String.valueOf(num)
		
			////for each number in the concat
		
			//document.order.enddate.value = endDate.getFullYear() +
		
			//                                               "/" +
		
			//                                               (endDate.getMonth() + 1) +
		
			//                                               "/" +
		
			//                                               endDate.getDate();
		
			//}
		
			function initdt(mf) {
		
			var startDate = new Date();
		
			var Month = startDate.getMonth() + 1;
		
			if(Month <12)
		
			var MonthEnd = startDate.getMonth() + 2;
		
			else
		
			var MonthEnd = 1;
		
			var Day = startDate.getDate();
		
			if (Month < 10)
		
			Month = "0" + Month;
		
			if (MonthEnd < 10)
		
			MonthEnd = "0" + MonthEnd;
		
			if (Day < 10)
		
			Day = "0" + Day;
		
			mf.startdate.value = Month + "/" + Day + "/" + startDate.getFullYear();
		
			mf.enddate.value = MonthEnd + "/" + Day + "/" + startDate.getFullYear();
		
			}
		
			function currdt(mf) {
		
			var startDate = new Date();
		
			mf.current_date.value = (startDate.getMonth() + 1) + "/" + startDate.getDate() + "/" + startDate.getFullYear();
		
			}
		
			function GlobalPopUp(url, w, h){
		
			var popUpWin=0;
		
			screenW = screen.availWidth;
		
			screenH = screen.availHeight;
		
			screenW = (screenW-w)/2
		
			screenH = (screenH-h)/2
		
			if(popUpWin){
		
			if(!popUpWin.closed) popUpWin.close();
		
			}
		
			popUpWin = open(url, '', 'scrollbars=yes,resizable=yes,width='+w+',height='+h+',left='+screenW+',top='+screenH);
		
			popUpWin.focus();
		
			}
		
			var popUpWin=0;
		
			function popUpWindow(URLStr){
		
			if(popUpWin){
		
			if(!popUpWin.closed) popUpWin.close();
		
			}
		
			popUpWin = open(URLStr, 'popUpWin', 'scrollbars=yes, resizable=no, width=400, height=400, left=0, top=0');
		
			popUpWin.focus();
		
			}
		
			function popUpBigWindow(URLStr){
		
			if(popUpWin){
		
			if(!popUpWin.closed) popUpWin.close();
		
			}
		
			popUpWin = open(URLStr, 'popUpWin', 'scrollbars=yes, resizable=no, width=600, height=600, left=0, top=0');
		
			popUpWin.focus();
		
			}
		
			//-->
		
		</script>
		
		<script type="text/javascript" src="prototype.js"></script>
		
		<!--[if IE 8]><html class="ie ie8 lte9 lte8"> <![endif]-->
		
		</head>
		
		<body>
		
		<div class="header-wrapper">
		
		<ul class="header-section">
		
		<li>
		
		<div class="logo-sec">
		<a href="index.php" class="logo">
		<img align="left" src="images/logo.jpg" border="0" />
		</a>
		
		</div>
		
		<div class="tagline">
		<span class="company-name"><?php echo $org?> supply chain</span>
		</div>
		
		<div class="user-help-sec">
			
		
		
		<div class="user-section">
		
		<a href="#" class="user">
		<img align="left" src="images/user.jpg" />
		</a><!--user-->
		
		<ul class="user-setting">
		<li>
		<a href="#">setting </a>
		</li>
		
		<li>
		<a href="logout.php">log out</a>
		</li>
		</ul>
		
		</div>
		
		<a href="#" class="help">
		help
		</a>
		
		</div><!--user-help-sec-->
		
		</li><li><div class="mobile-menu-sec">
			<a href="#" class="mobile-menu">Menu <span>  </span>  </a>
			
			<a href="#" class="mobile-search">search</a>
		</div><ul class="nav">
		<?php
		
		//if ($organization == "US" || $organization == "China")
		if ($userType == "1" || $userType == "3")
		{
		
		?>
		
		
		
		
		<!--mobile-menu-sec-->
		
                
<?php 
$path_parts = pathinfo($_SERVER["PHP_SELF"]);
$current = $path_parts['filename'];
?>
		<li nowrap class="DropDownHeader <?php if($current=='index' && $_SERVER["QUERY_STRING"]==''){?>active<?php }?>" align="center"><a href="index.php">Home</a></li>
		<li nowrap class="DropDownHeader <?php if($current=='add' || $current=='manageSupplierRequest'){?>active<?php }?>" >
			<a href="#">New</a>
		
			<div >
			<ul>
			<li><a href="add.php?op=addorder">New Order</a></li>
			<li><a href="add.php?op=addpart">New Item</a></li>
                        
<!--			<li><a href="add.php?op=addacces">New Accessory</a></li>
			<li><a href="add.php?op=addspecialorder">New Special Order</a></li>
			<li><a href="newProducts.php">New Art Order</a></li>
			<li><a href="add.php?op=addvendor">New Vendor</a></li>
			<li><a href="add.php?op=adddev">New Development</a></li>-->
			
			</ul>
			</div>
		</li>
		<li nowrap class="DropDownHeader <?php if($current=='index' && ($_GET[opstatus]=='Open' || $_GET['opstatus']=='Completed' || 
                        $_GET[opstatus]=='All' || $_GET['opstatus']=='Special' || $_GET['opstatus']=='SCompleted')){?>active<?php }?>"> <a href="#">Orders
		
		
		</a>
		
		<div >
		<ul>
		<li><a href="index.php?opstatus=Open">Open Orders</a></li>
		<li><a href="index.php?opstatus=Completed">Closed Orders</a></li>
		<li><a href="index.php?opstatus=All">All Orders</a></li>
<!--		<li><a href="index.php?opstatus=Special">Open Special Orders</a></li>
		<li><a href="index.php?opstatus=SCompleted">Closed Special Orders</a></li>-->
		
		</ul>
		</div>
		</li>
		<li nowrap class="DropDownHeader <?php if($current=='parts' || $current=='productBulkUpdate' || $current=='productImageUpload'
                        || $current=='viewdetail-dev-all' || $current=='demand_moldings' || $current=='part_timeline' || $current=='us-china-update'
                        || $current=='manufacturing-days-upload' || $current=='samsclub' || $current=='closeoutids'){?>active<?php }?>" > <a href="#">Inventory
		
		
		</a>
		
		<div >
		<ul>
		<li><a href="parts.php">Existing Inventory</a></li>
		<li><a href="productBulkUpdate.php">Bulk Product Update</a></li>
		<li><a href="productImageUpload.php">Bulk Image Upload</a></li>
<!--		<li><a href="viewdetail-dev-all.php">Development Queue</a></li>
		<li><a href="demand_moldings.php">Load Molding Qty</a></li>
		<li><a href="part_timeline.php">Load Part Timeline</a></li>
		<li><a href="us-china-update.php">Update US/China Part Numbers</a></li>-->
		<li><a href="manufacturing-days-upload.php">Update Manuafacturing Days</a></li>
<!--		<li><a href="samsclub.php">Load Sams Club Lookup</a></li>
		<li><a href="closeoutids.php">Load Closeout Lookup</a></li>-->
		
		</ul>
		</div>
		</li>
<!--                <li nowrap class="DropDownHeader <?php if($current=='search'){?>active<?php }?>" > <a href="#">Search
		
		
		</a>
		
		<div >
		<ul>
		
		<li><a href="search.php?op=searchorder">Search Orders</a></li>
		<li><a href="search.php?op=searchspecialorder">Special Orders</a></li>
		<li><a href="search.php?op=shipsearch">Search Shipments</a></li>
		<li>
		<a href="search.php?op=searchpart">Part Number</a>
		</li>
		<li>
		<a href="search.php?op=searchpnchina">Part Number China</a>
		</li>
		<li>
		<a href="search.php?op=searchname">Painting Name</a>
		</li>
		<li>
		<a href="search.php?op=searchartist">Artist Name</a>
		</li>
		
		</ul>
		</div>
		</li>-->
		<li nowrap class="DropDownHeader <?php if($current=='report_booked' || $current=='backorder-report' || $current=='eventItems'
                        || $current=='report_closeout' || $current=='demand1_new' || $current=='demand1_weekly' || $current=='demand-current-frame'
                        || $current=='pn-monthely' || $current=='aging' || $current=='status-report' || $current=='status-report-special' 
                        || $current=='vendor-report' || $current=='vendor-report-special' || $current=='best-seller' || $current=='urgent-report' 
                        || $current=='special-order-time-report'){?>active<?php }?>">
		<a href="#">Reports</a>
		
		<div >
		<ul>
		<li>
		<a href="report_booked.php">Booked Report</a>
		</li>
<!--		<li>
		<a href="notonsite-inv-excel.php">Not on Site Report</a>
		</li>
		<li>
		<a href="backorder-report.php">Backorder Report</a>
		</li>
		<li>
		<a href="eventItems.php">On Event Report</a>
		</li>-->
		<li>
		<a href="report_closeout.php">Discontinued Report</a>
		</li>
		<li>
		<a href="demand1_new.php">Demand Planning</a>
		</li>
		<li>
		<a href="demand1_weekly.php">Demand Weekly Sales</a>
		</li>
<!--		<li>
		<a href="demand-current-frame.php">Demand Planning Frames</a>
		</li>-->
		<li>
		<a href="pn-monthly.php">Demand by Month</a>
		</li>
		<li>
		<a href="aging.php">Aging Report</a>
		</li>
		<li>
		<a href="status-report.php">Status Report</a>
		</li>
<!--		<li>
		<a href="status-report-special.php">Status Report Special</a>
		</li>-->
		<li>
		<a href="vendor-report.php">Vendor Report</a>
		</li>
<!--		<li>
		<a href="vendor-report-special.php">Vendor Report Special</a>
		</li>-->
		<li>
		<a href="best-seller.php">Best Sellers by Title</a>
		</li>
		<li>
		<a href="urgent-report.php">Urgent Report</a>
		</li>
		<li>
		<a href="special-order-time-report.php">Time to Deliver Report</a>
		</li>
		
		</ul>
		</div> 
		</li>
		<li nowrap class="DropDownHeader <?php if($current=='index' && ($_GET[opstatus]=='shipmanager' || $_GET['opstatus']=='shipmanagerc' || 
                        $_GET[opstatus]=='returnmanager' || $_GET['opstatus']=='returnmanagerc') || $current=='packinglist' || $current=='packinglist-return'){?>active<?php }?>">
		<a href="#">Shipping
		 </a>
		 
		 <div >
		<ul>
		<li>
		<a href="index.php?opstatus=shipmanager">Ship Manager</a>
		</li>
		<li>
		<a href="index.php?opstatus=shipmanagerc">Completed Shipments</a>
		</li>
		<li>
		<a href="packinglist.php">Create Shipment</a>
		</li>
<!--		<li>
		<a href="index.php?opstatus=returnmanager">Returns to CN</a>
		</li>
		<li>
		<a href="index.php?opstatus=returnmanagerc">Completed Returns</a>
		</li>
		<li>
		<a href="packinglist-return.php">Create Return</a>
		</li>-->
		
		</ul>
		</div>
		</li>
		<?php if($userType=='1'){?>
		<li nowrap class="DropDownHeader <?php if($current=='$currentmanageNewUser' || $current=='manageRenewPlan'){?>active<?php }?>">
		<a href="#">Account Settings
		</a>
		
		<div >
		<ul>
		
		<li>
		<a href="manageNewUser.php">Add New User</a>
		</li>
                <li>
		<a href="manageSupplierRequest.php">Invite Suppliers</a>
		</li>
		<li>
		<a href="manageRenewPlan.php">Renew Plan</a>
		</li>
		</ul>
		</div> 
		</li>
		<?php } }
		?>
		</ul></li>
                <li class="sec-help"><?php if($userType=='2'){$class='none';}else{$class='';}?>
                    <div class="help-sec <?php echo $class;?>">
		
		
		
		<div class="search-section">
		<span>Search by </span>
		
		<div class="search">
		<select>
		<option>
		All
		</option>
		<option>
		Order number
		</option>
		
		<option>
		Shipment number
		</option>
		
		<option>
		Part number
		</option>
		</select>
		
		<input type="text" value="" />
		
		<a href="#" class="search-btn">search</a>
		
		</div><!--search-->
		</div><!--search-section-->
		
		</div>
		</li>
		</ul>
		
		
		
		</ul>
		
		</div><!--header-wrapper-->
		
		<div id="OptionListDiv" style="position:absolute; top:0; left:-500; z-index:65535; visibility:visible;">
		&nbsp;
		</div>
		
		<div id="main_table">
