/*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()", 5000 );
});
/*slideshow*/

/*image preload*/
var images = new Array()
function preload() {
	for (i = 0; i < preload.arguments.length; i++) {
		images[i] = new Image()
		images[i].src = preload.arguments[i]
	}
}
preload(
	"http://dawanproductions.com/images/amin_a.png",
	"http://dawanproductions.com/images/bg.jpg",
	"http://dawanproductions.com/images/latest_a.png",
	"http://dawanproductions.com/images/latest_v.png",
	"http://dawanproductions.com/images/logo.jpg",
	"http://dawanproductions.com/images/menu-bg.gif",
	"http://dawanproductions.com/images/icon-fac.png",
	"http://dawanproductions.com/images/icon-fli.png",
	"http://dawanproductions.com/images/icon-lin.png",
	"http://dawanproductions.com/images/icon-twi.png",
	"http://dawanproductions.com/images/current-bg.gif"	
)
/*image preload*/


/*pop up*/
function popup(mylink, windowname)
{
	if (! window.focus)return true;
		var href;
		if (typeof(mylink) == 'string')
   			href=mylink;
		else
   			href=mylink.href;
		window.open(href, windowname, 'width=370,height=100,scrollbars=no,left=300,top=300,screenX=0,screenY=100');
	return false;
}
/*pop up*/

