/* Name:            commonClientFunctions.js
   Programmer:      Dave Moore (david@canright.com)
   Inception Date:  3-26-2002
   Modify Date:     3-26-2002
   Description:     Provides common client side script functions
*/                    

var remote=null;
var awnd=null;


// function to call the popup 
// it would like to receive the session, and the quote_id
function openPrintWin(session, id){
   var h        = 340 // height of the new window
   var w        = 420 // width of the new window
   var leftPos  = 400 // left position of the new window
   var topPos   = 300 // top position of the new window

  awnd=rs('Print','recipePrint.asp?session='+session+'&id='+id,w,h,leftPos,topPos,1);
  awnd.focus();

}


// function to call the popup
// it would like to receive the session, and the quote_id
function openPlantWin(session, id){
   var h        = 398 // height of the new window
   var w        = 598 // width of the new window
   //var leftPos  = 400 // left position of the new window
   //var topPos   = 300 // top position of the new window


//   12.14.2004 - RDenmark : make Pacific Breeze open Flash item first   
	if (id == "pacificbreeze") {
		var u = "/nwpack/mini4.asp?session=" + session;
		//    h = 600;
		//    w = 720;
	} else {
      var u = "/nwpack/brands/plantWin.asp?session=" + session + "&code=" + id;
	}
   
   var n = "Plant"
   var args = "width="+w+",height="+h+",resizable=yes,scrollbars=no,status=0,menubar=no";
  
     
  
  remote=window.open(u,n,args);
  if (remote != null) {
    if (remote.opener == null)
      remote.opener = self;
  }
  remote.focus();
}


function rs(n,u,w,h,l,t,x) {
  
  args="width="+w+",height="+h+",resizable=yes,scrollbars=yes,status=0,left="+l+",top="+t+",menubar="+x;
  remote=window.open(u,n,args);
  if (remote != null) {
    if (remote.opener == null)
      remote.opener = self;
  }
  if (x == 1) { return remote; }
}


function refreshForm(form){
  form.submit();
}

