 
    var browserType
    var browserPlatFormAndVendor

function  getBrowserType() {
//alert("")
if (navigator.appVersion.indexOf("Mac") != -1) { 

	if (navigator.appVersion.indexOf("IE") != -1) { 
		browserType = 4 //IE
		browserPlatFormAndVendor = 'MAC IE'
	} 
	else {
		browserType = 3 //MAC NS
		browserPlatFormAndVendor = 'MAC Netscape'		
	}
 
	
} 
else {
	if (navigator.appVersion.indexOf("MSIE") != -1) { 
		browserType = 2 //IE
		browserPlatFormAndVendor = 'PC IE'
	} 
	else {
		browserType = 1 //Netscape
		browserPlatFormAndVendor = 'PC Netscape'
	}
}

}



function QueryString( key ) { 
  //alert("QueryString( ")
    var text = location.search.substring(  0 ,  location.search.length   );
    var posKey = text.indexOf(  '?' + key );
    if (posKey != -1) {
      }
    else {
       posKey = text.indexOf(  '&' + key );
   }
 
    var substr =  text.substring(  posKey+1 , text.length );
    var posEquals = substr.indexOf(  '=' );
     var posAmb    = substr.indexOf(  '&' );

    if (posAmb == -1) {
      posAmb = substr.length
    }

    var value = substr.substring( posEquals+1, posAmb  );

    return value 
}



function   replace(string, text, by ) {
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}






function addToFavorites() {
	if (browserType==1)  
	 alert('Unfortunately this feature is not supported in Netscape');
	else  
	// alert('IE');
	 window.external.AddFavorite( (location.href), (document.title)  )
}


function emailThisPage( Subject, URL ) {
     // window.location.href = 'mailto:?subject=' +   Subject  +  '&body=' + (self.location.href) ;
     window.location.href = 'mailto:?subject=' +   Subject  +  '&body=' + URL ;
}



 


  
function setSearchCriteria(   SearchEngineURL, theField)	{
 //  alert(  SearchEngineURL   );
 	//theField = eval(theField);
	var path;
	
 	path = SearchEngineURL +  '?Start=' + '1' + '&' +  'Show=' + '10' + '&' +  'Total=' + '' + '&' +  'Stat=' + 'New' + '&'   +  'Query=' + theField.value   
	  //alert(path);
	location.href = path ;
	return false;
}	 












//================================================
function listPropertyNames(obj)
{
var names = "";
for(var i in obj) names += i  + "\n";
alert (names);
}




function listPropertyNameValues(obj)
{
var names = "";
var value = "";

for(var i in obj) names += i + "=" +  obj.i   +  "\n";

alert (names);
}




//================================================ Cookies========================================================================
 
function Set_Cookie(name,value,expires,path,domain,secure) {
    document.cookie = name + "=" +escape(value) +
        ( (expires) ? ";expires=" + expires.toGMTString() : "") +
        ( (path) ? ";path=" + path : "") + 
        ( (domain) ? ";domain=" + domain : "") +
        ( (secure) ? ";secure" : "");
        
  // document.write( "SetCookie() Set_Cookie=" + name + value + expires + path + domain + secure + "<br>" );
        
}

 


function Get_Cookie(name) {
//   document.write( "GetCookie() name=" + name + "<br>" );
    var start = document.cookie.indexOf(name+"=");
    var len = start+name.length+1;
    
    if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
    
    if (start == -1) return null;
    var end = document.cookie.indexOf(";",len);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(len,end));
}
 




function Delete_Cookie( name,path,domain ) {
    if (Get_Cookie(name)) document.cookie = name + "=" +
       ( (path) ? ";path=" + path : "") +
       ( (domain) ? ";domain=" + domain : "") +
       ";expires=Thu, 01-Jan-70 00:00:01 GMT";
}
 


























