 function focusNClearInput(inputObject) {
    var hasBeenFocused = inputObject.getAttribute("hasBeenFocused") != null;
    
    if (!hasBeenFocused) {
        inputObject.setAttribute("hasBeenFocused", "true");
        inputObject.style.color = "#000000";
        inputObject.value = "";
        var thisForm = inputObject.form;
        for (ii = 0;  ii < thisForm.elements.length; ii++) {
            if (thisForm.elements[ii].type == "submit"){
                thisForm.elements[ii].disabled = false;
            }
        }
	
    }                                
}

//==========layer popup start============
		
if (document.getElementById) {	stdBrowser = true}
else {	stdBrowser = false}

function popUp(evt,currElem) {
	if (stdBrowser) {
		popUpWin = document.getElementById(currElem).style
	}
	popUpWin.visibility = "visible"
}
function popDown(currElem) {
	if (stdBrowser) {
		popUpWin = document.getElementById(currElem).style
	}
	else {popUpWin = eval("document." + currElem)}
	popUpWin.visibility = "hidden"
}
//==========layer popup end============

//===============mouseover image enlarge===============
//Thumbnail image viewer- © Dynamic Drive (www.dynamicdrive.com)
var ie=document.all
var ns=document.layers
var ns6=document.getElementById&&!document.all

function enlarge(which,e){
//Render image code for IE 4+ and NS6
if (ie||ns6){
crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
if (crossobj.style.visibility=="hidden"){
//crossobj.style.left=ns6? pageXOffset+e.clientX : document.body.scrollLeft+event.clientX
//crossobj.style.top=ns6? pageYOffset+e.clientY : document.body.scrollTop+event.clientY
//crossobj.innerHTML='<div align=right id=drag><b onClick=closepreview()>X</b></div><img src="'+which+'">'
crossobj.innerHTML='<img src="'+which+'">'
crossobj.style.visibility="visible"
}
else
crossobj.style.visibility="hidden"
return false
}
//Render image code for NS 4
else if (document.layers){
if (document.showimage.visibility=="hide"){
document.showimage.document.write('<a href="#" onMouseover="drag_dropns(showimage)"><img src="'+which+'" border=0></a>')
document.showimage.document.close()
document.showimage.left=e.x
document.showimage.top=e.y
document.showimage.visibility="show"
}
else
document.showimage.visibility="hide"
return false
}
//if NOT IE 4+ or NS 4, simply display image in full browser window
else
return true
}

function closepreview(){
crossobj.style.visibility="hidden"
}

function enlarge2(which,petnm,e){
//Render image code for IE 4+ and NS6
if (ie||ns6){
crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
if (crossobj.style.visibility=="hidden"){
//crossobj.style.left=ns6? pageXOffset+e.clientX : document.body.scrollLeft+event.clientX
//crossobj.style.top=ns6? pageYOffset+e.clientY : document.body.scrollTop+event.clientY
//crossobj.innerHTML='<div align=right id=drag><b onClick=closepreview()>X</b></div><img src="'+which+'">'
crossobj.innerHTML='<img src="'+which+'"><div class="text_05">'+petnm+'</div>'
crossobj.style.visibility="visible"
}
else
crossobj.style.visibility="hidden"
return false
}
//Render image code for NS 4
else if (document.layers){
if (document.showimage.visibility=="hide"){
document.showimage.document.write('<a href="#" onMouseover="drag_dropns(showimage)"><img src="'+which+'" border=0></a>')
document.showimage.document.close()
document.showimage.left=e.x
document.showimage.top=e.y
document.showimage.visibility="show"
}
else
document.showimage.visibility="hide"
return false
}
//if NOT IE 4+ or NS 4, simply display image in full browser window
else
return true
}

function closepreview(){
crossobj.style.visibility="hidden"
}

//=======mouseover image enlarge end=====================

// image swapping
function ImgChange(imgNum,imgSrc) {
document.images[imgNum].src = imgSrc;
}

//cvn window
function popCvn() {
window.open('../html/cvn.htm', 'myCvn', 'height=400,width=450,toolbar=0,menubar=0,scrollbars=1,resizable=0,location=0,directories=0,status=1');
}

//form validation
function Checkfields()
{
  if(document.inputForm.email.value == ""){
		alert("please enter your email address");
		return false;}		
}


function srchchk(minchars) {
if(document.form1.Keyword.value.length < minchars) {
	alert('Please enter a search keyword in the keyword field.')
return false; }
else
return true; }


 // Put the cursor in the first text field and select contents, if any
function initializeUI(f,e) {
  	document[f][e].focus(); //alert(document[f][e]);
	document[f][e].select();
}

//spawn window function
function spawnWindow(theURL,winName,properties) { 
  window.open(theURL,winName,properties);
}

function openbed(theURL) { 
  window.open(theURL,'bedship','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=,resizable=,height=170,width=570');
}

