//jQuery.noConflict();
function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}
function changeselect(){
var version = getInternetExplorerVersion();

if(version > 6){
	document.getElementById("search_desc_en_like").style.width="auto";}
}
function changeselect2(){
var version = getInternetExplorerVersion();

if(version > 6){
	document.getElementById("search_description_like").style.width="auto";}
}

function backselect(id_div){
	if(version > 6){
	document.getElementById(id_div).style.width="170px";
}

}
// =======================================================
//  for the scrolling logos
// =======================================================
var scroll1 = new scrollObject("scr1", 980, 500, "left", 6000, 1.25);
	
	scroll1.block[0] = "<img src='/images/products_images/Berth_ProductCycle_01.jpg' alt='' />";
	scroll1.block[1] = "<img src='/images/products_images/Berth_ProductCycle_02.jpg' alt='' />";
	scroll1.block[2] = "<img src='/images/products_images/Berth_ProductCycle_03.jpg' alt='' />";
	scroll1.block[3] = "<img src='/images/products_images/Berth_ProductCycle_04.jpg' alt='' />";
	scroll1.block[4] = "<img src='/images/products_images/Berth_ProductCycle_05.jpg' alt='' />";
	scroll1.block[5] = "<img src='/images/products_images/Berth_ProductCycle_06.jpg' alt='' />";
	//scroll1.block[6] = "<img src='/images/products_images/Berth_ProductCycle_07.jpg' alt='' />";

	function scrollObject(main, width, height, direct, pause, speed) {
	  var self = this;
	  this.main = main;
	  this.width = width;
	  this.height = height;
	  this.direct = direct;
	  this.pause = pause;
	  this.speed = Math.max(1.001, Math.min((direct == "up" || direct == "down") ? height : width, speed));
	  this.block = new Array();
	  this.blockprev = this.offset = 0;
	  this.blockcurr = 1;
	  this.mouse = false;
	  this.scroll = function() {
		if (!document.getElementById) return false;
		this.main = document.getElementById(this.main);
		while (this.main.firstChild) this.main.removeChild(this.main.firstChild);
		this.main.style.overflow = "hidden";
		this.main.style.position = "relative";
		this.main.style.width = this.width + "px";
		this.main.style.height = this.height + "px";
		for (var x = 0; x < this.block.length; x++) {
		  var table = document.createElement('table');
			  table.cellPadding = table.cellSpacing = table.border = "0";
			  table.style.position = "absolute";
			  table.style.left = table.style.top = "0px";
			  table.style.width = this.width + "px";
			  table.style.height = this.height + "px";
			  table.style.overflow = table.style.visibility = "hidden";
			var tbody = document.createElement('tbody');
			  var tr = document.createElement('tr');
				var td = document.createElement('td');
					td.innerHTML = this.block[x];
				  tr.appendChild(td);
				tbody.appendChild(tr);
			  table.appendChild(tbody);
		  this.main.appendChild(this.block[x] = table);
		}
		if (this.block.length > 1) {
		  this.main.onmouseover = function() { self.mouse = true; }
		  this.main.onmouseout = function() { self.mouse = false; }
		  setInterval(function() {
			if (!self.offset && self.scrollLoop()) self.block[self.blockcurr].style.visibility = "visible";
		  }, this.pause);
		} this.block[this.blockprev].style.visibility = "visible";
	  }
	  this.scrollLoop = function() {
		if (!this.offset) {
		  if (this.mouse) return false;
		  this.offset = (this.direct == "up" || this.direct == "down") ? this.height : this.width;
		} else this.offset = Math.floor(this.offset / this.speed);
		if (this.direct == "up" || this.direct == "down") {
		  this.block[this.blockcurr].style.top = ((this.direct == "up") ? this.offset : -this.offset) + "px";
		  this.block[this.blockprev].style.top = ((this.direct == "up") ? this.offset - this.height : this.height - this.offset) + "px";
		} else {
		  this.block[this.blockcurr].style.left = ((this.direct == "left") ? this.offset : -this.offset) + "px";
		  this.block[this.blockprev].style.left = ((this.direct == "left") ? this.offset - this.width : this.width - this.offset) + "px";
		}
		if (!this.offset) {
		  this.block[this.blockprev].style.visibility = "hidden";
		  this.blockprev = this.blockcurr;
		  if (++this.blockcurr >= this.block.length) this.blockcurr = 0;
		} else setTimeout(function() { self.scrollLoop(); }, 30);
		return true;
	  }
	}

	//******************************************
	//				autolabel.js				
	//			by Cameron Gaut, 2006			
	//				www.modcam.com				
	//
	//******************************************/	
	function labelFields() {
		if (!document.getElementsByTagName){ return; }
		var allfields = document.getElementsByTagName("input");	
		for (var i=0; i<allfields.length; i++){ 	// loop through all input tags and add events
			initField(allfields[i]);
		}
		var allfields2 = document.getElementsByTagName("textarea");	
		for (var i=0; i<allfields2.length; i++){ 	// loop through all textarea tags and add events
			initField(allfields2[i]);
		}
	}
	function initField(field) {
		if (field) { //prevent misfire
			var graycolor = "#000";
			if ((field.type == "text" || field.type == "textarea") && (field.value != null)) {	// include text boxes, exclude empty ones
				field.style.color = graycolor;
				field.graytext = field.value;
				field.onfocus = function () {
					if (this.value==this.graytext){
						this.style.color="#000";
						this.value="";
					} else {
						this.select();
					}
				}
				field.onblur = function () {
					if (this.value=="") {
						this.style.color=graycolor;
						this.value=this.graytext;
					}
				}
			}
		}
	}
	window.onload = function() {
		labelFields();
	}

