function getdefault_usr() { if(document.getElementById('uname').value == '') { document.getElementById('uname').value = '- username -'; }}
function getdefault_pass() { if(document.getElementById('pass').value == '') { document.getElementById('pass').value = '- password -'; }}
function toggle_members() { if(document.getElementById('recent_panel').style.display == 'block') { document.getElementById('recent_tab').style.fontWeight = 'normal'; document.getElementById('online_tab').style.fontWeight = 'bold'; document.getElementById('recent_panel').style.display = 'none'; document.getElementById('online_panel').style.display = 'block'; }	else if(document.getElementById('recent_panel').style.display == 'none') { document.getElementById('recent_tab').style.fontWeight = 'bold'; document.getElementById('online_tab').style.fontWeight = 'normal';		document.getElementById('recent_panel').style.display = 'block'; document.getElementById('online_panel').style.display = 'none'; }}
function toggle_toptalkler()
{
	if(jQuery('#talker_month').css("display") == 'none'){
		jQuery('#talker_month').css("display","block");
		jQuery('#talker_week').css("display","none");
		jQuery('#tab1').html('Month').css({"color":"#99a106"});
		jQuery('#tab2').html('Week').css({"color":"#99a106"});
		jQuery('#topboxHead').css({"background":"url(images/left_contentbox2_top.jpg) no-repeat","color":"#99a106"});
		jQuery('#topboxFooter').attr("src","images/left_contentbox2_bottom.jpg"); 
	}
	else if(jQuery('#talker_week').css("display") == 'none'){
		jQuery('#talker_month').css("display","none");
		jQuery('#talker_week').css("display","block");
		jQuery('#tab1').html('Week').css({"color":"#53672b"});
		jQuery('#tab2').html('Month').css({"color":"#53672b"});
		jQuery('#topboxHead').css({"background":"url(images/left_contentbox1_top.jpg) no-repeat","color":"#53672b"});
		jQuery('#topboxFooter').attr("src","images/left_contentbox1_bottom.jpg"); 
	}
}
/*stepcarousel.setup({
	galleryid: 'videolist', //id of carousel DIV
	beltclass: 'belt', //class of inner "belt" DIV containing all the panel DIVs
	panelclass: 'panel', //class of panel DIVs each holding content
	autostep: {enable:true, moveby:1, pause:5000},
	panelbehavior: {speed:50, wraparound:false, persist:true},	
	defaultbuttons: {enable: false, moveby: 1, leftnav: ['images/left_arrow.png', -4, 115], rightnav: ['images/right_arrow.png', -10, 115]},
	statusvars: ['statusA', 'statusB', 'statusC'], //register 3 variables that contain current panel (start), current panel (last), and total panels
	contenttype: ['inline'] //content setting ['inline'] or ['external', 'path_to_external_file']
})
stepcarousel.setup({
	galleryid: 'Mostviewed_video', //id of carousel DIV
	beltclass: 'belt', //class of inner "belt" DIV containing all the panel DIVs
	panelclass: 'panel', //class of panel DIVs each holding content
	autostep: {enable:true, moveby:1, pause:5000},
	panelbehavior: {speed:50, wraparound:false, persist:true},
	defaultbuttons: {enable: false, moveby: 1, leftnav: ['images/left_arrow.png', -4, 115], rightnav: ['images/right_arrow.png', -10, 115]},
	statusvars: ['statusA', 'statusB', 'statusC'], //register 3 variables that contain current panel (start), current panel (last), and total panels
	contenttype: ["ajax",'ajax/video_list_new.php?q=Mostviewed'] //content setting ['inline'] or ['external', 'path_to_external_file']
})
stepcarousel.setup({
	galleryid: 'Mosttalked_video', //id of carousel DIV
	beltclass: 'belt', //class of inner "belt" DIV containing all the panel DIVs
	panelclass: 'panel', //class of panel DIVs each holding content
	autostep: {enable:true, moveby:1, pause:5000},
	panelbehavior: {speed:50, wraparound:false, persist:true},
	defaultbuttons: {enable: false, moveby: 1, leftnav: ['images/left_arrow.png', -4, 115], rightnav: ['images/right_arrow.png', -10, 115]},
	statusvars: ['statusA', 'statusB', 'statusC'], //register 3 variables that contain current panel (start), current panel (last), and total panels
	contenttype: ["ajax",'ajax/video_list_new.php?q=Mosttalked'] //content setting ['inline'] or ['external', 'path_to_external_file']
})
stepcarousel.setup({
	galleryid: 'Mostfavorite_video', //id of carousel DIV
	beltclass: 'belt', //class of inner "belt" DIV containing all the panel DIVs
	panelclass: 'panel', //class of panel DIVs each holding content
	autostep: {enable:true, moveby:1, pause:5000},
	panelbehavior: {speed:50, wraparound:false, persist:true},
	defaultbuttons: {enable: false, moveby: 1, leftnav: ['images/left_arrow.png', -4, 115], rightnav: ['images/right_arrow.png', -10, 115]},
	statusvars: ['statusA', 'statusB', 'statusC'], //register 3 variables that contain current panel (start), current panel (last), and total panels
	contenttype: ["ajax",'ajax/video_list_new.php?q=Mostfavorite'] //content setting ['inline'] or ['external', 'path_to_external_file']
})
*/
(function (jQuery) {  
	jQuery.fn.simpleSpy = function (limit, interval) {
		limit = limit || 4;
		interval = interval || 4000;
		
		return this.each(function () {
			
			var jQuerylist = jQuery(this),
				items = [], 
				currentItem = limit,
				total = 0, 
				height = jQuerylist.find('> li:first').height();
				
		  
			jQuerylist.find('> li').each(function () {
				items.push('<li>' + jQuery(this).html() + '</li>');
			});
			
			total = items.length;
			
			jQuerylist.wrap('<div class="spyWrapper"></div>').parent().css({ height : height * limit });
			
			jQuerylist.find('> li').filter(':gt(' + (limit - 1) + ')').remove();
	
			  
			function spy() {
			   
				var jQueryinsert = jQuery(items[currentItem]).css({
					height : 0,
					opacity : 0,
					display : 'none'
				}).prependTo(jQuerylist);
							
				
				jQuerylist.find('> li:last').animate({ opacity : 0}, 1000, function () {
					
					jQueryinsert.animate({ height : height }, 1000).animate({ opacity : 1 }, 1000);
					
					
					jQuery(this).animate({ height : 0 }, 1000, function () {
						
						jQuery(this).remove();
					 });
				});
				
				currentItem++;
				if (currentItem >= total) {
					currentItem = 0;
				}
				
				setTimeout(spy, interval)
			}
			
			spy();
		});
	};
		
	})(jQuery);
// news spy Ends

	discard=function() {	
		jQuery('#info-box').slideUp('slow',function () { jQuery('#img-box').remove(); });
		jQuery('#external').fadeTo("slow",0.7).slideUp('slow',function () { jQuery('#external').remove(); });
	}	
	discard1=function() {	
		jQuery('#info-box').slideUp('slow',function () { jQuery('#img-box').remove(); });
		jQuery('#external').fadeTo("slow",0.7).slideUp('slow',function () { jQuery('#external').remove(); });
		jQuery('#uname').focus().css({'border':'1px solid #ff9966'});
	}	
	logout_flash= function(flag){
		if(flag == 'done'){
		jQuery('body').append('<div id="external" style="border: medium none ; margin: 0pt; padding: 0pt; z-index: 3005; cursor: wait; width: 100%; height: 100%; top: 0pt; left: 0pt; position: fixed; background-color:#254204;"></div>'); jQuery("#external").fadeTo("slow",0.6);
		
		jQuery('body').append('<div id="info-box" style="position: fixed;border:1px solid #ff9933; z-index: 3050; width:500px; bottom:250px; left:500px; background:#fff url(images/bg-info.gif) repeat-x left bottom; cursor:pointer; -moz-border-radius: 6px; -webkit-border-radius: 6px;"><table width="100%" border="0" cellspacing="2" cellpadding="2"><tr><td width="9%" align="left"><div id="imgsm" style=" position:relative; background:transparent url(images/smile.gif) no-repeat left top; width:60px; height:61px; left:-24px; top:-22px;"></div></td><td width="91%" align="left"><div class="signinbox_subhdr" style="padding-top:0px;">Hi! Have a good time!</div><ul class="signinbox_txt02"><li>You\'ve been successfully signed out.</li><li>If you\'ve made a terrible mistake, then feel free to <span class="signinbox_txt03" style="color:#339900;" onclick="discard1();"><strong>Sign in</strong></span> again.</li></ul></td></tr></table><div align="center" class="signinbox_subhdr" style="padding:5px; font-size:12px;color:#CC3333;">WAIT ! Latest movies section is coming very soon with updated International News!</div><div style="text-align:right;padding:5px;"><img src="images/discard.gif" alt="Discard me ..." class="fdut" style="cursor:pointer;" onclick="discard();" /></div></div>');
		}
	}
		
//AJAX JQUERY ......
	getMussic=function(urls,data,container,id,cat_id) {
		urls=urls+data;		
		jQuery(".cat").removeClass("done").removeClass('current');
		jQuery("#"+id).addClass("current"); jQuery.ajax({url: urls,cache: false,success: function(html){
		jQuery("#"+id).removeClass('current').addClass("done"); jQuery("#" + container).html(html);}});
		jQuery('#_hid_cat').val(cat_id);

	}
	getPagingUrl=function(page) { 
		if(!page) { page=1; } 
		//alert("pik_music_subpage_ajax.php?page=" + page + "&cat=" + jQuery('#_hid_cat').val());
		jQuery('#img-loader-page').css({display:"block"});
		jQuery.ajax({
		  url: "ajax/pik_music_subpage_ajax.php?page=" + page + "&cat=" + jQuery('#_hid_cat').val(),
		  cache: false,
		  success: function(html){
			jQuery("#contr").html(html);
			jQuery('#img-loader-page').css({display:"none"});
		  }
		});

	} 
	
	divHover=function() {
		jQuery('.main-box').hover(
				  function () {
					jQuery(this).addClass('main-box-hover');
				  }, 
				  function () {
					jQuery(this).removeClass('main-box-hover');
				  }
		);	
	}
	
	gameHover=function() {
		jQuery('.games-box').hover(
				  function () {
					jQuery(this).addClass('game-hover');
					
				  }, 
				  function () {
					jQuery(this).removeClass('game-hover');					
				  }
		);	
	}
	
	divsHover=function() {
		jQuery('.piksps').hover(
				  function () {
					jQuery(this).removeClass('pikspaceBox').addClass('hover-ps');					
				  }, 
				  function () {
					jQuery(this).removeClass('hover-ps').addClass('pikspaceBox');
				  }
		);	
	}
