/*************************************************************************/
/*                                                                 		 */
/*    JAVASCRIPT DOCUMENT DEVELOPED BY IVAN ALEKSIC				   		 */
/*    IMPLEMENTEK INTERNET CONSULTING GROUP	- BELGRADE - SERBIA		     */
/*    IVAN@IMPLEMENTEK.COM - WWW.IMPLEMENTEK.COM					     */
/*                                                                 		 */
/*    Copyright Safe deposit departmant   */
/*    BELGRADE - SERBIA - EUROPE									     */
/*                                                             	  	     */
/*    Revision 1.0 - Decembar 05. 2008. - Marija					  	 */
/*                                                             	  	     */
/*************************************************************************/
var splashSwitchClasses = ['current', ''];
function sS(el) {
    var elm = document.getElementById(el);    
    for(var i=0; i<splashSwitchElements.length; i++) {
        var el2 = document.getElementById(splashSwitchElements[i]);
        el2.className = splashSwitchClasses[1];
	}
    elm.className = splashSwitchClasses[0];
    return false;
}



var ScrollWin = {
	w3c : document.getElementById,
	iex : document.all,
	scrollLoop : false, 
	scrollInterval : null,
	currentBlock : null,
	getWindowHeight : function(){
		if(this.iex) return (document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.clientHeight;
		else return window.innerHeight;
	},
	getScrollLeft : function(){
		if(this.iex) return (document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
		else return window.pageXOffset;
	},
	getScrollTop : function(){
		if(this.iex) return (document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
		else return window.pageYOffset;
	},
	getElementYpos : function(el){
		var y = 0;
		while(el.offsetParent){
			y += el.offsetTop
			el = el.offsetParent;
		}
		return y;
	},
	scroll : function(name){
		if(!this.w3c){
			location.href = "#"+name;
			return;
		}
		if(this.scrollLoop){
			clearInterval(this.scrollInterval);
			this.scrollLoop = false;
			this.scrollInterval = null;
		}
		if(this.currentBlock != null) this.currentBlock.className = this.offClassName;
		this.currentBlock = document.getElementById(name);
		this.currentBlock.className = this.onClassName;
		var doc = document.getElementById(this.containerName);
		var documentHeight = this.getElementYpos(doc) + doc.offsetHeight;
		var windowHeight = this.getWindowHeight();
		var ypos = this.getElementYpos(this.currentBlock);
		if(ypos > documentHeight - windowHeight) ypos = documentHeight - windowHeight;
		this.scrollTo(0,ypos);
	},
	scrollTo : function(x,y){
		if(this.scrollLoop){
			var left = this.getScrollLeft();
			var top = this.getScrollTop();
			if(Math.abs(left-x) <= 1 && Math.abs(top-y) <= 1){
				window.scrollTo(x,y);
				clearInterval(this.scrollInterval);
				this.scrollLoop = false;
				this.scrollInterval = null;
			}else{
				window.scrollTo(left+(x-left)/2, top+(y-top)/2);
			}
		}else{
			this.scrollInterval = setInterval("ScrollWin.scrollTo("+x+","+y+")",50);
			this.scrollLoop = true;
		}
	}
};
ScrollWin.anchorName = "test";
ScrollWin.blockName = "test";

	
	
