function writetop(page) {
	var i = Math.ceil(Math.random()*5);
	var $html ='';
	if(page == 'v02') {
		$html = [ 
			'<img src="images/ftm/murks-',
			i,
			'.jpg" alt="" />'
		].join('');
	}
	else {
		$html = [ 
			'<img src="images/wfc/fluffy-',
			i,
			'.jpg" alt="" />'
		].join('');
	}
	document.write($html);
}

function popup(img) {
	window.open(img,'','width=308,height=262');
	return false;
}

var prevLink = '';

function switchltd(link) {
	document.getElementById('ltd-img').src = link.href;
	document.getElementById('ltd-hdr').src = 'images/ltd/print-' + link.innerHTML + '.gif';
	
	if( prevLink != '') { prevLink.parentNode.className = ''; }
	else { children = link.parentNode.parentNode.getElementsByTagName('LI'); children[0].className = ''; children[2].className = ''; }
	prevLink = link;
	prevLink.parentNode.className = 'on';
	return false;
}

function switchinfo(link) {
	document.getElementById('info-img').src = link.href;	
}

function writeTheForm() {
	document.write('<form action="http://echo7.bluehornet.com/phase2/bullseye/contactupdate1.php3" method="post" name="bullseye" id="bullseye" onsubmit="return doSubmit();" target="signup">');
	document.write('<input type="hidden" name="cid" value="25ee0c0c5392c0faf8d475917da10b" />');
	document.write('<input type="hidden" name="message" value="Thank you for signing up for the Brandon Boyd Art news! A confirmation email will be sent to the address you provided shortly." />');
	document.write('<input type="hidden" name="grp[]" value="528214" />');
	document.write('<input type="text" value="&gt;&nbsp;&nbsp;&nbsp;Please enter eMail address here" class="txt" name="email" id="email" onfocus="this.value = wipeout(this);" />');
	document.write('<input type="text" value="&gt;&nbsp;&nbsp;&nbsp;Please verify eMail address and enter here" class="txt" id="verify" onfocus="this.value = wipeout(this);" />');
	document.write('<input type="image" src="images/join/submit-btn.gif" alt="SUBMIT" name="submit" /></form>');
}

function wipeout(field) {
	var email = ">   Please enter eMail address here";
	var verify = ">   Please verify eMail address and enter here";
	if((field.value == email) || (field.value == verify)) { return ''; }
	return field.value;
}

function check_cdfs(form) {
	var email = document.getElementById('email').value;
	var verify = document.getElementById('verify').value;
	if(email == verify) { //2 fields match, but is it a valid email address?
		var last = email.lastIndexOf('@');
		if((last == email.indexOf('@')) && ( last > 0 )) { //ok
			return true;
		}
		else { 
			alert('It appears that you have enterred an invalid email address.\nPlease verify that it is correct and try again.');
			return false;
		}
	}
	alert('The email address you entered in both fields did not match.\nPlease verify that both entries are correct before submitting.');
	return false;
}
function doSubmit() {
	if (check_cdfs(document.survey)) {
		window.open('','signup','resizable=1,scrollbars=0,width=300,height=150');
		return true;
	}
	else { return false; }
}

/******************************************
* Scrollable content script II- © Dynamic Drive (www.dynamicdrive.com)
* Visit http://www.dynamicdrive.com/ for full source code
* This notice must stay intact for use
******************************************/

var iens6=document.all||document.getElementById;
var ns4=document.layers;

//specify speed of scroll (greater=faster)
var speed=1;

var crossobj;
var contentheight;

var movedownvar; var moveupvar; var moveIt;

function movedown(whichBox){
	crossobj = document.getElementById(whichBox);
	contentheight = crossobj.offsetHeight;
	
	if ((document.all||document.getElementById)&&(parseInt(crossobj.style.top)>=(contentheight*(-1)+100)))
	crossobj.style.top=parseInt(crossobj.style.top)-speed+"px";
	
	movedownvar=setTimeout(movedownmore,20);
}

function movedownmore() {
	if ((document.all||document.getElementById)&&(parseInt(crossobj.style.top)>=(contentheight*(-1)+100)))
	crossobj.style.top=parseInt(crossobj.style.top)-speed+"px";
	
	movedownvar=setTimeout(movedownmore,20);
}

function noMore(whichWay) {
	clearTimeout(whichWay);	
}

function moveup(whichBox){
	crossobj = document.getElementById(whichBox);
	contentheight = crossobj.offsetHeight;
	
	if ((document.all||document.getElementById)&&(parseInt(crossobj.style.top)<=0))
	crossobj.style.top=parseInt(crossobj.style.top)+speed+"px";

	moveupvar=setTimeout(moveupmore,20);
}

function moveupmore() {
	if ((document.all||document.getElementById)&&(parseInt(crossobj.style.top)<=0))
	crossobj.style.top=parseInt(crossobj.style.top)+speed+"px";
	
	moveupvar=setTimeout(moveupmore,20);
}


