function checkMaliciousWords(id) {    
    var mw = ["iframe","script","alert","javascript","style","src","lowsrc","href","&gt;","&lt;","&quot;","select","insert","delete","update","1=1","create"];
    var tval = $.trim($("#" + id).val());
    var a = tval.split(" ");
    var malicious = false;
    for(i = 0; i < a.length; i++) {
        var word = ($.trim(a[i])).toLowerCase();
        //alert("word =[" + word + "]");
        for(j = 0; j < mw.length; j++) {
            if(word.indexOf(mw[j]) >= 0) {
                //alert("mw =[" + mw[j] + "]");
                alert("Malicious words found in the input: " + mw[j]);
                return false;
            }
        }            
    }
    return true;
}


$(function() {
	$(".popup").click(
			function() {
				var url = $(this).attr("href");
				return pop(url);
			}
		);
});

function pop(url) {
	var w = 647, h = 480;
	var left = (screen.width/2)-(w/2);
	var top = (screen.height/2)-(h/2);
	var newwindow=window.open(url,'name','height='+h+',width='+w+',scrollbars=yes,left='+left+',top='+top);
	if (window.focus) {newwindow.focus()}
	return false;
}

$(function(){ 
	$('input[type=text]').focus(
			function(){ 
				if($(this).val() == $(this).attr('defaultValue')) {
					$(this).val('');
				}
			});
  
	$('input[type=text]').blur(
			function(){
				if($(this).val() == '') {
					$(this).val($(this).attr('defaultValue'));
				} 
			});
}); 



$(function() {
	$("#tab1").click(
		function () {
			$("#tab1_content").animate(
			{ "height": "toggle", "opacity": "toggle" }, 
		function () {
			updateSymbol($("#tab1_content").css("display"), "tab1e");});
		});
	$("#tab2").click(
		function () {
			$("#tab2_content").animate(
			{ "height": "toggle", "opacity": "toggle" }, 
		function () {updateSymbol($("#tab2_content").css("display"), "tab2e");});
		});
	$("#tab3").click(
		function () {
			$("#tab3_content").animate({ "height": "toggle", "opacity": "toggle" }, 
		function () {updateSymbol($("#tab3_content").css("display"), "tab3e");});
		});
	$("#tab4").click(
			function () {
				$("#tab4_content").animate({ "height": "toggle", "opacity": "toggle" }, 
				function () {updateSymbol($("#tab4_content").css("display"), "tab4e");});
			});
	$("#tab5").click(
			function () {
				$("#tab5_content").animate({ "height": "toggle", "opacity": "toggle" }, 
				function () {updateSymbol($("#tab5_content").css("display"), "tab5e");});
			});
	$("#tab6").click(
			function () {
				$("#tab6_content").animate({ "height": "toggle", "opacity": "toggle" }, 
				function () {updateSymbol($("#tab6_content").css("display"), "tab6e");});
			});
	$("#tab7").click(
			function () {
				$("#tab7_content").animate({ "height": "toggle", "opacity": "toggle" }, 
				function () {updateSymbol($("#tab7_content").css("display"), "tab7e");});
			});
	$("#tab8").click(
			function () {
				$("#tab8_content").animate({ "height": "toggle", "opacity": "toggle" }, 
				function () {updateSymbol($("#tab8_content").css("display"), "tab8e");});
			});
	$("#tab9").click(
			function () {
				$("#tab9_content").animate({ "height": "toggle", "opacity": "toggle" }, 
				function () {updateSymbol($("#tab9_content").css("display"), "tab9e");});
			});
	$("#tab10").click(
			function () {
				$("#tab10_content").animate({ "height": "toggle", "opacity": "toggle" }, 
				function () {updateSymbol($("#tab10_content").css("display"), "tab10e");});
			});
	$("#tab11").click(
			function () {
				$("#tab11_content").animate({ "height": "toggle", "opacity": "toggle" }, 
				function () {updateSymbol($("#tab11_content").css("display"), "tab11e");});
			});
	$("#tab12").click(
			function () {
				$("#tab12_content").animate({ "height": "toggle", "opacity": "toggle" }, 
				function () {updateSymbol($("#tab12_content").css("display"), "tab12e");});
			});
	$("#tab13").click(
			function () {
				$("#tab13_content").animate({ "height": "toggle", "opacity": "toggle" }, 
				function () {updateSymbol($("#tab13_content").css("display"), "tab13e");});
			});
	$("#tab14").click(
			function () {
				$("#tab14_content").animate({ "height": "toggle", "opacity": "toggle" }, 
				function () {updateSymbol($("#tab14_content").css("display"), "tab14e");});
			});
	$("#tab15").click(
			function () {
				$("#tab15_content").animate({ "height": "toggle", "opacity": "toggle" }, 
				function () {updateSymbol($("#tab15_content").css("display"), "tab15e");});
			});
	$("#tab16").click(
			function () {
				$("#tab16_content").animate({ "height": "toggle", "opacity": "toggle" }, 
				function () {updateSymbol($("#tab16_content").css("display"), "tab16e");});
			});
	$("#tab17").click(
			function () {
				$("#tab17_content").animate({ "height": "toggle", "opacity": "toggle" }, 
				function () {updateSymbol($("#tab17_content").css("display"), "tab17e");});
			});
	$("#tab18").click(
			function () {
				$("#tab18_content").animate({ "height": "toggle", "opacity": "toggle" }, 
				function () {updateSymbol($("#tab18_content").css("display"), "tab18e");});
			});
	$("#tab19").click(
			function () {
				$("#tab19_content").animate({ "height": "toggle", "opacity": "toggle" }, 
				function () {updateSymbol($("#tab19_content").css("display"), "tab19e");});
			});
	$("#tab20").click(
			function () {
				$("#tab20_content").animate({ "height": "toggle", "opacity": "toggle" }, 
				function () {updateSymbol($("#tab20_content").css("display"), "tab20e");});
			});
	$("#tab21").click(
			function () {
				$("#tab21_content").animate({ "height": "toggle", "opacity": "toggle" }, 
				function () {updateSymbol($("#tab21_content").css("display"), "tab21e");});
			});
	$("#tab22").click(
			function () {
				$("#tab22_content").animate({ "height": "toggle", "opacity": "toggle" }, 
				function () {updateSymbol($("#tab22_content").css("display"), "tab22e");});
			});
	$("#tab23").click(
			function () {
				$("#tab23_content").animate({ "height": "toggle", "opacity": "toggle" }, 
				function () {updateSymbol($("#tab23_content").css("display"), "tab23e");});
			});
	$("#tab24").click(
			function () {
				$("#tab24_content").animate({ "height": "toggle", "opacity": "toggle" }, 
				function () {updateSymbol($("#tab24_content").css("display"), "tab24e");});
			});
	$("#tab25").click(
			function () {
				$("#tab25_content").animate({ "height": "toggle", "opacity": "toggle" }, 
				function () {updateSymbol($("#tab25_content").css("display"), "tab25e");});
			});
});

function updateSymbol(x, y) {
	if (x == "block") {
		$("#"+y).empty();
		var ele = $("#minusimg").clone();
		$(ele).css("display", "inline");
		$(ele).appendTo($("#" + y));	
	} else {
		$("#"+y).empty();
		var ele = $("#plusimg").clone();
		$(ele).css("display", "inline");
		$(ele).appendTo($("#" + y));		
		
	}
}


$(function () {
	//Hide all div initially
	$(".leftnav_text_inner").hide('fast');
	//toggle the componenet with class leftnav_text_inner
		$(".toggeler_div").click(function(){
			var folderId = $(this).attr("id");
			var linkId = folderId.replace("f","l");
			var oldtext = $(this).text();
			if ($("#"+linkId).is(":hidden")) {
				var newtext = oldtext.replace("+","-");
				$(this).text(newtext);
			}
			else {
					var newtext = oldtext.replace("-","+");
					$(this).text(newtext);
			}	    			
			$("#"+linkId).toggle(50);
	});
});

$(function() {
	$(".rhs").click(function() {
		var id = $(this).attr("id");
		var name = $(this).attr("name");
		var imgname = id;
		$(".image_map").css("background", "url('" + imgname + "')");
		$(".contact_us").css("display", "none");
		$("#" + name + "_div").css("display", "block");
		return false;
	});
	$(".rhs:first").trigger("click");
});

$(function() {
	$(".resetFont").click(function() {
		$('.maincontent_cover').css('font-size', 11);
		$(".sizecursor").css("margin-right", -145);
		return false;
	});
	$(".increaseFont").click(function() {
		$('.maincontent_cover').css('font-size', 12);
		$(".sizecursor").css("margin-right", -155);
		return false;
	});
	$(".decreaseFont").click(function() {
		$('.maincontent_cover').css('font-size', 10);
		$(".sizecursor").css("margin-right", -135);
		return false;
	});
});

$(function() {
	$("#footer-toggler-handle").click(function() {
		$("#footer-toggler").animate( {
			"height" : "toggle",
			"opacity" : "toggle"
		});
	});
	$("#footer-toggler-arrow").click(function() {
		$("#footer-toggler").animate( {
			"height" : "toggle",
			"opacity" : "toggle"
		});
	});
});

$(function() {
	$("#get-in-touch-top").click(function() {
		$("#get-in-touch-toggler").animate( {
			"height" : "toggle",
			"opacity" : "toggle"
		});
		$("#get-in-touch-top").animate( {
			"height" : "toggle",
			"opacity" : "toggle"
		});
		$("#get-in-touch-bottom").animate( {
			"height" : "toggle",
			"opacity" : "toggle"
		});
	});
});

$(function() {
	$("#get-in-touch-bottom").click(function() {
		$("#get-in-touch-toggler").animate( {
			"height" : "toggle",
			"opacity" : "toggle"
		});
		$("#get-in-touch-bottom").animate( {
			"height" : "toggle",
			"opacity" : "toggle"
		});
		$("#get-in-touch-top").animate( {
			"height" : "toggle",
			"opacity" : "toggle"
		});
	});
});

function printBodyOld() {
	var inf = $(".maincontent_cover").text();
	inf = $.trim(inf);
	win = window.open("print.htm", 'popup', 'toolbar = no, status = no');
	win.document.write(inf);
	win.document.close();
}

function printBody() {
	window.print();	
}

function mailpage(x) {
	var link = new String(window.location);
	link = link.substring(0, link.length);
	$(x).attr("href", "mailto:?body=" + link);
}


$(document).ready(function(){
    $("#div1").attr("style","display : block");
    $("#div4").append($("#div1"));
    DisplayDiv('1');
});

function DisplayDiv(id){
    $("#div1").attr("style","display : none");
    $("#div2").attr("style","display : none");
    $("#div3").attr("style","display : none");
    
    var lis = $("li", $("#news_temp" + id));
    for(var i = 0; i < lis.length; i++) {
    	var newstext = $(lis[i]).text();
    	$("#news_span" + i, $("#div" + id)).text(newstext);
    	$("#news_li" + i, $("#div" + id)).toggle();
    	//alert(newstext);
    }
    
    $("#div"+id).attr("style","display : block");
    $("#div4").append($("#div" + id));
}
