
// ================================================
// kabuki javascript
// (c) 2008 Zettich
// ================================================

function submitVote(id) {
	var vote = document.getElementById("vote_"+id).value;
	myNavigate('/konkurs.php?action=vote&item='+id+'&vote='+vote, 'mainblock', '/child-menu.php?parent=6');
} 

function myNavigate(url, element, url_left) {
	document.body.style.cursor='wait';
		
    if (window.XMLHttpRequest) {
        try {
            req = new XMLHttpRequest();
        } catch (e){
        	document.body.style.cursor='default';
        	alert("Unable to load AJAX Extensions! Check security settings!");
        }
    } else if (window.ActiveXObject) {
        try {
            req = new ActiveXObject('Msxml2.XMLHTTP');
        } catch (e){
        	document.body.style.cursor='default';
        }
        try {
            req = new ActiveXObject('Microsoft.XMLHTTP');
        } catch (e){
        	document.body.style.cursor='default';
        	alert("Unable to load AJAX Extensions! Check security settings, or upgrade your browser!");
        }
    } else {
    	alert("Can't find any AJAX-extensions!");
    	document.body.style.cursor='default';
    }
    
		var x = 1;
    
		req.onreadystatechange = function() {
			try {
				if (req.status == 200) {
					document.body.style.cursor='default';
					document.getElementById(element).innerHTML = req.responseText;

					if(url_left != "") {
						myNavigate(url_left, "leftblock", "");
					}
						    									
					try {
						var barservice = 0;
						var fass = 0;
						
							var p = $$('.fadein');
							p.each(function(el){
							el.effect('opacity',{ duration:2500, wait:false, transition:Fx.Transitions.Back.easeOut }).start(0,1);
							})
							
							
						var p = new avScroll({container:'innerScroller', imgWidth:158, scrollRange:24, leftHandle:'leftClicker',rightHandle:'rightScroller', rw:'leftFF', ff:'rightFF', speed:700});						
					} catch (e) {
					
					}
					
					try {
						object[0] = new Slide(0, "f_frames");
					} catch (e) {
						
					}
					
					try {
						TypingText.all = new Array();
						new TypingText(document.getElementById("firstnews"));
						new TypingText(document.getElementById("firstnews2"));
						TypingText.runAll();
					} catch(e) {
						
					}
				}
			}
			catch( e ) {
				document.body.style.cursor='default';
			}
		}
		
		req.open("GET", url, true);
		req.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
		
		req.send(null);
}

//specify interval between slide (in mili seconds)
var slidespeed=3000


var slideimages=new Array("slide/9.jpg","slide/10.jpg","slide/11.jpg","slide/12.jpg","slide/13.jpg","slide/14.jpg","slide/15.jpg","slide/16.jpg","slide/17.jpg","slide/18.jpg","slide/19.jpg")
var slidelinks=new Array("","","","","","","","","","","")

//specify images
// var slideimages=new Array("slide/ab.jpg","slide/custo.jpg","slide/lagerfeld.jpg","slide/parasuco.jpg","slide/scervino.jpg", "slide/joseph.jpg")

//specify corresponding links
// var slidelinks=new Array("http://www.kabuki.by","http://kabuki.by","http://kabuki.by")

var newwindow=1 //open links in new window? 1=yes, 0=no

var imageholder=new Array()
var ie=document.all
for (i=0;i<slideimages.length;i++){
imageholder[i]=new Image()
imageholder[i].src=slideimages[i]
}

function gotoshow(){
if (newwindow)
window.open(slidelinks[whichlink])
else
window.location=slidelinks[whichlink]
}

// ================================================
// script: Gerard Ferrandez - Ge-1-doot - MAY 2005
// http://www.dhteumeuleu.com
// ================================================
var object = new Array();

function Slide(N,oCont){
	this.N  = N;
	this.S  = 1.1;
	this.object = new Array();

	this.CObj = function (parent,N){

		this.parent = parent;
		this.N = N;
		this.obj = parent.frm[N];
		this.tit = this.obj.firstChild;
		this.div = this.obj.getElementsByTagName("div")[1];
		this.div.style.visibility = "hidden";
		this.y0 = N * 18;
		this.Y1 = this.y0;
		this.obj.style.top = this.y0;
		this.obj.style.height = parent.H - (parent.NF-1) * 18 - 3;
		this.obj.style.visibility = "visible";
		this.obj.parent = this;
		this.run = false;

		this.move = function(){
			with(this){
				dy = (y1-y0)/parent.S;
				if(Math.abs(dy)>.1){
					y0+=dy;
					obj.style.top = Math.round(y0);
					setTimeout("object["+parent.N+"].object["+N+"].move();", 16);
				} else {
					run = false;
					if(dy>0)div.style.visibility="hidden";
					else if(N>0)parent.object[N-1].div.style.visibility="hidden";
				}
			}
		}

		this.obj.onmouseover = function(){
			with(this.parent){
				if(!run){
					run = true;
					div.style.visibility="visible";
					for(i=0;i<parent.NF;i++)parent.object[i].tit.className = "title";
					tit.className = "title_o";
					for(i=0;i<=N;i++){
						parent.object[i].y1 = i*18;
						parent.object[i].move();
					}
					for(i=N+1;i<parent.NF;i++){
						parent.object[i].y1 = parent.H-(parent.NF-i)*18;
						parent.object[i].move();
					}
				}
			}
		}
	}
	
	try {
		this.frm = document.getElementById(oCont);
		this.H = parseInt(this.frm.style.height);
		this.frm = this.frm.getElementsByTagName("span");
		this.NF = this.frm.length;
		for(i=0;i<this.NF;i++) this.object[i] = new this.CObj(this, i);
		this.object[0].obj.onmouseover();
		this.S = 10;
	} catch (e) {
	
	}
}

onload = function() {
	object[0] = new Slide(0, "f_frames");
}

function showNewsArchive() {
	myNavigate('/news.php', 'mainblock', '/newsblock.php');
}

function showFashionArchive() {
	myNavigate('/fashion-news.php', 'mainblock', '/newsblock.php');
}

