//GLOBALS
d=document;
browser=navigator.userAgent;
isIE=0;
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? 1 : 0;


errorString="Possible Error :\n\n";
var errorDivs = new Array();

if(parent.frames.length >1){parent.location.href = self.document.location;}

function L(o,u){
o.onmouseover=function(){status=u;o.style.background="#ff9900";}
o.onmouseout=function(){o.style.background="#003399";status="";return 1;}
o.onmousedown=function(){parent.location.href=u;}
}

function navMouseOvers(){
	LIST_COUNT=0;
	navLinks=document.getElementsByTagName("A");
	for (i=0;i<navLinks.length;i++) {
		e = navLinks[i];
		if(e.id.substring(0,1)== 'a'){
			LIST_COUNT++;
		}
	}
	for (i=0;i<LIST_COUNT;i++){	
		theHref = document.getElementById("a"+i);
		link= theHref.getAttribute("href");
		ele = theHref.parentNode;
		new L(ele,link);
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function buildMenu(nav) {
	if (isIE) {
		navRoot = document.getElementById(nav);
		if(navRoot){
			for (i=0; i<navRoot.childNodes.length; i++) {
				node = navRoot.childNodes[i];
				if (node.nodeName=="LI") {
					node.onmouseover=function() {
						this.className+=" over";
					}
					node.onmouseout=function() {
						this.className=this.className.replace(" over", "");
					}
				}
			}
		}
	}
}

function changeBack(obj){ 
  var id = obj.id+"";
  getQDiv="q"+(id.substr(2));
 if(d.getElementById(getQDiv)){
  	d.getElementById(getQDiv).style.fontWeight="normal";
  	d.getElementById(getQDiv).style.color="#000099";
 }
}

function mouseDownFormEles(){
 if(typeof d.f != 'undefined'){
	 dfeles = d.f.elements.length;
	 if(dfeles>1){
		for(i=0;i<dfeles-1;i++){
		if(d.f.elements[i].type=="select-one" || d.f.elements[i].type=="select-multiple"){
			if(typeof d.f.elements[i].onchange != "function"){
				d.f.elements[i].onchange=function(){changeBack(this);}
			}
			if(d.f.elements[i].selectedIndex>0){changeBack(d.f.elements[i]);}
		}
		if(d.f.elements[i].type=="text" || d.f.elements[i].type=="textarea"){
			d.f.elements[i].onkeypress=function(){changeBack(this);}
		}
		if(d.f.elements[i].type=="radio" && d.f.elements[i].name!="Cover" && d.f.elements[i].name!="Veterinary_Treatment_in_the_last_12_months" ){
			d.f.elements[i].onclick=function(){changeBack(this);}
			//if(d.f.elements[i].checked){e=d.f.elements[i].parentElement;changeBack(d.f.elements[i])}
		}
		if(d.f.elements[i].type=="checkbox"){
				d.f.elements[i].onclick=function(){
				if(this.checked){changeBack(this);}
			}
		}
		}
	 }
	}
}
function doLoad(){
navMouseOvers();
buildMenu("menuid");
if(d.getElementById('a7')){d.getElementById('a7').innerText="Small Pet Cover";}
mouseDownFormEles();
}

