/* 
Rotate Window by Alan Snedff
License: Linkware
*/
var RotateWindow = {dane:[ ],fotos:[ ],animacja:5000, idsetTimeout:null,	
	Rotation:function(id, act_anim) {
		
		var d = document.getElementById('w_show');
		
		for(var i = 0; i < this.dane.length; i++)
			d.getElementsByTagName('div')[i + 2].className = 'off_' + (i + 1);
		
		d.getElementsByTagName('div')[id + 2].className = 'on_' + (id + 1);
		d.getElementsByTagName('img')[0].src = this.fotos[id].src;
		
		d.getElementsByTagName('a')[0].href = this.dane[id][1];
		d.getElementsByTagName('a')[0].target = this.dane[id][2];
		
		if(this.dane[id][0] != null) {
			d.getElementsByTagName('h1')[0].style.display = 'block';
			d.getElementsByTagName('h1')[0].innerHTML = this.dane[id][0];
			
			d.getElementsByTagName('span')[0].style.height = '117px';
		} else {
				d.getElementsByTagName('h1')[0].style.display = 'none';
				d.getElementsByTagName('h1')[0].innerHTML = '';
				
				d.getElementsByTagName('span')[0].style.height = '151px';
			}
		
		switch(act_anim) {
			
			case false:
				clearTimeout(this.idsetTimeout);
				break;
			
			case true:
				this.idsetTimeout = setTimeout('RotateWindow.Rotation(' + ((id == this.dane.length - 1) ? 0 : id + 1) + ', true)', this.animacja);
				break;
			
		}//switch(act_anim) {
		
	},//Rotation:function(id, act_anim) {
	
	
	Show:function( ) {
		
		//styles window
		document.write('<link type="text/css" href="' + arguments[0] + '" rel="stylesheet" charset="utf-8" />');
		
		for(var i = 1; i < (arguments.length <= 15 ? arguments.length : 15); i++)
			if(arguments[i] === undefined) break;
				else this.dane.push(arguments[i]);
		
		try {
			
			for(var i = 0; i < this.dane.length; i++) {
				this.fotos[i] = new Image( );
				this.fotos[i].src = this.dane[i][3];
			}//for(var i = 0; i < this.dane.length; i++) {
			
			document.write('<div id="w_show" class="w_show">');
				document.write('<a href="javascript:void(0);" target="_self"><span></span><h1></h1></a>');
				document.write('<div style="width:225px; height:174px;">');
					document.write('<img width="225" height="174" vspace="0" hspace="0" border="0" />');
					document.write('<div class="przyciski" style="display:none;">');
					
						for(var i = 0; i < this.dane.length; i++)
							document.write('<div style="display:none;" onmouseover="RotateWindow.Rotation(' + i + ', false);" onmouseout="RotateWindow.Rotation(' + i + ', true);" class="off_' + (i + 1) + '">' + (i + 1) + '</div>');
						
					document.write('</div>');
				document.write('</div>');
			document.write( '</div>' );
			
			RotateWindow.Rotation(0, true);
		} catch(error) { document.write('=> <b>Błąd inicjacji "Okna Zobacz"!</b>'); }
		
	}//Show:function( ) {
	
}//var RotateWindow = {

/*****************************************************************************************************************************************/
