function MM_swapImgRestore() 
{
    var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() 
{
    var d=document; 
    if(d.images)
    { 
	if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
	for(i=0; i<a.length; i++)
	    if (a[i].indexOf("#")!=0)
	    { 
		d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
	    }
    }
}
function MM_swapImage() 
{
    var i,j=0,x,a=MM_swapImage.arguments; 
    document.MM_sr=new Array; 
    for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_openBrWindow(theURL,winName,features) 
{
    window.open(theURL,winName,features);
}
function MM_findObj(n, d) 
{
    var p,i,x;  
    if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) 
    {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
    }
    if(!(x=d[n])&&d.all) 
	x=d.all[n]; 
    for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
	x=MM_findObj(n,d.layers[i].document);
    if(!x && d.getElementById) 
	x=d.getElementById(n); 
    return x;			
}
function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}



function checkemail()	{
	var illegchar = /\<|\>|\^|\"|\'|\%|\;|\(|\)|\&|\\|\//g;
	var formstr = document.subscribe;
	var error = "false";
	var errmsg;
	var emailStr = formstr.from.value;
	var checkTLD=1;
	var emailPat=/^(.+)@(.+)$/;
	var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
	var validChars="\[^\\s" + specialChars + "\]";
	var quotedUser="(\"[^\"]*\")";
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
	var atom=validChars + '+';
	var word="(" + atom + "|" + quotedUser + ")";
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
	var matchArray=emailStr.match(emailPat);
	var ownname = formstr.name.value;
	if	(ownname.match(illegchar))	{
		error = "true";
		msg = "Please use only letters and / or numbers for your name (no &\'s, \\, /, etc).";
		errmsg = "formstr.name.focus()";
	}
	if	(formstr.name.value=="" || formstr.name.value=="Enter Your Name")	{
		error = "true";
		msg = "Please enter your name.";
		errmsg = "formstr.name.focus()";
	}
	if ((formstr.from.value == "" || formstr.from.value.indexOf('@', 0) == -1) || formstr.from.value.indexOf('.') == -1)  {
		error = "true";
		msg = "Please enter a valid e-mail address.";
		errmsg = "formstr.from.focus()";
	}
	if (error=="true")	{
		alert(msg);
		eval(errmsg);
		return false;
	}	else	{
	if (matchArray==null) {
		alert("Email address seems incorrect (check @ and .'s)");
		return false;
	}
	var user=matchArray[1];
	var domain=matchArray[2];
	for (i=0; i<user.length; i++) {
		if (user.charCodeAt(i)>127) {
			alert("Ths username contains invalid characters.");
			return false;
	   }
	}
	for (i=0; i<domain.length; i++) {
		if (domain.charCodeAt(i)>127) {
			alert("Ths domain name contains invalid characters.");
			return false;
	   	}
	}
	if (user.match(userPat)==null) {
		alert("The username doesn't seem to be valid.");
		return false;
	}
	var IPArray=domain.match(ipDomainPat);
	if (IPArray!=null) {
		for (var i=1;i<=4;i++) {
			if (IPArray[i]>255) {
				alert("Destination IP address is invalid!");
				return false;
	  		 }
		}
	}
	var atomPat=new RegExp("^" + atom + "$");
	var domArr=domain.split(".");
	var len=domArr.length;
	for (i=0;i<len;i++) {
		if (domArr[i].search(atomPat)==-1) {
			alert("The domain name does not seem to be valid.");
			return false;
   		}
	}
	if (len<2) {
		alert("This address is missing a hostname!");
		return false;
	}
	else	{
		//window.open("","nwdw","top=10,left=10,directories=no,height=455,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no,width=384");
		hideform();
		return true;
	}
	}
}

function checkemail2()	{
	var illegchar = /\<|\>|\^|\"|\'|\%|\;|\(|\)|\&|\\|\//g;
	var formstr = document.subscribe2;
	var error = "false";
	var errmsg;
	var emailStr = formstr.from.value;
	var checkTLD=1;
	var emailPat=/^(.+)@(.+)$/;
	var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
	var validChars="\[^\\s" + specialChars + "\]";
	var quotedUser="(\"[^\"]*\")";
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
	var atom=validChars + '+';
	var word="(" + atom + "|" + quotedUser + ")";
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
	var matchArray=emailStr.match(emailPat);
	var ownname = formstr.name.value;
	if	(ownname.match(illegchar))	{
		error = "true";
		msg = "Please use only letters and / or numbers for your name (no &\'s, \\, /, etc).";
		errmsg = "formstr.name.focus()";
	}
	if	(formstr.name.value=="" || formstr.name.value=="Enter Your Name")	{
		error = "true";
		msg = "Please enter your name.";
		errmsg = "formstr.name.focus()";
	}
	if ((formstr.from.value == "" || formstr.from.value.indexOf('@', 0) == -1) || formstr.from.value.indexOf('.') == -1)  {
		error = "true";
		msg = "Please enter a valid e-mail address.";
		errmsg = "formstr.from.focus()";
	}
	if (error=="true")	{
		alert(msg);
		eval(errmsg);
		return false;
	}	else	{
	if (matchArray==null) {
		alert("Email address seems incorrect (check @ and .'s)");
		return false;
	}
	var user=matchArray[1];
	var domain=matchArray[2];
	for (i=0; i<user.length; i++) {
		if (user.charCodeAt(i)>127) {
			alert("Ths username contains invalid characters.");
			return false;
	   }
	}
	for (i=0; i<domain.length; i++) {
		if (domain.charCodeAt(i)>127) {
			alert("Ths domain name contains invalid characters.");
			return false;
	   	}
	}
	if (user.match(userPat)==null) {
		alert("The username doesn't seem to be valid.");
		return false;
	}
	var IPArray=domain.match(ipDomainPat);
	if (IPArray!=null) {
		for (var i=1;i<=4;i++) {
			if (IPArray[i]>255) {
				alert("Destination IP address is invalid!");
				return false;
	  		 }
		}
	}
	var atomPat=new RegExp("^" + atom + "$");
	var domArr=domain.split(".");
	var len=domArr.length;
	for (i=0;i<len;i++) {
		if (domArr[i].search(atomPat)==-1) {
			alert("The domain name does not seem to be valid.");
			return false;
   		}
	}
	if (len<2) {
		alert("This address is missing a hostname!");
		return false;
	}
	else	{
		//window.open("","nwdw","top=10,left=10,directories=no,height=455,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no,width=384");
		return true;
	}
	}
}
function checkemail4()	{
	var illegchar = /\<|\>|\^|\"|\'|\%|\;|\(|\)|\&|\\|\//g;
	var formstr = document.subscribedd;
	var error = "false";
	var errmsg;
	var emailStr = formstr.from.value;
	var checkTLD=1;
	var emailPat=/^(.+)@(.+)$/;
	var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
	var validChars="\[^\\s" + specialChars + "\]";
	var quotedUser="(\"[^\"]*\")";
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
	var atom=validChars + '+';
	var word="(" + atom + "|" + quotedUser + ")";
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
	var matchArray=emailStr.match(emailPat);
	var ownname = formstr.name.value;
	if	(ownname.match(illegchar))	{
		error = "true";
		msg = "Please use only letters and / or numbers for your name (no &\'s, \\, /, etc).";
		errmsg = "formstr.name.focus()";
	}
	if	(formstr.name.value=="" || formstr.name.value=="Enter Your Name")	{
		error = "true";
		msg = "Please enter your name.";
		errmsg = "formstr.name.focus()";
	}
	if ((formstr.from.value == "" || formstr.from.value.indexOf('@', 0) == -1) || formstr.from.value.indexOf('.') == -1)  {
		error = "true";
		msg = "Please enter a valid e-mail address.";
		errmsg = "formstr.from.focus()";
	}
	if (error=="true")	{
		alert(msg);
		eval(errmsg);
		return false;
	}	else	{
	if (matchArray==null) {
		alert("Email address seems incorrect (check @ and .'s)");
		return false;
	}
	var user=matchArray[1];
	var domain=matchArray[2];
	for (i=0; i<user.length; i++) {
		if (user.charCodeAt(i)>127) {
			alert("Ths username contains invalid characters.");
			return false;
	   }
	}
	for (i=0; i<domain.length; i++) {
		if (domain.charCodeAt(i)>127) {
			alert("Ths domain name contains invalid characters.");
			return false;
	   	}
	}
	if (user.match(userPat)==null) {
		alert("The username doesn't seem to be valid.");
		return false;
	}
	var IPArray=domain.match(ipDomainPat);
	if (IPArray!=null) {
		for (var i=1;i<=4;i++) {
			if (IPArray[i]>255) {
				alert("Destination IP address is invalid!");
				return false;
	  		 }
		}
	}
	var atomPat=new RegExp("^" + atom + "$");
	var domArr=domain.split(".");
	var len=domArr.length;
	for (i=0;i<len;i++) {
		if (domArr[i].search(atomPat)==-1) {
			alert("The domain name does not seem to be valid.");
			return false;
   		}
	}
	if (len<2) {
		alert("This address is missing a hostname!");
		return false;
	}
	else	{
		//window.open("","nwdw","top=10,left=10,directories=no,height=455,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no,width=384");
		return true;
	}
	}
}

// this fixes an issue with the old method, ambiguous values 
// with this test document.cookie.indexOf( name + "=" );
function Get_Cookie(check_name) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f
	
	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );
		
		
		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
	
		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}


function Set_Cookie( name, value, expires, path, domain, secure ) 
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct 
expires time, the current script below will set 
it for x number of days, to make it for hours, 
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
( ( path ) ? ";path=" + path : "" ) + 
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}


function poppriv()	{
	window.open("priv.html","_blank","top=10,left=10,directories=no,height=300,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no,width=430");
}










// Drop-in content box- By Dynamic Drive
// For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
// This credit MUST stay intact for use

var persistclose=0 //set to 0 or 1. 1 means once the bar is manually closed, it will remain closed for browser session
var startX = 98.5 //set x offset of bar in %
var startY = 15 //set y offset of bar in px
var verticalpos="fromtop" //enter "fromtop" or "frombottom"

var IEfadelength=1 //fade in duration for IE, in seconds
var Mozfadedegree=0.2 //fade in degree for NS6+ (number between 0 and 1. Recommended max: 0.2)

var ie=document.all
var dom=document.getElementById
var ns4=document.layers

function mozfadefx(){
if (parseFloat(objref.style.MozOpacity)<1)
objref.style.MozOpacity=parseFloat(objref.style.MozOpacity)+Mozfadedegree
else{
clearInterval(mozfadevar)
//controlledhidebox()
}
}


function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

function hideform(){

	objref.style.visibility="hidden"
	if (typeof showonscrollvar!="undefined")	{
		clearInterval(showonscrollvar)
	}
	
	links = (dom)?document.getElementById("Layer1").style : ie? document.all.Layer1 : document.Layer1
	cvr = (dom)?document.getElementById("cover").style : ie? document.all.cover : document.cover
	crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin
	
	crossobj.visibility="hidden";
	cvr.visibility = "hidden";
	cvr.display="none";
	links.visibility = "visible";
	links.display="block";
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function staticbar(){
	var ie=document.all && !window.opera
	var dom=document.getElementById
	iebody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
	objref=(dom)? document.getElementById("dropin") : document.all.dropin
	
	barheight=document.getElementById("dropin").offsetHeight
	var ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera;
	var d = document;
	if (objref.filters){
		objref.filters[0].duration=IEfadelength
		objref.filters[0].Apply()
		objref.filters[0].Play()
	}
	objref.style.visibility="visible"
	if (objref.style.MozOpacity){
		mozfadevar=setInterval("mozfadefx()", 90)
	}
	
	var arrayPageSize = getPageSize();
		
	function ml(id){
		var el=d.getElementById(id);
		if (!persistclose || persistclose && get_cookie("remainclosed")=="")
		el.style.visibility="visible"
		if(d.layers)el.style=el;
		el.sP=function(x,y){this.style.left=x+"%";this.style.top=y+"px";};
		el.x = startX;
		if (verticalpos=="fromtop")
		el.y = startY;
		else{
		el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;
		el.y -= startY;
		}
		return el;
	}
	window.stayTopLeft=function(){
		if (verticalpos=="fromtop"){
		var pY = ns ? pageYOffset : iecompattest().scrollTop;
		ftlObj.y += (pY + startY - ftlObj.y)/8;
		}
		else{
		var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;
		ftlObj.y += (pY - startY - ftlObj.y)/8;
		}
		ftlObj.sP(ftlObj.x, ftlObj.y);
		setTimeout("stayTopLeft()", 10);
	}
	
	links = (dom)?document.getElementById("Layer1").style : ie? document.all.Layer1 : document.Layer1
	links.visibility = 'hidden';
	links.display = 'none';
	
	cvr = (dom)?document.getElementById("cover").style : ie? document.all.cover : document.cover
     //cvr.visibility = 'visible';
	cvr.display="block";
	
	
	cvr.width = (arrayPageSize[0] + 'px');
	cvr.height = (arrayPageSize[1] + 'px');
	
	ftlObj = ml("dropin");
	stayTopLeft();
}


function hidebox(){
	bbox=(dom)?document.getElementById("bottombar").style : ie? document.all.bottombar : document.bottombar
	bbox.visibility="hidden";
	bbox.display="none";
	Set_Cookie('vetpetcarebox','Box Closed',30, '/', '', '' );
}


function signups(){
	// bottombar + page peel
	bbar=(dom)? document.getElementById("bottombar") : document.all.bottombar
	cornerpeel=(dom)? document.getElementById("cornerlnk") : document.all.cornerlnk
	// set BOTTOM BAR + FLOATING PAGE PEEL VISIBLE
	cornerpeel.style.visibility="visible";
	
	if (Get_Cookie('vetpetcarebox'))	{}
	else	{
		bbar.style.visibility="visible";
	}
}

//use with drop-down:

if (Get_Cookie('vetpetcare'))	{}

else	{
	setTimeout("staticbar()",15000);
}



