﻿function right(e) {
if (navigator.appName =='Netscape'&&
(e.which ==3|| e.which ==2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2|| event.button ==3)) {
return false;
}
return true;
}

if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;

document.oncontextmenu=noshowmenu;
function noshowmenu()
{
//return false
}
//PF_Hits('board','id',<?=$rs["id"]?>)	 
function PF_Hits(dbtable,field,key){
		jQuery.ajax({
		type: "post",
		data: 'dbtable='+dbtable+'&field='+field+'&key='+key,
		url: 'PF_hits.php',		
		dataType: "html"
		})
}	 

function PF_escape(S){
	return encodeURIComponent(S)
}


function PF_BannerOnclick(e){
var id="";
  	   if(e==null){
       		e=window.event;         
			id=e.srcElement.aa;
	   }else{//FireFox
	   		id=e.originalTarget.aa;
	   }	
	
	if (id!='')
	PF_Hits('board','id',id);
	
}

function PF_getdata(requestURL,objname,pars) {    

	if (typeof(pars)=="object"){
		        	pars= $(pars).serialize();        	   
	}
	 jQuery.ajax({
		           type: "post",
		           data: pars,
			    url: requestURL,		
			    dataType: "html",			    
			    error: function(resp){
			    	//	alert('Error: url : ' + requestURL+'?'+pars+'\n'+resp.responseText); 	   
			    },
			     beforeSend:function(){	
				//jQuery("#"+objname).html('Loading content, please wait..');
			    },			
				success: function(resp){
			    	if (typeof(objname)=="object"){
			    		$(objname).html(resp);	
			    	}else if ( typeof(objname) == "string" ){	
			    		$("#"+objname).html(resp);
			    	}else if ( typeof(objname) != "undefined" ){
			    		$("#"+objname).html(resp);	
			    	}
			     }
	 });					      
}
function PF_AjaxblockUI(requestURL,pars,title){
	if (requestURL==''){return ;}	
	 jQuery.ajax({
		           type: "post",		        
			    url: requestURL,		
			    dataType: "html",
			    data: pars,
			    error: function(resp){
                                     alert('Error: url : ' + requestURL+'?'+pars+'\n'+resp); 	   
			    },
			     beforeSend:function(){	
				//jQuery("#loading").toggle();
			    },			
			    error : function(XMLHttpRequest, textStatus) {   
			
			     },   
			    success: function(resp){
			    		 $.growlUI(title, resp); 

			     }
	 })
}
/*
//定位在頁面頂端	
$(window).scroll(function(){
	$('#test').css('top', $(document).scrollTop());
});
//定位在頁面底端
$(window).scroll(function(){
	$('#mydiv').css('top', $(document).scrollTop() + $(window).height() - $('#test').height());
});
*/
