// Font Sizer Start (http://www.fluidbyte.net)
function fontResizer(smallFont,medFont,largeFont)	{
function clearSelected() { $(".smallFont").removeClass("curFont"); $(".medFont").removeClass("curFont"); $(".largeFont").removeClass("curFont"); }
function saveState(curSize) {	var date = new Date(); date.setTime(date.getTime()+(7*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); document.cookie = "fontSizer"+"="+curSize+expires+"; path=/"; }
$(".smallFont").click(function(){ $('html').css('font-size', smallFont); clearSelected(); $(".smallFont").addClass("curFont"); saveState(smallFont); });
$(".medFont").click(function(){ $('html').css('font-size', medFont); clearSelected(); $(".medFont").addClass("curFont"); saveState(medFont); });
$(".largeFont").click(function(){ $('html').css('font-size', largeFont); clearSelected(); $(".largeFont").addClass("curFont"); saveState(largeFont); });
function getCookie(c_name) { if (document.cookie.length>0) { c_start=document.cookie.indexOf(c_name + "="); if (c_start!=-1) { c_start=c_start + c_name.length+1; c_end=document.cookie.indexOf(";",c_start); if (c_end==-1) c_end=document.cookie.length; return unescape(document.cookie.substring(c_start,c_end)); } } return ""; }
var savedSize = getCookie('fontSizer');
if (savedSize!="") { $('html').css('font-size', savedSize); switch (savedSize) { case smallFont: $(".smallFont").addClass("curFont"); break; case medFont: $(".medFont").addClass("curFont"); break; case largeFont: $(".largeFont").addClass("curFont"); break; default: $(".medFont").addClass("curFont"); } }
else { $('html').css('font-size', medFont); $(".medFont").addClass("curFont"); }
}
//	Font Sizer End
// Quick Contact Start //
$(document).ready(function(){
	$("#contactLink").click(function(){
		if ($("#contactForm").is(":hidden")){
			$("#contactForm").slideDown("slow");
		}
		else{
			$("#contactForm").slideUp("slow");
		}
	});
});

$(document).ready(function(){
	$('#myForm').ajaxForm(function(data) {
		if (data==1){
			$("#messageSent").html("Your message has been sent successfully!");
			$('#myForm').resetForm();
			$("#messageSent").show("slow");
			setTimeout('$("#messageSent").hide();$("#contactForm").slideUp("slow")', 2000);
		} else if (data==2){
			$("#messageSent").html("Your email failed. Please try again.");
			$("#messageSent").show("slow");
		} else if (data==3) {
			$("#messageSent").html("Please enter valid info.");
			$("#messageSent").show("slow");
		}
	});
});

function closeForm(){
	$("#messageSent").show("slow");
	setTimeout('$("#messageSent").hide();$("#contactForm").slideUp("slow")', 2000);
}
// Quick Contact End //
//	Droppy 0.1.2	End
$.fn.droppy = function(options) {
	options = $.extend({speed: 250}, options || {});
	this.each(function() {
	var root = this, zIndex = 1000;
	function getSubnav(ele) {
		if (ele.nodeName.toLowerCase() == 'li') {
			var subnav = $('> ul', ele);
			return subnav.length ? subnav[0] : null;
		} else {
			return ele;
		}
	}
	function getActuator(ele) {
		if (ele.nodeName.toLowerCase() == 'ul') {
			return $(ele).parents('li')[0];
		} else {
			return ele;
		}
	}
	function hide() {
		var subnav = getSubnav(this);
		if (!subnav) return;
		$.data(subnav, 'cancelHide', false);
		setTimeout(function() {
			if (!$.data(subnav, 'cancelHide')) {
				$(subnav).slideUp(options.speed);
			}
		}, 500);
	}
	function show() {
		var subnav = getSubnav(this);
		if (!subnav) return;
		$.data(subnav, 'cancelHide', true);
		$(subnav).css({zIndex: zIndex++}).slideDown(options.speed);
		if (this.nodeName.toLowerCase() == 'ul') {
			var li = getActuator(this);
			$(li).addClass('hover');
			$('> a', li).addClass('hover');
		}
	}
	$('ul, li', this).hover(show, hide);
	$('li', this).hover(
		function() { $(this).addClass('hover'); $('> a', this).addClass('hover'); },
		function() { $(this).removeClass('hover'); $('> a', this).removeClass('hover'); }
	);
});
};
//	Droppy End	//
//	Search Script Start	(http://www.marcofolio.net/)	//
$(document).ready(function() {
	// Safely inject CSS3 and give the search results a shadow
	var cssObj = { 'box-shadow' : '#888 5px 10px 10px', // Added when CSS3 is standard
		'-webkit-box-shadow' : '#888 5px 10px 10px', // Safari
		'-moz-box-shadow' : '#888 5px 10px 10px'}; // Firefox 3.5+
	$("#suggestions").css(cssObj);

	// Fade out the suggestions box when not active
	$("input").blur(function(){
		$('#suggestions').fadeOut();
	});
});
function lookup(inputString) {
	if(inputString.length == 0) {
		$('#suggestions').fadeOut(); // Hide the suggestions box
	} else {
		$.post("/includes/search_results.php", {queryString: ""+inputString+""}, function(data) { // Do an AJAX call
			$('#suggestions').fadeIn(); // Show the suggestions box
			$('#suggestions').html(data); // Fill the suggestions box
		});
	}
}
//	Search Script End	//
//  Menu Script Start	http://www.i-marco.nl/weblog/	//
function initMenu() {
	$('#menu ul').hide();
	$('#menu li a').click(function() {$(this).next().slideToggle('normal');});
}
$(document).ready(function() {initMenu();});
function initMenu_faq() {
	$('#menu_faq ul').hide();
	$('#menu_faq li a').click(function() {$(this).next().slideToggle('normal');});
}
$(document).ready(function() {initMenu_faq();});
//	Menu Script End	//
$(document).ready(function() {
	fontResizer('11px','12px','13px');		//Resizer
	$('#nav').droppy({speed: 100});			//Droppy
	$('div#rq1').ifixpng();
	$('div#quoteh1').ifixpng();
	$('div#inb1').ifixpng();
	$('div.bscroll').ifixpng();
	$('div.flogo img').ifixpng();
	$('div#mcbg1').ifixpng();
	$('div.maintextbox').ifixpng();

});
function openPopUp(MessengerType) { 
	if (MessengerType == "Live")	{
		window.open("http://settings.messenger.live.com/Conversation/IMMe.aspx?invitee=49db7825f7beff00@apps.messenger.live.com&mkt=en-in","Window1", "menubar=no,width=300,height=300,toolbar=no");
	} else if (MessengerType == "GTalk")	{
		window.open("http://www.google.com/talk/service/badge/Start?tk=z01q6amlqilmreecg9d2hgblvnjhh5jaj2ig5o33ovjq814kfpph9hbqrarbu5dkogu9fvr621f7jf4egpah25sea95m63k01k4kqejbn20t25gbcjqgrkrhk43h5vnbi5h2llp5fjvj3fca8e7urdc6vv1vdse295blvb5dngvaek1qulj87g6lpo64p8096lrk8pjgkarmirju66o55akadecug","Window1", "menubar=no,width=300,height=300,toolbar=no");
	} else if (MessengerType == "Yahoo")	{
		window.open("/includes/popup_instant_messenger.php?messenger-type=Yahoo","Window1", "menubar=no,width=280,height=320,toolbar=no");
	} else if (MessengerType == "Skype")	{
		window.open("/includes/popup_instant_messenger.php?messenger-type=Skype","Window1", "menubar=no,width=300,height=300,toolbar=no");
	}
}

function test_()	{
	if( event.keyCode == 8 )	{
		return false;
	}
	return true;
}
// Request Quote Form Submit Start	//
$(document).ready(function() { 
	var options = {success: showResponse}; 
	$('#frmquote').submit(function() { 
		$(this).ajaxSubmit(options); 
		return false; 
	}); 
}); 
function showResponse(responseText, statusText)  { 
	$("#messageSent1").html(responseText);
	$("#messageSent1").show("slow");
} 
// Request Quote Form Submit End	//
// Hire Programmer Form Submit Start	//
$(document).ready(function() { 
	var options = {success: showResponse}; 
	$('#frmHireNow').submit(function() { 
		$(this).ajaxSubmit(options); 
		return false; 
	}); 
}); 
// Hire Programmer Form Submit End	//
// Contact Us Form Submit Start	//
$(document).ready(function() { 
	var options = {success: showResponse}; 
	$('#frmContactUs').submit(function() { 
		$(this).ajaxSubmit(options); 
		return false; 
	}); 
}); 
// Contact Us Form Submit End	//
