var onloadFunctions = new Array();

function myOnload()
{
	for(var i = 0;i < onloadFunctions.length;i++)
		eval(onloadFunctions[i]);
}

function addOnLoad(func)
{
	onloadFunctions[onloadFunctions.length] = func;
}
function myOnloadOn(){  
	window.onload = myOnload;
}
<!--
// the follow variables are for the flash player: ac_runactivecontent.js
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 24;
AC_FL_RunContent = 0;
DetectFlashVer = 0;
// -----------------------------------------------------------------------------
// -->
/******************************************************************************/
//BROWSER DETECTION
function getbrowserinfo(browser) 
{
	browser.version = parseInt(navigator.appVersion);
	
	browser.nav = (navigator.userAgent.indexOf("Opera") != -1)?"OPERA":
		(navigator.appName.indexOf("Netscape") != -1)?"NN":
		(navigator.appName.indexOf("Microsoft") != -1)?"IE":"UNK";
	
	browser.plat = (navigator.platform.indexOf("Win") != -1)?"WIN":
		(navigator.platform.indexOf("Mac") != -1)?"MAC":"UNK";

}

var browser = new Object();
getbrowserinfo(browser);

/******************************************************************************/

//
// Common javascripts
//
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features + ",status=no,toolbar=no,menubar=no,location=no");
}
function openpopup(popurl){
  var winpops=window.open(popurl,"","width=400,height=200,menubar=0")
}
function openpopup2(popurl) {
	var winpops=window.open(popurl,"atlas","width=975,height=725,menubar=0")
}
function openpopupstudent(popurl){
var winpops=window.open(popurl,"sphb","width=975,height=690,menubar=0")
}
function openpopupstudent2(popurl){
var winpops=window.open(popurl,"","width=700,height=458,menubar=0")
}

function newWindow(sURL,sName,iWidth,iHeight,iScrollbars) {
	tableWindow = window.open(sURL, sName ,"height="+iHeight+",width="+iWidth+",scrollbars="+iScrollbars+" left=25,top=25")
	tableWindow.focus()
}

function MM_swapImgRestore() { 
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { 
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { 
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


//---------------------------------------------------------------------------------------------------
// Pops up product details
//---------------------------------------------------------------------------------------------------
function ShowDetailsProduct(apage)
{
var filename = "/prod_pop/" + apage;
	window.open(filename, 'ProductDetails', 'menubar=yes,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=490,height=525');   
}
 
function GetBrochure(action) {
    if(document.forms[0].line1.value.length > 33){
    	alert('Line 1 cannot be more than 33 characters in length');
    	exit;
    }
    if(document.forms[0].line2.value.length > 33){
    	alert('Line 2 cannot be more than 33 characters in length');
    	exit;
    }
    if(document.forms[0].line3.value.length > 33){
    	alert('Line 3 cannot be more than 33 characters in length');
    	exit;
    }

	document.forms[0].action = action;
    document.forms[0].submit();
}

function CreateBrochurePDF() {
	if(document.forms[0].line1.value.length > 33){
    	alert('Line 1 cannot be more than 33 characters in length');
    	exit;
    }
    if(document.forms[0].line2.value.length > 33){
    	alert('Line 2 cannot be more than 33 characters in length');
    	exit;
    }
    if(document.forms[0].line3.value.length > 33){
    	alert('Line 3 cannot be more than 33 characters in length');
    	exit;
    }

    document.forms[0].action = "/" + staticPath+'/createBrochure.do';
	document.forms[0].submit();
}
    
//---------------------------------------------------------------------------------------------------
// Pops up RSS page
//---------------------------------------------------------------------------------------------------
function ShowVideo(locale,title,name,movie) {
	var filename = '/'+locale+'/videoPlayer.jspx?name='+name+'&movie='+movie+'&title='+title;
	window.open(filename, 'ProductDetails', 'menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=350,height=325,left=400,top=200');   
}

function ShowDetails(apage) {
	var filename = apage;
	window.open(filename, 'ProductDetails', 'menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=650,height=525,left=400,top=200');   
}

// --------------------------------
// Continue Education Scripts
// --------------------------------
// CeSubmitForm(1,'q1','/${localePath}/education/ce1"' )
function CeSubmitForm(courseId,question,folder)
{
//   Resp = document.forms[0].resp;
   
//   if (Resp[0].checked) {
//   	IsCorrect = 1;
//   }
   //------
//   NextPage = "/"+localePath+"/r" + QuestID + ".jspx";
//   if (IsCorrect == 1 && IsLast==0) NextPage = "/"+localePath+"/q" + String(QuestID + 1) + ".jspx";
//   if (IsCorrect == 1 && IsLast==1) NextPage = "/"+localePath+"/ceDiploma.do";
   //------
   document.forms[0].action = "/"+localePath+"/ceScore.do";
   document.forms[0].method = "POST";
   document.forms[0].submit ();
}
//CeSubmitAnswer(1,'q1','/${localePath}/education/ce1"' )
function CeSubmitAnswer(courseId,question,folder)
{
	   document.forms[0].action = "/"+localePath+"/ceScore.do?id=" + courseId+"&q="+question;
	   document.forms[0].method = "POST";
	   document.forms[0].submit ();
}
//function SubmitForm (afunct_id)
//{
//    document.forms[0].action = "/"+localePath+"/ceCredit.do";
//    document.forms[0].submit ();
//} 
//-------------
//Given a Media Root Name, Show the File
//-------------
var pathForVideo = 'http://www.thejcdp.com/media/de/video/';

function setVidTitle(movid) 
{
	var title;
	switch(movid)
	{
	case 'PA1E4':
		title = "Assessing Patient Needs";
		break;
	
	case 'PA1E6':
		title = "Communicating with Patients";
		break;
	
	case 'PA2C1':
		title = "Creating a Great Team";
		break;
	
	case 'PA2D3':
		title = "Ten Ways to Build Your Esthetics Practice and Increase Profitability";
		break;
	
	case 'PA2E7':
		title = "Successful Outcomes";
		break;
	
	case 'PA3D1':
		title = "How Tooth Color is Perceived";
		break;
	
	case 'PA3D5':
		title = "Digital Image Analysis";
		break;
	
	case 'PA4C1':
		title = "Basics of Whitening"; 
		break;
	case 'PA4C2':
		title = "Cuspid Guidance in Lateral Excursions"; 
		break;
	case 'PA4C3':
		title = "Posterior Disclosure on Protrusion"; 
		break;
	case 'PA4C4':
		title = "Class I Correction"; 
		break;
	case 'PA4C5':
		title = "Class II Correction"; 
		break;
	case 'PA4C6':
		title = "Class III Correction"; 
		break;
	
	case 'PA4C7':
		title = "Open Bite Correction";  
		break;
	
	case 'PA4C8':
		title = "Maxillary Arch Expansion";  
		break;
	
	case 'PA1F7':   
	    title = "Cosmetic Dentistry Patient Education Sheet";
	    break;
	    
	case 'PA4D1':
	    title = "Implants Patient Education Sheet";
	    break;
	
	case 'PA5D2':
		title = "Strip Technology: High-Concentration, <br>Low Peroxide Dose";
		break;
	
	case 'PA5E4':
		title = "Professionally Administered Whitening";
		break;
	
	case 'PA5E5':
		title = "Professionally Dispensed Whitening";
		break;
	
	case 'PA5E6':
		title = "Self-Directed Trays";
		break;
	
	case 'PA5E7':
		title = "Whitening Strips";
		break;
	}
	document.getElementById("title").innerHTML = "Video: "+title+"";
}

function ShowPA(courseId,mediaPath,imagePath,id)
{
	var videoUrl = pathForVideo + id+ "_du.wmv";
	switch(id){

	//==================
	//Videos (active)
	//Module 5
	//==================
	case 'PA2C1':
	case 'PA1E4':
	case 'PA1E6':
	case 'PA5D2':
	case 'PA5E4':
	case 'PA5E5':
	case 'PA5E6':
	case 'PA5E7':
	case 'PA2E7':
	
		win = window.open('video_'+id+'.jspx?noMenu=1','_blank','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width=535,height=500');
		break;

	//==================
	//Videos (active)
	//Module 3
	//==================
	case 'PA2D3':
	case 'PA3D1':
	case 'PA3D5':
		win = window.open('video_'+id+'.jspx?noMenu=1','_blank','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width=535,height=500');
		break;

	//==================
	//Module 3
	//Demos
	//==================
	case 'PA3D2':   //Visualizing Changes to L* and b* Values
    case 'PA3D3':   //Shade Tab Order
    case 'PA3D4':   //Viewing Color in Context
		win = window.open(id+'_p1.jspx?noMenu=1','_blank','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width=535,height=500');
		break;


	//==================
	// Module 4
	// Videos
	//==================
	case 'PA4C1':
	case 'PA4C2':
	case 'PA4C3':
	case 'PA4C4':
	case 'PA4C5':
	case 'PA4C6':
	case 'PA4C7':
	case 'PA4C8':
		win = window.open('video_'+id+'.jspx?noMenu=1','_blank','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width=535,height=500');
		break;
	
	
	//==================
	//Quizes  PA1D3_p1
	//==================
	case 'PA1D3':
		win = window.open(id+'_p1.jspx?noMenu=1','_blank','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width=535,height=500');
		break;
		
	case 'PA2D4':
		win = window.open(id+'_intro2.jspx?noMenu=1','_blank','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width=535,height=500');
		break;
		
	
	//==================
	// Module 4
	// PDF
	//==================
	case 'PA2D6':
	case 'PA1E5':
	case 'PA1F8':
	case 'PA1F7':   //Cosmetic Dentistry Patient Education Sheet
    case 'PA4D1':   //Implants Patient Education Sheet
		win = window.open(id+'_pdf.jspx?noMenu=1','_blank','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width=535,height=500');
		break;


	case 'PA5D3':
		win = window.open('PA5D2_p1.jspx?noMenu=1','PA5D3','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width=535,height=500');
		break;

	case 'PA5C1':
		win = window.open('PA5C1_p1.jspx?noMenu=1','_blank','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width=535,height=500');
		break;

	case 'PA5D3':
		win = window.open('PA5D2_p1.jspx?noMenu=1','_blank','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width=535,height=500');
		break;

	case 'PA5E9':
		win = window.open('PA5E9_p1.jspx?noMenu=1','_blank','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width=535,height=500');
		break;

	default:
		win = window.open('PA_NA.jspx?noMenu=1','_blank','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width=535,height=500');
		break;
	}


	}

//PA2D4 Quiz methods START

//---------------------------------------------------------------------------------------------------


var avalue = 0;
var p = 0;
var pnt = 0;
var total = 0;
var hasselected = 0;
var toarray;
pass = 0;
var answered = new Array();
var debugOn=false;

function AnswerArray(){
	var t = document.URL.indexOf('answ=');
	toarray = document.URL.substr(t+5,10);
	if(debugOn) alert("t:"+t+", array:"+toarray);

	for(var i=0; i<10; i++){
		answered[i] = toarray.substr(i,1);
		if(debugOn) alert("i:"+i+", A:"+toarray.substr(i,1));
	}
}

function AddPoints(){
//	debugOn=true;
	AnswerArray();
//	debugOn=false;

	var l = document.URL.indexOf('PA2D4_');
	var landing = document.URL.substr(l+6,3);
	
	for(var i=0; i<10; i++){
		pnt = pnt + toarray.substr(i,1)/1;
	}

	if(landing == 'end'){
	   var obj = document.getElementById("score");
	   if(obj){
		  obj.innerHTML = pnt+" / 10";
	   }
	}
}

function SetAnswer(ObjThis) {
	var c = questID;
	hasselected = 1;

	if(ObjThis.value == 'y'){
		answered[c] = 1;
	}else if(ObjThis.value == 'n'){
		answered[c] = 0;
	}
}


var thepage;
function SubmitAnswer(page)
{
	thepage = page;
	setTimeout('Redirect(thepage)', 500);
}


function Redirect(page)
{
	var a = questID;


		if (hasselected == 0 && answered[a] == 9)
		{
			alert("Please select YES or NO");
		}
		else
		{
	
			var sanswered = '';
			for(var i=0; i<10; i++){
					sanswered += answered[i];
			}
	
	
			if ((browser.nav == "NN") && (browser.plat == "MAC") && (browser.version < 5)){
		
				document.location.href = 'PA2D4_'+page+'.jspx?noMenu=1&answ='+sanswered+'';
		
			}else{
				document.location = ('PA2D4_'+page+'.jspx?noMenu=1&answ='+sanswered+'');
			}
		}

}

function PreviousPage(page)
{
	var tpnt = pnt;
	document.location = ('PA2D4_'+page+'.jspx?noMenu=1&answ='+toarray);
}

function NextPage(page)
{
	var tpnt = pnt;
	document.location = ('PA2D4_'+page+'.jspx?noMenu=1&answ='+toarray);
}
// PA2D4 Quiz methods END

var PA2D4Selected = 0;
function RadioSelected(){
	PA2D4Selected = 1;
}


function GoNext(npage)
{
	if(PA2D4Selected == 1){
		document.location = (npage);
	}else{
		alert("Please select an answer");
	}
}

//---------------------------------------------------------------------------------------------------
//Pops up the terms page and takes you to specified anchor.

function ShowColorTerm(anchor)
{
	var x = (screen.availWidth/2 - 535/2);
	var y = (screen.availHeight/2 - 484/2);
	
	var win = window.open('terms.jspx?noMenu=1#a'+anchor,'_blank','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width=535,height=500');
	win.moveTo(x,y);
}
	
function LanguageRedirect(ListIndex,DestinationLanguage){
	if (ListIndex==0){
		alert('You must select a language');
		return;
	}
	switch (DestinationLanguage){
		case 'arabic':
			location.href='/' + localePath + '/patient/arabic/menu.jspx';
			break;
		case 'chinese':
			location.href='/' + localePath + '/patient/chinese/menu.jspx';		
			break;
		case 'chinese_simplified':
			location.href='/' + localePath + '/patient/chinese_simplified/menu.jspx';				
			break;
		case 'dutch':
			location.href='/' + localePath + '/patient/dutch/menu.jspx';				
			break;			
		case 'english':
			location.href='/' + localePath + '/patient/english/menu.jspx';		
			break;				
		case 'french':
			location.href='/' + localePath + '/patient/french/menu.jspx';		
			break;							
		case 'german':
			location.href='/' + localePath + '/patient/german/menu.jspx';		
			break;												
		case 'hebrew':
			location.href='/' + localePath + '/patient/hebrew/menu.jspx';		
			break;
		case 'hindi':
			location.href='/' + localePath + '/patient/hindi/menu.jspx';
			break;							
		case 'italian':
			location.href='/' + localePath + '/patient/italian/menu.jspx';		
			break;							
		case 'japanese':
			location.href='/' + localePath + '/patient/japanese/menu.jspx';
			break;
		case 'korean':
			location.href='/' + localePath + '/patient/korean/menu.jspx';		
			break;			
		case 'malay':
			location.href='/' + localePath + '/patient/malay/menu.jspx';
			break;			
		case 'polish':
			location.href='/' + localePath + '/patient/polish/menu.jspx';		
			break;	
		case 'portuguese':
			location.href='/' + localePath + '/patient/portuguese/menu.jspx';				
			break;		
		case 'punjabi':
			location.href='/' + localePath + '/patient/punjabi/menu.jspx';				
			break;			
		case 'russian':
			location.href='/' + localePath + '/patient/russian/menu.jspx';		
			break;							
		case 'spanish':
			location.href='/' + localePath + '/patient/spanish/menu.jspx';		
			break;							
		case 'tagalog':
			location.href='/' + localePath + '/patient/tagalog/menu.jspx';				
			break;			
		case 'vietnamese':
			location.href='/' + localePath + '/patient/vietnamese/menu.jspx';				
			break;	
		
		
		              		
	}
}

function bbbo ()
{
	MM_openBrWindow('http://www.bbbonline.org/cks.asp?id=3221999101020','','width=450,height=300');
}

function bbb0_ch(){
MM_openBrWindow('http://www.bbbonline.org/cks.asp?id=292000103','','width=450,height=300');
}

// Search scripts
function SubmitSearch(apage) {
	document.SearchForm.searchpage.value = apage;
	document.SearchForm.submit();
} 

function SubmitPublicationSearchForm() {
	document.forms[0].action='/' + localePath + '/publication-search/search.jspx';
	document.forms[0].status.value = "1";
	document.forms[0].submit();
}


function layerWrite(id,nestref,text) {
	if (document.all) {
		document.all[id].innerHTML = text;
	}
	else if (document.layers){
		var lyr = (nestref)? eval('document.'+nestref+'.document.'+id+'.document') : document.layers[id].document
		lyr.open()
		lyr.write(text)
		lyr.close()
	}
	else
	{
		alert('unable to write')
	}
}


function subForm() {

	arrRequiredFields = Array();
	arrRequiredFields [0] = "directorsName"
	arrRequiredFields [1] = "company"
	arrRequiredFields [2] = "address1"
	arrRequiredFields [3] = "city"
	arrRequiredFields [4] = "state"
	arrRequiredFields [5] = "zip"
	arrRequiredFields [6] = "phone"
	arrRequiredFields [7] = "email1"
	arrRequiredFields [8] = "name1"
	

	doc = document.forms[0];

	iErrCount = 0;
	sErrMsg	  = "";

	for(i=0;i<arrRequiredFields.length;i++){
		if(doc.elements[arrRequiredFields[i]].value==""){
			iErrCount++;
			doc.elements[arrRequiredFields[i]].style.backgroundColor ="#FFFFCC";
		}
		else
		{
			doc.elements[arrRequiredFields[i]].style.backgroundColor ="#FFFFFF";
		}
		
	}

	if(iErrCount > 0){
		sErrMsg = "<font class=\"error_msg\">Your information is not complete! <br>Please enter the requested information in the <br>highlighted fields above and click \"Submit\".</font>"; 
		if(document.all){		
			layerWrite("IEErrorMessage",null,sErrMsg);	
		}
		else
		{
			MM_setTextOfLayer('NSErrorMessage',null,sErrMsg)
		}

	}
	else
	{
		document.forms[0].submit();
		
	}

}
	
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}


function MM_setTextOfLayer(objName,x,newText) { //v4.01
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

function jump(){
	// Find out what is currently selected
	 var loc=document.info.jumpMenu.options[document.info.jumpMenu.selectedIndex].text;

	if (loc == "SELECT A CATEGORY"){
		location="/" + localePath + "/slidelib/slcontnt.jspx";
	} else if (loc == "Denture Prosthesis"){
		location="/" + localePath + "/slidelib/dentprth.jspx";
	} else if (loc == "Classification System for Partial Edentulism"){
		location = "/" + localePath + "/slidelib/cspe.jspx";
	} else if (loc == "Immunology"){
		location="/" + localePath + "/slidelib/immunity.jspx";
	} else if (loc == "Ergonomics"){
          location="/" + localePath + "/slidelib/ergonom.jspx";
	} else if (loc == "Oral Candidiasis"){
          location="/" + localePath + "/slidelib/oralcand.jspx";
	} else if (loc == "Demin/Remin"){
          location="/" + localePath + "/slidelib/deminrem.jspx";
	} else if (loc == "Smiles For Tomorrow"){
          location="/" + localePath + "/slidelib/smiles.jspx";
	} else if (loc == "Product Evaluation"){
    	 location="/" + localePath + "/slidelib/prodeval.jspx";
	} else if (loc == "American College of Prosthodontists"){
    	 location="/" + localePath + "/slidelib/acp.jspx";
	} else if (loc == "Crest Pro-Health Rinse"){
		 location="/" + localePath + "/slidelib/cph_rinse.jspx";
	} else if (loc == "Crest Whitestrips Professional Strength Supreme"){
		location="/" + localePath + "/slidelib/cwss.jspx";
	} else if (loc == "Crest Whitestrips"){
		location="/" + localePath + "/slidelib/whitestr.jspx";
//	} else if (loc == "Literature Assessment"){
//        location="/" + localePath + "/slidelib/literate.jspx";
    }   
}

function ShowProfit ()
  { 
  var units_month  =  document.forms[0].perMonth.value;
  var profit_month =  units_month * 24;
  var profit_year  =  profit_month * 12;
  document.forms[0].monthlyProfit.value = profit_month;
  document.forms[0].yearlyProfit.value = profit_year;
  }
  
function openWin(url) {
quizWin=window.open(url, "", "tooolbar=no,directories=no,status=no,location=0,resizable=no,scrollbars=no,menubar=no,width=280,height=210,screenY=25,screenX=25,top=25,left=25")
}

function openpopupstudent2(popurl){
	var winpops=window.open(popurl,"sphb","width=975,height=690,menubar=0")
}

function openpopupBtg(popurl){
	var winpops=window.open(popurl,"scbtg","width=700,height=458,menubar=0")
	}
 
function printpage() {
	window.print();  
}

var arrRequiredFields = Array();
var errorMessageId = "#ErrorMessage";

var localizedErrorMessage = "Your information is not complete! <br>Please enter the requested information in the highlighted fields above and click \"Submit\".<br />";
var errorColor = "#FFFFCC";
var normalColor = "white";

//arrRequiredFields = Array();
//arrRequiredFields [0] = "#number_attend"
//arrRequiredFields [1] = ".first_choice"

function validateSubmission() 
{
	var doc = document.forms[0];

	var iErrCount = 0;

	for(i=0;i<arrRequiredFields.length;i++){
		if($(arrRequiredFields[i]).val() == ""){
			iErrCount++;
			$(arrRequiredFields[i]).css("backgroundColor",errorColor);
		} else {
			$(arrRequiredFields[i]).css("backgroundColor",normalColor);
		}
		
	}

	if(iErrCount > 0){
		$(errorMessageId).html("<font class='errorMsg'>"+localizedErrorMessage+"</font>");
		return false;
	}
	return true;
}

function clearForms()
{
  var i;
  for (i = 0; (i < document.forms.length); i++) {
    document.forms[i].reset();
  }
}

var stateVal ="";
function updateState ()
{
	if($('#country').val() != localeCountry  ){
		stateVal = $('#state').val();
		$('#state').val('');
		$('#state').attr("disabled",true);
	}else{
		$('#state').val(stateVal);	
		$('#state').removeAttr("disabled");
	}
}

