// 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','address','city','state','zip'];
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(FormOk){
document.forms[FormName].submit();	
}


}



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

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

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


}



function goup(FormName)
{
var theForm=document.getElementById('formShow');
var theMsg=document.getElementById('formHide');

//theForm.style.visibility="hidden";
theForm.style.display="none";
theMsg.style.display="block";
//if(FormOk){
document.forms[FormName].submit();	
//}


}







function textCounter() {

var maxlimit = 350;
var cntfield = document.getElementById('theCount');
var field = document.newartist2.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=7,0,0,0" width="800" height="400" id="rrcs3Home" align="middle">');
document.write('<param name="allowScriptAccess" value="sameDomain" />');
document.write('<param name="movie" value="mm/rrcs3Home.swf" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="bgcolor" value="#007d2d" />');

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

}

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

document.write('<param name="bgcolor" value="#007d2d" />');

document.write('<embed src="mm/rrcs3SiteBanner.swf" quality="high" bgcolor="#007d2d" width="450" height="145" name="rrcs3SiteBanner" 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="";
}


function gogoSockMonkey(){
	
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="300" height="225" id="FLVPlayer">');
document.write('<param name="movie" value="FLVPlayer_Progressive.swf" />');
document.write('<param name="salign" value="lt" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="scale" value="noscale" />');
document.write('<param name="FlashVars" value="&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=mm/sockumentary&autoPlay=true&autoRewind=false" />');
document.write('<param name="bgcolor" value="#5a471c" />');

document.write('<embed src="FLVPlayer_Progressive.swf" flashvars="&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=mm/sockumentary&autoPlay=true&autoRewind=false" quality="high" scale="noscale" width="300" height="225" name="FLVPlayer" bgcolor="#007d2d" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');	

}

