$(document).ready(function() {		
	//Input Box BG Color
	$("input,select,textarea").focus(function() {		
		$(this).addClass("bgyellow");				
	});
	
	$("input,select,textarea").blur(function () {
		$(this).removeClass("bgyellow");	
	});	
	
	//Set Class for all input buttons
	$("input[type='button']").addClass("stylebutton");
	
	$("input[type='button']").hover(function() {
		$(this).addClass("stylebutton-h");										 
	},function() {
		$(this).removeClass("stylebutton-h");	
	});
	
	$("a.capply").click(function() {
		var id = $(this).attr("name");
		location.href=base_path+"careers/apply-"+id;
	});
		
	$('.right-articles').hover(function(){
		$(".timg", this).stop().animate({top:'-160px'},{queue:false,duration:300,easing: "easeOutQuad"});
	}, function() {
		$(".timg", this).stop().animate({top:'10px'},{queue:false,duration:300,easing: "easeOutQuad"});
	});

	docReady();		
});

function docReady() {
	$("a.targetbl").click(function() {
		var url=$(this).attr("name");
		window.open("http://"+url);
	});
		
	setHeight();
}

function setHeight() {
	//Set Height
	$(".redirect").css("height","auto");
	var sub_height = $(".page-header").height()+$(".menu").height()+$(".header-bottom").height();
	var set_height = $(window).height()-sub_height;		
	set_height = set_height-80;
	var org_height = $(".redirect").height();
	if(org_height < set_height) {				
		$(".redirect").css("height",set_height);
	} else {		
		$(".redirect").css("height","auto");		
	}	
}

function callProcessing() {
	$("#result").html("<span><img src='"+base_path+"images/loader.gif' class='imgLoader' alt='' /></span>");		
}

function callDialogRedirect() {
	if($(".result span").attr("class")=="msg") {
		$("#dialog").dialog("close");
		$(".result").replaceWith("<span></span>");
		$("#dialog input[type=text]").each(function(i) {
    		$(this).val("");
    	});	
		//var indx=$("#indx").val();
		//filter(indx);
	}
}

function callDialogError() {
	$(".result").replaceWith(user_ajax_misfield);
	$(".result").fadeIn(2000);	
}

function callDProcessing() {
	$(".result").html("<img src='"+base_path+"images/site-admin/loader.gif' class='imgLoader' alt='' />");	
	$(".result").fadeIn();	
}
