(function($){jQuery.AjaxifyDefaults={event:'click',link:false,target:'#container',animateOut:false,animateIn:false,animateOutSpeed:'normal',animateInSpeed:'normal',method:'GET',tagToload:false,loading_txt:'',loading_img:"images/loading.gif",loading_target:false,loading_fn:function(options){jQuery.ajaxifyLoading(options);},loadHash:false,title:false,forms:false,params:'ajax=true',timeout:false,contentType:"application/x-www-form-urlencoded",dataType:'html',cache:false,username:false,password:false,onStart:function(op){},onError:function(op){jQuery.ajaxifyManip(op,"<font style='color: #CC0000'>Error: </font> Couldn't open the page.");},onSuccess:function(op){},onComplete:function(op){}};jQuery.AjaxifyFirstLoad=true;jQuery.AjaxifyhistorySet=new Object();jQuery.AjaxifyPageTitle=document.title;jQuery.AjaxifyDebug=false;jQuery.fn.ajaxify=function(options){if(!jQuery(this).size()){jQuery.ajaxifylog('Error: No matched element/s for your ajaxify selector " '+jQuery(this).selector+' ".');return false;}
var ver=jQuery.fn.jquery.split('.');if(ver[0]<1||ver[1]<2||ver[2]<6){jQuery.ajaxifylog('Error: Your jQuery version is old. Version 1.2.6 or newer is required.');return false;}
return this.each(function(){var current=jQuery.extend({},jQuery.AjaxifyDefaults,options);if(jQuery.metadata){current=jQuery.extend(current,jQuery(this).metadata());}
if(current.event){jQuery(this).bind(current.event,function(){jQuery(this).ajaxifyAnalyse(current);if(!current.hash)
jQuery.ajaxifyLoad(current);else{jQuery.ajaxifyHash(current);}
if(jQuery(this).is('a')||jQuery(this).is('form'))return false;});}else{jQuery(this).ajaxifyAnalyse(current);jQuery.ajaxifyLoad(current);}
if(current.loadHash&&jQuery.AjaxifyFirstLoad){jQuery(this).ajaxifyAnalyse(current);if(document.location.hash.replace(/^#/,'')==current.hash&&current.hash){jQuery.ajaxifyHash(current);jQuery.AjaxifyFirstLoad=false;}}});};jQuery.fn.ajaxifyAnalyse=function(current){current.object=this;if(jQuery(this).is('a')){if(jQuery(this).attr('href')){var link=jQuery(this).attr('href').replace(/^#/,"");current.link=link||current.link;}else
current.link;if(typeof current.tagToload!='object')
if(jQuery(this).attr('target'))
current.target=jQuery(this).attr('target');else
current.target;else
current.target=current.loading_target||'#AjaxifyTemp';}
if(!current.loading_target)
current.loading_target=current.target;if(current.forms){var text=jQuery(current.forms).serialize();current.paramres=text;}
if(typeof current.params=='function')
var params=current.params(current);else
var params=current.params;if(typeof params=='string'){if(text)
current.paramres+='&'+params;else
current.paramres=params;}
var len=current.target.length-1;if(typeof current.tagToload!='object')
if(current.target.charAt(len)=='+'||current.target.charAt(len)=='-'){current.manip=current.target.charAt(len);current.target=current.target.substr(0,len);}
if(current.loadHash){if(!jQuery.historyInit){jQuery.ajaxifylog('Error: loadHash is enabled but history plugin couldn\'t be found.');return false;}
if(current.loadHash===true){jQuery.ajaxifylog('Info: It seemes you are upgrading from v1.0. Please see the new documentation about loadHash. "attr:href" will be used instead of "true".');current.loadHash="attr:href";}
if(current.loadHash.toLowerCase()=='attr:href'||current.loadHash.toLowerCase()=='attr:rel'||current.loadHash.toLowerCase()=='attr:title'){current.loadHash=current.loadHash.toLowerCase();current.hash=jQuery(this).attr(current.loadHash.replace('attr:',''));if(jQuery.browser.opera){current.hash=current.hash.replace('?','%3F');current.hash=current.hash.replace('&','%26');current.hash=current.hash.replace('=','%3D');}}else
current.hash=current.loadHash;if(!current.hash)
jQuery.ajaxifylog('Warning: You have specified loadHash, but its empty or attribute couldn\'t be found.');}
if(!jQuery(current.target).size()&&typeof current.tagToload!='object')
jQuery.ajaxifylog('Warning: Target " '+current.target+' " couldn\'t be found.');};jQuery.ajaxifyLoading=function(options){var html="<div id='AjaxifyLoading'><img src='"+options.loading_img+"' alt='Loading...' title='Loading...' >"+options.loading_txt+"</div>";if(options.loading_target)
jQuery.ajaxifyManip(options.loading_target,html);else
jQuery.ajaxifyManip(options,html);}
jQuery.ajaxifyHash=function(current){var ob=new Object();jQuery.each(current,function(key,value){ob[key]=value;});jQuery.AjaxifyhistorySet[ob.hash]=ob;location.hash=ob.hash;jQuery.historyInit(jQuery.ajaxifyHistory);jQuery.AjaxifyFirstLoad.history=false;};jQuery.ajaxifyLoad=function(current){jQuery.ajaxSetup({global:false});jQuery.ajax({type:current.method,url:current.link,dataType:current.dataType,data:current.paramres,contentType:current.contentType,processData:true,timeout:current.timeout,cache:current.cache,username:current.username,password:current.password,complete:function(){current.onComplete(current)},beforeSend:function(){current.onStart(current);if(current.animateOut){if(current.loading_target!=current.target);current.loading_fn(current);jQuery(current.target).animate(current.animateOut,current.animateOutSpeed,function(){if(!current.loading_target)
current.loading_fn(current);});}else
current.loading_fn(current);},success:function(data){jQuery(current.target).stop();jQuery('#AjaxifyLoading').remove();if(current.title)
document.title=current.title;else if(document.title!=jQuery.AjaxifyPageTitle)
document.title=jQuery.AjaxifyPageTitle;if(current.tagToload){data='<div>'+data+'</div>';if(typeof current.tagToload=='string'){jQuery.ajaxifyManip(current,jQuery(data).find(current.tagToload));}else if(typeof current.tagToload=='object'){jQuery.each(current.tagToload,function(tag,target){if(jQuery(data).find(tag).size())
jQuery.ajaxifyManip(target,jQuery(data).find(tag));else
jQuery.ajaxifylog('Warning: Tag "'+tag+'" couldn\'t be found.');});}}else{jQuery.ajaxifyManip(current,data);}
current.onSuccess(current,data);if(current.animateIn)
jQuery(current.target).animate(current.animateIn,current.animateInSpeed);},error:function(msg){jQuery(current.target).stop();current.onError(current,msg);if(current.animateIn)
jQuery(current.target).animate(current.animateIn,current.animateInSpeed);}});};jQuery.ajaxifylog=function(message){if(jQuery.AjaxifyDebug)
if(window.console){console.debug(message);}else{alert(message);}};jQuery.ajaxifyHistory=function(hash){if(hash){if(jQuery.browser.safari){var options=jQuery.AjaxifyhistorySet[location.hash.replace(/^#/,'')];}else
var options=jQuery.AjaxifyhistorySet[hash];if(options)
jQuery.ajaxifyLoad(options);else
jQuery.ajaxifylog('History Fired. But I couldn\'t find hash. Most propabley, the hash is empty. If so, its normal.');}};jQuery.ajaxifyManip=function(current,data){if(typeof current!='object'){var target=current;var current=new Object;var len=target.length-1;if(target.charAt(len)=='+'||target.charAt(len)=='-'){current.manip=target.charAt(len);current.target=target.substr(0,len);}
else{current.manip='';current.target=target;}
if(!jQuery(current.target).size())
jQuery.ajaxifylog('Warning: Target "'+current.target+'" couldn\'t be found.');}
if(current.manip=='+')
jQuery(current.target).append(data);else if(current.manip=='-')
jQuery(current.target).prepend(data);else
jQuery(current.target).html(data);};})(jQuery);;$(document).ready(function(){addFrameLinks();initFrames();addAjaxForms();function initFrames(local){var bindlink='.mpframe';if(local){bindlink=local+' '+bindlink;}
$(bindlink).each(function(){var src=$(this).attr('src');var target=$(this).attr('id');if(target){target='#'+target;}
if(src){src=src.replace(/ /g,"+");var query='?';if(src.indexOf('?')!==-1){query='&';}
var loader=$(this).children('.mpframeloader');$(this).load(src.substr(0,(src+'#').indexOf('#'))+query+'randDate='+(new Date()).getTime()+"&isajax=true&"+src.substr((src+'#').indexOf('#')),function(responseText){$(this).append(loader.hide());initFrames(target);addFrameLinks(target);if($(this).hasClass('applympajaxforms'))addAjaxForms(target);});}else{$(this).children('.mpframeloader').hide();}});}
function addFrameLinks(local){var bindlink='.mpframelink';if(local){bindlink=local+' '+bindlink;}
$(bindlink).each(function(){var onclickfunc;if($(this).attr('onclick')!=null&&typeof $(this).attr('onclick')=='function'){onclickfunc=$(this).attr('onclick');$(this).removeAttr('onclick');}else{onclickfunc=function(){return true;};}
$(this).click(function(){if(onclickfunc()){var target=$(this).attr('target');var href=$(this).attr('href');if(href&&target&&target.charAt(0)=='#'){if(href.indexOf('#')>-1){var scrolltargetOffset=0;var scrolltarget=href.substr(href.indexOf('#')+1);if(scrolltarget!=''&&$('a[name='+scrolltarget+']').length>0){scrolltargetOffset=$('a[name='+scrolltarget+']:first').offset().top;}
$('html,body').scrollTop(scrolltargetOffset);}
href=href.replace(/ /g,"+");var loader=$(target).children('.mpframeloader');$(target).html($(target).children('.mpframeshow')).append(loader);loader.show();var query='?';if(href.indexOf('?')!==-1){query='&';}
$(target).load(href.substr(0,(href+'#').indexOf('#'))+query+'randDate='+(new Date()).getTime()+"&isajax=true&"+href.substr((href+'#').indexOf('#')),function(responseText){$(target).append(loader.hide());initFrames(target);addFrameLinks(target);if($(this).hasClass('applympajaxforms'))addAjaxForms(target);});}else{return true;}}
return false;});});}
function addAjaxForms(local){var bindlink='form.mpajaxforms';if(local){bindlink=local+' '+bindlink;}
$(bindlink).each(function(){var loaders=$(this).find('.mpajaxformsloader');if($(this).attr('targetajax')&&$(this).attr('targetajax').match(/^#[\w]+/)&&$(this).attr('actionajax')){var target=$(this).attr('targetajax');var targetFrame=target+"frame";var action=$(this).attr('actionajax');var targetloaders=$(target).find('.mpajaxformstargetloader');$(this).append('<input type="hidden" name="isajax" value="true" />').append('<iframe name="'+targetFrame+'" style="display:none;"></iframe>').attr('target',targetFrame).find('input[name=\'action\']').each(function(){$(this).attr('name','form_action_temp');}).end().each(function(){this.setAttribute('action',action);}).find('input[name=\'form_action_temp\']').each(function(){$(this).attr('name','action');}).end().submit(function(){loaders.css('visibility','visible');targetloaders.show();}).children('iframe[name=\''+targetFrame+'\']').load(function(){var data=$(this).contents().contents().children('body').html();if(data&&data!=''&&data!='null'){$(target).html(targetloaders.hide()).append(data);addAjaxForms(target);}
loaders.css('visibility','hidden');});}});}});;(function($){$.fn.tipsy=function(opts){opts=$.extend({fade:false,gravity:'n'},opts||{});var tip=null,cancelHide=false;this.hover(function(){$.data(this,'cancel.tipsy',true);var tip=$.data(this,'active.tipsy');if(!tip){tip=$('<div class="tipsy"><div class="tipsy-inner">'+$(this).attr('title')+'</div></div>');tip.css({position:'absolute',zIndex:100000});$(this).attr('title','');$.data(this,'active.tipsy',tip);}
var pos=$.extend({},$(this).offset(),{width:this.offsetWidth,height:this.offsetHeight});tip.remove().css({top:0,left:0,visibility:'hidden',display:'block'}).appendTo(document.body);var actualWidth=tip[0].offsetWidth,actualHeight=tip[0].offsetHeight;switch(opts.gravity.charAt(0)){case'n':tip.css({top:pos.top+pos.height,left:pos.left+pos.width/2-actualWidth/2}).addClass('tipsy-north');break;case's':tip.css({top:pos.top-actualHeight,left:pos.left+pos.width/2-actualWidth/2}).addClass('tipsy-south');break;case'e':tip.css({top:pos.top+pos.height/2-actualHeight/2,left:pos.left-actualWidth}).addClass('tipsy-east');break;case'w':tip.css({top:pos.top+pos.height/2-actualHeight/2,left:pos.left+pos.width}).addClass('tipsy-west');break;}
if(opts.fade){tip.css({opacity:0,display:'block',visibility:'visible'}).animate({opacity:1});}else{tip.css({visibility:'visible'});}},function(){$.data(this,'cancel.tipsy',false);var self=this;setTimeout(function(){if($.data(this,'cancel.tipsy'))return;var tip=$.data(self,'active.tipsy');if(opts.fade){tip.stop().fadeOut(function(){$(this).remove();});}else{tip.remove();}},100);});};})(jQuery);


//<![CDATA[
$(document).ready(function()
{ $('.ajaxify').ajaxify(); });
/*for logging */
$(document).ready(function()
{
$("#username").change(function()
{
//remove all the class add the messagebox classes and start fading
$("#msgbox").removeClass().addClass('messagebox').text('Checking...').fadeIn(1000);
//check the username exists or not from ajax
$.post("user_availability.php",{ user_name:$(this).val() } ,function(data)
{
if(data=='no') //if username not avaiable
{
$("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
{
//add message and change the class of the box and start fading
$(this).html('This User name Already exists').addClass('messageboxerror').fadeTo(900,1);
});
}
else
{
$("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
{
//add message and change the class of the box and start fading
$(this).html('Username available to register').addClass('messageboxok').fadeTo(900,1);
});
}
});
});
});
/*for list*/
$(document).ready(function(){

        $("#number li").each(function (i) {
                i = i+1;
                $(this).addClass("item");
   });
});


var MyPage = {
init: function() {
MyPage.bindButtons();
$('.go').click(function() {
var location = '/tag/' + this.form.enter_category.value.replace('#', '');
window.location = location;
return false;
});
},
unBindButtons: function() {
$('.a-info').unbind().click(function() {
return false;
});
},
bindButtons: function() {
$('.a-info').click(function() {
MyPage.unBindButtons();
$('.more-info:not(#info-' + this.id + ')').hide('fast');
$('#info-' + this.id).toggle('fast', MyPage.bindButtons);
return false;
});
}
};
$(document).ready(function() {
MyPage.init();
});
//]]>

//http://assets.zipsite.net.s3.amazonaws.com/mpglobal/plugin.dimensions.js

/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)

 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)

 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.

 *

 * $LastChangedDate: 2008-02-28 05:49:55 -0500 (Thu, 28 Feb 2008) $

 * $Rev: 4841 $

 *

 * Version: @VERSION

 *

 * Requires: jQuery 1.2+

 */



(function($){



$.dimensions = {

	version: '@VERSION'

};



// Create innerHeight, innerWidth, outerHeight and outerWidth methods

$.each( [ 'Height', 'Width' ], function(i, name){



	// innerHeight and innerWidth

	$.fn[ 'inner' + name ] = function() {

		if (!this[0]) return;



		var torl = name == 'Height' ? 'Top'    : 'Left',  // top or left

		    borr = name == 'Height' ? 'Bottom' : 'Right'; // bottom or right



		return this.css('display') != 'none' ? this[0]['client' + name] : num( this, name.toLowerCase() ) + num(this, 'padding' + torl) + num(this, 'padding' + borr);

	};



	// outerHeight and outerWidth

	$.fn[ 'outer' + name ] = function(options) {

		if (!this[0]) return;



		var torl = name == 'Height' ? 'Top'    : 'Left',  // top or left

		    borr = name == 'Height' ? 'Bottom' : 'Right'; // bottom or right



		options = $.extend({ margin: false }, options || {});



		var val = this.css('display') != 'none' ?

				this[0]['offset' + name] :

				num( this, name.toLowerCase() )

					+ num(this, 'border' + torl + 'Width') + num(this, 'border' + borr + 'Width')

					+ num(this, 'padding' + torl) + num(this, 'padding' + borr);



		return val + (options.margin ? (num(this, 'margin' + torl) + num(this, 'margin' + borr)) : 0);

	};

});



// Create scrollLeft and scrollTop methods

$.each( ['Left', 'Top'], function(i, name) {

	$.fn[ 'scroll' + name ] = function(val) {

		if (!this[0]) return;



		return val != undefined ?



			// Set the scroll offset

			this.each(function() {

				this == window || this == document ?

					window.scrollTo(

						name == 'Left' ? val : $(window)[ 'scrollLeft' ](),

						name == 'Top'  ? val : $(window)[ 'scrollTop'  ]()

					) :

					this[ 'scroll' + name ] = val;

			}) :



			// Return the scroll offset

			this[0] == window || this[0] == document ?

				self[ (name == 'Left' ? 'pageXOffset' : 'pageYOffset') ] ||

					$.boxModel && document.documentElement[ 'scroll' + name ] ||

					document.body[ 'scroll' + name ] :

				this[0][ 'scroll' + name ];

	};

});



$.fn.extend({

	position: function() {

		var left = 0, top = 0, elem = this[0], offset, parentOffset, offsetParent, results;



		if (elem) {

			// Get *real* offsetParent

			offsetParent = this.offsetParent();



			// Get correct offsets

			offset       = this.offset();

			parentOffset = offsetParent.offset();



			// Subtract element margins

			offset.top  -= num(elem, 'marginTop');

			offset.left -= num(elem, 'marginLeft');



			// Add offsetParent borders

			parentOffset.top  += num(offsetParent, 'borderTopWidth');

			parentOffset.left += num(offsetParent, 'borderLeftWidth');



			// Subtract the two offsets

			results = {

				top:  offset.top  - parentOffset.top,

				left: offset.left - parentOffset.left

			};

		}



		return results;

	},



	offsetParent: function() {

		var offsetParent = this[0].offsetParent;

		while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && $.css(offsetParent, 'position') == 'static') )

			offsetParent = offsetParent.offsetParent;

		return $(offsetParent);

	}

});



function num(el, prop) {

	return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;

};



})(jQuery);



//<![CDATA[
$(function() {
$('.north').tipsy({gravity: 'n'});
$('.south').tipsy({gravity: 's'});
$('.east').tipsy({gravity: 'e'});
$('.west').tipsy({gravity: 'w'});
$('#fade').tipsy({fade: true});
});
jQuery(function($) {
$('button.fabmenu').one('click', openMenu);
function openMenu(e) {
var button = $(this).addClass('active');
var menu = $('#' + button.attr('name'));
var offset = button.offset();
var h = (button.outerHeight) ? button.outerHeight() : button.height();
menu.addClass('active').css({
'top': offset.top + h, 'left': offset.left
}).click(function(e) { e.stopPropagation(); }).show(200, function() {
$(document).one('click', {button: button, menu: menu}, closeMenu);
});
}
function closeMenu(e) {
e.data.menu.removeClass('active').hide(100, function() {
e.data.button.removeClass('active');
});
e.data.button.one('click', openMenu);
}
});
//]]>



$(document).ready(function(){

	//prepend span tag
	$(".jquery h1").prepend("<span></span>");

});



//<![CDATA[
a2a_linkname=" ";a2a_linkurl="";a2a_show_title=0;
//]]>


$(function () {
    $('ul.spy').simpleSpy();
});

(function ($) {

$.fn.simpleSpy = function (limit, interval) {
    limit = limit || 4;
    interval = interval || 4000;

    return this.each(function () {
        // 1. setup
            // capture a cache of all the list items
            // chomp the list down to limit li elements
        var $list = $(this),
            items = [], // uninitialised
            currentItem = limit,
            total = 0, // initialise later on
            height = $list.find('> li:first').height();

        // capture the cache
        $list.find('> li').each(function () {
            items.push('<li>' + $(this).html() + '</li>');
        });

        total = items.length;

        $list.wrap('<div class="spyWrapper" />').parent().css({ height : height * limit });

        $list.find('> li').filter(':gt(' + (limit - 1) + ')').remove();

        // 2. effect
        function spy() {
            // insert a new item with opacity and height of zero
            var $insert = $(items[currentItem]).css({
                height : 0,
                opacity : 0,
                display : 'none'
            }).prependTo($list);

            // fade the LAST item out
            $list.find('> li:last').animate({ opacity : 0}, 1000, function () {
                // increase the height of the NEW first item
                $insert.animate({ height : height }, 1000).animate({ opacity : 1 }, 1000);

                // AND at the same time - decrease the height of the LAST item
                // $(this).animate({ height : 0 }, 1000, function () {
                    // finally fade the first item in (and we can remove the last)
                    $(this).remove();
                // });
            });

            currentItem++;
            if (currentItem >= total) {
                currentItem = 0;
            }

            setTimeout(spy, interval)
        }

        spy();
    });
};

})(jQuery);



