<?php 

session_start(); 



include ("config.php");

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><a href='logout.php'>click here</a>  <font color=\"#293b74\"> to log out</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{

$redirect = $_SERVER['REQUEST_URI'];

header("Location: login.php?redirect=$redirect");

//echo "You are not logged in you can log in <a href='login.php'>here</a>.";

//echo $_SESSION['s_username'];





}





$user = $_SESSION['s_username'];

$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>



<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 markBad(id,bad){

var txtBad = ''

if (bad == 1) 

{txtBad = 'bad'}

else {txtBad = 'good'}



 if(!confirm('are you sure you want to mark this image as ' + txtBad + '?')) return false;

 new Ajax.Request('markImageBad.php', {

 method: 'get',

 parameters: 'comm_id=' + id + '&bad=' + bad,

 onSuccess: function(){ alert('image has been marked ' + txtBad + '!') }

 });

 }



 function markBadOrder(id,bad){

var txtBad = ''

if (bad == 1) 

{txtBad = 'bad'}

else {txtBad = 'good'}

 

 if(!confirm('are you sure you want to mark this image as ' + txtBad + '?')) return false;

 new Ajax.Request('markImageBadOrder.php', {

 method: 'get',

 parameters: 'comm_id=' + id + '&bad=' + bad,

 onSuccess: function(){ alert('image has been marked ' + txtBad + '!') }

 });

 }

 

 function markOut(id,out){

var txtOut = ''

if (out == 1) 

{txtOut = 'out of'}

else {txtOut = 'back in'} 



 if(!confirm('are you sure you want to mark this item as ' + txtOut + ' stock at supplier?')) return false;

 new Ajax.Request('markItemOut.php', {

 method: 'get',

 parameters: 'comm_id=' + id + '&out=' + out,

 onSuccess: function(){ alert('item is marked ' + txtOut + ' stock at supplier\'s facility!') }

 });

 }

 

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', 'ordermanager.php')

		i++;LinkArray2[i]=new Array('Closed Orders', 'ordermanager.php?showOnly=Closed&showOnlyPart=all&org1=all&orderType=all&submitShow=Show')

		i++;LinkArray2[i]=new Array('All Orders', 'ordermanager.php')

		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', 'shipmanager.php?complete=NO')

		i++;LinkArray4[i]=new Array('Completed Shipments', 'shipmanager.php?complete=YES')

		i++;LinkArray4[i]=new Array('Create Shipment', 'packinglist-setup.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-frames-setup.php')

		i++;LinkArray5[i]=new Array('Demand Planning Moldings', 'demand_moldings.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('Slow Moving Inventory', 'slow_moving_setup.php')

		i++;LinkArray5[i]=new Array('Event Ready & In Route Inventory', 'event_ready_setup.php')

		i++;LinkArray5[i]=new Array('Inventory over Time', 'inventory_timeline.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')

		

	LinkArray7=new Array();i=-1

		i++;LinkArray7[i]=new Array('Demand Planning', 'demand1_new.php')

		i++;LinkArray7[i]=new Array('Demand Weekly Sales', 'demand1_weekly.php')

		/*i++;LinkArray7[i]=new Array('Demand Planning Frames', 'demand-current-frame.php')*/

		i++;LinkArray7[i]=new Array('Demand Planning Frames', 'demand-frames-setup.php')

		i++;LinkArray7[i]=new Array('Demand Planning Moldings', 'demand_moldings.php')

		i++;LinkArray7[i]=new Array('Demand by Month', 'pn-monthly.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')

//////////////////////////////////////////////////////////////////////////////////////////////////

// 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 += '<table cellpadding="0" cellspacing="0" border="0" class="DropDownOutBox"><tr><td>'

		HTMLCode += '<table cellpadding="0" cellspacing="0" border="0" class="DropDownSubBox">'

				for(i=0;i<HTMLelem.length;i++){

						//if(i!=0){HTMLCode += '</td>'}

						clearTimeout(timer)

						HTMLCode += '<tr><td 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></td></tr>'

				}

		HTMLCode += '</table></td></tr></table>'



	}

		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>

</head>

<body>

      <table border="0" width="100%">

        <tr>

  	  <td bgcolor="#FFFFFF" height="1"><a href="index.php"><img align="left" src="images/logo.jpg" border="0" /></a><a href="index.php"><img align="right" src="images/logo2.jpg" border="0" /></a></td>

        </tr>

<?php

if ($organization == "US" || $organization == "China")

{

?>

        <tr>

          <td width="100%">

	<table cellpadding="0" cellspacing="0" border="0" width="100%" bgcolor="#C9C9C9" height="15" style="border-collapse: collapse">

	<tr>

		<td nowrap class="DropDownHeader" onmouseover="this.style.backgroundColor='#000066'; this.style.color='#ffffff';" onclick="self.location.href='index.php'" onmouseout="this.style.backgroundColor='#C9C9C9';this.style.color='#000000';" align="center">Home</td>

		<td nowrap class="DropDownHeader" onmouseover="ShowMenu(this,'LinkArray1')" onclick="ShowMenu(this,'LinkArray1')" onmouseout="timer=setTimeout('HideDiv()',500);" align="center">New</td>

		<td nowrap class="DropDownHeader" onmouseover="ShowMenu(this,'LinkArray2')" onclick="ShowMenu(this,'LinkArray2')" onmouseout="timer=setTimeout('HideDiv()',500);" align="center">Orders</td>

		<td nowrap class="DropDownHeader" onmouseover="ShowMenu(this,'LinkArray6')" onclick="ShowMenu(this,'LinkArray6')" onmouseout="timer=setTimeout('HideDiv()',500);" align="center">Inventory</td>

		<td nowrap class="DropDownHeader" onmouseover="ShowMenu(this,'LinkArray3')" onclick="ShowMenu(this,'LinkArray3')" onmouseout="timer=setTimeout('HideDiv()',500);" align="center">Search</td>

        <td nowrap class="DropDownHeader" onmouseover="ShowMenu(this,'LinkArray7')" onclick="ShowMenu(this,'LinkArray7')" onmouseout="timer=setTimeout('HideDiv()',500);" align="center">Demand</td>

		<td nowrap class="DropDownHeader" onmouseover="ShowMenu(this,'LinkArray5')" onclick="ShowMenu(this,'LinkArray5')" onmouseout="timer=setTimeout('HideDiv()',500);" align="center">Reports</td>

		<td nowrap class="DropDownHeader" onmouseover="ShowMenu(this,'LinkArray4')" onclick="ShowMenu(this,'LinkArray4')" onmouseout="timer=setTimeout('HideDiv()',500);" align="center">Shipments</td>

	</tr>

          </td>

        </tr>

<?php

}

?>

      </table>

<div id="OptionListDiv" style="position:absolute; top:0; left:-500; z-index:65535; visibility:visible;">&nbsp;</div>

<div id="main_table">