$(document).ready( function(){
$("video").VideoJS()

	$('#promo a').hover(function() {$('#promoico').show(); }, function() {$('#promoico').hide(); });
 	$('#promo a').mousemove(function(e){ x = e.pageX+5; y = e.pageY+5; $('#promoico').css({'top': y+'px', 'left': x+'px'});});

$('.hvr').focus(function(){ if ($(this).attr('alt')!='') if ($(this).attr('value')==$(this).attr('alt')) {$(this).attr('value','');}});

$('.hvr').blur(function(){ if ($(this).attr('alt')!='') if ($(this).attr('value')=='') {$(this).attr('value',$(this).attr('alt'));}});

$('.hvr').each(function(i) {if (($(this).attr('alt')!='') && ($(this).attr('value')=='')) {$(this).attr({'value':$(this).attr('alt')});}});



var preload = new Array();iter=0;

$('#sponsori li a').each(function() {

preload[++iter] = '/upload/'+$(this).attr('title')+'.jpg';

$(this).html('<img src="/upload/bw_'+$(this).attr('title')+'.jpg'+'" />');



$(this).hover(function() {$(this).children('img').attr({'src':'/upload/'+$(this).attr('title')+'.jpg'})}, function() {$(this).children('img').attr({'src':'/upload/bw_'+$(this).attr('title')+'.jpg'})});

});

$('#artextension a').each(function() {

preload[++iter] = '/media/artextension.jpg';

$(this).html('<img src="/media/bw_artextension.jpg" />');



$(this).hover(function(){$(this).children('img').attr({'src':'/media/artextension.jpg'})},function(){$(this).children('img').attr({'src':'/media/bw_artextension.jpg'})});

});



preloadImages(preload); 



$('#btmlvl1 a').mouseover(function() {$('.hd').css({'display':'none'});$("#"+$(this).attr('class')).css({'display':'block'}); });

$('#articles h2').css({'text-indent':'-9999px'});

$('#articles h2.title').css({'text-indent':'0px'});



$('#articles h2').each(function() {if ($(this).attr('class')!='title') {var pic = '/upload/'+$(this).attr('class')+'.jpg';$(this).css({'background':'url("'+pic+'") top left no-repeat'});}});



$('#hdrmenu a').click(function() {if ($(this).attr('target')=='_blank') {window.open($(this).attr('href'), 'windet', 'width=420, height=440,scrollbars=1'); return false;} });

$('#unsubscribe_contact').click(function() {if ($(this).attr('target')=='_blank') {window.open($(this).attr('href'), 'windet', 'width=420, height=440,scrollbars=1'); return false;} });

$('#emailit').click(function() {if ($(this).attr('target')=='_blank') window.open($(this).attr('href'), 'windet', 'width=410, height=440,scrollbars=1,resizable=0'); return false; });

$('#printit').click(function() {if ($(this).attr('target')=='_blank') window.open($(this).attr('href'), 'windet', 'width=800, height=600,scrollbars=1'); return false; });





$(".winbig").click(function() {window.open('/img.php?img='+$(this).attr('href'), 'imgprev', 'width=800, height=600,scrollbars=0,resizable=0'); return false;  });



if ($('#colbigpic').length >0) {

	mX = mY = 0;

	$(document).mousemove(function(e){mX = e.pageX; mY=e.pageY;$('#colbigpic').css({'left':mX+20, 'top':mY+20});}); 

	$('#colbigpic').html('<img src="/media/watermark.png" />');

	$('#collections li a').hover(function(){$('#colbigpic img').attr({'src':'/upload/'+$(this).children('img').attr('src').substring(14)});$('#colbigpic').css({'display':'block'}); },function(){ $('#colbigpic').css({'display':'none'}); });

	$('#collections li a').click(function(){ return false;});

}

$("#flashbig").css({'height':$(document).height(), 'width':$(document).width()}) ;$("#flashbig").hide();

$("#flashbig").click( function () { $("object").css({'visibility':'visible'});$("#flashbig").hide();})

$("#flashbiginner").click( function () { });

});

function shfl(flash,width,height) {

	$("object").css({'visibility':'hidden'});

	swfobject.embedSWF("/upload/"+flash, "flashbiginner", width, height, "9.0.0", {}, {}, {"wmode":"window"});

	$("#flashbiginner").css({'height':height, 'width':width,'top':$(document).scrollTop()+($(window).height()-height)/2,'left':($(document).width()-width)/2});

	$("#flashbig").show();





}



function preloadImages(a) {

	for(var i = a.length -1; i > 0; i--) {

		$("<img>").attr("src", a[i]);

	}

}


