// JavaScript Document


$(document).ready(function() {
	//Default Action
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content
	//On Click Event
	$("ul.tabs li").click(function() {
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
	$(".tab_contentad").hide(); //Hide all content
	$("ul.tabsad li:first").addClass("active").show(); //Activate first tab
	$(".tab_contentad:first").show(); //Show first tab content
	//On Click Event
	$("ul.tabsad li").click(function() {
		$("ul.tabsad li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_contentad").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
	
	
	$(".tab_contentad_slim").hide();
	$(".tab_contentad_slim:first").show();
	$("ul.tabsad_slim li:first").addClass("active");
	$("ul.tabsad_slim li:first a").addClass("selected");
	$("ul.tabsad_slim li").click(function() {
		$("ul.tabsad_slim li").removeClass("active"); //Remove any "active" class
		$("ul.tabsad_slim li a").removeClass("selected"); //Remove any "selected" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_contentad_slim").hide(); //Hide all tab content
		$(this).find("a").addClass("selected");
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
	
	bindHintedBox();
	
	$("a.loginnn").fancybox({
				'width'				: 614,
				'height'			: 424,
				'autoScale'			: false,
				'transitionIn'		: 'elastic',
				'transitionOut'		: 'elastic',
				'overlayOpacity'	: 0.8,			
				'overlayColor'		: '#000',		
				'type'				: 'iframe'
			});
			
	$("a.registerrr").fancybox({
		'width'				: 614,
		'height'			: 293,
		'autoScale'			: false,
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'overlayOpacity'	: 0.8,			
		'overlayColor'		: '#000',		
		'type'				: 'iframe'
	});
	
	$(".testimonial-jcarousel2").jCarousel2({
		vertical: false,
		hoverPause:true,
		visible: 1,
		auto:2000,
		speed:1000
	});
	
	$(".newsticker-jcarousel").jCarousel({
		vertical: true,
		hoverPause:true,
		visible: 3,
		auto:2000,
		speed:2000
	});
});



function set_checked(checked) {
	$('input[name=check]').attr('checked', checked);
}


$(function(){$('#myList').listnav();});



var Lst;
function CngClass(obj){
 if (Lst) Lst.className='';
 obj.className='selected';
 Lst=obj;
}

var Lst;
function BClass(obj){
 if (Lst) Lst.className='flags';
 obj.className='flags select';
 Lst=obj;
}

function bindHintedBox()
{
    $(".hintedBox").focus(function(){
	        $(this).removeClass("hintedBox");
	        defVal = $(this).attr("defaultvalue");
	        if ($(this).val()==defVal)
	        {
	            $(this).val("");
	        }
	    });
	
	$(".hintedBox").focusout(function(){
	    $(this).addClass("hintedBox");
	    if ($(this).val()=='')
	    {
	        defVal = $(this).attr("defaultvalue");
	        $(this).val(defVal);
	    }
	});
}

function showDefaultValue(obj)
{
    box = $(obj);
    if (box.val()=='')
    {
        defVal = box.attr("defaultvalue");
        box.val(defVal);
    }
}

function removeDefaultValue(obj)
{
    box = $(obj);
    defVal = box.attr("defaultvalue");
    if (box.val()==defVal)
    {
        box.val("");
    }
}

