/* Home Page Slider*/

$(document).ready(function(){
		$("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, false);
});
jQuery(document).ready(function() {
    jQuery('.ourClients').jcarousel({
		scroll: 1,
        auto: 2,
        wrap: 'last',
		//wrap: 'circular',
        initCallback: mycarousel_initCallback
    });
});

/* Home Page Tab Section*/
$(function() {
    var tabContainers = $('div.tabs .content> div');

    $('div.tabs ul.tabNavigation a').click(function() {
        tabContainers.hide().filter(this.hash).fadeIn('normal').show();

        $('div.tabs ul.tabNavigation a').parent().removeClass('active');
        $(this).parent().addClass('active');

        return false;
    })
    //.filter(':first').click();
    });

/* Function for Carasoul */
function mycarousel_initCallback(carousel) {
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

/* Cufon */
Cufon.replace('.navigation ul li', {
    hover: 'true'
});
Cufon.replace('.quicklinks label');
Cufon.replace('#content-body .newserv .pod h2');
Cufon.replace('#content-body .testimonial h2');
Cufon.replace('.tabs ul.tabNavigation li', {fontWeight: 'bold'});
Cufon.replace('#container .content_area h1');
Cufon.replace('#container .right_panel h5');
/*
Cufon.replace('#menu li', {textShadow: '#fff 1px 1px',hover: {color: '#e63232'}});
*/

/* Max Height*/
jQuery(document).ready(function() {
    var arr = [];

    jQuery(".max").each(function() {
        arr.push(jQuery(this).height());
    });
    /*$(".max").css('height', $(".content").height() - 18);*/
    for (var i = 0; i < arr.length; i++) {
        var max = arr[0];
        if (max < arr[i]) {
            max = arr[i];
        }
    }
    max = max;
    jQuery(".max").css('min-height', max);
});

/* Qucik Links */
function updatecities(selectedcitygroup) {
    var modellist = document.getElementById("model_cmb");
    var models = new Array();
    models[0] = ["Select Offerings|/0"];
    models[1] = ["Select Offerings|/0", "Application development & maintenance|/software-services/application-development-maintenance.html", "Application Testing|/software-services/application-testing.html", "IT project Engagement models|/software-services/it-project-engagement-models.html"];

    models[2] = ["Select Offerings|/0", "Web Solution|/digital-media-solutions/web-solution.html", "E-Learning Solutions|/digital-media-solutions/e-learning-solution.html", "New Media|/digital-media-solutions/new-media.html", "Social media|/digital-media-solutions/social-media.html"];

    models[3] = ["Select Offerings|/0", "Data Services|/it-enabled-services/data-services.html", "Voice Services|/it-enabled-services/voice-services.html", "Financial Services / Accounting Services|/it-enabled-services/financial-services-accounting-servicess.html", "Recruitment Services / Human Resources|/it-enabled-services/recruitment-services-Human-resources.html", "Transcription Services|/it-enabled-services/transcription-services.html"];
    modellist.options.length = 0
    if (selectedcitygroup >= 0) {
        for (i = 0; i < models[selectedcitygroup].length; i++)
            modellist.options[modellist.options.length] = new Option(models[selectedcitygroup][i].split("|")[0], models[selectedcitygroup][i].split("|")[1])
        }
}
function MM_jumpMenu(targ, selObj, restore) {
    //v3.0
    eval(targ + ".location='" + selObj.options[selObj.selectedIndex].value + "'");
    if (restore)
        selObj.selectedIndex = 0;
}
/*PUT / infront when moved to server root */

/* Popup Career Apply Now */
$(document).ready(function() {
    //When you click on a link with class of poplight and the href starts with a # 
    $('a.poplight[href^=#]').click(function() {
        var popID = $(this).attr('rel');
        //Get Popup Name
        var popURL = $(this).attr('href');
        //Get Popup href to define size
        //Pull Query & Variables from href URL
        var query = popURL.split('?');
        var dim = query[1].split('&');
        var popWidth = dim[0].split('=')[1];
        //Gets the first query string value
        //Fade in the Popup and add close button
        $('#' + popID).fadeIn().css({
            'width': Number(popWidth)
            }).prepend('<a href="#" class="close"><img src="library/images/close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>');

        //Define margin for center alignment (vertical   horizontal) - we add 80px to the height/width to accomodate for the padding  and border width defined in the css
        var popMargTop = ($('#' + popID).height() + 80) / 2;
        var popMargLeft = ($('#' + popID).width() + 80) / 2;

        //Apply Margin to Popup
        $('#' + popID).css({
            'margin-top': -popMargTop,
            'margin-left': -popMargLeft
        });

        //Fade in Background
        $('body').append('<div id="fade"></div>');
        //Add the fade layer to bottom of the body tag.
        $('#fade').css({
            'filter': 'alpha(opacity=80)'
        }).fadeIn();
        //Fade in the fade layer - .css({'filter' : 'alpha(opacity=80)'}) is used to fix the IE Bug on fading transparencies 
        return false;
    });

    //Close Popups and Fade Layer
    $('a.close, #fade').live('click', function() {
        //When clicking on the close or fade layer...
        $('#fade , .popup_block').fadeOut(function() {
            $('#fade, a.close').remove();
            //fade them both out
            });
        return false;
    });
});

/* Tooltip */
	$(document).ready(function(){	
		$("a").easyTooltip();
	});

/* Expand Collapse */
animatedcollapse.addDiv('job_1', 'fade=0,speed=400,group=pets,persist=1,hide=1')
    animatedcollapse.addDiv('job_2', 'fade=0,speed=400,group=pets,persist=1,hide=1')
    animatedcollapse.ontoggle = function($, divobj, state) {
    //fires each time a DIV is expanded/contracted
    }
animatedcollapse.init();


 $(document).ready(function(){
	  $('#in').click(function(){
	  $('#google-map').html('<iframe width="510" height="150" frameborder="0" scrolling="No" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=Impressico+Business+Solutions+Private+Limited,+Sector+6,+NOIDA,+Uttar+Pradesh,+India&amp;aq=0&amp;sll=44.362029,20.961227&amp;sspn=0.031418,0.084543&amp;vpsrc=6&amp;g=Smederevska+Palanka,+Central+Serbia,+Serbia&amp;ie=UTF8&amp;hq=&amp;hnear=Impressico+Business+Solutions+Private+Limited,+Noida,+Uttar+Pradesh+201301,+India&amp;t=m&amp;ll=28.592511,77.318172&amp;spn=0.018464,0.037336&amp;z=14&amp;output=embed"></iframe>');
	  });
	  $('#uk').click(function(){
	  $('#google-map').html('<iframe width="510" height="150" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.co.in/maps?hl=en&amp;client=firefox-a&amp;q=83+Victoria+Street,+London+-+SW1H+0HW&amp;ie=UTF8&amp;hq=&amp;hnear=83+Victoria+St,+Westminster,+London+SW1H+0,+United+Kingdom&amp;gl=in&amp;t=m&amp;vpsrc=6&amp;ll=51.497683,-0.131664&amp;spn=0.008015,0.043688&amp;z=14&amp;output=embed"></iframe>');
	  });
	  $('#us').click(function(){
	  $('#google-map').html('<iframe width="510" height="150" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.co.in/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=4+Killian+Lane,+Brewster,+NY+10509,+United+States&amp;aq=0&amp;sll=41.436339,-73.613773&amp;sspn=0.008494,0.021136&amp;vpsrc=0&amp;gl=in&amp;ie=UTF8&amp;hq=&amp;hnear=4+Killian+Ln,+Brewster,+New+York+10509,+United+States&amp;t=m&amp;ll=41.436356,-73.613806&amp;spn=0.009652,0.043688&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe>');
	  });
	  });
 
 // NewsLetter Signhup //
 
	// Email validation function//
	
	function is_signup(signup)
	{
		if(!signup.match(/^[A-Za-z0-9\._\-+]+@[A-Za-z0-9_\-+]+(\.[A-Za-z0-9_\-+]+)+$/))
			return false;
		return true;
	}
function validateNewsletter()
{
		var fValNews = document.news;
		
	if(fValNews.signup.value=='')
	{
		alert("Please enter a valid e-mail address.");
		fValNews.signup.focus();
		return false;
	}else if(!is_signup(fValNews.signup.value))
	{
		alert("You have entered an invalid e-mail address, try again.");
		fValNews.signup.value="";
		fValNews.signup.focus();
		return false;
	}
	return true;
}

