/*
 * SimpleModal Basic Modal Dialog
 * http://www.ericmmartin.com/projects/simplemodal/
 * http://code.google.com/p/simplemodal/
 *
 * Copyright (c) 2009 Eric Martin - http://ericmmartin.com
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Revision: $Id: basic.js 185 2009-02-09 21:51:12Z emartin24 $
 *
 */

$(document).ready(function () {
	$('#lnkDownForm').click(function (e) {
		e.preventDefault();
		$('#basicModalContentDown').modal();
		loadForm();
	});
	
	
	$('#lnkContactForm').click(function (e) {
		e.preventDefault();
		$('#basicModalContent').modal();
		loadForm();
	});
	
	
	$('#lnkBookForm').click(function (e) {
	
	$.get("down.php",function(data){alert("Data Loaded:"+data);});
	 var language = $.getQueryString({ID:"lang"});
	      if($("input[@type=checkbox]:checked").size()==0 && language=="eng")
        {
		
          alert('Please Selecte PDF file(s)');
         return false;
         }else if($("input[@type=checkbox]:checked").size()==0 && language=="chs")
        {
		
          alert('请选择PDF文件');
         return false;
         }else if($("input[@type=checkbox]:checked").size()==0 && language=="cht")
        {
		
          alert('請選擇PDF文件');
         return false;
         }else{
	    e.preventDefault();
		$('#basicModalContentDown').modal();
		loadForm();
       }
	});
	
/*	*/
	
	$('#basic-modal a.basic2').click(function (e) {
		e.preventDefault();
		$('#basic-modal-content2').modal();
	});
	
	$('#basic-modal a.basic1').click(function (e) {
		e.preventDefault();
		$('#basic-modal-content1').modal();
	});
	
	$('#simplemodal-container a.modalCloseImg').click(function(e){
		e.preventDefault();
		$('#basic-modal-content1').modal();
		//$.get("delete.php",function(data){alert("Data Loaded:"+data);});
	});

		$('#DownForm input.btnSubmit').click(function(e){
		e.preventDefault();
		$('#basic-modal-content1').modal();
		//$.get("delete.php",function(data){alert("Data Loaded:"+data);});
	});
	
/*	$('#btnClose').click(function(){
	 
	 alert('closegr');
	
	});
	
	$('#btnSubmit').click(function(){

	
	 
	 
	 alert('submit');
	
	});
	
	
	
	$('#btnSubmit').click(function (e) {
	  
	  	var PdfFileNo="";
        
		var language = $.getQueryString({ID:"lang"});
		var firstname = $("#firstname")[0].value;
		
		$("input[@type=checkbox]:checked").each(function(){
		   PdfFileNo+=this.value+",";
		})
		
		$.get("compress.php",{name:PdfFileNo,lang:language,prefixname:firstname});
		
	    e.preventDefault();
		$('#basicModalContentDown').modal();
		loadForm();
      
	});



	$('#test').click(function (e) {
	$.get("down.php",function(data){alert("Data Loaded:"+data);});
	
	$.get("compress.php",{name:PdfFileNo,lang:language,prefixname:firstname},function(data){alert("Data Loaded:"+data);});
	     $.get("delete.php");
          alert('123');
     

      
	});
	
	
	*/	
	
	

/*	$("#btnSubmit").modal({onClose: function (dialog) {
	$.get("delete.php",function(data){alert("Data Loaded:"+data);});
	
	dialog.data.fadeOut('slow', function () {
		dialog.container.hide('slow', function () {
			dialog.overlay.slideUp('slow', function () {
				$.modal.close();
			});
		});
	});
	
}});
	*/
	
});


/*




*/


