var detect = navigator.userAgent.toLowerCase();
var OS,browser;

if (checkIt('konqueror'))
{
browser = "other";
OS = "Linux";
}
else if (checkIt('omniweb')) browser = "other"
else if (checkIt('opera')) browser = "other"
else if (checkIt('webtv')) browser = "other"
else if (checkIt('icab')) browser = "other"
else if (checkIt('msie')) browser = "msie"
else if (!checkIt('compatible'))
{
browser = "other"; //did read 'Netscape Navigator'
version = detect.charAt(8);
}
else browser = "other";

function checkIt(string)
{
place = detect.indexOf(string) + 1;
thestring = string;
return place;
}

function bannerOff()
{                                              
  adbanner.style.visibility="hidden";
} 
  

function bannerOn()
{
  adbanner.style.visibility="visible";
} 

function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
  // W3C DOM
  return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
  // MSIE 4 DOM
  return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
  // NN 4 DOM.. note: this won't find nested layers
  return document.layers[objectId];
    } else {
  return false;
    }
} // getStyleObject

function changeObjectVisibility(objectId, newVisibility) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
  styleObject.visibility = newVisibility;
  return true;
    } else {
  // we couldn't find the object, so we can't change its visibility
  return false;
    }
} // changeObjectVisibility

function newVin(url, _name, width, height, nobars )
{	
	if(nobars)
		nobars = 'no';
	else
		nobars = 'yes';
	
	var scrheight = window.screen.availHeight;
	var scrwidth = window.screen.availWidth;
	scrheight = (scrheight/2)-(height/2);
	scrwidth = (scrwidth/2)-(width/2);
	Vindue1 = window.open(url,_name,'toolbar=no,resizable=no,menubar=no,scrollbars='+nobars+', left='+scrwidth+', top='+scrheight+', width='+width+',height='+height);
	Vindue1.focus();
	return Vindue1;
}

function insertIntoSelectedField(_ref, _value) {
	//IE support
	if (document.selection) {
		_ref.focus();
		sel = document.selection.createRange();
    sel.text = _value;
	//other support
 	} else {
  	_ref.value += _value;
  }
}	  
