	
	/* ------------------------------------------------------------------- */
	function show_main_menu(id){
		
		if(id=='box_parent'){
			$("#box_copy").hide("fast");
			$("#box_partner").hide("fast");
			$("#box_about").hide("fast");
			$("#"+id).show("slow");

		} else if(id=='box_partner'){
			$("#box_copy").hide("fast");
			$("#box_parent").hide("fast");
			$("#box_about").hide("fast");
			$("#"+id).show("slow");
			
		} else if(id=='box_about'){
			$("#box_copy").hide("fast");
			$("#box_parent").hide("fast");
			$("#box_partner").hide("fast");
			$("#"+id).show("slow");
		}
	}

	/* ------------------------------------------------------------------- */
	function hide_main_menu(){
		$("#box_parent").hide("fast");
		$("#box_partner").hide("fast");
		$("#box_about").hide("fast");
		$("#box_copy").show("fast");
	}

	/* ------------------------------------------------------------------- */
	function show_about_new(){
		show_main_menu('box_about');
		show_about_menu('box_about_new');
	}
	
	/* ------------------------------------------------------------------- */
	function show_about_menu(id){
		
		if(id=='box_about_origin'){
			$("#box_about_team").hide("fast");
			$("#box_about_new").hide("fast");
			$("#"+id).show("slow");

		} else if(id=='box_about_team'){
			$("#box_about_origin").hide("fast");
			$("#box_about_new").hide("fast");
			$("#"+id).show("slow");
			
		} else if(id=='box_about_new'){
			$("#box_about_origin").hide("fast");
			$("#box_about_team").hide("fast");
			$("#"+id).show("slow");
		}
	}
	

	/* ------------------------------------------------------------------- */
	function email_text(id,action){
		var input_value 		= $('#'+id).val();
		var default_text		= "Enter a valid email address";
		
		if(action=='hide'){
			if(input_value==default_text){
				$('#'+id).val("");
			}
		}else{
			if(input_value==""){
				$('#'+id).val(default_text);
			}
		}
	}
	
	/* ------------------------------------------------------------------- */
	function validate_email(id){
		var ret					= false;
		var input_value			= $("#"+id).val();
		var msg_email_error		= "Invalid Email Address";
		
		if(input_value.indexOf("@")>0){
			if(input_value.length >= 9){
				if(input_value.indexOf(".")>0){
					ret					= true;
				}
			}
		}
		
		if(ret == false){
			alert(msg_email_error);
			$('#'+id).focus();
		}
		
		return ret;
	}
	
	/* ------------------------------------------------------------------- */
	$(document).ready(function() {
		
		email_text('p_email1','show');
		email_text('p_email2','show');
		
		$(".box_privacy").fancybox({'href' : 'content/privacy.php', 'width' : '75%', 'height' : '75%', 'autoScale' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'type' : 'iframe' });
		$(".box_term").fancybox({'href' : 'content/term.php', 'width' : '75%', 'height' : '75%', 'autoScale' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'type' : 'iframe' });
		$(".box_contact").fancybox({'href' : 'includes/insert_email.php', 'autoScale' : true, 'transitionIn' : 'none', 'transitionOut' : 'none', 'type' : 'iframe' });
		$(".box_contact_media").fancybox({'href' : 'includes/insert_email.php?r=media', 'autoScale' : true, 'transitionIn' : 'none', 'transitionOut' : 'none', 'type' : 'iframe' });

	});
	
	
	
	/* ------------------------------------------------------------------- */
	/* ------------------------------------------------------------------- */
	function validate_contact_form(){
		var ret							= false;
		var msg_email_error				= "Please Check the Required Information!";
		var contact_name				= $("#contact_name").val();
		var contact_phone				= $("#contact_phone").val();
		var contact_email				= $("#contact_email").val();
		var contact_msg					= $("#contact_msg").val();
		
		if(contact_name.length >= 3){
			if(contact_msg.length >= 3){
				if(contact_phone.length >=5){
					ret					= validate_email('contact_email');
				}
			}
		}
		
		if(ret==false){
			alert(msg_email_error);
			$("#contact_name").focus();
		}
		
		return ret;
	}
	
	
	
	/* ------------------------------------------------------------------- */
	function ajax_request(url,form_fields,id_loader,id_response){
		
		$.ajax({
			type: "POST",
			url: url,
			data: form_fields,
			beforeSend: function() {
				$("#"+id_loader).show("fast");
			},
			success: function(response){
				$("#"+id_loader).hide("fast");
				$("#"+id_response).html(response);
			}
		});		
	}
	
	
