function setDetails(){
	document.getElementById('contactLink').href="mailto:contact@poeticcreative.com";
	document.getElementById('contactInfo').innerHTML="<b>phone:</b> 303.731.3106&nbsp;&nbsp; <b>email:</b> contact@poeticcreative.com";
	document.getElementById('joinInfoContent').innerHTML="<div class='favoriteTitleBox'><span class='joinInfo'>join the poetic mailing list</span></div><span class='displayText' style='color:rgb(70,70,70)'>&larr; Enter your name and email in the form to the left and anticipate receiving updates when we release new products, add new games,  make special offers, or have important news. We respect your privacy and will not share your information with any third party.<br />";
}

function defineLink(identifier){
switch (identifier){
	case 'studioButton':
		window.location = 'workSamplePages/samples-matchbox.html';
		break;
	case 'studioButton_wrksmpl':
		window.location = 'samples-matchbox.html';
		break;
	case 'studioButton_shpitm':
		window.location = '../workSamplePages/samples-matchbox.html';
		break;
	}
}

function setSamplePresent(id){
window.frames['navFrame'].document.getElementById(id).className = "sampleIconPresent";
}

function navAutoScroll(dir,overRide){
window.frames['navFrame'].scrollSampleSlip(dir,overRide);
}

function shopNavAutoScroll(dir,overRide){
window.frames['navFrame'].scrollShopSlip(dir,overRide);
}

function toggleButton(buttonId, inOrOut){
  if(inOrOut == 'in'){
    document.getElementById(buttonId).className = 'navButtonOver';
	}else{
	document.getElementById(buttonId).className = 'navButton';
	}
}
function toggleCommerceButton(buttonId, inOrOut){
  if(inOrOut == 'in'){
    document.getElementById(buttonId).style.backgroundColor = 'rgb(80,80,80)';
	document.getElementById(buttonId).style.borderColor = 'rgb(80,80,80)';
	document.getElementById(buttonId).style.color = 'white';
	}else{
	document.getElementById(buttonId).style.backgroundColor = 'white';
	document.getElementById(buttonId).style.borderColor = 'silver';
	document.getElementById(buttonId).style.color = 'gray';
	}
}

function showDropDown(id){
document.getElementById(id).style.display = 'block';
}
function hideDropDown(id){
document.getElementById(id).style.display = 'none';
}

function swapDispImg(srcName){
document.getElementById("displayImage").src = "../images/displayImages/"+srcName;
}

var mt=0;
var position=0;
function scrollSampleSlip(dir,overRide){
clearTimeout('tDown'); 
clearTimeout('tUp');
//having these above commands seems to help prevent jittering if the down and up arrows are pressed to quickly after one another.
if(overRide){position=overRide;}
//the 'overRide' variable is used for the auto-scrolling that happens on sample pages that feature samples in the bottom two quarters of the sample slip.

  if (dir==1 && position==0){
  if(mt>-430){
    document.getElementById("scrollButtonDown").style.marginLeft = '-30px';
    document.getElementById("sampleIconSlip").style.marginTop = mt+'px';
	mt=mt*1.09-1;
	if(mt<-431){mt=-430;document.getElementById("sampleIconSlip").style.marginTop = mt+'px';}//This line deals with the gap resulting from the multiplication of mt, and ensures that the sampleIconSlip gets positioned just right.
	tUp=setTimeout("scrollSampleSlip(1)",10);
	}else{document.getElementById("scrollButtonDown").style.marginLeft = '-25px'; position=1; setPositionBox(2); stScrlBtnOpcty('normal');return null;}
  }
  
  if (dir==1 && position==1){
  if(mt>-860){
    document.getElementById("scrollButtonDown").style.marginLeft = '-30px';
    document.getElementById("sampleIconSlip").style.marginTop = mt+'px';
	mt=mt*1.02-1;
	if(mt<-861){mt=-860;document.getElementById("sampleIconSlip").style.marginTop = mt+'px';}//This line deals with the gap resulting from the multiplication of mt, and ensures that the sampleIconSlip gets positioned just right.
	tUp=setTimeout("scrollSampleSlip(1)",10);
	}else{document.getElementById("scrollButtonDown").style.marginLeft = '-25px'; position=2; setPositionBox(3); stScrlBtnOpcty('normal');return null;}
  }
  
  if (dir==1 && position==2){
  if(mt>-1290){
    document.getElementById("scrollButtonDown").style.marginLeft = '-30px';
    document.getElementById("sampleIconSlip").style.marginTop = mt+'px';
	mt= (overRide) ? mt*1.05-1 : mt-(1-0.1*(mt+860));
	if(mt<-1291){mt=-1290;document.getElementById("sampleIconSlip").style.marginTop = mt+'px';}//This line deals with the gap resulting from the multiplication of mt, and ensures that the sampleIconSlip gets positioned just right.
	tUp= (overRide) ? setTimeout("scrollSampleSlip(1,2)",10) : setTimeout("scrollSampleSlip(1)",10);
	}else{document.getElementById("scrollButtonDown").style.marginLeft = '-25px'; position=3; setPositionBox(4); stScrlBtnOpcty('normal');stScrlBtnOpcty('noDown');return null;}
  }
  
  if (dir==0 && position==1){
  if(mt<1){
    document.getElementById("scrollButtonUp").style.marginLeft = '-30px';
    document.getElementById("sampleIconSlip").style.marginTop = mt+'px';
	mt=mt*0.95+1;
	if(mt>1){mt=0;document.getElementById("sampleIconSlip").style.marginTop = mt+'px';}
	tDown=setTimeout("scrollSampleSlip(0)",10);
	}else{document.getElementById("scrollButtonUp").style.marginLeft = '-25px'; position=0; setPositionBox(1); stScrlBtnOpcty('noUp');return null;}
  }
  
  if (dir==0 && position==2){
  if(mt<-430){
    document.getElementById("scrollButtonUp").style.marginLeft = '-30px';
    document.getElementById("sampleIconSlip").style.marginTop = mt+'px';
	mt=mt*0.98+1;
	if(mt>-431){mt=-430;document.getElementById("sampleIconSlip").style.marginTop = mt+'px';}
	tDown=setTimeout("scrollSampleSlip(0)",10);
	}else{document.getElementById("scrollButtonUp").style.marginLeft = '-25px'; position=1; setPositionBox(2); stScrlBtnOpcty('normal');return null;}
  }
  
  if (dir==0 && position==3){
  if(mt<-860){
    document.getElementById("scrollButtonUp").style.marginLeft = '-30px';
    document.getElementById("sampleIconSlip").style.marginTop = mt+'px';
	mt=mt+(1-0.1*(mt+860));
	if(mt>-861){mt=-860;document.getElementById("sampleIconSlip").style.marginTop = mt+'px';}
	tDown=setTimeout("scrollSampleSlip(0)",10);
	}else{document.getElementById("scrollButtonUp").style.marginLeft = '-25px'; position=2; setPositionBox(3); stScrlBtnOpcty('normal');return null;}
  }
}

function scrollShopSlip(dir,overRide){
clearTimeout('tDown'); 
clearTimeout('tUp');
//having these above commands seems to help prevent jittering if the down and up arrows are pressed to quickly after one another.
if(overRide){position=overRide;}
//the 'overRide' variable is used for the auto-scrolling that happens on sample pages that feature samples in the bottom two quarters of the sample slip.

  if (dir==1 && position==0){
  if(mt>-430){
    document.getElementById("scrollButtonDown").style.marginLeft = '-30px';
    document.getElementById("shopIconSlip").style.marginTop = mt+'px';
	mt=mt*1.09-1;
	if(mt<-431){mt=-430;document.getElementById("shopIconSlip").style.marginTop = mt+'px';}//This line deals with the gap resulting from the multiplication of mt, and ensures that the sampleIconSlip gets positioned just right.
	tUp=setTimeout("scrollShopSlip(1)",10);
	}else{document.getElementById("scrollButtonDown").style.marginLeft = '-25px'; position=1; setPositionBox(2); stScrlBtnOpcty('normal'); stScrlBtnOpcty('noDown');return null;}
  }
  
  if (dir==0 && position==1){
  if(mt<1){
    document.getElementById("scrollButtonUp").style.marginLeft = '-30px';
    document.getElementById("shopIconSlip").style.marginTop = mt+'px';
	mt=mt*0.95+1;
	if(mt>1){mt=0;document.getElementById("shopIconSlip").style.marginTop = mt+'px';}
	tDown=setTimeout("scrollShopSlip(0)",10);
	}else{document.getElementById("scrollButtonUp").style.marginLeft = '-25px'; position=0; setPositionBox(1); stScrlBtnOpcty('normal'); stScrlBtnOpcty('noUp');return null;}
  }
}

function setPositionBox(position){
for (i=1; i<5; i++){
  var brdrclr = (i==position) ? 'white' : 'rgb(230,230,230)';
  var bgndclr = (i==position) ? 'silver' : 'rgb(250,250,250)';
  document.getElementById("positionBox"+i).style.backgroundColor = bgndclr;
  document.getElementById("positionBox"+i).style.borderColor = brdrclr;
  }
}

function stScrlBtnOpcty(state){
//alert('called');
if (state == 'noUp'){
    document.getElementById("scrollButtonUp").style.filter = "alpha(opacity=50)";
	document.getElementById("scrollButtonUp").style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=50)";
	document.getElementById("scrollButtonUp").style.MozOpacity = "50%";
	document.getElementById("scrollButtonUp").style.KhtmlOpacity = "0.5";
	document.getElementById("scrollButtonUp").style.opacity = "0.5";
	document.getElementById("scrollButtonUp").style.cursor='none';
	}
if (state == 'noDown'){
    document.getElementById("scrollButtonDown").style.filter = "alpha(opacity=50)";
	document.getElementById("scrollButtonDown").style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=50)";
	document.getElementById("scrollButtonDown").style.MozOpacity = "50%";
	document.getElementById("scrollButtonDown").style.KhtmlOpacity = "0.5";
	document.getElementById("scrollButtonDown").style.opacity = "0.5";
	document.getElementById("scrollButtonDown").style.cursor='none';
	}
if (state == 'normal'){
    document.getElementById("scrollButtonUp").style.filter = "alpha(opacity=100)";
	document.getElementById("scrollButtonUp").style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=100)";
	document.getElementById("scrollButtonUp").style.MozOpacity = "100%";
	document.getElementById("scrollButtonUp").style.KhtmlOpacity = "1.0";
	document.getElementById("scrollButtonUp").style.opacity = "1.0";
    document.getElementById("scrollButtonDown").style.filter = "alpha(opacity=100)";
	document.getElementById("scrollButtonDown").style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=100)";
	document.getElementById("scrollButtonDown").style.MozOpacity = "100%";
	document.getElementById("scrollButtonDown").style.KhtmlOpacity = "1.0";
	document.getElementById("scrollButtonDown").style.opacity = "1.0";
	document.getElementById("scrollButtonUp").style.cursor='pointer';
	document.getElementById("scrollButtonDown").style.cursor='pointer';
	}
}

var descOp = 100;
var descMl = 120;
function transitionSillyFace(){
if(descOp>0){
    parent.document.getElementById("descriptionDiv").style.filter = "alpha(opacity="+descOp+")";
	parent.document.getElementById("descriptionDiv").style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity="+descOp+")";
	parent.document.getElementById("descriptionDiv").style.MozOpacity = descOp+"%";
	parent.document.getElementById("descriptionDiv").style.KhtmlOpacity = descOp/100;
	parent.document.getElementById("descriptionDiv").style.opacity = descOp/100;
	descOp=descOp-5;
	t=setTimeout("transitionSillyFace()",100);
	}else{
	descOp=0;
	parent.document.getElementById("descriptionDiv").style.display = 'none';
	}
if(descMl<155){
	parent.document.getElementById("sillyFaceDiv").style.marginLeft = descMl+"px";
	descMl = descMl*1.001;
	t=setTimeout("transitionSillyFace()",100);
	}
}


var w=120;
function showEmailForm(){
  if (w<620){
  document.getElementById("emailFormDiv").style.width = w+"px";
  w=w*1.04;
  t=setTimeout("showEmailForm()",10);
  }
document.getElementById("elistname").focus();
}

function hideEmailForm(){
  if (w>110){
  document.getElementById("emailFormDiv").style.width = w+"px";
  w=w*0.95;
  t=setTimeout("hideEmailForm()",10);
  }
}

function showHide(visibility, id){
if (visibility == 'yes'){
  document.getElementById(id).style.display ='block';
  }else{
  document.getElementById(id).style.display ='none';
  }
}

function setFocus(id){
  document.getElementById(id).focus();
}

var fieldFlag = 0;
function setFieldValue(id,val){
if(fieldFlag == 0){
  document.getElementById(id).value = val;
  fieldFlag=1;
}
}

function fillPaypalField(v){
  document.getElementById("paypalInput").value = v;
}

var cOp=20;
function fadeContact(dir){
if(dir=='up'){
if(cOp<100){
	document.getElementById("contactArrow").style.filter = "alpha(opacity="+cOp+")";
	document.getElementById("contactArrow").style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity="+cOp+")";
	document.getElementById("contactArrow").style.MozOpacity = cOp+"%";
	document.getElementById("contactArrow").style.KhtmlOpacity = cOp/100;
	document.getElementById("contactArrow").style.opacity = cOp/100;
	
	document.getElementById("contactInfo").style.filter = "alpha(opacity="+cOp+")";
	document.getElementById("contactInfo").style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity="+cOp+")";
	document.getElementById("contactInfo").style.MozOpacity = cOp+"%";
	document.getElementById("contactInfo").style.KhtmlOpacity = cOp/100;
	document.getElementById("contactInfo").style.opacity = cOp/100;
	cOp=cOp+1;
	t=setTimeout("fadeContact('up')",10);
	}
}else{
if(cOp>0){
	document.getElementById("contactArrow").style.filter = "alpha(opacity="+cOp+")";
	document.getElementById("contactArrow").style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity="+cOp+")";
	document.getElementById("contactArrow").style.MozOpacity = cOp+"%";
	document.getElementById("contactArrow").style.KhtmlOpacity = cOp/100;
	document.getElementById("contactArrow").style.opacity = cOp/100;
	
	document.getElementById("contactInfo").style.filter = "alpha(opacity="+cOp+")";
	document.getElementById("contactInfo").style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity="+cOp+")";
	document.getElementById("contactInfo").style.MozOpacity = cOp+"%";
	document.getElementById("contactInfo").style.KhtmlOpacity = cOp/100;
	document.getElementById("contactInfo").style.opacity = cOp/100;
	cOp=cOp-5;
	t=setTimeout("fadeContact('down')",10);
	}
}
}

var scrollMarker = 0
function pageScroll(override){
if(override){
	if(scrollMarker<30){
		window.scrollBy(0,20); // horizontal and vertical scroll increments
		scrollMarker++;
		scrolldelay = setTimeout('pageScroll(1)',10); // scrolls every 100 milliseconds
		}else{
		clearTimeout(scrolldelay);
		}
}else{
	if(scrollMarker<140){
		window.scrollBy(0,1); // horizontal and vertical scroll increments
		scrollMarker++;
		scrolldelay = setTimeout('pageScroll()',10); // scrolls every 100 milliseconds
		}else{
		clearTimeout(scrolldelay);
		}
	}
}
	


//Start Bravenet.com Service Code
function validate_elist_135157765()
{
    e = document.getElementById('elist_err135157765');
    e.innerHTML="";
    regexPattern = "^[-!#$%&'*+./0-9=?A-Z^_`a-z{|}]+@[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~.]+?.+[a-zA-Z]{2,4}$";
    if (!document.getElementById('elistaddress135157765').value.match(regexPattern))
    {
        e.innerHTML += 'Invalid email address :(&nbsp;&nbsp;';
    }
    if (e.innerHTML != "") return false;
    return true;
}
//End Bravenet.com Service Code


/*This function is here to make sure hitting the enter key does not submit the what if form. 
When it did, it was not submitting the content, it was just refreshing the page.
I got this code from http://www.webcheatsheet.com/javascript/disable_enter_key.php*/
function stopRKey(evt) { 
  var evt = (evt) ? evt : ((event) ? event : null); 
  var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); 
  if ((evt.keyCode == 13) && (node.type=="text"))  {return false;} 
} 

document.onkeypress = stopRKey; 
			



