﻿var vidwidth = "640";
var vidheight = "385";
function is_ie6(){return ((window.XMLHttpRequest == undefined) && (ActiveXObject != undefined));}
$(function(){$('.twl1').tweetable({username: 'bigkidscalendar', time: true, limit: 4});});

/*bigkidscalendar*/

function writeObj(obj,content){$(obj).html(content);}
function rollOverContent(thisObj)
{ 
	$(thisObj).click(function(){
		
		var currentId = $(this).attr('id').replace('A','').replace('B','').replace('C',''); 
		if (currentId < 25){writeObj(".popupbody","<div><object width=\"" + vidwidth + "\" height=\"" + vidheight + "\"><param name=\"movie\" value=\"" + arrVLink[currentId] + "\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"" + arrVLink[currentId] + "\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"" + vidwidth + "\" height=\"" + vidheight + "\"></embed></object></div>");centerPopup();loadPopup();}
		else if(currentId == 25){writeObj(".popupbody",arrVLink[currentId]);centerPopup();loadPopup();}
		return false;
	});
}
$(document).ready(function() {
	/*--LINK EASING--*/
	var style_in = 'easeInSine';
	var style_out = 'jswing';
	var speed_in = 400;
	var speed_out = 400;	
	var neg = 254;
	var out = 260;
	
	$('.qitem').each(function () {
		url = $(this).find('a').attr('href');
		img = $(this).find('img').attr('src');
		alt = $(this).find('img').attr('img');
		$('img', this).remove();
		$(this).append('<div class="topLeft"></div>');
		$(this).children('div').css('background-image','url('+ img + ')');
		$(this).find('div.topLeft').css({top:0, left:0});	
	}).hover(function () {
		$(this).find('div.topLeft').stop(false, true).animate({top:neg, left:0}, {duration:speed_out, easing:style_out});	
	},
	function () {
		$(this).find('div.topLeft').stop(false, true).animate({top:0, left:0}, {duration:speed_in, easing:style_in});	
	}).click (function () {
		//window.location = $(this).find('a').attr('href');	
	});
	
	/*--POP UP--*/
	rollOverContent(".rollContent");
	$("#popupWrapClose").click(function(){disablePopup(); writeObj(".popupbody","");});
	$("#backgroundPopup").click(function(){disablePopup(); writeObj(".popupbody","");});
});