// JavaScript Document
$(document).ready(function (){
	$('#button a').click(function(){
		var integer = $(this).attr('rel');
		$('#myslide .cover').animate({left:-222*(parseInt(integer)-1)})  /*----- Width of div mystuff (here 160) ------ */
		$('#button a').each(function(){
		$(this).removeClass('active');
			if($(this).hasClass('button'+integer)){
				$(this).addClass('active')}
		});
	});	
	$('#img a').click(function(){
		var integer = $(this).attr('rel');
		$('#myslide .cover').animate({left:-222*(parseInt(integer)-1)})  /*----- Width of div mystuff (here 160) ------ */
		$('#img a').each(function(){
		$(this).removeClass('active-none');
			if($(this).hasClass('img'+integer)){
				$(this).addClass('active-none')}
		});
	});
});

//For iPad
$(document).ready(function (){
	$('#button a').click(function(){
		var integer = $(this).attr('rel');
		$('#myslide-iPad .cover').animate({left:-420*(parseInt(integer)-1)})  /*----- Width of div mystuff (here 160) ------ */
		$('#button a').each(function(){
		$(this).removeClass('active');
			if($(this).hasClass('button'+integer)){
				$(this).addClass('active')}
		});
	});	
	$('#img a').click(function(){
		var integer = $(this).attr('rel');
		$('#myslide-iPad .cover').animate({left:-420*(parseInt(integer)-1)})  /*----- Width of div mystuff (here 160) ------ */
		$('#img a').each(function(){
		$(this).removeClass('active-none');
			if($(this).hasClass('img'+integer)){
				$(this).addClass('active-none')}
		});
	});
});

//For wp7
$(document).ready(function (){
	$('#button a').click(function(){
		var integer = $(this).attr('rel');
		$('#myslide-wp7 .cover').animate({left:-235*(parseInt(integer)-1)})  /*----- Width of div mystuff (here 235) ------ */
		$('#button a').each(function(){
		$(this).removeClass('active');
			if($(this).hasClass('button'+integer)){
				$(this).addClass('active')}
		});
	});	
	$('#img a').click(function(){
		var integer = $(this).attr('rel');
		$('#myslide-wp7 .cover').animate({left:-235*(parseInt(integer)-1)})  /*----- Width of div mystuff (here 235) ------ */
		$('#img a').each(function(){
		$(this).removeClass('active-none');
			if($(this).hasClass('img'+integer)){
				$(this).addClass('active-none')}
		});
	});
});

//For andriod
$(document).ready(function (){
	$('#button a').click(function(){
		var integer = $(this).attr('rel');
		$('#myslide-android .cover').animate({left:-234*(parseInt(integer)-1)})  /*----- Width of div mystuff (here 235) ------ */
		$('#button a').each(function(){
		$(this).removeClass('active');
			if($(this).hasClass('button'+integer)){
				$(this).addClass('active')}
		});
	});	
	$('#img a').click(function(){
		var integer = $(this).attr('rel');
		$('#myslide-android .cover').animate({left:-234*(parseInt(integer)-1)})  /*----- Width of div mystuff (here 235) ------ */
		$('#img a').each(function(){
		$(this).removeClass('active-none');
			if($(this).hasClass('img'+integer)){
				$(this).addClass('active-none')}
		});
	});
});



function enact(what){
     var p = what.parentNode;
     var els = p.getElementsByTagName('li');
	 for(i=0;i<els.length;i++){
          els[i].className = '';
     }
     what.className = 'active' ;//active-none
}

function enactThumbnails(what){
     var p = what.parentNode;
     var els = p.getElementsByTagName('li');
	 for(i=0;i<els.length;i++){
          els[i].className = '';
     }
     what.className = 'active active-none' ;//active-none
}

function blinker(){
	//debugger;
	 var p = document.getElementById('button');
     var els = p.getElementsByTagName('li');
	 for(i=0;i<els.length;i++){
	      switch(els[i].className)
    	 {
	     case "active":
		     els[i].className = "active ";
    		 break;
		 case "active ":
		     els[i].className = "active-blink";
    		 break;
	     case "active-blink":
		     els[i].className = "active";
    		 break;
		 }
	 }
}
var idd = setInterval('blinker()',600);


