// JavaScript Document

Cufon.replace(".cufon ,.price ", { textShadow:"1px 1px 0px #fff" });

Cufon.replace(".buy ", { textShadow:"-1px -1px 0px #43ad0b" });
Cufon.replace(".more  ", { textShadow:"-1px -1px 0px #3b4e31" });
Cufon.replace("#subscribeSubmit ", { textShadow:"-1px -1px 0px #7b7f83" });
	
$(function(){
	var address = " Udaipur , India ";
	
	
	$("#subscribeSubmit").click(function(event){
										 
										   if(jQuery.trim($("#subscribeform").val())=="")
										   {
											  
											   $("#subscribeform").addClass("errortext");
											   event.preventDefault();
											   return;
										   }
										   else
										    $("#subscribeform").removeClass("errortext");
											
										   $("#subscribeSubmit").html("Sending"); Cufon.refresh();
										   $.post("contact.php",{email:$("#subscribeform").val(),choice:"inform"},
										   function(data){ 
																														 
																		  if(data=="success")
																		   $("#subscribeSubmit").html("SENT!");
																		  else
																		  $("#subscribeSubmit").html("ERROR!");
																				Cufon.refresh();										  
																														  });
										  
										  
										  
										    event.preventDefault();
										   });		
				var flag = false;						   
			$("#submit-Contact").click(function(event){
										  flag= false;	
										 
											
										   $("#quickcontact").find("input[type=text],textarea").each(function(){
											  if(jQuery.trim($(this).val())=="")
										   		{
												 $(this).addClass("errortext");
												  flag = true;
										 		  }
										  		  else
										  		{
													  $(this).removeClass("errortext");	
												   
												}
											});
											  if(flag==true)
										   {
											    event.preventDefault(); return;
										   }
										   
										   
										    $("#submit-Contact").attr("value","Sending");
										    $.post("contact.php",{email:$("#email").val(),name:$("#name").val(),message:$("#message").val(),choice:"contact"},function(data){ 
																																								   
                                                  if(data=="success")
												  $("#submit-Contact").attr("value","Sent !");
												else
												  $("#submit-Contact").attr("value","Not Sent !"); 
																																								   });
										   
										  
											   event.preventDefault();
											
											
										  
										 
										 
										   });								   
										   
	$(".testimonials>div ").wrap("<div class='testimonials-wrapper'/>");
	$("#social li").hover(function(){
		
		$(this).children("div").stop(true,true).fadeIn("normal");
		
		},function(){ $(this).children("div").hide(); });
		
	$(".gallery ul li a").prettyPhoto();
	$(".gallery ul li a").append("<span class='overlay'></span>");
	
	$(".gallery ul li a").hover(function(){
		if($.browser.msie)
		$(this).children("span").stop(true,true).show();
		else
		$(this).children("span").stop(true,true).fadeIn("slow");
		},function(){
		
		if($.browser.msie)
		$(this).children("span").stop(true,true).hide();
		else	
		$(this).children("span").stop(true,true).fadeOut("fast");	
			});
			
			// gooogle map function 
  function initialize() {
    geocoder = new google.maps.Geocoder();
    var latlng = new google.maps.LatLng(-34.397, 150.644);
    var myOptions = {
      zoom: 8,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  }

// google location set by address function
  function codeAddress() {
   
    geocoder.geocode( { 'address': address}, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        map.setCenter(results[0].geometry.location);
        var marker = new google.maps.Marker({
            map: map, 
            position: results[0].geometry.location
        });
      } else {
        alert("Geocode was not successful for the following reason: " + status);
      }
    });
  }
  
 var api = $(".scrollable").scrollable({api:true}) ,temp;

 $("#next").click(function(e){ api.next(); e.preventDefault();  });
 $("#prev").click(function(e){ api.prev(); e.preventDefault();  });

initialize();
codeAddress();
 $("a").css("-moz-outline-style","none");
 $("input[type=text],textarea").bind({
									  
									  focusin:function(){
										  
										  temp = $(this).val();
										  $(this).val('');
										  
										  
										  },
										focusout:function(){
										  
										  
										  if($(this).val()=='')
										  {
											$(this).val(temp);
										  }
										  
										  
										  }
									   
									  });
									  
									  
								  
									  
	var commas = ' <img src="css/i/starting-comma.png" alt="comma-start" class="comma-start"/><img src="css/i/ending-comma.png" alt="comma-end" class="comma-end"/>';
	$(".testimonials").prepend(commas);								  
									  
									  
									  
	});
