function showregbox(){
	var obj=document.getElementById("registerbox");
	if (obj.style.display=='block') { obj.style.display=''; } else { obj.style.display='block'; document.getElementById("username_log_ac").focus(); }
	return true;
	}

function bookmarksite(){
	var title='ActionTrip';
	var url='http://www.actiontrip.com/';
	if (window.sidebar) // firefox
		window.sidebar.addPanel(title, url, "");
		else if(window.opera && window.print){ // opera
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	} 
	else if(document.all)// ie
	window.external.AddFavorite(url, title);
	}



//----------------------------------- funkcije za ispisivanje svih platformi -----------------

var leftcor;
var topcor;

function showhidebox(platformbox,platformboxexpand,color) {
	var obj=document.getElementById(platformboxexpand);
	var obj2=document.getElementById(platformbox);

	findMyPos(obj2);
	topcor=topcor+obj2.offsetHeight;
	obj.style.position='absolute';
	obj.style.left=leftcor+'px';		// '690px';
	obj.style.top=topcor+'px';
	obj.style.width=obj2.offsetWidth-6+'px';


	if (obj.style.display=='block') { obj.style.display=''; obj2.style.background=color; } else { obj.style.display='block'; obj2.style.background='#000000'; }
	return true;
	}

function findMyPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
			} while (obj = obj.offsetParent);
	}
	leftcor=curleft;
	topcor=curtop;
}




function position_multipage_comic_nav() {
	var obj=document.getElementById('comic');
	var obj2=document.getElementById('multipagenav');
	findMyPos(obj);
	leftcor-=10;
	topcor+=obj.offsetHeight-85;
	obj2.style.left=leftcor+'px';
	obj2.style.top=topcor+'px';
	obj2.style.visibility = 'visible';
	}







//------------------------------------- cheats funcije --------------------------------------

function cheats_compact_expand(button){

var obj=document.getElementById(button.replace('_text',''));

if (obj.style.display=='block') {					// obj.style.display=='' || 
	obj.style.display='none';
	var obj=document.getElementById(button);
	obj.parentNode.parentNode.style.marginTop='-35px';
	obj.innerHTML='EXPAND TO SEE ALL <img border="0" src="http://www.cdn.actiontrip.com/gfx4/cheatsexpand.gif">';
	} else {
	obj.style.display='block';
	var obj=document.getElementById(button);
	obj.parentNode.parentNode.style.marginTop='-10px';
	obj.innerHTML='COMPACT <img border="0" src="http://www.cdn.actiontrip.com/gfx4/cheatscompact.gif">';
	}
}


function var_compact_expand(button){

var obj=document.getElementById(button.replace('_text',''));

if (obj.style.display=='block') {					// obj.style.display=='' || 
	obj.style.display='none';
	var obj=document.getElementById(button);
	obj.innerHTML='<img border="0" src="http://www.cdn.actiontrip.com/gfx4/cheatsexpand.gif"> EXPAND TO SEE ALL';
	} else {
	obj.style.display='block';
	var obj=document.getElementById(button);
	obj.innerHTML='<img border="0" src="http://www.cdn.actiontrip.com/gfx4/cheatscompact.gif"> COMPACT';
	}
}




//--------------------------- search stuff -------------------------------
function checkplatforms(name, clicked) {
var theForm = document.searchsection;
var allbox;
var numberofchecked=0;
for (i=0; i<theForm.elements.length; i++) {
    if (theForm.elements[i].type == 'checkbox' && theForm.elements[i].name == name && theForm.elements[i].value=='all') { allbox=theForm.elements[i]; }
    if (theForm.elements[i].type == 'checkbox' && theForm.elements[i].name == name && theForm.elements[i].checked && theForm.elements[i]!=allbox) {
	numberofchecked++;
	if (clicked && allbox.checked) { theForm.elements[i].checked=false; numberofchecked=0; }	// kliknuli smo na all, pa sve ostale brisemo
	}
    }
if (numberofchecked) { allbox.checked=false; } else { allbox.checked=true; } 
return false;
}



function setplatforms(name, platset) {
var theForm = document.searchsection;
var allbox;
var numberofchecked=0;
platset = ','+platset;
for (i=0; i<theForm.elements.length; i++) {
    if (theForm.elements[i].type == 'checkbox' && theForm.elements[i].name == name && theForm.elements[i].value=='all') { allbox=theForm.elements[i]; }
    if (theForm.elements[i].type == 'checkbox' && theForm.elements[i].name == name && platset.indexOf(theForm.elements[i].value+',')>0) {
	numberofchecked++;
	theForm.elements[i].checked=true;
	}
    }
if (numberofchecked) { allbox.checked=false; } else { allbox.checked=true; } 
}
// use setplatforms('platforms[]',platset);








function open_girl(doc_loc) {
	winLeft = (screen.width-980)/2;
	winTop = (screen.height-(720+110))/2; 
	window.open(doc_loc, 'loginWindow', 'width=980,height=720,screenX='+winLeft+',screenY='+winTop+',top='+winTop+',left='+winLeft+',resizable=yes,scrollbars=yes');
	}
function open_mail(doc_loc) {
	winLeft = (screen.width-620)/2;
	winTop = (screen.height-(280+110))/2; 
	window.open('/rei/send_email.phtml?id='+doc_loc, 'loginWindow', 'width=620,height=280,screenX='+winLeft+',screenY='+winTop+',top='+winTop+',left='+winLeft+',resizable=yes,scrollbars=no');
	}
function open_prof(doc_loc) {
	winLeft = (screen.width-400)/2;
	winTop = (screen.height-(240+110))/2; 
	window.open('/rei/show_profile.phtml?id='+doc_loc, 'loginWindow', 'width=400,height=240,screenX='+winLeft+',screenY='+winTop+',top='+winTop+',left='+winLeft+',resizable=yes,scrollbars=no');
	}
function open_dl(doc_loc) {
	winLeft = (screen.width-800)/2;
	winTop = (screen.height-(400+110))/2; 
	if (doc_loc.indexOf('phtml')>0) { window.open(doc_loc, 'loginWindow', 'width=800,height=400,screenX=180,screenX='+winLeft+',screenY='+winTop+',top='+winTop+',left='+winLeft+',resizable=yes,scrollbars=no'); } else { window.open('/link.phtml?'+doc_loc, '', ''); }
	}
function open_poll(doc_loc) {
	winLeft = (screen.width-300)/2;
	winTop = (screen.height-(400+110))/2; 
	window.open('/polls.phtml?poll='+doc_loc, 'loginWindow', 'width=300,height=400,screenX=180,screenX='+winLeft+',screenY='+winTop+',top='+winTop+',left='+winLeft+',resizable=yes,scrollbars=no');
	}
function open_editwindow(doc_loc) {
	winLeft = (screen.width-565)/2;
	winTop = (screen.height-(280+110))/2; 
	window.open(doc_loc, 'loginWindow', 'width=565,height=280,screenX='+winLeft+',screenY='+winTop+',top='+winTop+',left='+winLeft+',resizable=yes,scrollbars=yes');
	}
function open_friend(doc_loc) {
	winLeft = (screen.width-400)/2;
	winTop = (screen.height-(240+110))/2; 
	window.open(doc_loc, 'popuppoll', 'width=400,height=240,screenX='+winLeft+',screenY='+winTop+',top='+winTop+',left='+winLeft+',resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no');
	}

function popup_ac(loc) {
	var left = (screen.width - 400)/2;
	var top = (screen.height - 200)/2.1;
	window.open(loc, "_blank", "left = " + left + ", top = " + top + ", toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=400, height=200");
	return false;
	}


function pop_articles_vote(vote,id) {
	var left = (screen.width - 400)/2;
	var top = (screen.height - 200)/2.1;
	var loc = '/rei/game_save_vote.phtml?vote=' + vote + '&id=' + id;
	window.open(loc, "_blank", "left = " + left + ", top = " + top + ", toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=400, height=200");
	showhidebox('rateitbox','rateitboxexpand','#000000');
	return false;
	}





	
	
	
	
	
$(document).ready(function(){
 		$('#topimagemenu a').hover(
		  function () {
		  var racko = $(this).attr('class').replace(/^.* /, '');
		  if (racko.charAt(racko.length-1)!='2') {
			$(this).removeClass(racko);
			$(this).addClass(racko+'2');
			}
		  }, 
		  function () {
		  var racko = $(this).attr('class').replace(/^.* /, '');
		  if (racko.charAt(racko.length-1)=='2' && $(this).attr('name')!='activesec') {
			$(this).removeClass(racko);
			$(this).addClass(racko.substr(0,6));
			}
		  }
		);
		
		
	$("#topbabes a").mouseenter(function(){
		$("#topbabesdesc").html($(this).attr('title'));
		$(this).animate( { width:"175px" }, { queue:false, duration:200 } )
		$(this).siblings().each(function() {
			$(this).animate( { width:"23px" }, { queue:false, duration:200 } )
			});
	});

    $("#topvideos img").tipTip({edgeOffset: -20});

	$("#topcomic img").hover(function() { $("#topcomicdesc").text($(this).attr('alt')); },function() { $("#topcomicdesc").html('&nbsp;'); } );
	
	var isShotsBusy = false;
	
	$("#isShotsNextButton").click(function(event){
		var ukupno = $("#isShotsImageRow img").size();
		var pages = Math.ceil(ukupno/2);
		var offs = parseInt($("#isShotsImageRow").css('marginLeft'));
		if (offs<=0 && offs>-((ukupno-2)*132) && !isShotsBusy) {
			isShotsBusy = true;
			$("#isShotsImageRow").animate( { marginLeft: "-=264px" }, 150, "linear", function(){ isShotsBusy = false; });
			$("#isShotsPreviousButton").attr("src", 'http://www.cdn.actiontrip.com/gfx4/scrollleft.gif');
			if (offs == -(pages-2)*264) {
				$("#isShotsNextButton").attr("src", 'http://www.cdn.actiontrip.com/gfx4/scrollright_lite.gif');
				}
			}
	event.preventDefault();
	});

	$("#isShotsPreviousButton").click(function(event){
		var offs = parseInt($("#isShotsImageRow").css('marginLeft'));
		if (offs < 0 && !isShotsBusy) {
			isShotsBusy = true;
			$("#isShotsImageRow").animate( { marginLeft: "+=264px" }, 150, "linear", function(){ isShotsBusy = false; });
			$("#isShotsNextButton").attr("src", 'http://www.cdn.actiontrip.com/gfx4/scrollright.gif');
			if (offs == -264) {
				$("#isShotsPreviousButton").attr("src", 'http://www.cdn.actiontrip.com/gfx4/scrollleft_lite.gif');
				}
			}
	event.preventDefault();
	});
		




	var isShots2Busy = false;
		
	$("#isShots2NextButton").click(function(event){
		var ukupno = $("#isShots2ImageRow img").size();
		var pages = Math.ceil(ukupno/3);
		var offs = parseInt($("#isShots2ImageRow").css('marginLeft'));
		if (offs<=0 && offs>-((ukupno-3)*156) && !isShots2Busy) {
			isShots2Busy = true;
			$("#isShots2ImageRow").animate({ marginLeft: "-=468px" }, 150, "linear", function(){ isShots2Busy = false; });
			$("#isShots2PreviousButton").css('background-position', '-10px 0px');
			if (offs == -(pages-2)*468) {
				$("#isShots2NextButton").css('background-position', '-20px 0px');
				}
			}
	event.preventDefault();
	});

	$("#isShots2PreviousButton").click(function(event){
		var offs = parseInt($("#isShots2ImageRow").css('marginLeft'));
		if (offs < 0 && !isShots2Busy) {
			isShots2Busy = true;
			$("#isShots2ImageRow").animate( { marginLeft: "+=468px" }, 150, "linear", function(){ isShots2Busy = false; });
			$("#isShots2NextButton").css('background-position', '0px 0px');
			 if (offs == -468) {
				$("#isShots2PreviousButton").css('background-position', '-30px 0px');
				}
			 }
	event.preventDefault();
	});
		
	if ($("#isShots2ImageRow img").length != 0) {
		$("#isShots2PreviousButton").css('background-position', '-30px 0px');
		if ($("#isShots2ImageRow img").length <= 3) {
		$("#isShots2NextButton").css('background-position', '-20px 0px');
			}
		}
		
 });
 
 







 
 
 
 
 
 
 
 
 
 
 
// --------------------------------------------------- this one is for the HP flash panel ------------------------------------------------
 
window.onerror=function(desc,page,line,chr){
/* alert('JavaScript error occurred! \n'
  +'\nError description: \t'+desc
  +'\nPage address:      \t'+page
  +'\nLine number:       \t'+line
 );*/
}

$(function(){
 $('a').focus(function(){this.blur();});
 SI.Files.stylizeAll();
 slider.init();

 $("#slide-runner strong img").load(function(){
	var k = $(this).attr('id').replace(/.*-/, '');
	$('#slide-nav a#slide-link-'+k).removeClass('loading');
	});
 
 $("#navline a").hover(function(){
	$(this).fadeTo("fast", 1.0);
	},function(){
	$(this).fadeTo("fast", 0.3);
	});

 $('input.text-default').each(function(){
  $(this).attr('default',$(this).val());
 }).focus(function(){
  if($(this).val()==$(this).attr('default'))
   $(this).val('');
 }).blur(function(){
  if($(this).val()=='')
   $(this).val($(this).attr('default'));
 });

 $('input.text,textarea.text').focus(function(){
  $(this).addClass('textfocus');
 }).blur(function(){
  $(this).removeClass('textfocus');
 });

 var popopenobj=0,popopenaobj=null;
 $('a.popup').click(function(){
  var pid=$(this).attr('rel').split('|')[0],_os=parseInt($(this).attr('rel').split('|')[1]);
  var pobj=$('#'+pid);
  if(!pobj.length)
   return false;
  if(typeof popopenobj=='object' && popopenobj.attr('id')!=pid){
   popopenobj.hide(50);
   $(popopenaobj).parent().removeClass(popopenobj.attr('id').split('-')[1]+'-open');
   popopenobj=null;
  }
  return false;
 });

});
var slider={
 num:-1,
 cur:0,
 cr:[],
 al:null,
 at:10*1000,
 ar:true,
 init:function(){
  if(!slider.data || !slider.data.length)
   return false;

  var d=slider.data;
  slider.num=d.length;
  var pos=Math.floor(Math.random()*1);//slider.num);
  for(var i=0;i<slider.num;i++){
   $('#slide-runner strong').append('<a href="'+d[i].link+'"><img id="'+d[i].id+'" src="'+d[i].img+'" class="slide" /></a>');
   $('#'+d[i].id).css({left:((i-pos)*667)});
   $('#slide-nav').append('<a id="slide-link-'+i+'" href="#" onclick="slider.ar=false;slider.slide('+i+');return false;" onfocus="this.blur();"></a>');
   $('#slide-nav a#slide-link-'+i).addClass('loading');
  }

  $('img,div#slide-controls',$('div#slide-holder')).fadeIn();
  slider.text(d[pos]);
  slider.on(pos);
  slider.cur=pos;
  window.setTimeout('slider.auto();',slider.at);
 },
 auto:function(){
  if(!slider.ar)
   return false;

  var next=slider.cur+1;
  if(next>=slider.num) next=0;
  slider.slide(next);
 },
 slide:function(pos){
 
  if (pos=='prev') { pos = slider.cur-1; if (pos<0) pos=slider.num-1; }
  if (pos=='next') { pos = slider.cur+1; if (pos>=slider.num) pos=0; }
 
  if(pos<0 || pos>=slider.num || pos==slider.cur)
   return;

  window.clearTimeout(slider.al);
  slider.al=window.setTimeout('slider.auto();',slider.at);

  var d=slider.data;
  for(var i=0;i<slider.num;i++)
   $('#'+d[i].id).stop().animate({left:((i-pos)*667)},667,'swing');

  slider.on(pos);
  slider.text(d[pos]);
  slider.cur=pos;
 },
 on:function(pos){
  $('#slide-title a').attr('href', slider.data[pos].link);				// ovde setujemo URL na sve linkove
  $('#slide-desc a').attr('href', slider.data[pos].link);
  $('#slide-nav a').removeClass('on');
  $('#slide-nav a#slide-link-'+pos).addClass('on');
 },
 text:function(di){
  slider.cr['a']=di.title;
  slider.cr['b']=di.desc;
  slider.ticker('#slide-title a',di.title,0,'a');
  slider.ticker('#slide-desc a span',di.desc,0,'b');
 },
 ticker:function(el,text,pos,unique){
  if(slider.cr[unique]!=text)
   return false;

  ctext=text.substring(0,pos)+(pos%2?'-':'_');
  $(el).html(ctext);

  if(pos==text.length)
   $(el).html(text);
  else
   window.setTimeout('slider.ticker("'+el+'","'+text+'",'+(pos+1)+',"'+unique+'");',30);
 }
};


// STYLING FILE INPUTS 1.0 | Shaun Inman <http://www.shauninman.com/> | 2007-09-07
if(!window.SI){var SI={};};
SI.Files={
 htmlClass:'SI-FILES-STYLIZED',
 fileClass:'file',
 wrapClass:'cabinet',
 
 fini:false,
 able:false,
 init:function(){
  this.fini=true;
 },
 stylize:function(elem){
  if(!this.fini){this.init();};
  if(!this.able){return;};
  
  elem.parentNode.file=elem;
  elem.parentNode.onmousemove=function(e){
   if(typeof e=='undefined') e=window.event;
   if(typeof e.pageY=='undefined' &&  typeof e.clientX=='number' && document.documentElement){
    e.pageX=e.clientX+document.documentElement.scrollLeft;
    e.pageY=e.clientY+document.documentElement.scrollTop;
   };
   var ox=oy=0;
   var elem=this;
   if(elem.offsetParent){
    ox=elem.offsetLeft;
    oy=elem.offsetTop;
    while(elem=elem.offsetParent){
     ox+=elem.offsetLeft;
     oy+=elem.offsetTop;
    };
   };
  };
 },
 stylizeAll:function(){
  if(!this.fini){this.init();};
  if(!this.able){return;};
 }
};

// ---------------------------------------------------------------------------------------------------------------------------------------














 /*
 * TipTip
 * Copyright 2010 Drew Wilson
 * www.drewwilson.com
 * code.drewwilson.com/entry/tiptip-jquery-plugin
 *
 * Version 1.3   -   Updated: Mar. 23, 2010
 *
 * This Plug-In will create a custom tooltip to replace the default
 * browser tooltip. It is extremely lightweight and very smart in
 * that it detects the edges of the browser window and will make sure
 * the tooltip stays within the current window size. As a result the
 * tooltip will adjust itself to be displayed above, below, to the left 
 * or to the right depending on what is necessary to stay within the
 * browser window. It is completely customizable as well via CSS.
 *
 * This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
(function($){$.fn.tipTip=function(options){var defaults={activation:"hover",keepAlive:false,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('<div id="tiptip_holder" style="max-width:'+opts.maxWidth+';"></div>');var tiptip_content=$('<div id="tiptip_content"></div>');var tiptip_arrow=$('<div id="tiptip_arrow"></div>');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')))}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow")}return this.each(function(){var org_elem=$(this);if(opts.content){var org_title=opts.content}else{var org_title=org_elem.attr(opts.attribute)}if(org_title!=""){if(!opts.content){org_elem.removeAttr(opts.attribute)}var timeout=false;if(opts.activation=="hover"){org_elem.hover(function(){active_tiptip()},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}else if(opts.activation=="focus"){org_elem.focus(function(){active_tiptip()}).blur(function(){deactive_tiptip()})}else if(opts.activation=="click"){org_elem.click(function(){active_tiptip();return false}).hover(function(){},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}function active_tiptip(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(opts.defaultPosition=="bottom"){t_class="_bottom"}else if(opts.defaultPosition=="top"){t_class="_top"}else if(opts.defaultPosition=="left"){t_class="_left"}else if(opts.defaultPosition=="right"){t_class="_right"}var right_compare=(w_compare+left)<parseInt($(window).scrollLeft());var left_compare=(tip_w+left)>parseInt($(window).width());if((right_compare&&w_compare<0)||(t_class=="_right"&&!left_compare)||(t_class=="_left"&&left<(tip_w+opts.edgeOffset+5))){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare)}else if((left_compare&&w_compare<0)||(t_class=="_left"&&!right_compare)){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare)}var top_compare=(top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop());var bottom_compare=((top+org_height)-(opts.edgeOffset+tip_h+8))<0;if(top_compare||(t_class=="_bottom"&&top_compare)||(t_class=="_top"&&!bottom_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_top"}else{t_class=t_class+"_top"}arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset))}else if(bottom_compare|(t_class=="_top"&&bottom_compare)||(t_class=="_bottom"&&!top_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_bottom"}else{t_class=t_class+"_bottom"}arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset)}if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5}if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5}tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout)}timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn)},opts.delay)}function deactive_tiptip(){opts.exit.call(this);if(timeout){clearTimeout(timeout)}tiptip_holder.fadeOut(opts.fadeOut)}}})}})(jQuery);







/* Top Cheats Tabs */
$(function () {
	var tabContainers = $('div.tctabs > div');
	tabContainers.hide().filter(':first').show();
	
	$('div.tctabs ul.tctabNavigation a').click(function () {
		tabContainers.hide();
		tabContainers.filter(this.hash).show();
		$('div.tctabs ul.tctabNavigation a').removeClass('selected');
		$(this).addClass('selected');
		return false;
	}).filter(':first').click();
});

