// JavaScript Document
//$(document).ready(function()
/*(function($){
  tile = function() {
    $("body").append('See? It works.');
  };
})(jQuery);
*/
$(document).ready(function(){
	
	var slider1 = new Object();
    slider1= $('#slider1').bxSlider({
	mode: 'horizontal',
	controls: false,
	infiniteLoop: true,
	nextImage : "js/images/arrow-right.png",
	prevImage : "js/images/arrow-left.png",
	auto : true
	
    });
	
	
	$("#prev").click(function(){
  	 slider1.goToPreviousSlide();
     return false;
		
		});
	
	$('#next').click(function(){
    slider1.goToNextSlide();
    return false;
  });
	
	
	
var sliderpg=$('#sliderpg').bxSlider({
	mode: 'horizontal',
	controls: false,
    auto:true,
	infiniteLoop: true,
	nextImage:"js/images/arrow-right.png",
	prevImage:"js/images/arrow-left.png"
    });
	
		$("#prevpg").click(function(){
  	 sliderpg.goToPreviousSlide();
     return false;
		
		});
	
	$('#nextpg').click(function(){
	 sliderpg.goToNextSlide();
    return false;
  });
	
	
	
	
	$("a.popup").click(function(){
		var $linkid=$(this).attr('id')
		if($linkid=="delhi")
		var id = '#dialog1';
		if($linkid=="jaipur")
		var id = '#dialog2';
		if($linkid=="chennai")
		var id = '#dialog3';
		//Get the screen height and width
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();
	
		//Set heigth and width to mask to fill up the whole screen
		$('#mask').css({'width':maskWidth,'height':maskHeight});
		
		//transition effect		
		$('#mask').fadeIn(1000);	
		$('#mask').fadeTo("slow",0.8);	
	
		//Get the window height and width
		var winH = $(window).height();
		var winW = $(window).width();
              
		//Set the popup window to center
		$(id).css('top',  winH/2-$(id).height()/2);
		$(id).css('left', winW/2-$(id).width()/2);
	
		//transition effect
		$(id).fadeIn(2000);

		});
								   
	/*		var id = '#dialog';
			//Get the screen height and width
			var maskHeight = $(document).height();
			var maskWidth = $(window).width();
		
			//Set heigth and width to mask to fill up the whole screen
			$('#mask').css({'width':maskWidth,'height':maskHeight});
			
			//transition effect		
			$('#mask').fadeIn(1000);	
			$('#mask').fadeTo("slow",0.8);	
		
			//Get the window height and width
			var winH = $(window).height();
			var winW = $(window).width();
				  
			//Set the popup window to center
			$(id).css('top',  winH/2-$(id).height()/2);
			$(id).css('left', winW/2-$(id).width()/2);
		
			//transition effect
			$(id).fadeIn(2000);
			*/
	
	// onload popup code end here	
		

    $("#dialog #flashContent").click(function(){
			//$(document).delay(3000);
		 	 window.location.replace("http://pearlacademy.com/shoppersstop/");
			
		});

	
	//if close button is clicked
	$('.window .close').click(function (e) {
		//Cancel the link behavior
		e.preventDefault();
		
		$('#mask').hide();
		$('.window').hide();
	});		
	
	//if mask is clicked
	$('#mask').click(function () {
		$(this).hide();
		$('.window').hide();
	});	
	
	
	//code for text hide aand show 
	
	 $(":text").focus(function(){
	 
	
	  if(this.value == this.defaultValue){
   		this.value = '';
  		this.style.color = '#666666';
	  }
	 
	 });
	
	
	  $(":text").blur(function(){
	 
	 if(this.value==''){
		 
		 this.value = this.defaultValue;
  		this.style.color = '#666666';
		 }
	 
	 
	 });
 
 
 // end code here 
 
 
 //iframe code script here
 
 $("a#delhi_tab").click(function(){
		//alert('ok');
		//document.getElementById("tabiframe").src="delhi.php";		
		$('#tabiframe').attr("src",'delhi.php');
		});
		
		
		
		$('a#jaipur_tab').click(function(){
		//document.getElementById("tabiframe").src="delhi.php";		
		$('#tabiframe').attr("src","jaipur.php");
		//$('#tabiframe').prop("src", "http://www.google.com");
		});
		
		
		
		$('a#chennai_tab').click(function(){
		//document.getElementById("tabiframe").src="delhi.php";		
		$('#tabiframe').attr("src","chennai.php");
		//$('#tabiframe').prop("src", "http://www.google.com");
		});
		
 
 // 
	
	
});

