//Setup a namespace to contain your own code within the YAHOO namespace
  YAHOO.namespace("indiaAhoy");

  //Create our carousel object literal with an init method
  YAHOO.indiaAhoy.headerCarousel = {
    carousel: '',
    init: function()
    {
      this.carousel = new YAHOO.widget.Carousel("heroshot-carousel",
      {
        autoPlayInterval: 10000,
        isCircular: true,
        navigation: { prev: null },
        animation: {speed: 0.5},
        numVisible: 1,
        revealAmount:0,
				numItems:10 ,//total no of items
				selectOnScroll :true
        });

      		var nxtItemsArray=[
		            '<img width="970" height="315" alt="An island in the Andaman archipelago" src="'+rootpath+'/images/andaman-islands.jpg"  /><div class="outer"><div class="prevBtn"><input type="image" src="'+rootpath+'/images/prevbtn.gif" title="Previous Slide"/></div><div class="herotext"><p class="heading">Where the Sun Shines</p><p class="text">The Andaman and Nicobar Islands are one of India’s most beautiful seaside destinations, and offer crystal clear waters, untouched beaches, water sports, great shopping, and awesome historical edifices. </p></div><div class="nxtBtn"><input type="image" src="'+rootpath+'/images/nextbtn.gif" title="Next Slide"/></div></div>',
		            '<img width="970" height="315" alt="Chinese fishing nets, Cochin" src="'+rootpath+'/images/chinese fishing net-coachin.jpg"/><div class="outer"><div class="prevBtn"><input type="image" src="'+rootpath+'/images/prevbtn.gif" title="Previous Slide"/></div><div class="herotext"><p class="heading">Cultural Mosaic</p><p class="text">Cochin, one of Kerala’s oldest and most important cities, has been the centre of trade for hundreds of years. From Chinese fishing nets to British and Portuguese colonial architecture, Cochin is a swirl of cultures.</p></div><div class="nxtBtn"><input type="image" src="'+rootpath+'/images/nextbtn.gif" title="Next Slide"/></div></div>',
		            '<img width="970" height="315" alt="City Palace on the banks of Lake Pichola, Udaipur" src="'+rootpath+'/images/lake pichola-udaipur.jpg"/><div class="outer"><div class="prevBtn"><input type="image" src="'+rootpath+'/images/prevbtn.gif" title="Previous Slide"/></div><div class="herotext"><p class="heading">The Lake City</p><p class="text">Spread out on the banks of Lake Pichola, Udaipur is a stunning jewel of the Aravali Hills, coruscating images of grandeur and royalty across its innumerable sprawling palaces and forts. </p></div><div class="nxtBtn"><input type="image" src="'+rootpath+'/images/nextbtn.gif" title="Next Slide"/></div></div>',
			            '<img width="970" height="315" alt="Palace in Orchha" src="'+rootpath+'/images/fort orcha-orcha.jpg"/><div class="outer"><div class="prevBtn"><input type="image" src="'+rootpath+'/images/prevbtn.gif" title="Previous Slide"/></div><div class="herotext"><p class="heading">Ageless Beauty</p><p class="text">The former capital of the mighty Bundela Kingdom of Central India, Orchha is home to stunning architecture – palaces, temples, forts - set amidst verdant valleys, gushing rivers and placid lakes.</p></div><div class="nxtBtn"><input type="image" src="'+rootpath+'/images/nextbtn.gif" title="Next Slide"/></div></div>',  
		            '<img width="970" height="315" alt="A tea garden in Sikkim" src="'+rootpath+'/images/tea-plantation, sikkim.jpg"/><div class="outer"><div class="prevBtn"><input type="image" src="'+rootpath+'/images/prevbtn.gif" title="Previous Slide"/></div><div class="herotext"><p class="heading">Tranquil Beauty</p><p class="text">Truly beautiful, Sikkim’s hills, valleys, forests and lakes have a charm of their own. Gifted with vistas of the mighty Himalayas and peppered with serene monasteries, Sikkim’s allure is undeniable.</p></div><div class="nxtBtn"><input type="image" src="'+rootpath+'/images/nextbtn.gif" title="Next Slide"/></div></div>',
		            '<img width="970" height="315" alt="Ghats along the holy Lake of Pushkar, Rajastan" src="'+rootpath+'/images/Ghats along the holy Lake of Pushkar, Rajastan.jpg"/><div class="outer"><div class="prevBtn"><input type="image" src="'+rootpath+'/images/prevbtn.gif" title="Previous Slide"/></div><div class="herotext"><p class="heading">Festive & Mystical</p><p class="text">A unique temple town nestled on the banks of the holy Pushkar Lake, Pushkar is home to the only Brahma Temple in the world, and is also known for the vibrant Pushkar Camel Festival.</p></div><div class="nxtBtn"><input type="image" src="'+rootpath+'/images/nextbtn.gif" title="Next Slide"/></div></div>',
		            '<img width="970" height="315" alt="Royal Bengal Tiger, Ranthambore National Park" src="'+rootpath+'/images/tiger.jpg"/><div class="outer"><div class="prevBtn"><input type="image" src="'+rootpath+'/images/prevbtn.gif" title="Previous Slide"/></div><div class="herotext"><p class="heading">Black-barbed and Whiskered</p><p class="text">A beast found in nature reserves and national parks across India, the Royal Bengal Tiger is the supreme denizen of the forest, master of the dappled trails, and the well-dressed king of the jungle.</p></div><div class="nxtBtn"><input type="image" src="'+rootpath+'/images/nextbtn.gif" title="Next Slide"/></div></div>',
		            '<img width="970" height="315" alt="Ghats along the Ganges, Varanasi" src="'+rootpath+'/images/ghats, varanasi.jpg"/><div class="outer"><div class="prevBtn"><input type="image" src="'+rootpath+'/images/prevbtn.gif" title="Previous Slide"/></div><div class="herotext"><p class="heading">Immersive Experience</p><p class="text">An ancient centre of learning and a holy town on the banks of the sacred Ganges, Varanasi is where thousands of pilgrims come to receive River Ganga’s purifying blessings.</p></div><div class="nxtBtn"><input type="image" src="'+rootpath+'/images/nextbtn.gif" title="Next Slide"/></div></div>',
		            '<img width="970" height="315" alt="Shanti Stupa, Ladakh Himalayas" src="'+rootpath+'/images/Shanti Stupa, Ladakh Himalayas.jpg"/><div class="outer"><div class="prevBtn"><input type="image" src="'+rootpath+'/images/prevbtn.gif" title="Previous Slide"/></div><div class="herotext"><p class="heading">Stupefying & Gravity-Defying</p><p class="text">Imagine rock & ice towering above the clouds. Imagine verdant valleys and glacier-fed rivers. Imagine the Himalayas, the greatest, biggest, and tallest mountain range in the world!</p></div><div class="nxtBtn"><input type="image" src="'+rootpath+'/images/nextbtn.gif" title="Next Slide"/></div></div>'
						];
		var itemsIndex=0;
		var that=this;


		var addItems=function(a,b){
			if(itemsIndex<19){
			that.carousel.addItem(nxtItemsArray[itemsIndex]);
			itemsIndex++;
			//SET UP Buttons
			 var dom=YAHOO.util.Dom;
			var nxtImgArr=dom.getElementsBy(function(el){
			if(el.className=="nxtBtn"){
				return true;
			}
		}
		,"div","heroshot-carousel");

		var prevImgArr=dom.getElementsBy(function(el){
			if(el.className=="prevBtn"){
				return true;
			}
		}
		,"div","heroshot-carousel");

			YAHOO.util.Event.addListener(nxtImgArr,"click",scrollForward);
			YAHOO.util.Event.addListener(prevImgArr,"click",scrollBackward);

			//SET UP Buttons
			}


		};
		this.carousel.addListener("beforeScroll",addItems);
		this.carousel.addListener("afterScroll",function(){
			
			if(that.carousel.get("currentPage") ==0){
			that.carousel.set("animation",{speed:0.5, effect:null});
			}
			if(that.carousel.get("currentPage") == (that.carousel.get("numItems")-1)){
			//that.carousel.scrollTo(0);
			that.carousel.set("animation",{speed:0.001, effect:null})
			
			}
			
			});
		this.carousel.addListener("loadItems",addItems);

		//add second item(first from array)
		addItems();

	    this.carousel.render();
		this.carousel.show();
		this.carousel.startAutoPlay();
		var that=this;
		this.carousel.addListener("stopAutoPlay",function(){
			that.carousel.startAutoPlay();

		});
		//SET UP Buttons
		 var dom=YAHOO.util.Dom;
		var nxtImgArr=dom.getElementsBy(function(el){
			if(el.className=="nxtBtn"){
				return true;
			}
		}
		,"div","heroshot-carousel");

		var prevImgArr=dom.getElementsBy(function(el){
			if(el.className=="prevBtn"){
				return true;
			}
		}
		,"div","heroshot-carousel");

		var scrollForward=function(){
		YAHOO.indiaAhoy.headerCarousel.carousel.scrollForward();
		};
		var scrollBackward=function(){
		YAHOO.indiaAhoy.headerCarousel.carousel.scrollBackward();
		};

		YAHOO.util.Event.addListener(nxtImgArr,"click",scrollForward);


		YAHOO.util.Event.addListener(prevImgArr,"click",scrollBackward);


		//SET UP Buttons

    }
  };

  //onDomReady check to see if our carousel exists, and call the setup function
  YAHOO.util.Event.onDOMReady(
    function (ev) {
      if(YAHOO.util.Dom.get("heroshot-carousel"))
      {
    	  YAHOO.indiaAhoy.headerCarousel.init();
      }
      if(YAHOO.util.Dom.get("popular_itneries_carousel"))
      {
        YAHOO.indiaAhoy.popular_itneries_carousel.init();
      }

      if(YAHOO.util.Dom.get("our_offer_carousel"))
      {
        YAHOO.indiaAhoy.our_offer_carousel.init();
      }

	  mySimpleDialog = new YAHOO.widget.SimpleDialog("dialog", {
		width: "700px",
		effect:{effect:YAHOO.widget.ContainerEffect.FADE,
	        duration:0.25},
		fixedcenter:"contained",
		underlay:"matte",
		modal:true,
		visible:true,
		close:false,
		draggable:false });

	  mySimpleDialogGMap = new YAHOO.widget.SimpleDialog("GMap", {
		width: "930px",
		effect:{effect:YAHOO.widget.ContainerEffect.FADE,
	        duration:0.25},
		fixedcenter:true,
		underlay:"matte",
		modal:true,
		visible:true,
		close:false,
		draggable:false });


	/*	YAHOO.util.Event.addListener("sendQuery","click",function(){
		document.getElementById("dialog").style.display="block";
		mySimpleDialog.render(document.body);
		mySimpleDialog.show();
		document.getElementById("dialog_mask").style.zIndex="100";
		document.getElementById("dialog_c").style.zIndex="1000";
		}); */

	  ext_DomainO1 = new YAHOO.widget.Panel("ext_DomainO", {
		effect:{effect:YAHOO.widget.ContainerEffect.FADE,
	        duration:0.25},
		fixedcenter:"contained",
		constraintoviewport: "true",
		underlay:"matte",
		modal:true,
		visible:false,
		close:false,
		draggable:false });


		YAHOO.util.Event.addListener("livechat","click",function(){
		document.getElementById("ext_DomainIF").src="http://www.google.com";
		document.getElementById("ext_DomainIF").style.width="300px";
		document.getElementById("ext_DomainIF").style.height="300px";
		document.getElementById("ext_DomainO").style.width="300px";
		document.getElementById("ext_DomainO").style.display="block";
		ext_DomainO1.cfg.setProperty("width","300",true);
		ext_DomainO1.render(document.body);
		ext_DomainO1.show();
		document.getElementById("ext_DomainO_mask").style.zIndex="100";
		document.getElementById("ext_DomainO_c").style.zIndex="1000";
		});

		YAHOO.util.Event.addListener("sendQuery","click",function(){
		document.getElementById("ext_DomainIF").src="http://www.yahoo.com";
		document.getElementById("ext_DomainIF").style.width="500px";
		document.getElementById("ext_DomainIF").style.height="500px";
		document.getElementById("ext_DomainO").style.width="500px";
		document.getElementById("ext_DomainO").style.display="block";
		ext_DomainO1.cfg.setProperty("width","500",true);
		ext_DomainO1.render(document.body);
		ext_DomainO1.show();
		document.getElementById("ext_DomainO_mask").style.zIndex="100";
		document.getElementById("ext_DomainO_c").style.zIndex="1000";
		});

		YAHOO.util.Event.addListener("register","click",function(){
		document.getElementById("dialog").style.display="block";
		mySimpleDialog.render(document.body);
		mySimpleDialog.show();
		document.getElementById("dialog_mask").style.zIndex="100";
		document.getElementById("dialog_c").style.zIndex="1000";
		});
	  }
  );


var showDialogMap=function(){
		document.getElementById("GMap").style.display="block";
		mySimpleDialogGMap.render(document.body);
		mySimpleDialogGMap.show();
		document.getElementById("GMap_mask").style.zIndex="100";
		document.getElementById("GMap_c").style.zIndex="1000";
		};


var frameURLNULL = function()
{
	document.getElementById("ext_DomainIF").src="";
}

   //Create our carousel object literal with an init method
  YAHOO.indiaAhoy.popular_itneries_carousel = {
    carousel: '',
    init: function()
    {
      this.carousel = new YAHOO.widget.Carousel("popular_itneries_carousel",
      {
      	numItems: 6,
        autoPlayInterval: 5000,
       /* isCircular: true,*/
        animation: {speed: 0.5},
        numVisible: 1
       });
     	this.carousel.CONFIG.MAX_PAGER_BUTTONS = 20;




	/*array of next items innerHTML | to be rendered on demand*/
		var nxtItemsArray=[
	  '<div class="packageContainer" style="cursor: pointer;" onclick="javascript:viewPkg(\'/indiaahoy/3976-northern_india_wildlife_tour.html\',isLoggedIn);"><p style="width:253px;"><img src="'+rootpath+'/images/north-india-wildlife.jpg" alt="Northern India Wildlife Tour" title="Northern India Wildlife Tour" /></p><div class="floatR packagedesc"><h4 class="pkg_head">Northern India Wildlife Tour</h4><p class="TxtLimit">Walk on the wild side! Experience the thrill of tigers on the prowl in Ranthambore or the cackle of countless birds as they nestle in Bharatpur. For a tinge of history, the magnificent forts and palaces offer plenty as do the beautifully carved statues of Khajuraho and of course the eternal Taj Mahal.</p><p><span class="packagebox"><a href="#">View Package</a></span></p></div></div><div class="packageContainer" style="cursor: pointer;" onclick="javascript:viewPkg(\'/indiaahoy/3995-zanskar_river_expedition.html\',isLoggedIn);"><p style="width:253px;"><img src="'+rootpath+'/images/zanskar.jpg" alt="The Zanskar River Rafting Expedition" title="The Zanskar River Rafting Expedition" /></p><div class="floatR packagedesc"><h4 class="pkg_head">The Zanskar River Rafting Expedition</h4><p class="TxtLimit">Surrounded by towering mountain ranges from all sides, Zanskar is famous for its snow-clad hills, monasteries and the amazing river rafting excursions it offers. For all adventure-seeking enthusiasts, the area presents an amazing opportunity to enjoy a thrilling ride down the river. An amazing chance to discover the soul-stirring landscape with a dash of adventure, prepare yourself to have the time of your life!</p><p><span class="packagebox"><a href="#">View Package</a></span></p></div></div>',
	  '<div class="packageContainer" style="cursor: pointer;" onclick="javascript:viewPkg(\'/indiaahoy/4007-himalayan_vistas.html\',isLoggedIn);"><p style="width:253px;"><img src="'+rootpath+'/images/eastern-himalayas.jpg" alt="Eastern Himalayan Tour" title="Eastern Himalayan Tour" /></p><div class="floatR packagedesc"><h4 class="pkg_head">Eastern Himalayan Tour</h4><p class="TxtLimit">The beauty of the Himalayas is unmistakable with its myriad valleys and peaks including the highest of them all – Mt. Everest. Begin your tour in New Delhi and thereafter set off on a journey to explore the raw beauty of the mountains, with diverse landscapes at every stop. Visit monasteries steeped in history and tradition that evoke a spiritual calm in Kalimpong and see the awesomeness of the entire Kanchenjunga range from Gangtok. A window into the warmth of the people of the hill stations dotted along the way as well as a chance to admire the sheer enormity of nature, this is truly a once in a lifetime experience.</p><p><span class="packagebox"><a href="#">View Package</a></span></p></div></div><div class="packageContainer" style="cursor: pointer;" onclick="javascript:viewPkg(\'/indiaahoy/4010-kerala_backwater_bliss.html\',isLoggedIn);"><p style="width:253px;"><img src="'+rootpath+'/images/backwaters-of-kerela.jpg" alt="Backwaters of Kerala" title="Backwaters of Kerala" /></p><div class="floatR packagedesc"><h4 class="pkg_head">Backwaters of Kerala</h4><p class="TxtLimit">Green and silver – the two words that best sum up the landscapes along the backwaters of Kerala. Sail through the palm-fringed canals and go past quiet rivulets and grassy banks. One of the most visited attractions in Kerala, the backwaters never fail to enchant one with the rice boats and Chinese fishing nets – reminiscent of the times when this was part of the ancient trade route and goods from here were carried to the Arabian countries. Covered with coir, today the boats have furnished rest rooms and well-equipped kitchens and offer an interesting accommodation option for travelers. Pack your bags for the visual treat that these lands offer and experience the magic of the backwaters.</p><p><span class="packagebox"><a href="#">View Package</a></span></p></div></div>',
	  '<div class="packageContainer" style="cursor: pointer;" onclick="javascript:viewPkg(\'/indiaahoy/4006-exciting_kerala.html\',isLoggedIn);"><p style="width:253px;"><img src="'+rootpath+'/images/kerela-gods-own-country.jpg" alt="Kerala – God\'s Own Country" title="Kerala – God\'s Own Country" /></p><div class="floatR packagedesc"><h4 class="pkg_head">Kerala – God\'s Own Country</h4><p class="TxtLimit">Sprawling plantations and paddy fields, Ayurvedic treatments, enchanting art and culture, exotic cuisine – Kerala offers a unique experience. The magnificent little state holds several attractions within its bountiful confines. A vast scope for many exciting adventures is what makes Kerala a favorite haunt!</p><p><span class="packagebox"><a href="#">View Package</a></span></p></div></div><div class="packageContainer" style="cursor: pointer;" onclick="javascript:viewPkg(\'/indiaahoy/3979-the_indian_maharaja_deccan_odyssey.html\',isLoggedIn);"><p style="width:253px;"><img src="'+rootpath+'/images/indian-maharaja.jpg" alt="The Indian Maharaja - Deccan Odyssey" title="The Indian Maharaja - Deccan Odyssey" /></p><div class="floatR packagedesc"><h4 class="pkg_head">The Indian Maharaja - Deccan Odyssey</h4><p class="TxtLimit">Embark on a memorable journey exploring India’s great culture and heritage along with its cosmopolitan visage. From the majestic walls of the Red Fort, Jama Masjid and Qutub Minar in Delhi to the beautiful edifice of romance – Taj Mahal in Agra and from the red sandstone Hawa Mahal in Jaipur to the glorious caves at Ajanta, enjoy a fun filled vacation in the heart of India.</p><p><span class="packagebox"><a href="#">View Package</a></span></p></div></div>',
	  '<div class="packageContainer" style="cursor: pointer;" onclick="javascript:viewPkg(\'/indiaahoy/4009-kerala_ayurveda_package.html\',isLoggedIn);"><p style="width:253px;"><img src="'+rootpath+'/images/ayurveda.jpg" alt="Ayurvedic Rejuvenation Therapy" title="Ayurvedic Rejuvenation Therapy" /></p><div class="floatR packagedesc"><h4 class="pkg_head">Ayurvedic Rejuvenation Therapy</h4><p class="TxtLimit">Let the centuries old therapies work on you. Close your eyes, stretch out and relax and let the power of Ayurveda take over your body. Kerala is unique; for you don\'t get this special a treatment anywhere else in the world. Oils, herbs and massages, all done by deft expert hands. Time to forget all your worries and tensions and come a shining rejuvenated you!</p><p><span class="packagebox"><a href="#">View Package</a></span></p></div></div><div class="packageContainer" style="cursor: pointer;" onclick="javascript:viewPkg(\'/indiaahoy/4001-tour_of_north_east_india.html\',isLoggedIn);"><p style="width:253px;"><img src="'+rootpath+'/images/brahmaputra-cruise.jpg" alt="Brahmaputra River Cruise" title="Brahmaputra River Cruise" /></p><div class="floatR packagedesc"><h4 class="pkg_head">Brahmaputra River Cruise</h4><p class="TxtLimit">Enjoy the beauty of North India and the North-East as you explore rolling tea gardens, lush forest sanctuaries and ancient temples revered for their strange practices. See the romance that surrounds the majestic Taj Mahal in Agra, as well as splendor of the ancient dome-shaped Kamakhya Temple in Assam, before enjoying a lovely cruise in the Himalayan belt.</p><p><span class="packagebox"><a href="#">View Package</a></span></p></div></div>',
	  '<div class="packageContainer" style="cursor: pointer;" onclick="javascript:viewPkg(\'/indiaahoy/3966-the_kamasutra_holiday.html\',isLoggedIn);"><p style="width:253px;"><img src="'+rootpath+'/images/kamasutra-holidays.jpg" alt="The Kamasutra Holiday" title="The Kamasutra Holiday" /></p><div class="floatR packagedesc"><h4 class="pkg_head">The Kamasutra Holiday</h4><p class="TxtLimit">Wallow in the pleasures of the senses and rediscover passion as you travel through some of the most romantic destinations in India. Enjoy gourmet cuisine, the finest spirits and dreamy destinations including Khajuraho, Jodhpur and Udaipur. A perfect way to rekindle the romance in your life!</p><p><span class="packagebox"><a href="#">View Package</a></span></p></div></div><div class="packageContainer" style="cursor: pointer;" onclick="javascript:viewPkg(\'/indiaahoy/4004-blissful_south_india.html\',isLoggedIn);"><p style="width:253px;"><img src="'+rootpath+'/images/grand-tour-of-south-india.jpg" alt="Grand Tour of South India (Deluxe)" title="Grand Tour of South India (Deluxe)" /></p><div class="floatR packagedesc"><h4 class="pkg_head">Grand Tour of South India (Deluxe)</h4><p class="TxtLimit">Packed with the most beautiful and sought-after destinations, this tour is a must for any travel buff. A myriad places with just as many experiences... caves, temples, palaces, giant statues, warm sunny beaches... the South has it all. A fantastic blend of adventure, sightseeing and an all-pervading sense of spirituality. 17 days of pure, fun-filled holidaying. Have a great time.</p><p><span class="packagebox"><a href="#">View Package</a></span></p></div></div>'
	  ];
	 /*maintain array index*/
	  var nxtIndex=0;
	  var that=this;
	  this.carousel.addListener("loadItems", function (o) {
	  that.carousel.addItem(nxtItemsArray[nxtIndex]);
	  //YAHOO.indiaAhoy.our_offer_carousel.carousel.addItem(nxtItemsArray[nxtIndex]);
	  nxtIndex++;
	  TextTruncate();
	  });



      this.carousel.render();
      this.carousel.show();   // display the widget
     //this.carousel.startAutoPlay();
    }
  };


	YAHOO.indiaAhoy.our_offer_carousel = {
    carousel: '',
    init: function()
    {
      this.carousel = new YAHOO.widget.Carousel("our_offer_carousel",
      { numItems: 10,	//**** total items(offers)
        numVisible: 1,
				animation: {
          speed: 0.5

        }
      });
     	this.carousel.CONFIG.MAX_PAGER_BUTTONS = 20;

		/*array of next items innerHTML | to be rendered on demand*/
		var nxtItemsArray=[
				'<span style="cursor: pointer;" onclick="javascript:viewPkg(\'/indiaahoy/search?category=All+Packages&dest=&minDuration=1&month=-1&duration=-1&theme=Golden%20Triangle\',isLoggedIn);"><img src="'+rootpath+'/images/golden-triangles.jpg" class="mrgn-top35" alt="Golden Triangle" height="191" width="600" /><h3>Golden Triangle</h3><p>The rich and royal heritage that has long been associated with India shines in the Golden Triangle. An epic story of splendor, the triangle is made up of the 3 points of Delhi, Agra, and Jaipur. Delhi, the capital of India and historic centre of numerous struggles for throne, crown and scepter, is filled with massive forts, modern palaces, along with other monumental legacies of the past. Agra is an architectural wonderland, and holds the jewel of all wonders of India – the Taj Mahal. Jaipur, known as the Pink City, is the capital of the historically ripe state of Rajasthan, and is glorious with its staggering edifices and cultural majesty. The Golden Triangle truly evokes the colors, flavors, sights, and sounds of the country, and each is a pinnacle of Indian culture.</p><p><span class="packagebox"><a href="#">View Packages</a></span></p></span>',
		'<span style="cursor: pointer;" onclick="javascript:viewPkg(\'/indiaahoy/search?category=All+Packages&dest=&minDuration=1&month=-1&duration=-1&theme=Honeymoon\',isLoggedIn);"><img src="'+rootpath+'/images/honeymoon.jpg" class="mrgn-top35" alt="Honeymoon" height="191" width="600"/><h3>Honeymoon</h3><p>An unforgettable way of embarking on the journey of married life and everlasting bliss, a honeymoon is something to be cherished for a lifetime! Everything has to be perfect and seamless, exactly as delightful as you would dream it would be. Knowing this, it is no wonder that planning a honeymoon is difficult. But you have nothing to fear. Our honeymoons are lovingly planned by our holiday specialists keeping your every requirement in mind, a masterpiece that is carefully designed to satisfy every desire on that special occasion.</p><p><span class="packagebox"><a href="#">View Packages</a></span></p></span>',
		'<span style="cursor: pointer;" onclick="javascript:viewPkg(\'/indiaahoy/search?category=All+Packages&dest=&minDuration=1&month=-1&duration=-1&theme=Spa%20%26%20Yoga\',isLoggedIn);"><img src="'+rootpath+'/images/yoga.jpg" class="mrgn-top35" alt="Spa &amp; Yoga" height="191" width="600"/><h3>Spa &amp; Yoga</h3><p>India, the birthplace of such ancient knowledge systems as Yoga, Meditation and Ayurveda, is a world class destination for those looking for a holistic approach to both relaxation and beauty, as well as the quality application of Western techniques. With us, you are in safe hands, experiencing and learning the full power of arts at some of the best spas, meditation and Yoga institutes in the world, from Kerala to Rishikesh, Mungher to Haridwar.</p><p><span class="packagebox"><a href="#">View Packages</a></span></p></span>',
		'<span style="cursor: pointer;" onclick="javascript:viewPkg(\'/indiaahoy/search?category=All+Packages&dest=&minDuration=1&month=-1&duration=-1&theme=Culture%20%26%20Heritage\',isLoggedIn);"><img src="'+rootpath+'/images/culture.jpg" class="mrgn-top35" alt="Culture &amp; Heritage" height="191" width="600"/><h3>Culture &amp; Heritage</h3><p>Experience the richness of India\'s innumerable and diverse cultures. Stroll down the mazelike alleyways of Delhi\'s Chandni Chowk, set sail on Kolkata\'s mystical Hooghly River, gaze rapturously at the erotic carvings of Khajuraho, see the camel races of Pushkar, get entranced by Kathakali dancing in Kerala, and try the indescribable kebabs of Lucknow! See firsthand the complexity of India\'s vibrant cultures while being guided step by step through each layered revelation by our knowledgeable and experienced tour managers. With us, cultural tours are much more than just educational experiences; they’re life-changing journeys.</p><p><span class="packagebox"><a href="#">View Packages</a></span></p></span>',
		'<span style="cursor: pointer;" onclick="javascript:viewPkg(\'/indiaahoy/search?category=All+Packages&dest=&minDuration=1&month=-1&duration=-1&theme=Wildlife%20%26%20Eco%20Tours\',isLoggedIn);"><img src="'+rootpath+'/images/wild-life.jpg" class="mrgn-top35" alt="Wildlife &amp; Eco Tours" height="191" width="600"/><h3>Wildlife &amp; Eco Tours</h3><p>India is one of the best destinations in the world for Wildlife & Ecology tours, with its millions of species of vibrant flora and fauna and wide range of ecological habitats. A kaleidoscope of animals and plants, India has hundreds of unique national parks, nature and wildlife reserves, each protecting a portion of the nation’s tremendous biodiversity. Our Wildlife tours give you the chance to feel one with nature, learning organic farming, sitting in the shade of a banyan tree, or staring into the eyes of a tiger.</p><p><span class="packagebox"><a href="#">View Packages</a></span></p></span>',
		'<span style="cursor: pointer;" onclick="javascript:viewPkg(\'/indiaahoy/search?category=All+Packages&dest=&minDuration=1&month=-1&duration=-1&theme=Beach%20Holidays\',isLoggedIn);"><img src="'+rootpath+'/images/beach.jpg" class="mrgn-top35" alt="Beach Holidays" height="191" width="600"/><h3>Beach Holidays</h3><p>India is a peninsula that has over 6100 km of coastline just on the mainland, and a total of 7517 km when including the coastlines of the Andaman and Nicobar Islands in the Bay of Bengal to the east, and Lakshwadweep Islands in the Arabian Sea to the west. Coral reefs and river beaches, white sand and black sand, secluded and popular, India’s beaches are various in nature and number, each beautiful in its own way. Simply lounge away in the warm sun, devour fresh seafood at shacks, indulge in water sports, or party the night away. Whatever your desire, we can help you set the beach on fire.</p><p><span class="packagebox"><a href="#">View Packages</a></span></p></span>',
		'<span style="cursor: pointer;" onclick="javascript:viewPkg(\'/indiaahoy/search?category=All+Packages&dest=&minDuration=1&month=-1&duration=-1&theme=Luxury%20Tours\',isLoggedIn);"><img src="'+rootpath+'/images/luxury01.jpg" class="mrgn-top35" alt="Luxury Tours" height="191" width="600"/><h3>Luxury Tours</h3><p>It’s the little things in life that make it special. And, it’s the little things in life that make it luxurious. From a fluffy bathrobe to pillow sweets, hour-long spa sessions to the finest burgundy, your every little dream will come together on this lavish experience of a lifetime, where you shall be spoilt for choice at every stage of your unforgettable holiday.</p><p><span class="packagebox"><a href="#">View Packages</a></span></p></span>',
		'<span style="cursor: pointer;" onclick="javascript:viewPkg(\'/indiaahoy/search?category=All+Packages&dest=&minDuration=1&month=-1&duration=-1&theme=Study%20Tours\',isLoggedIn);"><img src="'+rootpath+'/images/study-tours.jpg" class="mrgn-top35" alt="University Study Tours" height="191" width="600"/><h3>University Study Tours</h3><p>There is no better way to learn than through first hand experience. Our tailor-made Study Tours let you broaden your intellectual horizons and expand your knowledge base. Always planning one step ahead to suit your every requirement, and yet giving you unheard of flexibility, we ensure you receive gainful insights and varied exposure, furthering your comprehension and erudition in your chosen field of study.</p><p><span class="packagebox"><a href="#">View Packages</a></span></p></span>',
		'<span style="cursor: pointer;" onclick="javascript:viewPkg(\'/indiaahoy/search?category=All+Packages&dest=&minDuration=1&month=-1&duration=-1&theme=Family%20tours\',isLoggedIn);"><img src="'+rootpath+'/images/family-tour.jpg" alt="family tour" width="600" height="191" class="mrgn-top35" /><h3>Family Tours</h3><p>Planned, coordinated and directed by our team of in-house industry experts, your family tour has been flawlessly engineered. Everything - from the locations to the accommodation, meals to the transportation – has been tested with the utmost care and diligence. No unpleasant surprises await you, simply a holiday of a lifetime enjoying the innumerable and varied pleasures that India has to offer - with those you cherish the most, your family.</p><p><span class="packagebox"><a href="#">View Packages</a></span></p></span>'
	  ];
	 /*maintain array index*/
	  var nxtIndex=0;
	  var that=this;
	   this.carousel.addListener("loadItems", function (o) {
	  that.carousel.addItem(nxtItemsArray[nxtIndex]);
	  //YAHOO.indiaAhoy.our_offer_carousel.carousel.addItem(nxtItemsArray[nxtIndex]);
	  nxtIndex++;
	  });
      this.carousel.render();
      this.carousel.show();   // display the widget
    }
  };


  // Left Options carousal Initiate
    (function () {
        var carousel;

        YAHOO.util.Event.onDOMReady(function (ev) {
            var carousel    = new YAHOO.widget.Carousel("trip_Carousel", {
                        animation: { speed: 0.5 }
                });
		    carousel.set("numVisible", 1);
				carousel.CONFIG.MAX_PAGER_BUTTONS = 10;
				carousel.render();
				carousel.show();
        });
    })();





/* Calendar Object Instantiate */
Dom = YAHOO.util.Dom;
Event = YAHOO.util.Event;
var labelsJS = new Object();

function initFunc(){
globalArray[0]=creatorCal("date","calContainer",730,"dateImg","dateView",null,true,3);
}
/* Calendar Object Instantiate */




/* Self written JS */
function ExpandCollapseSection(id,currElem)
{
	var elem = Dom.get(id);
	var status=(elem.style.display=="none")?"block":"none";
	elem.style.display=status;

	if(currElem!=null)
	{
	  if(status!="block")
		 currElem.src=""+rootpath+"/images/modifysearchclose.gif";
	  else
		 currElem.src=""+rootpath+"/images/modifysearchopen.gif";
	 }
}

function TabActive(elem)
{
	/* remove class first which is already active */
	Dom.removeClass('our_offer','active');
	Dom.removeClass('pop_Iten','active');
	/* remove class first which is already active */

	/* Then add a class */
	Dom.addClass('our_offer','unactive');
	Dom.addClass('pop_Iten','unactive');
	/* Then add a class */

	Dom.setStyle("our_offer_data","display","none");
	Dom.setStyle("pop_Iten_data","display","none");

	if(elem!=null)
	{
		var data_section = elem.id+"_data";
		Dom.setStyle(data_section,"display","block");
		Dom.addClass(elem,"active");
	}

	if(elem.id=="pop_Iten")
		TextTruncate();
}



function TextTruncate()
{
		var paraTrunc = document.getElementById("popular_itneries_carousel").getElementsByTagName("p");

		for(i=paraTrunc.length-1;i>=0;i--)
		{
			if(paraTrunc[i].className=="TxtLimit")
			{
					var len = 190;
          var trunc = paraTrunc[i].innerHTML;
          if (trunc.length > len) {

            /* Truncate the content of the P, then go back to the end of the
               previous word to ensure that we don't truncate in the middle of
               a word */
            trunc = trunc.substring(0, len);
            trunc = trunc.replace(/\s*\w+$/, '');

            /* Add an ellipses to the end and make it a link that expands
               the paragraph back to its original size */
            //trunc += '<a href="#" ' +'onclick="this.parentNode.innerHTML=' +'unescape(\''+escape(para)+'\');return false;">' +'...<\/a>';
            trunc += '...';
          }
          paraTrunc[i].innerHTML = trunc;  //call a function for para truncate
			}

		}


  //return trunc;
}

function validateSearch()
{
	 //get theme value
	theme='';
	for (var i=0; i < document.searchForm.tripchoice.length; i++)
	   {
	   if (document.searchForm.tripchoice[i].checked)
	      {
		   theme = document.searchForm.tripchoice[i].value;
	      break;
	      }
	   }


	  minDuration=1;
	  //get duration value
	maxDuration=document.searchForm.duration.value;
	if(maxDuration==7){
		 minDuration=4;
	}else if(maxDuration==10){
		 minDuration=7;
	}
	 //get month value
	depDateTokens=(document.searchForm.dateView.value).split('\/');
	month=-1;
	if(depDateTokens.length==3 && (depDateTokens[1]).match(/^\d{1,2}$/)){
		month=depDateTokens[1];
	}
	
	dest=document.searchForm.dest.value;
	if(dest=='Enter your destination here'){
		dest='';
	}
	
urlToSubmit=rootpath+'/indiaahoy/search?category=All+Packages&dest='+dest+'&minDuration='+minDuration+'&month='+month+'&duration='+maxDuration+'&theme='+theme;
document.location.href = urlToSubmit;
return false;
}


function showDiv(id)
{
	var elem = Dom.get(id);
	elem.style.display="block";
}

function hideDiv(id)
{
	var elem = Dom.get(id);
	elem.style.display="none";
}

function changeDiv(id,id1,spanid,spanid1)
{
	elemStat = document.getElementById(id).style.display;

	if(elemStat=="block")
	{
		document.getElementById(id1).style.display="block";
		document.getElementById(spanid1).innerHTML="&ndash;";
		document.getElementById(id).style.display="none";
		document.getElementById(spanid).innerHTML="+";
	}

	if(elemStat=="none")
	{
		document.getElementById(id1).style.display="none";
		document.getElementById(spanid1).innerHTML="+";
		document.getElementById(id).style.display="block";
		document.getElementById(spanid).innerHTML="&ndash;";
	}
}

/* / Self written JS */
