
function getxmlhttp() {
 //alert('');
 // Create a boolean variable to check for a valid IE instance
 var xmlhttp = false;
 
 //Check if we are usng IE
 try {
  // If the JavaScrpt version is greater than 5.
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
 
  // If not, then use the older active x object
  try {
   // If we are using Internet Explorer
   xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (E) {
   // Else we must be using a non-IE browser
   xmlhttp = false;
  }
 
 }
 
 // If we are using a non-IE browser, create a JavaScript instance of the object
 if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
  xmlhttp = new XMLHttpRequest();
 }
 
 return xmlhttp;
}






function FlPath(WT, HT, Path) { // Display our flash files

 var str = '';

 str += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="'+WT+'" height="'+HT+'">';
 str += '<param name="bgcolor" value="transparent">';
 str += '<param name="wmode" value="transparent">';
  str += '<param name="movie" value="'+Path+'">';
 str += '<param name="quality" value="high">';
 str += '<embed src="'+Path+'" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="' + WT + '" height="'+HT+'" wmode="transparent" >';

 str += '</embed></object>';

 return str;

}







/*
Handles :

Opening new windows

URL | Window Name | 

Width | Height | 
Resize | Scrollbar | Statusbar | LocationBar | Toolbar | 
Left | Top

<a href="#" onclick="OpenWindow('','',800,600,1,1,1,1,1,20,20); return false">
<a href="#" onclick="OpenWindow('url','window_name','width','height','resizeable','scrollbar','statusbar','locationbar','left','top'); return false"></a>
*/

var NewWin; // Declare as a global variable

function OpenWindow(URL,WinName,Width1,Height1,Resize1,ScrollBars1,Status1,Location1,ToolBar1,MenuBar1,Left1,Top1) {

 if (N4) {

  if (NewWin && !NewWin.closed) { // If a window is already open
  NewWin.close(); // Close that window first

  NewWin = window.open(URL,WinName,"width=" + Width1 + ",height=" + Height1 + ",resizable=1,scrollbars=1,status=" + Status1 + ",location=" + Location1 + ",toolbar=" + ToolBar1 + ",menubar=" + MenuBar1 + ",left=" + Left1 + ",top=" + Top1);


  } else {

    NewWin = window.open(URL,WinName,"width=" + Width1 + ",height=" + Height1 + ",resizable=1,scrollbars=1,status=" + Status1 + ",location=" + Location1 + ",toolbar=" + ToolBar1 + ",menubar=" + MenuBar1 + ",left=" + Left1 + ",top=" + Top1);


  }

 } else { // Other than N4

if (NewWin && !NewWin.closed) { // If a window is already open

 //alert(NewWin);
 NewWin.close(); // Close that window first
 

  NewWin = window.open(URL, WinName, "width=" + Width1 + ",height=" + Height1 + ",resizable=" + Resize1 + ",scrollbars=" + ScrollBars1 + ", status=" + Status1 + ",location=" + Location1 + ",toolbar=" + ToolBar1 + ",menubar=" + MenuBar1 + ",left=" + Left1 + ",top=" + Top1);


} else {
 //alert(NewWin);
  NewWin = window.open(URL, WinName, "width=" + Width1 + ",height=" + Height1 + ",resizable=" + Resize1 + ",scrollbars=" + ScrollBars1 + ",status=" + Status1 + ",location=" + Location1 + ",toolbar=" + ToolBar1 + ",menubar=" + MenuBar1 + ",left=" + Left1 + ",top=" + Top1);

  //alert(NewWin);

}

 }

//NewWin.document.title="newee";

} 



function CloseWindow() {
 self.close();
} 

// href="#" onclick="CloseWindow();" alt="Close Window"


function confirmDelete(gotoURL, msg) {
 if(confirm(msg)) {
  location.href = gotoURL;
 }
}

function confirmDelete2(gotoURL, msg) {
 if(confirm(msg)) {
  location.href = gotoURL;
 } else {
  return false;
 }
}



function focus_txtarea() {
 document.getElementById("txtInfo1").focus();
}



// checkbox
 function chk_sd1(form, a) {
  var d = form; 
  for (i=0; i < d.elements.length; i++) {
     d.elements[i].checked = a;
  }
 }

 //  INVERT SELECT CHECKBOXES
 function chk_sd(form) {
  var d = form; 
  for (i=0; i < d.elements.length; i++) {
   if (d.elements[i].name == 'item_id[]') {
    if (d.elements[i].checked == false) {
     d.elements[i].checked = true;
    } else {
     d.elements[i].checked = false;
    }
   }
  }
 }








