// JavaScript Document
function MM_swapImgRestore() { 
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() {
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_findObj(n, d) {
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x &&d.getElementById) x=d.getElementById(n); return x;
}
/*****************Print Function******************/
/*function print_function()
{     
	var disp_setting="toolbar=no,location=no,directories=no,menubar=no,";
	disp_setting+="scrollbars=no,width=1200 , height=400, left=100, top=100";
	var content_value = document.getElementById("printarea").innerHTML;
	var docprint=window.open("","",disp_setting);
	docprint.document.open();
	docprint.document.write('<html><head><title>test</title>');
	docprint.document.write('<link rel="stylesheet" type="text/css" href="styles/styles.css" media="screen" /></head><body onLoad="javascript:self.print(); self.close();">');
	docprint.document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td style="padding:10px;">'+content_value+'</td></tr></table>');
	docprint.document.write('</body></html>');
	docprint.document.close(); 
 	docprint.focus();
}
*//***********************************SlideShow*************************/
function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 2500 );
});
/**************************************collapse*****************************/
$(document).ready(function(){
$("#slideMail").hide();
$("a#mailBtn").click(function () {
  if ($("#slideMail").is(":hidden")) {
	$("#slideMail").slideDown("slow");
  } else {
	$("#slideMail").slideUp();
  }
});
$("#closeMail").click(function(){
	$("#slideMail").slideUp();							   
})
});


/* -------- Print -------- */
function print_function()
{     
                var disp_setting="toolbar=no,location=no,directories=no,menubar=no,";
                disp_setting+="scrollbars=yes,width=670, height=400, left=0, top=0";
                var content_value = document.getElementById("printarea").innerHTML;
				var subtitle_value = document.getElementById("sub-titles").innerHTML;
                var title_value = document.getElementById("big-title").innerHTML;
                var docprint=window.open("","",disp_setting);
                docprint.document.open();
                docprint.document.write('<html><head><title>Zahar-kids</title>');
                docprint.document.write('<link rel="stylesheet" type="text/css" href="css/styles.css" /></head><body onLoad="javascript:self.print(); self.close();">');
                docprint.document.write('<table width="695" border="0" cellspacing="0" cellpadding="0"><tr><td><div class="subtitle-div bottom"><img src="images/logo.gif" /></div><div class="subtitle-div bottom sub-titles">'+title_value+' > '+subtitle_value+'</div><div class="content">'+content_value+'</div><br><br><div class="subtitle-div bottom"></div></td></tr></table>');
                docprint.document.write('</body></html>');
                docprint.document.close(); 
                docprint.focus();
}
/*******************************************************/

