

var ninetyfour = {
	
	initted: false,
	
	
  init: function(){
    
		if(ninetyfour.initted) return;
		
		ninetyfour.initted = true;
		
		var flashDone = false;
		if( jQuery("#Security").length < 1 ){
			
			var flashVersion = swfobject.getFlashPlayerVersion();
			if(flashVersion.major > 8){
				
				var swfAttr = { id: "bestfx-swf", 'name' : "bestfx-swf" };
				var swfParams = { bgcolor: 0 };
				
				swfobject.embedSWF(
					"flash/bestfx.swf", "bestfx-swf", 
					"100%", "100%", "9.0.0", null, 
					swfParams, swfAttr
				);
				
				if(swfmacmousewheel) swfmacmousewheel.registerObject( swfAttr.id );
				
				flashDone = true;
				
			}
			
    } 
		
		if(!flashDone) jQuery("#bestfx-swf").remove();
		
  },
  

	checkForm: function( data ){

	  var emailRegExp = /[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}/g;
    var phoneRegExp=/((\+\d{1,3}(-| )?\(?\d\)?(-| )?\d{1,3})|(\(?\d{2,3}\)?))(-| )?(\d{3,4})(-| )?(\d{4})(( x| ext)\d{1,5}){0,1}/g;
	  
    if( emailRegExp.test( data )) return true;
    if( phoneRegExp.test( data )) return true;

    //no valid contact info found
    return false;
	  
	},

	submitForm: function(data) {
	  
    if( ninetyfour.checkForm(data) ){

      //ajax submit here

      return true;
      
    } else {
      
      return false;
      
    }
	  
	}
	
}






$(document).ready(function(){
  
  ninetyfour.init();
  
});





