function displayWindow (url, width, height,windowName)
{
  
 var Win = window.open (url, windowName, 'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=yes,status=yes');
      
}

function displayCustomWindow (windowName,width,height)

{

url="about:blank";

 var Win = window.open (url, windowName, 'width='+width+',height='+height+',resizable=1,scrollbars=yes,menubar=yes,status=yes');

}


function displayViewWindow (windowName,width,height,indVal,tf){

//alert (windowName);
if (windowName == "view" || windowName == "create" || windowName == "upload" || windowName == "rename"){

        url="about:blank";
        var Win = window.open (url, windowName, 'width='+width+',height='+height+',resizable=1,scrollbars=yes,menubar=yes,status=yes');

        tf.target = windowName;
        tf.buttonPushed.value = windowName;
        tf.submit();


} else {
        tf.target="_self";
        tf.buttonPushed.value = "";
        tf.submit();
}


}

function displayNewDirectory (newDoc)
{

        document.docListing.target = "_self";
        document.docListing.dirInQues.value = newDoc;
        document.docListing.submit();

}



function displayWindowSolo (url)
  {
    var Win = window.open (url, "displayWindow", 'width=200,height=250,resizable=1,scrollbars=yes,menubar=yes,status=yes');
  }

 function createDate(thisform) {
  var input = parseInt(thisform.createDay.options[thisform.createDay.selectedIndex].value,10)
  var yearField = parseInt(thisform.createYear.options[thisform.createYear.selectedIndex].value,10)
  var monthField = parseInt(thisform.createMonth.options[thisform.createMonth.selectedIndex].value,10)
  var monthMax = new Array(31,31,28,31,30,31,30,31,31,30,31,30,31)
  if ( yearField % 4 == 0) {
         monthMax [2] = 29
         }  
  var top = monthMax[monthField]
  if (!inRange(input,1,top)) {
        thisform.createDay.options[thisform.createDay.selectedIndex].selected =false;
        top=top -1 ;
        thisform.createDay.options[top].selected =true;
    select(thisform.createDay)
        return false
         }
        return true
  }
  
  function inRange(inputStr, lo, hi) {
    var num = parseInt(inputStr, 10)
    if (num < lo || num > hi) {
        return false
    }
    return true
  }

function select(field) {
  field.focus()
  field.select()
}


function changeAction(thisform) {
   thisform.submit();
}
function call_submit(thisform,sortValue,startPR,endPR,buyerID,statusID) {
   document.forms[0].sortByValue.value = sortValue
   document.forms[0].startPR.value = startPR
   document.forms[0].endPR.value = endPR
   document.forms[0].buyerID.value = buyerID
   document.forms[0].statusID.value = statusID
   document.forms[0].submit();
}

function Quit(){
 window.location="index.html";
}
//Expandable Menu
menu_status = new Array();
function showHide(theid){
    if (document.getElementById) {

    var switch_id = document.getElementById(theid);

        if(menu_status[theid] != 'show') {
           switch_id.className = 'show';
           menu_status[theid] = 'show';
        }else{
           switch_id.className = 'hide';
           menu_status[theid] = 'hide';
        }
    }
}
