// Facebook Like button
function fb(){
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) {return;}
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&appId=257800487586494";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
}
// Google Plus +1 button

  window.___gcfg = {lang: 'en-GB'};

  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();

window.onload=follow_the_stars;
window.onload=fb;
var showclass,ignore;
var iphone=false;
var ipad=false;
var sbhov=false;
var oldtc, oldbc;
var tempdetails, tempcolor, tempsize, tempweight, templeft, tempwidth, tempsearch, tempsimg;

if((navigator.userAgent.match(/iPad/i))) {
	document.write("<link rel=\"apple-touch-icon\" href=\"http://www.scoobyprojects.co.uk/icon.png\" />");
	document.write("<link type=\"text\/css\" rel=\"stylesheet\" media=\"all\" href=\"http://www.scoobyprojects.co.uk/css/ipad.css\" charset=\"utf-8\" \/>");
	document.write("<meta name=\"viewport\" content=\"width=920px, user-scalable = yes, maximum-scale=1.10996\" \/>");
	document.write("<meta name=\"format-detection\" content=\"telephone=no\" \/>");
	ipad=true;
} else if(navigator.userAgent.match(/iPhone/i)) {
	document.write("<link rel=\"apple-touch-icon\" href=\"http://www.scoobyprojects.co.uk/icon.png\" />");
	document.write("<link rel=\"apple-mobile-web-app-capable\" content=\"yes\" />");
	document.write("<link rel=\"apple-touch-startup-image\" href=\"http://www.scoobyprojects.co.uk/icons/iphone_splash.png\" />");
	document.write("<link type=\"text\/css\" rel=\"stylesheet\" media=\"all\" href=\"http://www.scoobyprojects.co.uk/css/iphone.css\" charset=\"utf-8\" \/>");
	document.write("<meta name=\"viewport\" content=\"width=device-width, user-scalable = yes\" \/>");
	document.write("<meta name=\"format-detection\" content=\"telephone=no\" \/>");
}	
	//										Follow the stars code...
function follow_the_stars(){
	var starbox=document.getElementById('stars');
	if(starbox && iphone==false && ipad==false){
		if(starbox.innerHTML==""){
			var starcode='<img src="http://www.scoobyprojects.co.uk/icons/blank.png" usemap="#starsMap" id="hoverstar"/>';
			starcode=starcode+'<map name="starsMap" id="starsMap"><area shape="poly" coords="59,13,65,35,68,38,105,44,68,48,63,53,59,76,54,53,50,49,13,45,49,40,53,37" href="http://www.scoobyprojects.co.uk/contact/directions.shtml" onmouseover="starhover()" onmouseout="starout()" onfocus="if(this.blur)this.blur()" /></map>';
			starbox.innerHTML=starcode;
		}
	}
}
function starhover(){ document.getElementById('hoverstar').src="http://www.scoobyprojects.co.uk/icons/star_hover.png"; }
function starout(){ document.getElementById('hoverstar').src="http://www.scoobyprojects.co.uk/icons/blank.png"; }

//										end of follow the stars
function sbhover(){
	var siloc=document.getElementById('sbimg');
	var sbloc=document.getElementById('searchbox');
	siloc.src="http://www.scoobyprojects.co.uk/icons/search_hover.png";
	if(sbhov==false){
		oldtc=sbloc.style.color;
		oldbc=sbloc.style.borderColor;
		sbloc.style.color="#000";
		sbloc.style.borderColor="#666";
		sbhov=true;
	}
}
function sbout(){
	var siloc=document.getElementById('sbimg');
	var sbloc=document.getElementById('searchbox');
	siloc.src="http://www.scoobyprojects.co.uk/icons/search.png";
	if(sbhov==true){
		sbloc.style.color=oldtc;
		sbloc.style.borderColor=oldbc;
		sbhov=false;
	}
}
function showmenu() {
	var sidemenu=document.getElementById('sidemenu');
	var shown=sidemenu.style.visibility;
	if(shown=='visible'){ sidemenu.style.visibility = 'hidden'; } else { sidemenu.style.visibility = 'visible'; }
}
function shopmenu() {
	var sidemenu=document.getElementById('navColumnOne');
	var shown=sidemenu.style.visibility;
	if(shown=='visible'){ sidemenu.style.visibility = 'hidden'; } else { sidemenu.style.visibility = 'visible'; }
}
function logo() {
	if(navigator.userAgent.match(/iPhone/i)) {
		document.write("<a href='http://www.scoobyprojects.co.uk/index.shtml'><img src='http://www.scoobyprojects.co.uk/icons/sp_iphone.png' alt='Scooby Projects' class='scoobyprojects' /></a>");
	} else {
		document.write("<a href='http://www.scoobyprojects.co.uk/index.shtml'><img src='http://www.scoobyprojects.co.uk/icons/scoobyprojects.png' alt='Scooby Projects' class='scoobyprojects' /></a>");
	}
}
function closenotice(){
	document.getElementById('notice').style.opacity=0;
}
