﻿
 var arrIE6 = new Array();
 
 function IE6Items(menuIndex,tagId )
  {this.MenuIndex = menuIndex;
    this.TagId = tagId;  }
  
function IsIE6()
{
  return true;
}
 function AddItemToIE6(menuIndex, tagId)
 {arrIE6[arrIE6.length] = new IE6Items(menuIndex, tagId );  }
  
  function ExecuteIE6(menuIndex, v)
  {
    for(var x =0; x< arrIE6.length; x++)
    {
                var obj = arrIE6[x];
                if(menuIndex == obj.MenuIndex)
                {
                    var div = document.getElementById(obj.TagId) ;
                    var elms = div.getElementsByTagName("*");
                      for(var i = 0, maxI = elms.length; i < maxI; ++i) {
                          var elm = elms[i];
                          switch(elm.type)
                          {case "select-one":
                            SetDisplay(elm.id,v);}
                     }
                 }
     }
  }

// example: window.onload=functionName; -> AddLoadEvent(functionName) 
function AddLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

function Get(id){ return document.getElementById(id);}

// id : id of the control
// value : boolean (true/ false )
// UseBlock : bool ,  use  block to display
function SetDisplay( id , value, UseBlock )
{  var type =  UseBlock ? "block" : "inline"; 
  if ( value ) Get(id).style.display = type;else
   Get(id).style.display = "none";
}

// Ajax calls
//how to use
//jx.load('http://sdsad.com',function(data){
//  	/*... do what you want with 'data' varaible ...//  	*/
//  	alert(data);
//	},'text','get');
 jx={http:false,format:'text',callback:function(data){},error:false,getHTTPObject:function(){var http=false;
if(typeof ActiveXObject !='undefined'){try{http=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){
try{http=new ActiveXObject("Microsoft.XMLHTTP");}catch(E){http=false;}}
}else if(XMLHttpRequest){try{http=new XMLHttpRequest();}catch(e){http=false;}}return http},
load:function(url,callback,format){this.init();if(!this.http||!url)return;
if(this.http.overrideMimeType)this.http.overrideMimeType('text/xml');this.callback=callback;
if(!format)var format="text";this.format=format.toLowerCase();var ths=this;
if(this.http.overrideMimeType)this.http.overrideMimeType('text/xml');var now="uid="+new Date().getTime();
url+=(url.indexOf("?")+1)?"&":"?";url+=now;
this.http.open("GET",url,true);this.http.onreadystatechange=function(){
if(!ths)return;var http=ths.http;if(http.readyState==4){if(http.status==200){var result="";
if(http.responseText)result=http.responseText;if(ths.format.charAt(0)=="j"){result=result.replace(/[\n\r]/g,"");
result=eval('('+result+')'); }if(ths.callback)ths.callback(result);}else{if(ths.error)ths.error()}}}
this.http.send(null);},init:function(){this.http=this.getHTTPObject();}}

function BrowserIsActiveXCompatible(){
	blnResult = false;	
	if (navigator.appName.indexOf("Internet Explorer") != -1){		
		blnResult = true;

		// Exclude Opera
		if (navigator.userAgent.indexOf("Opera") != -1)
			blnResult = false;
	}	
	return blnResult;
}
function WindowsXpServicePack2Installed(){
  blnResult = false;
  if (navigator.appName.indexOf("Internet Explorer") != -1){
    if ((navigator.userAgent.indexOf("SV1;") != -1) || (navigator.userAgent.indexOf("SV1)") != -1)){
      blnResult = true;
    }
  }
  return blnResult;
}



