
/* function photoLoop(childs) {
	for(var u=0; u<childs.length; u++) {
		$(childs[u-1]).delay(5000*u).fadeOut(500);
		$(childs[u]).delay(5000*u).fadeIn(500);
		// setTimeout((childs[u].fadeIn(1000)), 4000*u);	
	}
	photoLoop(childs);
}
	
	
$(document).ready ( 
	function() {
		// $("#pictures img:first").toggleClass('show', 1);
		// $("#pictures img:second").delay(3000).toggleClass('show', 4000);
		
		var childs = $("#pictures").children();
		photoLoop(childs);
		// alert (childs.length);
		
		
	}
) ; */

$(document).ready (
	function(){
		if (document.getElementById('pictures')) var holder = "#pictures";
		if (document.getElementById('homeSlideHolder')) var holder = "#homeSlideHolder";
		$( holder +' img:gt(0)').hide();
		var childs = $(holder).children();
		
		if ( childs.length > 1 ) {
			setInterval(function(){
			  $( holder +' :first-child').fadeOut()
				 .next('img').fadeIn()
				 .end().appendTo( holder );}, 
			  6000);
		}
	}
);

$(document).ready (
	function() {
		$("#movein").datepicker();
	}
);

function func_coupon (id) {
	var width = 630;
	var height = 610;
	window.open("/coupon/"+ id,"coupon","menubar=no,width="+ width +",height="+ height +",toolbar=no,scrollbars=no");
}

function GetXmlHttpObject2()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

function stateChanged2() 
{ 
if (xmlHttp.readyState==4)
{ 

}
}

function print_coupon(str,location)
{

xmlHttp=GetXmlHttpObject2();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="/templates/3-2/coupon_print.php";
url=url+"?barcode="+str;
url=url+"&location="+location;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged2;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
window.print();
}
