//hoverintent plugin
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);
//xmenu plugin
function showm() { $(this).children('ul').slideDown('fast'); }
function hidem() { $(this).children('ul').slideUp('fast'); }
;(function($){
	$.fn.xmenu = function(op){
		var flvl = $(this).children('ul').children('li'); var flvllength = flvl.length; $(flvl).addClass('flvl');
		$(flvl).hoverIntent({
			over: showm,
			timeout: 200,
			out: hidem
		});
	}
})(jQuery);
//watermark plugin
(function($) {
$.fn.watermark = function(c, t) { var e = function(e) { var i = $(this);
if (!i.val()) { var w = t || i.attr('title'), $c = $($("<div />").append(i.clone()).html().replace(/type=\"?password\"?/, 'type="text"')).val(w).addClass(c);
i.replaceWith($c);
$c.focus(function() { $c.replaceWith(i); setTimeout(function() {i.focus();}, 1); })
.change(function(e) { i.val($c.val()); $c.val(w); i.val() && $c.replaceWith(i); })
.closest('form').submit(function() { $c.replaceWith(i); }); } };
return $(this).live('blur change', e).change();
};
})(jQuery);

function domagic() {
	$(".bnrcyc").cycle({fx:'fade',speed:1000,timeout:8000,height:'313px',cleartypeNoBg:true,pager:'.slidepane'});	
	$("#menu").xmenu(); $("#con .news-item:last-child").css("border-bottom","none");/*
	$(".ngg-galleryoverview .ngg-gallery-thumbnail-box a,.wpsc_default_product_list a.preview_link,.single_product_display a.preview_link").lightBox({
		overlayOpacity: 0.5,
		imageLoading: '/wp-content/themes/ptf/js/images/lightbox-ico-loading.gif',
		imageBtnClose: '/wp-content/themes/ptf/js/images/lightbox-btn-close.gif',
		imageBtnPrev: '/wp-content/themes/ptf/js/images/lightbox-btn-prev.gif',
		imageBtnNext: '/wp-content/themes/ptf/js/images/lightbox-btn-next.gif',
		imageBlank: '/wp-content/themes/ptf/js/images/lightbox-blank.gif'
	});*/
	/* watermark */
	$(".webb-searchbox input").watermark('watermark');
	
}
