/* ------------------------------------------------------------- 
   Send to a friend  ------------------------------------------ */  
   
	function openPopin(which,width,height) {
		document.getElementById(which).style.display = "block";
		positionneDiv(which,width,height);
	}
	
	function closePopin(which,width,height) {
	    document.getElementById("validate_send").style.display = "none";
		document.getElementById(which).style.display = "none";
	}


	function validate_form(){
			Goon = "0";
			var msg = "";
			if(document.getElementById("stf_name").value == ""){ Goon = "1"; document.getElementById("l_stf_name").className="error"; }else{ document.getElementById("l_stf_name").className="";}
			if(!checkEmail(document.getElementById("stf_email").value)){ Goon = "1"; document.getElementById("l_stf_email").className="error";	}else{ document.getElementById("l_stf_email").className="";}
			if(document.getElementById("stf_friend_name").value == ""){ Goon = "1"; document.getElementById("l_stf_friend_name").className="error"; }else{ document.getElementById("l_stf_friend_name").className="";}
			if(!checkEmail(document.getElementById("stf_friend_email").value)){	Goon = "1"; document.getElementById("l_stf_friend_email").className="error"; }else{ document.getElementById("l_stf_friend_email").className="";}
			if(Goon == "0")	{
				name = document.getElementById("stf_name").value;
				email = document.getElementById("stf_email").value;
				friendname = document.getElementById("stf_friend_name").value;
				friendemail = document.getElementById("stf_friend_email").value;
				message = document.getElementById("stf_comments").value;
				path_query_url = document.getElementById("path_query_url").value;
				
				http.open('get', '/4105/db_send.asp?path_query_url='+path_query_url+'&lang='+lang+'&name='+name+'&email='+email+'&friendname='+friendname+'&friendemail='+friendemail+'&message='+escape(message));
				http.onreadystatechange = handleLoginResponse;
				http.send(null);
			}else{	
				document.getElementById("validate_send").style.display = "block";
				document.getElementById("validate_send").innerHTML = sendtofriend_error;
			}
		}
			
			
		function handleLoginResponse(){
			if(http.readyState == 4){			
				if(http.responseText=="good"){			
					document.getElementById("validate_send").style.display = "block";
					document.getElementById("validate_send").innerHTML = sendtofriend_thankyou;
					document.getElementById("stf_name").value = "";
					document.getElementById("stf_email").value = "";
					document.getElementById("stf_friend_name").value = "";
					document.getElementById("stf_friend_email").value = "";
					document.getElementById("stf_comments").value = "";
				}else{
					document.getElementById("validate_send").style.display = "block";
					document.getElementById("validate_send").innerHTML = sendtofriend_error_connect;
				}
			}
		}


/* ---------------------------------------------------
   Center a div in the page  ------------------------- */

	var myWidth=0;
	var myHeight=0;
	function positionneDiv(divname,w,h){
		switch(browserName) {
			case "MSIE": ypos = document.body.scrollTop; break;
			case "NS": ypos = window.scrollY; break;
			case "Firefox": ypos = window.scrollY; break;
			default: ypos = document.body.scrollTop; break;
		}
		if( typeof( window.innerWidth ) == 'number' ) { //Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		}else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ){ //IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		}else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
		document.getElementById(divname).style.top = ypos + (myHeight/2) - (h/2) + "px";
		document.getElementById(divname).style.left = (myWidth/2) - (w/2) + "px";
	}



/* ------------------------------------------------------------- 
   Forms  ------------------------------------------ */  
   
  function generateProvinces(prefix){
	if (document.getElementById(prefix + 'country').options.value != ""){
		//remove all options
		the_field_select = document.getElementById(prefix + 'state').options;
		remove_all_options(the_field_select);
		if (document.getElementById(prefix + 'country').value == "United States"){
			the_field_select[the_field_select.length] = new Option(t_select_one,''); 
			the_field_select[the_field_select.length] = new Option('Alaska','US-AK'); 
			the_field_select[the_field_select.length] = new Option('Alabama','US-AL'); 
			the_field_select[the_field_select.length] = new Option('Arkansas','US-AR'); 
			the_field_select[the_field_select.length] = new Option('Arizona','US-AZ'); 
			the_field_select[the_field_select.length] = new Option('California','US-CA'); 
			the_field_select[the_field_select.length] = new Option('Colorado','US-CO'); 
			the_field_select[the_field_select.length] = new Option('Connecticut','US-CT'); 
			the_field_select[the_field_select.length] = new Option('District of Columbia','US-DC'); 
			the_field_select[the_field_select.length] = new Option('Delaware','US-DE'); 
			the_field_select[the_field_select.length] = new Option('Florida','US-FL'); 
			the_field_select[the_field_select.length] = new Option('Georgia','US-GA'); 
			the_field_select[the_field_select.length] = new Option('Hawaii','US-HI'); 
			the_field_select[the_field_select.length] = new Option('Iowa','US-IA'); 
			the_field_select[the_field_select.length] = new Option('Idaho','US-ID'); 
			the_field_select[the_field_select.length] = new Option('Illinois','US-IL'); 
			the_field_select[the_field_select.length] = new Option('Indiana','US-IN'); 
			the_field_select[the_field_select.length] = new Option('Kansas','US-KS'); 
			the_field_select[the_field_select.length] = new Option('Kentucky','US-KY'); 
			the_field_select[the_field_select.length] = new Option('Louisiana','US-LA'); 
			the_field_select[the_field_select.length] = new Option('Massachusetts','US-MA'); 
			the_field_select[the_field_select.length] = new Option('Maryland','US-MD'); 
			the_field_select[the_field_select.length] = new Option('Maine','US-ME'); 
			the_field_select[the_field_select.length] = new Option('Michigan','US-MI'); 
			the_field_select[the_field_select.length] = new Option('Minnesota','US-MN'); 
			the_field_select[the_field_select.length] = new Option('Missouri','US-MO'); 
			the_field_select[the_field_select.length] = new Option('Mississippi','US-MS'); 
			the_field_select[the_field_select.length] = new Option('Montana','US-MT'); 
			the_field_select[the_field_select.length] = new Option('North Carolina','US-NC'); 
			the_field_select[the_field_select.length] = new Option('North Dakota','US-ND'); 
			the_field_select[the_field_select.length] = new Option('Nebraska','US-NE'); 
			the_field_select[the_field_select.length] = new Option('New Hampshire','US-NH'); 
			the_field_select[the_field_select.length] = new Option('New Jersey','US-NJ'); 
			the_field_select[the_field_select.length] = new Option('New Mexico','US-NM'); 
			the_field_select[the_field_select.length] = new Option('Nevada','US-NV'); 
			the_field_select[the_field_select.length] = new Option('New York','US-NY'); 
			the_field_select[the_field_select.length] = new Option('Ohio','US-OH'); 
			the_field_select[the_field_select.length] = new Option('Oklahoma','US-OK'); 
			the_field_select[the_field_select.length] = new Option('Oregon','US-OR'); 
			the_field_select[the_field_select.length] = new Option('Pennsylvania','US-PA'); 
			the_field_select[the_field_select.length] = new Option('Rhode Island','US-RI'); 
			the_field_select[the_field_select.length] = new Option('South Carolina','US-SC'); 
			the_field_select[the_field_select.length] = new Option('South Dakota','US-SD'); 
			the_field_select[the_field_select.length] = new Option('Tennessee','US-TN'); 
			the_field_select[the_field_select.length] = new Option('Texas','US-TX'); 
			the_field_select[the_field_select.length] = new Option('Utah','US-UT'); 
			the_field_select[the_field_select.length] = new Option('Virginia','US-VA'); 
			the_field_select[the_field_select.length] = new Option('Vermont','US-VT'); 
			the_field_select[the_field_select.length] = new Option('Washington','US-WA'); 
			the_field_select[the_field_select.length] = new Option('Wisconsin','US-WI'); 
			the_field_select[the_field_select.length] = new Option('West Virginia','US-WV'); 
			the_field_select[the_field_select.length] = new Option('Wyoming','US-WY'); 					
			document.getElementById(prefix + 'state').disabled = false;
			
		} else if (document.getElementById(prefix + 'country').value == "Canada") {
			the_field_select[the_field_select.length] = new Option(t_select_one,''); 
			the_field_select[the_field_select.length] = new Option(t_province_ab,'CA-AB'); 
			the_field_select[the_field_select.length] = new Option(t_province_bc,'CA-BC'); 
			the_field_select[the_field_select.length] = new Option(t_province_mb,'CA-MB'); 
			the_field_select[the_field_select.length] = new Option(t_province_nb,'CA-NB'); 
			the_field_select[the_field_select.length] = new Option(t_province_nf,'CA-NF'); 
			the_field_select[the_field_select.length] = new Option(t_province_ns,'CA-NS'); 
			the_field_select[the_field_select.length] = new Option(t_province_nt,'CA-NT'); 
			the_field_select[the_field_select.length] = new Option(t_province_on,'CA-ON'); 
			the_field_select[the_field_select.length] = new Option(t_province_pe,'CA-PE'); 
			the_field_select[the_field_select.length] = new Option(t_province_qc,'CA-QC'); 
			the_field_select[the_field_select.length] = new Option(t_province_sk,'CA-SK'); 
			the_field_select[the_field_select.length] = new Option(t_province_yk,'CA-YK'); 
			document.getElementById(prefix + 'state').disabled = false;
		} else if (document.getElementById(prefix + 'country').value == "Australia") {
			the_field_select[the_field_select.length] = new Option('Select&hellip;',''); 
			the_field_select[the_field_select.length] = new Option('Australian Capital Territory','AU-AC'); 
			the_field_select[the_field_select.length] = new Option('New South Wales','AU-NS'); 
			the_field_select[the_field_select.length] = new Option('Northern Territory','AU-NT'); 
			the_field_select[the_field_select.length] = new Option('Queensland','AU-QL'); 
			the_field_select[the_field_select.length] = new Option('South Australia','AU-SA'); 
			the_field_select[the_field_select.length] = new Option('Tasmania','AU-TA'); 
			the_field_select[the_field_select.length] = new Option('Victoria','AU-VI'); 
			the_field_select[the_field_select.length] = new Option('Western Australia','AU-WA');
			document.getElementById(prefix + 'state').disabled = false;
 
		} else {
			the_field_select[the_field_select.length] = new Option('N/A','XX');
			document.getElementById(prefix + 'state').disabled = true;
		}	
	}
}



function remove_all_options(the_field_select){
	while (the_field_select.length > 0){
		the_field_select[0] = null;
	}
 }
 
 /* ------------------------------------------------------------- 
   Add an attendees  ---------------------------------------------- */  
   
		number_attendees = 1

		function firstAttendees(){

				/* Event - b_minus Cell */
				theTR = document.createElement("tr");
				theTR.setAttribute("id","line1_1");
				theTD = document.createElement("td");
				theTD.innerHTML = t_event + " <span>*</span>"
				theTD.setAttribute("width","220px");
				theTD.setAttribute("id","lbl_attendees_location_" + number_attendees );
				theTR.appendChild(theTD);
				
				theTD2 = document.createElement("td");
				theTD2.innerHTML = "* " + t_required_fields
				theTD2.setAttribute("height","35px" );
				//theTD2.setAttribute("valign","top" )
				theTD2.setAttribute("id","required" );
				theTR.appendChild(theTD2);
				
				document.getElementById("tbody_attendees").appendChild(theTR);
				
				/* /Event Cell */
				
				/* Event Select */
				
				theTR = document.createElement("tr");
				theTR.setAttribute("id","line1_2");
				theSelect = "<select tabindex='1' name='attendees_location_"+number_attendees+"' id='attendees_location_"+number_attendees+"' style='display:inline;'><option value>" + t_select_one + "</option>";
				for(k=0;k<arr_location.length;k++){
					theSelect += "<option value='" + arr_location[k][0] + "'>" + arr_location[k][1] + "</option>"
				};
				theSelect += "</select>"
				
				theTD = document.createElement("td");
				theTD.setAttribute("height","35px");
				theTD.setAttribute("colspan","2");
				//theTD.setAttribute("valign","top");
				theTD.innerHTML = theSelect
				theTR.appendChild(theTD);
				
				document.getElementById("tbody_attendees").appendChild(theTR);
				
				/* /Event Select */
				
				
				/* First Name - Last Name Cell */
				
				theTR = document.createElement("tr");
				theTR.setAttribute("id","line1_3");
				theTD = document.createElement("td");
				theTD.innerHTML = t_first_name + " <span>*</span>"
				theTD.setAttribute("width","220px");
				theTD.setAttribute("id","lbl_attendees_firstname_" + number_attendees );
				theTR.appendChild(theTD);
				
				theTD2 = document.createElement("td");
				theTD2.innerHTML = t_last_name + " <span>*</span>"
				theTD2.style.width = "220px"
				theTD2.setAttribute("width","220px");
				theTD2.setAttribute("id","lbl_attendees_lastname_" + number_attendees );
				theTR.appendChild(theTD2);
				
				document.getElementById("tbody_attendees").appendChild(theTR);
				
				/* /First Name - Last Name Cell */
				
				
				
				
				/* First Name - Last Name Input */
				
				theTR = document.createElement("tr");
				theTR.setAttribute("id","line1_4");
				theTD = document.createElement("td");
				theTD.setAttribute("height","35px");
				theTD.setAttribute("valign","top");
				theTD.innerHTML = "<input type='text' tabindex='2' name='attendees_firstname_"+number_attendees+"' id='attendees_firstname_"+number_attendees+"' style='display:inline;width:195px;' />"
				theTR.appendChild(theTD);
				
				theTD2 = document.createElement("td");
				theTD2.setAttribute("height","35px");
				theTD2.setAttribute("valign","top");
				theTD2.innerHTML = "<input type='text' tabindex='3' name='attendees_lastname_"+number_attendees+"' id='attendees_lastname_"+number_attendees+"' style='display:inline;' />"
				theTR.appendChild(theTD2);
				
				document.getElementById("tbody_attendees").appendChild(theTR);
				
				/* /First Name - Last Name Input */
				
				
				/* Company - Title Cell */
				
				theTR = document.createElement("tr");
				theTR.setAttribute("id","line1_5");
				theTD = document.createElement("td");
				theTD.innerHTML = t_company + " <span>*</span>"
				theTD.setAttribute("width","220px");
				theTD.setAttribute("id","lbl_attendees_company_" + number_attendees );
				theTR.appendChild(theTD);
				
				theTD2 = document.createElement("td");
				theTD2.innerHTML = t_title + " <span>*</span>"
				theTD2.style.width = "220px"
				theTD2.setAttribute("width","220px");
				theTD2.setAttribute("id","lbl_attendees_title_" + number_attendees );
				theTR.appendChild(theTD2);
				
				document.getElementById("tbody_attendees").appendChild(theTR);
				
				/* /Company - Title Cell */
				
				
				
				
				/* Company - Title Input */
				
				theTR = document.createElement("tr");
				theTR.setAttribute("id","line1_6");
				theTD = document.createElement("td");
				theTD.setAttribute("height","35px");
				//theTD.setAttribute("valign","top");
				theTD.innerHTML = "<input type='text' tabindex='4' name='attendees_company_"+number_attendees+"' id='attendees_company_"+number_attendees+"'  style='display:inline;' />"
				theTR.appendChild(theTD);	

				theTD2 = document.createElement("td");
				theTD2.setAttribute("height","35px");
				//theTD2.setAttribute("valign","top");
				theTD2.innerHTML = "<input type='text' tabindex='5' name='attendees_title_"+number_attendees+"' id='attendees_title_"+number_attendees+"'  style='display:inline;' />"
				theTR.appendChild(theTD2);
				
				document.getElementById("tbody_attendees").appendChild(theTR);
				
				/* /Company - Title Input */
				
				
				
				
				
				/* Email Cell */
				
				theTR = document.createElement("tr");
				theTR.setAttribute("id","line1_7");
				theTD = document.createElement("td");
				theTD.innerHTML = t_email + " <span>*</span>"
				theTD.setAttribute("width","220px");
				theTD.setAttribute("id","lbl_attendees_email_" + number_attendees );
				theTR.appendChild(theTD);
				
				document.getElementById("tbody_attendees").appendChild(theTR);
				
				/* /Email Cell */
				
				
				
				
				
				/* Email Input */
				
				theTR = document.createElement("tr");
				theTR.setAttribute("id","line1_8");
				theTD = document.createElement("td");
				theTD.setAttribute("height","35px");
				//theTD.setAttribute("valign","top");
				theTD.innerHTML = "<input type='text'tabindex='6' name='attendees_email_"+number_attendees+"' id='attendees_email_"+number_attendees+"'  style='display:inline;' />"
				theTR.appendChild(theTD);
				
				document.getElementById("tbody_attendees").appendChild(theTR);
				
				/* /Email Input */
				
				/* / Mobile */
				
				theTR = document.createElement("tr");
				theTR.setAttribute("id","line1_9");
				theTD = document.createElement("td");
				theTD.setAttribute("align","left");
				theTD.innerHTML = '<table width="200" style="margin-bottom:15px;"><tr><td width="25"><input type="checkbox" name="mobileTicket_1"  id="mobileTicket_1" onclick="showTicketNumber(this);" /></td><td valign="top">' + t_mobile_ticket_checkbox + '</td></tr><tr><td colspan="2" height="5"></td></tr><tr><td></td><td style="font-weight:normal;"><a href="javascript:getMobileInfo();">' + t_what + '</a></td></tr></table>';
				theTD.innerHTML += '<div id="mobileTicket_div_1" class="hide" style="margin-bottom:15px;font-weight:normal;"><strong> ' + t_mobile_ticket_number + '</strong> <span>*</span><br>(ex : 514-555-5555)<br><input type="text"  class="phoneFormat" name="mobileTicket_number_1" id="mobileTicket_number_1"/></div>';
				theTR.appendChild(theTD);
				document.getElementById("tbody_attendees").appendChild(theTR);
				
				/* Buttons Cell */
				
				theTR = document.createElement("tr");
				theTR.setAttribute("id","line1_10");
				theTD = document.createElement("td");
				theTD.innerHTML = '<a href="javascript:add_attendees();" ><img src="images/' + season + '/b_add.gif" id="b_add1" alt="Add Another Attendee" title="Add Another Attendee"   /></a>'

				theTR.appendChild(theTD);
				
				theTD = document.createElement("td");
				theTD.setAttribute("style","padding-left:10px;");
				theTD.innerHTML = '<a href="Javascript:void(RemoveAttendees('+number_attendees+'));" onmouseout="rollOut()"><img src="images/' + season + '/b_minus.gif" id="b_minus'+number_attendees+'" alt="Remove" style="display:none;" /></a>'
				
				theTR.appendChild(theTD);
				
				document.getElementById("tbody_attendees").appendChild(theTR);
				document.getElementById('number_attendees').value = number_attendees
				/* /Buttons Cell */
		}



		function add_attendees(){
			
			
			if (number_attendees <= 8){
			
			error=0;
			for (i=1;i<=number_attendees;i++){
						la_ligne = new String (document.getElementById('attendees_location_'+i).value + document.getElementById('attendees_firstname_'+i).value + document.getElementById('attendees_lastname_'+i).value + document.getElementById('attendees_email_'+i).value + document.getElementById('attendees_company_'+i).value + document.getElementById('attendees_title_'+i).value)
						if((la_ligne.length!=0)||(i==1)||(i==number_attendees)){
							if(document.getElementById('attendees_location_'+i).value==''){
								document.getElementById('lbl_attendees_location_'+i).className = "error";
								error = 1;
							}else{
								document.getElementById('lbl_attendees_location_'+i).className = "";
							};
							
							if(document.getElementById('attendees_firstname_'+i).value==''){
								document.getElementById('lbl_attendees_firstname_'+i).className = "error";
								error = 1;
							}else{
								document.getElementById('lbl_attendees_firstname_'+i).className = "";
							};
							
							if(document.getElementById('attendees_lastname_'+i).value==''){
								document.getElementById('lbl_attendees_lastname_'+i).className = "error";	
								error = 1;
							}else{
								document.getElementById('lbl_attendees_lastname_'+i).className = "";
							};
							
							if(document.getElementById('attendees_email_'+i).value==''){
								document.getElementById('lbl_attendees_email_'+i).className = "error";
								error = 1;
							}else{
								document.getElementById('lbl_attendees_email_'+i).className = "";
							};
							
							if(document.getElementById('attendees_company_'+i).value==''){
								document.getElementById('lbl_attendees_company_'+i).className = "error";
								error = 1;
							}else{
								document.getElementById('lbl_attendees_company_'+i).className = "";
							};
							
							if(document.getElementById('attendees_title_'+i).value==''){
								document.getElementById('lbl_attendees_title_'+i).className = "error";
								error = 1;
							}else{
								document.getElementById('lbl_attendees_title_'+i).className = "";
							};

							if( document.getElementById('mobileTicket_'+i).checked == true && document.getElementById('mobileTicket_number_'+i).value==''){
								document.getElementById('mobileTicket_div_'+i).className = "error";
								error = 1;
							}							
							if( document.getElementById('mobileTicket_'+i).checked == true && document.getElementById('mobileTicket_number_'+i).value!=''){
							    if (!checkPhone(document.getElementById('mobileTicket_number_'+i).value)){
							    	document.getElementById('mobileTicket_div_'+i).className = "error";
								    error = 1;
							    }else{
							        document.getElementById('mobileTicket_div_'+i).className = "";
							    }
							}
						};
						if (!checkEmail(document.getElementById('attendees_email_'+i).value)){
							document.getElementById('lbl_attendees_email_'+i).className = "error";
							error = 1;
						}else{
							document.getElementById('lbl_attendees_email_'+i).className = "";
						};
					};
					
					
			if(error==1 || document.getElementById("attendees_location_"+ number_attendees).value == "" || document.getElementById("attendees_firstname_"+ number_attendees).value == "" || document.getElementById("attendees_lastname_"+ number_attendees).value == "" || document.getElementById("attendees_email_"+ number_attendees).value == "" || document.getElementById("attendees_company_"+ number_attendees).value == "" || document.getElementById("attendees_title_"+ number_attendees).value == ""){
				//alert("Please fill all fields for attendee #" + number_attendees + " before attempting to add another attendee.");
				
					
			}else{
				document.getElementById('b_minus1').style.display='block';
				number_attendees += 1;
						
						
				theTR = document.createElement("tr");
				theTD = document.createElement("td");
				theTD.innerHTML = '<br /><br />'
				theTD.setAttribute("colspan","4");
				theTR.appendChild(theTD);
				
				document.getElementById("tbody_attendees").appendChild(theTR);

				/* Event - b_minus Cell */
				theTR = document.createElement("tr");
				theTR.setAttribute("id","line"+number_attendees+"_1");
				theTD = document.createElement("td");
				theTD.innerHTML = "Event"
				theTD.setAttribute("width","220px");
				theTD.setAttribute("id","lbl_attendees_location_" + number_attendees );
				theTR.appendChild(theTD);
				
				document.getElementById("tbody_attendees").appendChild(theTR);
				
				/* /Event Cell */
				
				/* Event Select */
				
				theTR = document.createElement("tr");
				theTR.setAttribute("id","line"+number_attendees+"_2");
				theSelect = "<select tabindex='" + ((number_attendees-1) * 6 + 1) + "' name='attendees_location_"+number_attendees+"' id='attendees_location_"+number_attendees+"' style='display:inline;'>";
				theSelect += "<option value=''>Select...</option>"
				for(k=0;k<arr_location.length;k++){
					theSelect += "<option value='" + arr_location[k][0] + "'>" + arr_location[k][1] + "</option>"
				};
				theSelect += "</select>"
				
				theTD = document.createElement("td");
				theTD.setAttribute("height","35px");
				//theTD.setAttribute("valign","top");
				theTD.innerHTML = theSelect
				theTR.appendChild(theTD);
				
				document.getElementById("tbody_attendees").appendChild(theTR);
				
				/* /Event Select */
				
				/* First Name - Last Name Cell */
				
				theTR = document.createElement("tr");
				theTR.setAttribute("id","line"+number_attendees+"_3");
				theTD = document.createElement("td");
				theTD.innerHTML = "First Name"
				theTD.setAttribute("width","220px");
				theTD.setAttribute("id","lbl_attendees_firstname_" + number_attendees );
				theTR.appendChild(theTD);
				
				theTD2 = document.createElement("td");
				theTD2.innerHTML = "Last Name"
				theTD2.style.width = "220px"
				theTD2.setAttribute("width","220px");
				theTD2.setAttribute("id","lbl_attendees_lastname_" + number_attendees );
				theTR.appendChild(theTD2);
				
				document.getElementById("tbody_attendees").appendChild(theTR);
				
				/* /First Name - Last Name Cell */
			
				/* First Name - Last Name Input */
				
				theTR = document.createElement("tr");
				theTR.setAttribute("id","line"+number_attendees+"_4");
				theTD = document.createElement("td");
				theTD.setAttribute("height","35px");
				//theTD.setAttribute("valign","top");
				theTD.innerHTML = "<input type='text' tabindex='" + ((number_attendees-1) * 6 + 2) + "' name='attendees_firstname_"+number_attendees+"' id='attendees_firstname_"+number_attendees+"' style='display:inline;' />"
				theTR.appendChild(theTD);
				
				theTD2 = document.createElement("td");
				theTD2.setAttribute("height","35px");
				//theTD2.setAttribute("valign","top");
				theTD2.innerHTML = "<input type='text' tabindex='" + ((number_attendees-1) * 6 + 3) + "' name='attendees_lastname_"+number_attendees+"' id='attendees_lastname_"+number_attendees+"' style='display:inline;' />"
				theTR.appendChild(theTD2);
				
				document.getElementById("tbody_attendees").appendChild(theTR);
				
				/* /First Name - Last Name Input */
				
				/* Company - Title Cell */
				
				theTR = document.createElement("tr");
				theTR.setAttribute("id","line"+number_attendees+"_5");
				theTD = document.createElement("td");
				theTD.innerHTML = "Company"
				theTD.setAttribute("width","220px");
				theTD.setAttribute("id","lbl_attendees_company_" + number_attendees );
				theTR.appendChild(theTD);
				
				theTD2 = document.createElement("td");
				theTD2.innerHTML = "Title"
				theTD2.style.width = "220px"
				theTD2.setAttribute("width","220px");
				theTD2.setAttribute("id","lbl_attendees_title_" + number_attendees );
				theTR.appendChild(theTD2);
				
				document.getElementById("tbody_attendees").appendChild(theTR);
				
				/* /Company - Title Cell */

				/* Company - Title Input */
				
				theTR = document.createElement("tr");
				theTR.setAttribute("id","line"+number_attendees+"_6");
				theTD = document.createElement("td");
				theTD.setAttribute("height","35px");
				//theTD.setAttribute("valign","top");
				theTD.innerHTML = "<input type='text' tabindex='" + ((number_attendees-1) * 6 + 4) + "' name='attendees_company_"+number_attendees+"' id='attendees_company_"+number_attendees+"'  style='display:inline;' />"
				theTR.appendChild(theTD);	

				theTD2 = document.createElement("td");
				theTD2.setAttribute("height","35px");
				//theTD2.setAttribute("valign","top");
				theTD2.innerHTML = "<input type='text' tabindex='" + ((number_attendees-1) * 6 + 5) + "' name='attendees_title_"+number_attendees+"' id='attendees_title_"+number_attendees+"'  style='display:inline;' />"
				theTR.appendChild(theTD2);
				
				document.getElementById("tbody_attendees").appendChild(theTR);
				
				/* /Company - Title Input */
				
				/* Email Cell */
				
				theTR = document.createElement("tr");
				theTR.setAttribute("id","line"+number_attendees+"_7");
				theTD = document.createElement("td");
				theTD.innerHTML = "Email"
				theTD.setAttribute("width","220px");
				theTD.setAttribute("id","lbl_attendees_email_" + number_attendees );
				theTR.appendChild(theTD);
				
				document.getElementById("tbody_attendees").appendChild(theTR);
				
				/* /Email Cell */
				
				/* Email Input */
				
				theTR = document.createElement("tr");
				theTR.setAttribute("id","line"+number_attendees+"_8");
				theTD = document.createElement("td");
				theTD.setAttribute("height","35px");
				//theTD.setAttribute("valign","top");
				theTD.innerHTML = "<input type='text'tabindex='" + ((number_attendees-1) * 6 + 6) + "' name='attendees_email_"+number_attendees+"' id='attendees_email_"+number_attendees+"' style='display:inline;' />"
				theTR.appendChild(theTD);
				
				document.getElementById("tbody_attendees").appendChild(theTR);
				
				/* /Email Input */
				
				
				/* / Mobile */
				
				theTR = document.createElement("tr");
				theTR.setAttribute("id","line"+number_attendees+"_9");
				theTD = document.createElement("td");
				theTD.setAttribute("align","left");
				theTD.innerHTML = '<table width="200" style="margin-bottom:15px;"><tr><td width="25"><input type="checkbox" name="mobileTicket_' + number_attendees + '"  id="mobileTicket_' + number_attendees + '" onclick="showTicketNumber(this);"/></td><td valign="top">' + t_mobile_ticket_checkbox + '</td></tr></table>';
				theTD.innerHTML += '<div id="mobileTicket_div_' + number_attendees + '" class="hide" style="margin-bottom:15px;font-weight:normal;"><strong> ' + t_mobile_ticket_number + '</strong> <span>*</span><br>(ex : 514-555-5555)<br><input type="text"  class="phoneFormat" name="mobileTicket_number_' + number_attendees + '" id="mobileTicket_number_' + number_attendees + '"/></div>';
				theTR.appendChild(theTD);
				document.getElementById("tbody_attendees").appendChild(theTR);
				
				/* Buttons Cell */
				
				theTR = document.createElement("tr");
				theTR.setAttribute("id","line"+number_attendees+"_10");
				theTD = document.createElement("td");
				theTD.innerHTML = '<a href="javascript:add_attendees();"><img src="images/' + season + '/b_add.gif" id="b_add'+number_attendees+'" alt="Add Another Attendee" title="Add Another Attendee" /></a>'

				theTR.appendChild(theTD);
				
				theTD = document.createElement("td");
				theTD.setAttribute("style","padding-left:10px;");
				theTD.innerHTML = '<a href="Javascript:void(RemoveAttendees('+number_attendees+'));"><img src="images/' + season + '/b_minus.gif" id="b_minus'+number_attendees+'" alt="Remove"  /></a>'
				theTR.appendChild(theTD);
				
				document.getElementById("tbody_attendees").appendChild(theTR);
				
				/* /Buttons Cell */
				
				if (number_attendees==8){
					document.getElementById("b_add"+number_attendees).style.display='none';
				};
				document.getElementById("b_add"+ (number_attendees - 1)).style.display = "none";
				
			}
			document.getElementById('number_attendees').value = number_attendees
			document.getElementById("attendees_firstname_" + number_attendees).focus();
			};
		}
		
		
		function showTicketNumber(o)
		{
		    if(o.checked)
		    {
		        $("#mobileTicket_div_" + o.id.split("_")[1]).removeClass("hide");    
		    }
		    else
		    {
		        $("#mobileTicket_number_" + o.id.split("_")[1]).val("");
		        $("#mobileTicket_div_" + o.id.split("_")[1]).addClass("hide");    
		    }
		    
		}
		
		function showSoldout(){
		    var errorMsg = document.getElementById('attendees_location_1').value;
		    //alert(errorMsg);
		    if(errorMsg == "38"){
		        document.getElementById('msg_soldout').style.display = "block";
		    }else{
		        document.getElementById('msg_soldout').style.display = "none";
		    }
		}

/* ------------------------------------------------------------- 
   Validate Form  ---------------------------------------------- */  
   
   	function validate_checkout() {	
		var msg = "";
		var error = 0;
	    //alert(number_attendees);
	    //if(document.getElementById('number_attendees')>0){
	        for (i=0;i<number_attendees;i++){
		        //la_ligne = new String (document.getElementById('attendees_location_'+i).value + document.getElementById('attendees_firstname_'+i).value + document.getElementById('attendees_lastname_'+i).value + document.getElementById('attendees_email_'+i).value + document.getElementById('attendees_company_'+i).value + document.getElementById('attendees_title_'+i).value)
//		        la_ligne = new String ($('#attendees_location_'+i).val() 
//		                            + $('#attendees_firstname_'+i).val() 
//		                            + $('#attendees_lastname_'+i).val() 
//		                            + $('#attendees_email_'+i).val() 
//		                            + $('#attendees_company_'+i).val() 
//		                            + $('#attendees_title_'+i).val());
		       // if((la_ligne.length!=0)){
		        //||(i==1)
		           // alert((i+1))
		            cn = i+1;
		            
			        if($('#attendees_location_'+cn).val() == ""){
				        $('#lbl_attendees_location_'+cn).addClass("error");
				        error = 1;
			        }else{
				        $('#lbl_attendees_location_'+cn).removeClass("error");
			        };
        			
			        if($('#attendees_firstname_'+cn).val() == ""){
				        $('#lbl_attendees_firstname_'+cn).addClass("error");
				        error = 1;
			        }else{
				        $('#lbl_attendees_firstname_'+cn).removeClass("error");
			        };
        			
			        if($('#attendees_lastname_'+cn).val() == ""){
				        $('#lbl_attendees_lastname_'+cn).addClass("error");	
				        error = 1;
			        }else{
				        $('#lbl_attendees_lastname_'+cn).removeClass("error");
			        };
        			
			        if($('#attendees_email_'+cn).val() == ""){
				        $('#lbl_attendees_email_'+cn).addClass("error");
				        error = 1;
			        }else{
				        $('#lbl_attendees_email_'+cn).removeClass("error");
			        };
        			
			        if($('#attendees_company_'+cn).val() == ""){
				        $('#lbl_attendees_company_'+cn).addClass("error");
				        error = 1;
			        }else{
				        $('#lbl_attendees_company_'+cn).removeClass("error");
			        };
        			
			        if($('#attendees_title_'+cn).val() == ""){
				        $('#lbl_attendees_title_'+cn).addClass("error");
				        error = 1;
			        }else{
				        $('#lbl_attendees_title_'+cn).removeClass("error");
			        };
			        
			        if($('#mobileTicket_'+cn).size() > 0 && $('#mobileTicket_'+cn).get(0).checked)
			        {
			            //hasError = $('#mobileTicket_number_'+(i+1)).val() == "514-555-5555" ? true : false;
			            /*numerPasses = $('#mobileTicket_number_'+cn).val().search(/\d{3}\-\d{3}\-\d{4}/) == 0
			                                            ? $('#mobileTicket_number_'+cn).val() == "514-555-5555"
			                                                ? false : true
			                                            : false;
			                                            */
			            if($('#mobileTicket_number_'+cn).val() == "")
			            {
			                $("#mobileTicket_div_"+cn).addClass("error");
			                error = 1;
			            }
			            else
			            {
			                $("#mobileTicket_div_"+cn).removeClass("error");
			            }
			        }
			        
			    //};
	        };
	  //  }
	
	//Video Validation
	if(document.getElementById('video')){
	    vid = document.getElementById('video').value;
	    if(vid == ""){
	        document.getElementById("videoError").className = "error";
	        document.getElementById("videoError").innerHTML = t_video_error;
	        msg = msg + t_video_error +"<br>";
			error = 1;
	    }else{
	        document.getElementById("videoError").className = "";
	        document.getElementById("videoError").innerHTML = "";
	    }
	}
	
	//Validate Terms
	if(document.getElementById("terms2")){
	    if(document.getElementById("terms2").checked){
	        document.getElementById("termsNotAccepted").style.display = "block";
	        error = 1;
	    }else{
	        document.getElementById("termsNotAccepted").style.display = "none";
	    }
	}
	
	
	//Firstname Validation
		if (document.getElementById("first_name").value == ""){
			document.getElementById("l_first_name").className = "error";
			msg = msg + "First name is empty.<br>";
			error = 1;
		} else {document.getElementById("l_first_name").className = "";}
	//lastname Validation
		if (document.getElementById("last_name").value == ""){
			document.getElementById("l_last_name").className = "error";
			msg = msg + "Last Name is empty.<br>";
			error = 1;
		} else {document.getElementById("l_last_name").className = "";}
	//title Validation
		if (document.getElementById("title").value == ""){
			document.getElementById("l_title").className = "error";
			msg = msg + "Title is empty.<br>";
			error = 1;
		} else {document.getElementById("l_title").className = "";}
	//company Validation
		if (document.getElementById("company").value == ""){
			document.getElementById("l_company").className = "error";
			msg = msg + "Company is empty.<br>";
			error = 1;
		} else {document.getElementById("l_company").className = "";}

	//address Validation
		if (document.getElementById("address").value == ""){
			document.getElementById("l_address").className = "error";
			msg = msg + "Address is empty.<br>";
			error = 1;
		} else {document.getElementById("l_address").className = "";}
	//city Validation
		if (document.getElementById("city").value == ""){
			document.getElementById("l_city").className = "error";
			msg = msg + "City is empty.<br>";
			error = 1;
		} else {document.getElementById("l_city").className = "";}
	//zipcode Validation
		if (document.getElementById("zip").value == ""){
			document.getElementById("l_zip").className = "error";
			msg = msg + "ZIP Code / Postal Code is empty.<br>";
			error = 1;
		} else {document.getElementById("l_zip").className = "";}
	//Country Validation
		if (document.getElementById("country").value == ""){
			document.getElementById("l_country").className = "error";
			msg = msg + "Country is empty.<br>";
			error = 1;
		} else {document.getElementById("l_country").className = "";}

	//State Validation
		if (document.getElementById("state").value == ""){
			document.getElementById("l_state").className = "error";
			msg = msg + "State is empty.<br>";
			error = 1;
		} else {document.getElementById("l_state").className = "";}	
		
		
	//Email
		if(!checkEmail(document.getElementById("email").value)){
			error = "1"; document.getElementById("l_email").className="error";
		}else{
			document.getElementById("l_email").className="";
		}
	//phone
		if(!checkPhone(document.getElementById("phone").value)){
			error = "1"; document.getElementById("l_phone").className="error";
		}else{
			document.getElementById("l_phone").className="";
		}
	
	
	//Discount Code	 
	
	   if(document.getElementById("membre1")){   
		if(document.getElementById("membre3").checked){
			if (document.getElementById("discount_code").value == ""){
				document.getElementById("l_discount_code").className = "error";
				msg = msg + "Discount Code is empty.<br>";
				error = 1;
			} else {document.getElementById("l_discount_code").className = "";}
		}else if(document.getElementById("membre1").checked==false && document.getElementById("membre2").checked==false && document.getElementById("membre3").checked==false){
			document.getElementById("l_membre1").className = "error";
			document.getElementById("l_membre2").className = "error";
			document.getElementById("l_membre3").className = "error";
			error = 1;
		}else if(document.getElementById("membre1").checked || document.getElementById("membre2").checked){
			document.getElementById("discount_code").value = "";
		}else{
			document.getElementById("l_membre1").className = "";
			document.getElementById("l_membre2").className = "";
			document.getElementById("l_membre3").className = "";
		}
	  }else{
	    // This script is custom for video sales
        if(document.getElementById("Guest").checked){
            if (document.getElementById("discount_code").value == ""){
			    document.getElementById("l_discount_code").className = "error";
			    msg = msg + "Discount Code is empty.<br>";
			    error = 1;
		    } else {document.getElementById("l_discount_code").className = "";}
		 }else{
		    document.getElementById("discount_code").value = "";
		 }
		 
		 
		
	  }			
	
		if (error == 1) {
			document.getElementById("validate_checkout").style.display="block";
		} else {
			document.getElementById("checkout_confirm").submit();
		}
	}


function validate_creditcard() {	
	var pattern_email = /([A-Za-z0-9\.\_]{1,})\@([A-Za-z0-9\.\_]{1,})\.([A-Za-z]{2,})/;
	var pattern_phone = /[^\d\s() -]/;
	var pattern_extension = /\d{0,}/;
	var msg = "";
	var error = 0;

	//cc Cardholder
		if (document.getElementById("cardholder").value == ""){
			document.getElementById("l_cardholder").className = "error";
			msg = msg + "Cardholder is empty.<br>";
			error = 1;
		} else {document.getElementById("l_cardholder").className = "";}

	//cc Card Type
		if (document.getElementById("card_type").value == ""){
			document.getElementById("l_card_type").className = "error";
			msg = msg + "Card Type is empty.<br>";
			error = 1;
		} else {document.getElementById("l_card_type").className = "";}

	//cc Validation
		if (document.getElementById("card_num").value == ""){
			document.getElementById("l_card_num").className = "error";
			msg = msg + "Card Number is empty.<br>";
			error = 1;
		} else {document.getElementById("l_card_num").className = "";}
	//expiry Validation
		if (document.getElementById("exp_month").value == "" || document.getElementById("exp_year").value == ""){
			document.getElementById("l_exp_month").className = "error";
			msg = msg + "Credit Card Expiry Date is invalid.<br>";
			error = 1;
		} else {document.getElementById("l_exp_month").className = "";}

		
		if (error == 1) {
			//alert("Information is missing or invalid. Please correct the following fields:\n" + msg)
			document.getElementById("validate_checkout").style.display="block";
		} else {
			document.getElementById("validate_checkout").style.display="none";
			document.getElementById("b_back").style.display="none";
			document.getElementById("b_continue").style.display="none";
			document.getElementById("processing").style.display="block";
					
			//document.getElementById("checkout_confirm").action = SSL_URL + "/4105/confirmation.asp";
			document.getElementById("checkout_confirm").submit();
		}
}




function checkDiscount(status){
	if(status=="open"){
		document.getElementById("dv_discount_code").style.display="block";
	}else{
		document.getElementById("dv_discount_code").style.display="none";
	}
}



/* ------------------------------------------------------------- 
   AJAX -------------------------------------------------------- */ 

	
	function createRequestObject() {		
		var ro;
		if(browserName == "MSIE"){
			ro = new ActiveXObject("Microsoft.XMLHTTP");
		}else{
			ro = new XMLHttpRequest();
		}
		return ro;
	}
	var http = createRequestObject();
	
/* ------------------------------------------------------------- 
   Buy Video Functions -------------------------------------------------------- */ 	
	
	function setPrice(sbox){
	        o = document.getElementById(sbox);
	        
	        tbl = document.getElementById('user_type');
	        utype = tbl.getElementsByTagName("input");
	        //clear values
	        
	        for(i=0;i<utype.length;i++){
               document.getElementById(utype[i].id + "_Price").value = 0;
            }
	        
	        if(o.value!=""){
	            val = o.value.split("|");
	            id = val[0];
	            Member = val[1];
	            NonMember = val[2];
	            Guest = val[3];
	            
	            for(i=0;i<utype.length;i++){
	                if(utype[i].checked){
	                    document.getElementById(utype[i].id + "_Price").value = eval(utype[i].id);
	                }
	            }
	           
	        }
	    }
	    
	    
	    
	/* ------------------------------------------------------------- 
   Ticket Functions -------------------------------------------------------- */ 	    
	    
	    
	var guest_price = 0
	var member_price = 0
	var nonmember_price = 0
		
//	function SetPrice(event_id, member, nonmember, guest, is_open){
//		if(event_id==11){
//			document.getElementById('montreal_french').style.display='block';
//		}else{
//			document.getElementById('montreal_french').style.display='none';
//		};
//		
//		for(i=11;document.getElementById("date"+i);i++){
//			document.getElementById("date"+i).className="date";
//		}
//		document.getElementById("date"+event_id).className="date_selected";
//		document.getElementById("member_price").value = member;
//		document.getElementById("nonmember_price").value = nonmember;
//		document.getElementById("guest_price").value = guest;
//		document.getElementById("event_id").value = event_id;
//		/*if(is_open!=1){
//			document.getElementById('no_place_left').style.display = 'block';
//			document.getElementById('checkout_confirm').action = 'https://<%=Request.servervariables("HTTP_HOST")%>/4105/db_WaitingList.asp'
//		}else{*/
//			document.getElementById('no_place_left').style.display = 'none';
//			document.getElementById('checkout_confirm').action = '<%=PAYMENT_URL%>/4105/register_2.asp'
//			
//		//};
//	};

//    function SetPrice(event_id, member, nonmember, guest){
//			document.getElementById("member_price").value = member;
//			document.getElementById("nonmember_price").value = nonmember;
//			document.getElementById("guest_price").value = guest;
//			document.getElementById("event_id").value = event_id;
//			alert('Do integration for color and such')
//		};
		
	function RemoveAttendees(no){
	    //alert(number_attendees);
		for(i=no;i<=number_attendees;i++){
			if(document.getElementById("attendees_firstname_" + (i + 1)) == null){
				document.getElementById("attendees_firstname_" + i ).value = '';
				document.getElementById("attendees_lastname_" + i ).value = '';
				document.getElementById("attendees_location_" + i ).value = '';
				document.getElementById("attendees_email_" + i ).value = '';
				document.getElementById("attendees_company_" + i ).value = '';
				document.getElementById("attendees_title_" + i ).value = '';
			}else{
				document.getElementById("attendees_location_" + i ).value = document.getElementById("attendees_location_" + (i+1) ).value;
				document.getElementById("attendees_firstname_" + i ).value = document.getElementById("attendees_firstname_" + (i+1) ).value;
				document.getElementById("attendees_lastname_" + i ).value = document.getElementById("attendees_lastname_" + (i+1) ).value;
				document.getElementById("attendees_email_" + i ).value = document.getElementById("attendees_email_" + (i+1) ).value;
				document.getElementById("attendees_company_" + i ).value = document.getElementById("attendees_company_" + (i+1) ).value;
				document.getElementById("attendees_title_" + i ).value = document.getElementById("attendees_title_" + (i+1) ).value;
			};
		};
		
		if(number_attendees > 1){
		    for(k=1;k<=10;k++){
			    document.getElementById("tbody_attendees").removeChild(document.getElementById('line'+number_attendees+'_'+k));
		    };
		    --number_attendees;
        }
        
		if (document.getElementById('b_add'+number_attendees) != null && document.getElementById('b_add'+number_attendees) != ""){
		    document.getElementById('b_add'+number_attendees).style.display = 'block';

		    if (number_attendees==1){
			   document.getElementById('b_minus1').style.display = 'none';
		    }else{
			    document.getElementById('b_minus1').style.display = 'block';
		};
		}

		
		document.getElementById('number_attendees').value = number_attendees
	};   
	
	function DoBack(){
			document.checkout_confirm.action = backTo;
			document.checkout_confirm.submit();
		};
		
	function TestRegExp(txt_string, pattern){ 
				obj = document.getElementById(txt_string).value
				objRegExp = new RegExp(pattern)
				bad_field  = txt_string;
				return objRegExp.test(obj)
		};
		
	
	function validate_payment(){
		error=0;
		//error=1;
		
		var str = new String();
		str = document.getElementById("card_no").value;
		document.getElementById("card_no").value = str.replace(/[^\d]/g,'');
		
		
		if	(!TestRegExp("card_no", /^\d{13,16}$/)){
			document.getElementById("l_card_no").className="error";
			document.getElementById("error_message").style.display = "block";	
			document.getElementById("error_space").style.display = "none";	
			error=1;
		}else{
			document.getElementById("l_card_no").className="";
		}
		
		
		if (document.getElementById("expire_mm").value=="-"){
			document.getElementById("l_expire_mm").className="error";
			document.getElementById("error_message").style.display = "block";	
			document.getElementById("error_space").style.display = "none";	
			error=1;
		}else{
			document.getElementById("l_expire_mm").className="";
		}
		if (document.getElementById("expire_yyyy").value=="-"){
			document.getElementById("l_expire_yyyy").className="error";
			document.getElementById("error_message").style.display = "block";	
			document.getElementById("error_space").style.display = "none";	
			error=1;
		}else{
			document.getElementById("l_expire_yyyy").className="";
		}
		
		if (document.getElementById("card_type").value=="-"){
			document.getElementById("l_card_type").className="error";
			document.getElementById("error_message").style.display = "block";	
			document.getElementById("error_space").style.display = "none";	
			error=1;
		}else{
			document.getElementById("l_card_type").className="";
		}
		
		if(error!=1){
		    document.getElementById("b_submit").style.display = "none";
			document.checkout_confirm.submit();
		}
		
	};
		
		
	//Mobile Info
	
	function getMobileInfo(url)
    {
	    window.open('/4105/includes/content/fall/' + lang + '/mobile-info.asp','name','height=540,width=470,resizable=no,scrollbars=no');  
    }

	
	
	//Video
	
	function getVideoInfo()
	{
	    val = $("#video").get(0).value;
	    if(val != "")
	    {
	        val = val.split("|")[0];
	        window.open("/buy-video/4105/video-summary.asp?videoId=" + val + "&lang=" + lang, "name");
	        //alert(val + " - " + lang);
	    }
	}
	
	/*function assignPhoneFormat()
	{
	    $(".phoneFormat").each(function()
	    {
	        alert($(this).attr("id"));
	        formatPhone($(this).attr("id"), true);
	    });
	    
	    
	    formatPhone("phone", false);
	}
	
	function formatPhone(objId, isMobile)
	{
	    alert($("#" + objId).size())
	    $("#" + objId).bind("click", function()
        {
            alert("oi")
            str = $(this).val();
            str = str.replace(/[a-zA-Z]/g,"");
            str = str.replace(/(\d{3})(\d{3})/,'$1'+'-'+'$2'+'-');
            
            if(isMobile)
            {
                if(str.length > 11)
                {
                    str = str.substring(0, 12);
                }
            }
            else
            {
                if(str.length > 12)
                {
                    ph = str.substring(0, 12);
                    ext = str.substring(12, str.length);
                    
                    str = ph.replace(/\s/,"") + " #" + ext.replace(/\W/g,"");
                }
            }
            
            $(this).val(str);
        });
	}	
	*/	
		
/*if(document.getElementById('mobileTicket_'+i) != null && document.getElementById('mobileTicket_'+i).checked)
			        {
			            alert("sss");
			        }*/		