// JavaScript Document

function formPop(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=520,height=700,left=0,top=0');");
}




function entryForm(FormName)
{
//var theList = ['fName','lName','address','city','state','zip','email','phone1','phone2','phone3','artStatement','userImg1','userImg2','userImg3'];
var theList = ['fName','lName','email','phone1','phone2','phone3','artStatement','userImg1','userImg2','userImg3'];
var theLength = theList.length;
var  x       = 0;
var FormOk  = true;

while (x < theLength && (FormOk))
   {
     if (document.getElementById(theList[x]).value == '')
     { 
        alert('Please enter the '+document.getElementById(theList[x]).name +' and submit again.');
        document.getElementById(theList[x]).focus();
        FormOk = false ;
     }
     x ++;
   }
//return FormOk;

if (!document.getElementById('partRequ').checked){
	alert('Please read the Participant Requirements and check the box saying you have done so.');
	document.getElementById('partRequ').focus();
	FormOk=false;
}



if(FormOk){
document.forms[FormName].submit();	

}
}


function textCounter() {

var maxlimit = 350;
var cntfield = document.getElementById('theCount');
var field = document.newartist.artStatement;

if (field.value.length > maxlimit) { // if too long...trim it!

field.value = field.value.substring(0, maxlimit);

} else {  // otherwise, update 'characters left' counter

cntfield.value = maxlimit - field.value.length;
}

}

////this is the Flash embed workaround


function gogoFlashNav(){
	
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="800" height="200" id="rrcspageNav" align="middle">');
document.write('<param name="allowScriptAccess" value="sameDomain" />');
document.write('<param name="movie" value="mm/nav.swf" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="wmode" value="transparent" />');
document.write('<param name="bgcolor" value="#5a471c" />');

document.write('<embed src="mm/nav.swf" quality="high" wmode="transparent" bgcolor="#5a471c" width="800" height="200" name="rrcspageNav" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');	

}

function gogoFlashSplash(){
	
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="800" height="400" id="rrcsHome_3" align="middle">');
document.write('<param name="allowScriptAccess" value="sameDomain" />');
document.write('<param name="movie" value="mm/movie.swf" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="bgcolor" value="#5a471c" />');


document.write('<embed src="mm/movie.swf" quality="high" bgcolor="#5a471c" width="800" height="400" name="rrcsHome_3" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');	

}


//this is the script to swap out the images with the artist statement

/*function showState(theID,theStatement) {
	
document.getElementById(theID).innerHTML="<p>"+theStatement+"</p>";	
	
	
}

function hideState(theID){
document.getElementById(theID).innerHTML="";
}*/
function swapState(theID,theStatement,theTag){

var currentEntry=document.getElementById(theID).innerHTML;

if (currentEntry==""){
	showState(theID,theStatement,theTag);
}else{
	hideState(theID);
	
}
}


function showState(theID,theStatement,theTag) {

if(theTag=="none"){
document.getElementById(theID).innerHTML="<p>"+theStatement+"</p>";
	
}else{
document.getElementById(theID).innerHTML="<p>"+theStatement+"</p><a href=\"http://www."+theTag+"\"target=\"_blank\">"+theTag+"</a>";
}
}

function hideState(theID){
document.getElementById(theID).innerHTML="";
}


