
function stoperror(){
    return true
}
window.onerror=stoperror;

 


//Print page
/*
function printWindow(){
   bVer = parseInt(navigator.appVersion)
   if (bVer >= 4){
    window.print();}
    else (alert ("This function is not supported.. Please use the print function on you browser."));
}
*/

function printWindow(){  
if (window.print) {
    window.print() ;  
} else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);  //Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  
}
}




// Window status 

msg = new Array(40) 
    msg[0] = 'Save a Pet, Gain a Pal 4 Life'                    // Default window status
    msg[1] ='Return to Pooch Heaven Main Page'                  // Home
	msg[2] = 'Your Donations will go to a Wonderful Cause'      // Donations
	msg[3] = 'Fostering a Dog can be great experience'       // Foster homes
	msg[4] = 'Become a Pooch Heaven Volunteer'                  // Volunteer
	msg[5] = 'Sponsor a Needy Dog'                              // Sponsors
	msg[6] = 'Pooch Heavens Amazing Rescues'                    // Rescues
	msg[7] = 'Dog Laws.. Local and National'                    // Dog Laws
	msg[8] = 'Dog Medicine.. How to keep your dog healthy '     // Dog Medicine
	msg[9] = 'Dog Behavior & Training'                          // Dog Behavior
	msg[10] = 'Dog Chat & Pooch Talk Message Board'             // Dog Chat & Message Board
	msg[11] = 'Pooch Heaven News & General dog news'            // News
	msg[12] = 'Pooch Resource Links'                            // Links
    msg[13] = 'About Pooch Heaven'                              // About Us
    msg[14] = 'List of Local Events'                            // Events
    msg[15] = 'Contact Us for More Information'                 // Contact Us
    msg[16] = 'Easy Navagation with our Site Map'               // Site Map
    msg[17] = 'How to Adopt a Dog from Pooch Heaven'            // How to Adopt a Dog
    msg[18] = 'Search our Doggie Database'                      // Find a Dog
    msg[19] = 'Lost or Found a Dog?  Search our lost & found database'   // Lost and Found
    msg[20] = 'Pooch Heavens Mission'                           // mission
    msg[21] = 'The Pooch Heaven Wish List'                      // Wish List
    msg[22] = 'Please read our Adoption Agreement'              // Adoption Agreement
    msg[23] = 'Your Privacy and Pooch Heaven'                   // Your Privacy
    msg[24] = 'Report Animal Cruelty and Abuse'                 // Cruelty and Abuse
    msg[25] = 'Pooch Talk Message Board'                        // Pooch Talk Message Board
    msg[26] = 'Ways you can Help!'                              // Ways you can Help
    msg[27] = 'Trade Dog Related links with Pooch Heaven'       // Links Xchange
    msg[28] = 'Pooch Heaven Banners'                            // Banner Kennel
    msg[29] = 'Add a lost or found dog to our doggie database'  // Add Lost or found Dog
    msg[30] = 'Previous Page'                                   // Previous Page
    msg[31] = 'Donate by US Mail or Fax'                        // Donate by mail   
    msg[32] = 'Donate Online... Secure Server'                  // Donate Online
    msg[33] = 'Download printable form in MS Word format'       // Download mail in form
    //Forums
    msg[35] = 'Ask the Dog Behaviorist'                         // Ask the Dog Behaviorist
    msg[36] = 'Ask Doctor Dana'                                 // Ask Doctor Dana
    msg[37] = 'Ask the Dog Law Attorney'                        // Ask the Dog Law Attorney
    
    msg[38] = 'Live Pooch Chat'                                 // Live Pooch Chat
    msg[39] = 'Download printable form in Adobe Acrobat format' // Download mail in form
    
    
    
function MsgStatus(num) {
if(num == 0) 
window.status = msg[num];
else
window.status = msg[num];
}


// set subject in mail form
function setSubject(){

var url= window.location;
var urlstring = new String(url);

var subject = urlstring.split('?', 2);

if ( subject[1] != null){

switch (subject[1]){
     case "Adoption" :
     document.form.subject.selectedIndex = 1;
     break;
     
     case "Donations" :
      document.form.subject.selectedIndex = 2;
     break;  
     
     case "Volunteer" :
       document.form.subject.selectedIndex = 3;
     break; 
     
     case "Foster" :
        document.form.subject.selectedIndex = 4;
     break;
     
     case "Sponsor" :
       document.form.subject.selectedIndex = 5;
     break; 
     
     case "LostFound" :
       document.form.subject.selectedIndex = 6;
     break; 
     
     case "Law" :
       document.form.subject.selectedIndex = 7;
     break;
      
     case "Medicine" :
       document.form.subject.selectedIndex = 8;
     break; 
     
     case "Behavior" :
       document.form.subject.selectedIndex = 9;
     break; 
     
     case "Rescues" :
       document.form.subject.selectedIndex = 10;
     break; 
     
     case  "Links" :
       document.form.subject.selectedIndex = 11;
     break;
     
     default :
     num = 0;
     
    }
  }
}



function setcookie(name, value, expires)
	{
	// no expiration date specified? use this date and it will just be deleted soon.
     if (!expires) expires = new Date(); 
		document.cookie = name + "=" + escape(value) + "; expires=" + expires.toGMTString() + "; path=/";
	}

function getcookie(name)
{
	var cookies = document.cookie;
	if (cookies.indexOf(name) != -1){
		var startpos = cookies.indexOf(name)+name.length+1;
		var endpos = cookies.indexOf(";",startpos)-1;
		if (endpos == -2) endpos = cookies.length;
		return unescape(cookies.substring(startpos,endpos));
	}else{
		return false; // the cookie couldn't be found! it was never set before, or it expired.

	}

}