﻿var ServiceTabId = 'WebServices';
var PrevPageId = 'ServPage1';
function ShowServiceTab(TabId) {
    $('#' + ServiceTabId)
    //.css("opacity", 0)
     .hide().animate({ 'opacity': '0' }, { duration: 400, easing: 'easeOutQuad' });
     
    // .end()
    //document.getElementById(ServiceTabId).style.display = 'none';
    ServiceTabId = TabId;
    //document.getElementById(ServiceTabId).style.display = 'inline-block';*/
    $('#' + ServiceTabId)
    //.hide()
    .show().animate({ 'opacity': '1' }, { duration: 400, easing: 'easeOutQuad' });

}

function ShowServiceText(ServiceId) {
    //alert(ServiceTabId);
    //remove selected class from previous item
    $('#a' + ServiceTabId).attr("class", "asdf");

    //show selected div
    //ShowServiceTab(ServiceId);

    $('#' + ServiceTabId).css("display", "none");
    ServiceTabId = ServiceId;
    $('#' + ServiceTabId).css("display", "inline");
    cssClass = ServiceId + 'Selected';

    //add selected class to new item
    $('#a' + ServiceId).attr("class", cssClass);
    
    
    
}

function ChangePage(pageId) {

    $('#img' + PrevPageId).attr("src", "images/dot_unslctd.jpg");
    $('#'+PrevPageId).hide().animate({ 'opacity': '0' }, { duration: 400, easing: 'easeOutQuad' });

    PrevPageId = pageId;

    $('#img' + PrevPageId).attr("src", "images/dot_slctd.jpg");
    $('#'+PrevPageId).show().animate({ 'opacity': '1' }, { duration: 400, easing: 'easeOutQuad' });

}

function MoveMenu(MenuId, HideMenu) {
    $('#' + HideMenu).hide().animate({ 'opacity': '0' }, { duration: 400, easing: 'easeOutQuad' });
    $('#' + MenuId).show().animate({ 'opacity': '1' }, { duration: 400, easing: 'easeOutQuad' });
}
function quotator(options) {
    var container = $("#quotes");
    var defaults =
    {
        speed: 5000,
        json: "quotator_quotes.js"
    }
    
    var options = $.extend(defaults, options);

    //var quotes_json = options.json;
    var quotes;
    
   var quotesobject = 
 [
	{
	    quote: "It is difficult to find a company that is reliable and iSolutions has gained my trust through the three months I have been working with them...",
		author : "Ali Ballout"
	},
	
	{
	    quote: " I would like to take this opportunity to thank iSolutions team for doing an exceptional job and fulfilling the needs of our companies’ ...",
	    author: "Ahmed Sattar"
	},
	{
	    quote: " iSolutions' team is always good to work with. They are friendly and courteous and always responds promptly to any emails or phone calls from me, and ...",
	    author: "Amir Basharat Butt"
	}];
	
        //var quotesobject = eval(data.quotes);
        var index = 0;


        setInterval(changeQuote, options.speed);

        container.html('<div class="tstmnlComntTxt">' + quotesobject[index].quote + '</div><div class="tstmlGndrIcon"><img src="images/tstmnlz_male.jpg" width="14" height="16" border="0" /></div>' + '<div class="tstmnlName">' + quotesobject[index].author + "</div>");

        
        function changeQuote() {
            container.fadeOut(function () {
                container.html('<div class="tstmnlComntTxt">' + quotesobject[index].quote + '</div><div class="tstmlGndrIcon"><img src="images/tstmnlz_male.jpg" width="14" height="16" border="0" /></div>' + '<div class="tstmnlName">' + quotesobject[index].author + "</div>").fadeIn();
            });

            if (index == quotesobject.length - 1) {
                index = 0;
            } else {
                index++;
            }
        }

   
    return container;
}



function solutions(options) {
    var container = $("#Solutions");
    var defaults =
    {
        speed: 5000
        
    }

    var options = $.extend(defaults, options);

    //var quotes_json = options.json;
    var sols;

    var solsobject =
 [
	{
	    imageurl: "images/bnrTab_1.jpg",
	    link: "WebServices.aspx"
	    
	},

	{
	    imageurl: "images/bnrTab_2.jpg",
	    link: "SoftwareApplication.aspx"

	},
    {
        imageurl: "images/bnrTab_3.jpg",
        link: "WebSupport.aspx"

    },
    {
        imageurl: "images/bnrTab_4.jpg",
        link: "ContentWriting.aspx"

    },
    {
        imageurl: "images/bnrTab_5.jpg",
        link: "Online-Marketing.aspx"


    },
    {
        imageurl: "images/bnrTab_6.jpg",
        link: "Consultancy.aspx"

    }
	];

    //var quotesobject = eval(data.quotes);
    var index = 0;


    setInterval(changeSolution, options.speed);

    container.html('<div class="pagingDots"><ul id="pagingDotslist"><li><img src="images/dot_unslctd.jpg" width="10" height="10" border="0" id="sol_dot_4" /></li><li><img src="images/dot_unslctd.jpg" width="10" height="10" border="0" id="sol_dot_2" /></li><li><img src="images/dot_unslctd.jpg" width="10" height="10" border="0" id="sol_dot_0" /></li></ul></div><div class="solushnzBox1"><div class="slushnzBoxIcon"><a href="' + solsobject[index].link + '"><img src="' + solsobject[index].imageurl + '" width="216" height="138" border="0" /></a></div></div><div class="solushnzBox2"><div class="slushnzBoxIcon"><a href="' + solsobject[index + 1].link + '"><img src="' + solsobject[index + 1].imageurl + '" width="216" height="138" border="0" /></a></div></div>');

    container.find("#sol_dot_"+index).attr("src", "images/dot_slctd.jpg");

    function changeSolution() {
        container.fadeOut(function () {
            container.html('<div class="pagingDots"><ul id="pagingDotslist"><li><img src="images/dot_unslctd.jpg" width="10" height="10" border="0" id="sol_dot_4" /></li><li><img src="images/dot_unslctd.jpg" width="10" height="10" border="0" id="sol_dot_2" /></li><li><img src="images/dot_unslctd.jpg" width="10" height="10" border="0" id="sol_dot_0" /></li></ul></div><div class="solushnzBox1"><div class="slushnzBoxIcon"><a href="' + solsobject[index].link + '"><img src="' + solsobject[index].imageurl + '" width="216" height="138" border="0" /></a></div></div><div class="solushnzBox2"><div class="slushnzBoxIcon"><a href="' + solsobject[index + 1].link + '"><img src="' + solsobject[index + 1].imageurl + '" width="216" height="138" border="0" /></a></div></div>').fadeIn();
            container.find("#sol_dot_"+index).attr("src", "images/dot_slctd.jpg");
        });

        

        
        
        if (index == solsobject.length - 2) {
            index = 0;
        } else {
            index = index + 2;
        }
    }


    return container;
}

function projects(options) {
    var container = $("#Projects");
    var defaults =
    {
        speed: 5000

    }

    var options = $.extend(defaults, options);

    //var quotes_json = options.json;
    var pros;

    var prosobject =
 [
	{
	    imageurl: "images/portfolio1_img.jpg",
	    link: "Portfolio.aspx"

	},

	{
	    imageurl: "images/portfolio2_img.jpg",
	    link: "Portfolio.aspx"

	},
    {
        imageurl: "images/portfolio3_img.jpg",
        link: "Portfolio.aspx"

    }
   
	];

    //var quotesobject = eval(data.quotes);
    var index = 0;


    setInterval(changeProjects, options.speed);

    container.html('<div class="pagingDots"><ul id="pagingDotslist"><li><img src="images/dot_unslctd.jpg" width="10" height="10" border="0" id="sol_dot_2" /></li><li><img src="images/dot_unslctd.jpg" width="10" height="10" border="0" id="sol_dot_1" /></li><li><img src="images/dot_unslctd.jpg" width="10" height="10" border="0" id="sol_dot_0" /></li></ul></div> <div class="prjctsImgz" align="center"><a href="' + prosobject[index].link + '"><img src="' + prosobject[index].imageurl + '" width="454" height="167" /></a></div>');

    container.find("#sol_dot_" + index).attr("src", "images/dot_slctd.jpg");

    function changeProjects() {
        container.fadeOut(function () {
            container.html('<div class="pagingDots"><ul id="pagingDotslist"><li><img src="images/dot_unslctd.jpg" width="10" height="10" border="0" id="sol_dot_2" /></li><li><img src="images/dot_unslctd.jpg" width="10" height="10" border="0" id="sol_dot_1" /></li><li><img src="images/dot_unslctd.jpg" width="10" height="10" border="0" id="sol_dot_0" /></li></ul></div> <div class="prjctsImgz" align="center"><a href="' + prosobject[index].link + '"><img src="' + prosobject[index].imageurl + '" width="454" height="167" /></a></div>').fadeIn();
            container.find("#sol_dot_" + index).attr("src", "images/dot_slctd.jpg");
        });





        if (index == prosobject.length - 1) {
            index = 0;
        } else {
            index ++;
        }
    }


    return container;
}
