var browser = navigator.appName;
var str = navigator.appVersion;
var IS_IE=false;


if (browser == "Microsoft Internet Explorer"){
IS_IE=true;
IS_IE6 = /msie|MSIE 6/.test(navigator.userAgent);
}
function printGalleryMenu(){
		  document.write('<div id="menu">');
		  document.write('<ul id="mainMenu">');
		  document.write('<li><a href="../index.html">critters</a></li>');
		  document.write('<li><a href="index.html">gallery</a></li>');
		  document.write('<li><a href="contact.php">contact</a></li>');
		  document.write('<li><a href="login.php">log in</a></li>');
		  document.write('</ul>');
		  document.write('</div>');  
		  
}
function printGalleryMenuLO(){
		  document.write('<div id="menu">');
		  document.write('<ul id="mainMenu">');
		  document.write('<li><a href="../index.html">critters</a></li>');
		  document.write('<li><a href="index.html">gallery</a></li>');
		  document.write('<li><a href="contact.php">contact</a></li>');
		  document.write('<li><a href="accountOpts.php">options</a></li>');
		  document.write('<li><a href="logout.php">log out</a></li>');
		  document.write('</ul>');
		  document.write('</div>');  
		  
}
function printMenu(){
		  document.write('<div id="menu">');
		  document.write('<ul id="mainMenu">');
		  document.write('<li><a href="index.html">features</a></li>');
		  document.write('<li><a href="examples.html">examples</a></li>');
		  document.write('<li><a href="pricing.html">pricing</a></li>');
		  document.write('<li><a href="galleries.html">galleries</a></li>');
		  document.write('<li><a href="about.html">about us</a></li>');
		  document.write('<li><a href="contact.php">contact</a></li>');
		  document.write('</ul>');
		  document.write('</div>');

}
		  
function alert800by600(){
	    if (screen.width <=800){	
			alert("This site is best viewed with a screen resolution larger than 600x800.  Your visual experience with this site will be comprimised.");
	    }
}

function linkCSS(){
	    
    document.write('<link type="text/css" rel="stylesheet" href="style.css"/>');
    document.write('<!--[if lte IE 7]><link rel ="stylesheet" type="text/css" href="styleIE6.css" /><![endif]-->');

if ((screen.width <= 1024) && (screen.width > 800)){
            document.write('<link rel="stylesheet" type="text/css" href="style800-1024.css" />');
    }else if (screen.width <=800){
            document.write('<link rel ="stylesheet" type ="text/css" href ="style800.css" />');
    }
}

function getYear (){
	var today = new Date();
	if (IS_IE){
	    return(today.getYear());
	}else{
	    return (today.getYear()+1900);
	}

}

function copyRight (){
	    document.write('<div id="copyright">Copyright &copy; '+getYear()+' Sandies Critters');
	    document.write('<br /><a href="http://www.jordinbrown.com" id="linktojb">website design by Jordin Brown</a></div>');
}


function printPostCard(){
	    document.write ('<form name="postcard" method="post" action="process.php">');
	    document.write ('<table style="padding:120px 50px 50px 50px"  id="postcard">');
	    document.write ('<tr><td rowspan="3"><textarea class="inputs" id="message" name="message" style="width:300px; height:100px" onblur="resetInputs(\'message\')" onfocus="setupInputs(\'message\');">Your Message</textarea></td><td class="dotLine" style="width:210px"><strong>MWCH Reno</strong></td></tr>');
	    document.write ('<tr><td class="dotLine" >2715 Ostiguy</td></tr>');
	    document.write ('<tr><td class="dotLine" >Ville St. Laurent, QC</td></tr>');
	    document.write ('<tr><td><input type="text" class="inputs" name="fullName" id="fullName" value="Your Name" maxlength="50" style="width:300px; height:20px;" onblur="resetInputs(\'fullName\')" onfocus="setupInputs(\'fullName\');"/></td><td class="dotLine" >H4R 1N3</td></tr>');
	    document.write ('<tr><td><input type="text" class="inputs" name="emailAddress" id="emailAddress" value="Your Email Address" maxlength="100" style="width:300px; height:20px;" onblur="resetInputs(\'emailAddress\')" onfocus="setupInputs(\'emailAddress\');" /></td><td class="dotLine" ><a href="mailto:info@mwchreno.com">info@mwchreno.com</a></td></tr>');
	    document.write ('<tr><td></td><td class="dotLine" ><img src="images/businessCard.gif" /> &nbsp;<a href="MWCHReno_Business_Card.vcf">Our Vcard</a></td></tr>');
	    document.write ('<tr style="margin-bottom:50px;"><td style="text-align:right; padding-right:50px;"><input type="image" src="images/Send_Mail.gif" id="Send_Mail" onclick="validatePostCard(this.form)" onmouseover="btnHover(\'Send_Mail\',\'gif\')" onmouseout="btnRelease(\'Send_Mail\',\'gif\')" onmousedown="btnDown(\'Send_Mail\',\'gif\')" onmouseup="btnRelease(\'Send_Mail\',\'gif\')"/></td><td></td></tr>');
	    document.write ('</table>');
	    document.write ('</form>');	    
}


function validatePostCard(form){
		  if (form.message.value=="Your Message"){
				    form.message.value="";
		  }else if (form.name.value=="Your Name"){
				    form.name.value="";
		  }else if (form.email.value=="Your Email Address"){
				    form.email.value="";
		  }
				    
		  form.submit();
}

function btnHover(btnName, ext){
	    var image = document.getElementById(btnName);
	    image.src = 'images/'+btnName+'_H.'+ext;
	    image.style.cursor="pointer";
}
function btnDown(btnName, ext){
	    var image = document.getElementById(btnName);
	    image.src = 'images/'+btnName+'_D.'+ext;
	    image.style.cursor="pointer";
}
function btnRelease (btnName, ext){
	    var image = document.getElementById(btnName);
	    image.src = 'images/'+btnName+"."+ext;
	    image.style.cursor="pointer";
}
function setupInputs(inputName){
		  var inputDefualt ="";
		  if (inputName=="message"){
				    inputDefault="Your Message";
		  }else if (inputName=="name"){
				    inputDefault="Your Name";
		  }else if (inputName=="email"){
				    inputDefault="Your Email Address";
		  }
		  
		  if (document.getElementById(inputName).value == inputDefualt || document.getElementById(inputName).value==""){
			document.getElementById(inputName).value='';	    
		  }


	    
	    document.getElementById(inputName).style.backgroundColor="#E4E1DB";
	    document.getElementById(inputName).style.borderColor="#9A8F75";
	    document.getElementById(inputName).style.borderWeight="1px";
	    document.getElementById(inputName).style.borderStyle="solid";
	    document.getElementById(inputName).style.color="#312A1E";
	    document.getElementById(inputName).focus();
}
function resetInputs(inputName){
	    var input = document.getElementById(inputName);	    
	    input.style.backgroundColor="transparent";
	    input.style.borderColor="#E2E1DD";
	    input.style.borderWeight="1px";
	    input.style.borderStyle="solid";
	    input.style.color="#8A8A87";
	    
	    if (input.value ==""){
			if (inputName =="message"){
				    input.value="Your Message";
			}else if (inputName =="name"){
				    input.value="Your Name";
			}else if (inputName =="email"){
				    input.value="Your Email Address";
	    		}else{
				input.value="";
			}    
	    }
}

function verifyMod(form){
		  return confirm('Modify Caption?');
	
		  
}

function verifyDelete(){
		  return confirm('Are you sure you want to remove this image?');
		


}
function timedCount(){
	    getNextLogo();
	    t=setTimeout("timedCount()",60000);
}



function getNextLogo (){
	    var randomnumber=Math.floor(Math.random()*9);
	    while (randomnumber == 0){
			randomnumber  = Math.floor(Math.random()*9);
	    }
	    var logo = 'images/logo'+randomnumber+'.png';
	    document.getElementById("logo_image").src=logo;
}


