
document.write("\<LINK REL=STYLESHEET HREF=\"../inc/styles.css\">");
document.write("\<LINK REL=STYLESHEET HREF=\"inc/styles.css\">");



//pet gallery hover
var ie=document.all
var ns=document.layers
var ns6=document.getElementById&&!document.all
function enlarge(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="../img/pets/big/'+which+'"><div id="text">'+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="javascript://" onMouseover="drag_dropns(showimage)"><img src="../img/pets/big/'+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"
}



 // 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);
}


//form validation
function Checkfields()
{
  if(document.inputForm.email.value == ""){
		alert("please enter your email address");
		return false;}		
}

 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;
            }
        }
	
    }                                
}


 //**************************email validation start
function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Please enter a valid email address.")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Please enter a valid email address.")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Please enter a valid email address.")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Please enter a valid email address.")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Please enter a valid email address.")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Please enter a valid email address.")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Please enter a valid email address.")
		    return false
		 }

 		 return true					
	}

function ValidateForm(){
	var emailID=document.frmSample.txtEmail
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please enter your email address.")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }
 //**************************email validation end
 
 
function srchchk(minchars) {
if(document.form3.keyword.value.length < minchars) {
	alert('Please enter a keyword in the search field.')
return false; }
else
return true; }

//=================================
//homepage random image & link rotator
NumberOfImagesToRotate = 3;
firstPart = '<img src="img/hm';
LastPart = '.jpg" width="143" height="159" border="0">';
one = '1_';
two = '2_';
three = '3_';

function printImage1() {
var r = Math.ceil(Math.random() * NumberOfImagesToRotate);
document.write(firstPart + one + r + LastPart);
}

function printImage2() {
var r = Math.ceil(Math.random() * NumberOfImagesToRotate);
document.write(firstPart + two + r + LastPart);
}

function printImage3() {
var r = Math.ceil(Math.random() * NumberOfImagesToRotate);
document.write(firstPart + three + r + LastPart);
}
//===================================