//open window
openwin = new Array() ;
function MM_openBrWindow(theURL,winName,features) { //v2.0
	own = winName ;
	openwin[own]=window.open(theURL,winName,features);
	openwin[own].focus();
}

//Rollover img change
function smartRollover() {
 if(document.getElementsByTagName) {
					
  var images = document.getElementsByTagName("img");
  for(var i=0; i < images.length; i++) {
   if(images[i].className.match("over"))
   {
    images[i].onmouseover = function() {
     this.setAttribute("src", this.getAttribute("src").replace(".gif", "_over.gif"));
     this.setAttribute("src", this.getAttribute("src").replace(".jpg", "_over.jpg"));
    }
    images[i].onmouseout = function() {
     this.setAttribute("src", this.getAttribute("src").replace("_over.gif", ".gif"));
     this.setAttribute("src", this.getAttribute("src").replace("_over.jpg", ".jpg"));
    }
   }
  }
 }
}

//inputAreaColor
function inputAreaColor() {
	var inputAreaID="SS_searchQuery";
	var inputStr="Enter text here";
	var OnColor="#000000";
	var OffColor="#999999";
	var OnBgColor="#FFFFFF";
	var OffBgColor="#e1e1e1";
	if(document.getElementById(inputAreaID)) {
	 
		//initialize
		document.getElementById(inputAreaID).value=inputStr;
		document.getElementById(inputAreaID).style.color=OffColor;
		document.getElementById(inputAreaID).style.backgroundColor=OffBgColor;
		
		//onfocus
		document.getElementById(inputAreaID).onfocus =function() {
			if(this.value==inputStr){
				this.value='';
			}
			this.style.color=OnColor;
			this.style.backgroundColor=OnBgColor;
		}
		
		//onblur
		document.getElementById(inputAreaID).onblur =function() {
		this.style.backgroundColor=OnBgColor;
			if(this.value==''){
				this.value=inputStr;
				this.style.color=OffColor;
				this.style.backgroundColor=OffBgColor;
			}else{
				this.style.color=OnColor;
				this.style.backgroundColor=OnBgColor;
			}
		}
	}
}



function smartSelect(){
		if(document.getElementById("selectmenu")) {
			document.getElementById("selectmenu").style.width ='180px';
	}
}


function findTable() {
var parentTagName ="table";
var parentClassName ="addBorder";
var childsTagName ="tr";
if (!document.getElementsByTagName) return;
var elements = document.getElementsByTagName(parentTagName);
	for (var i = 0, len = elements.length; i < len; i++) {
		if(elements[i].className.match(parentClassName)){ 
		var childs = document.getElementsByTagName(childsTagName);
			for (var n = 0, childslen = childs.length; n < childslen; n++) {
						if((n % 2) == 0){
									childs[n].className += ' odd';
					}else{
									childs[n].className += ' even';
				}
			}
		}
	}
}




if (window.addEventListener) {
window.addEventListener("load", smartRollover, false);
window.addEventListener("load", inputAreaColor, false);
window.addEventListener("load", smartSelect, false);
window.addEventListener("load", findTable, false);
}
if (window.attachEvent) {
window.attachEvent("onload", smartRollover);
window.attachEvent("onload", inputAreaColor);
window.attachEvent("onload", smartSelect);
window.attachEvent("onload", findTable);
}



