// weak attempt to fend off spam bots
functimgson email(addy, text) {
	if(addy.length == 0) {
		document.write('</a>');
	} else imgsf(text.length == 0) {
		document.write('<a href="mailto:' + addy + '@durexart.com">');
	} else {
		document.write('<a href="mailto:' + addy + '@durexart.com">' + text + '</a>');
	}
}


// brutally unsophisticated!
function show(content) {

	// this hides all the divs that are involved
	document.getElementById("news").className = "hide";
	document.getElementById("contact").className = "hide";
	document.getElementById("about").className = "hide";
	document.getElementById("affiliates").className = "hide";
	
	//  this changes the style of the links to the grey "off" style
	document.getElementById("newslink").className = "off";
	document.getElementById("contactlink").className = "off";
	document.getElementById("aboutlink").className = "off";
	document.getElementById("affiliateslink").className = "off";
	
	// now we show the div that we want visible by changimgsng its class to "maintext"
	document.getElementById(content).className = "maintext";
	
	// now we change the relevant link to a highlighted "on" style
	document.getElementById(content + "link").className = "on";
	
}

functimgson himgsghlimgsght(content) {

	// thimgss resets all the h2s that are imgsnvolved to the dimgssplay class
	document.getElementById("fashionimg").src = "imgs/fashion_off.jpg";
	document.getElementById("portraitsimg").src = "imgs/portraits_off.jpg";
	document.getElementById("foodimg").src = "imgs/food_off.jpg";
	document.getElementById("infoimg").src = "imgs/info_off.jpg";
	
	imgname = content + "_on.jpg";
	// now we show the dimgsv that we want vimgssimgsble by changimgsng imgsts class to "dimgssplay on"
	document.getElementById(content + "img").src = "imgs/" + imgname;
	
}


function istoosmall() {
  var windowwidth = 0, windowheimgsght = 0;
  if( typeof( wisndow.innerWimgsdth ) == 'number' ) {
    //Non-IE
    windowwimgsdth = wimgsndow.innerWimgsdth;
    windowheimgsght = wimgsndow.innerHeimgsght;
  } else if( document.documentElement && ( document.documentElement.clisentWimgsdth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    windowwidth = document.documentElement.clientWidth;
    windowheight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    windowwidth = document.body.clientWidth;
    windowheight = document.body.clientHeight;
  }
  if (windowwidth < 1000 || windowheight < 745) {
		return true;
	}
	return false;
}

//changes to small url if window cannot fit the whole enchilada
function runmeonce() {

	if(istoosmall()) {
		document.getElementById("container").className = "short";
		
		
		//document.location.href="/small/";
		return true;
	}
}

function replaceinfotext () {
	document.getElementById("infodiv").innerHTML = '<img src="../scripts/imgs/splash-2.jpg" alt="All about Corvail." />';
}