// JavaScript Document
var tbselect = 1
var sm1 = false
var sm2 = false
var sm3 = false
var sm4 = false
bselect = 1;
tr = true
function submen(sn,sv, sa){
	obj1 = document.getElementById(sn);
	a1 = Number(sv);
	a2 = (a1*23)+(a1*3)+0;
	a3 = obj1.style.height;
	a4 = a3.slice(0,a3.indexOf('p',0));
	a5 = Number(a4);
		
	if (sa == 'open') {
	Tween1 = new Tween(obj1.style,'height',Tween.elasticEaseOut, a5, a2, 0.8,'px');
	obj1.style.display='block';
	} else {
	Tween1 = new Tween(obj1.style,'height',Tween.strongEaseOut, a5, 1, 0.8,'px');
	}
	Tween1.start();
	Tween1.onMotionFinished = function() {
		if (sa == 'close') {
			obj1.style.display='none';
		} 
	}
	

}
function tabb(a) {
	speed = 0.7
	if (tr == true){
		if (tbselect != a){
			tr = false
			obj2 = document.getElementById('tb'+tbselect);
			obj4 = document.getElementById('tt'+tbselect);
			obj4.className = 'tbn';
			obj5 = document.getElementById('tt'+a);
			obj5.className = 'tbd';
			a1 = obj2.filters.alpha.opacity;
			Tween2 = new OpacityTween(obj2,Tween.strongEaseInOut, a1, 0, speed);
			Tween2.start();
			
			Tween2.onMotionFinished = function() {
				tbselect = a;
				obj2.style.display = 'none';
				obj3 = document.getElementById('tb'+a);
				obj3.style.display = 'block'
				a2 = obj3.filters.alpha.opacity;
				Tween3 = new OpacityTween(obj3,Tween.strongEaseInOut, a2, 100, speed);
				Tween3.start();
				obj5.className = 'tbd';
				obj4.className = 'tbn';
				Tween3.onMotionFinished = function() {
					tr = true
					obj5.className = 'tbd';
					obj4.className = 'tbn';
				}
			}
		}
	}
}
var imgn = 1
var imgtotal = 5
function searchbt(a){
	speed = 0.3
	obj1 = document.getElementById('search-bt');
	a1 = obj1.filters.alpha.opacity;
	if (a == 1) {
		
		Tween4 = new OpacityTween(obj1,Tween.strongEaseInOut, a1, 40, speed);
		Tween4.start();
	}else{
		Tween4 = new OpacityTween(obj1,Tween.strongEaseInOut, a1, 0, speed);
		Tween4.start();
	
	}
}
function imgrstart() {
	for (var i = 1; i <= imgtotal; i++){
		obja1 = document.getElementById('imgr'+i)
		obj1 = document.getElementById('imgr')
		if (obja1 != null) {
		obja1.style.filter = "alpha(opacity=0)";
		obja1.style.zIndex = i
		obja1.style.width = 210
		obja1.style.height = 140
		obja1.style.position = "absolute"
		obja1.style.posTop = obj1.style.posTop//-(10*(i-1))
		obja1.style.posLeft = obj1.style.posLeft
		}
		
		
	}
	if (document.getElementById('imgr1') != null) {
	document.getElementById('imgr1').style.filter = "alpha(opacity=100)";
	imgt();
	}
}
function imgt() {
	obj1 = document.getElementById('imgr1')
	Tween1 = new Tween(obj1,'t',Tween.strongEaseIn, 0, 15, 10,'');
	Tween1.start()
	
	Tween1.onMotionFinished = function () {
		imgn += 1
		if (imgn > imgtotal) {
			imgn = 1;
		}
		obj2 = document.getElementById('imgr'+imgn)
		if (obj2 != null) {
		obj2.style.filter = "alpha(opacity=0)";
		}
		imgr(imgn);
		
	}
}
var w = 1
function imgr(a) {
	a1= a2 = 0;
	obj1 = document.getElementById('imgr'+a)
	if (obj1 != null) {
	w += 1
	obj1.style.filter = "alpha(opacity=0)";
	obj1.style.zIndex = w
	
	Tween1 = new Tween(obj1,'a1',Tween.regularEaseOut, 0, 190, 2,'');
	Tween1.start()
	Tween11 = new Tween(obj1,'a22',Tween.regularEaseOut, 0, 100, 1,'');
	Tween11.start()
	
	Tween1.onMotionChanged = function () {
			document.getElementById('imgr'+a).style.filter="alpha(opacity="+(obj1.a22)+", finishopacity=0, style=1, startx=0, starty="+(obj1.a1-50)+", finishx=0, finishy="+(obj1.a1)+")"
			
			
	}
	Tween1.onMotionFinished = function () {
		imgt()
	}
	}
}
function searchw () {
	
	if (document.getElementById("memet_search").value == "memet.imgr.hide") {
		for (var i = 1; i <= imgtotal; i++){
			obja1 = document.getElementById('imgr'+i);
			alert(document.getElementById('imgr1'))
			if (obja1 != null) {
				obja1.style.display = 'none';
			}
		}
	
	} else if (document.getElementById("memet_search").value == "memet.imgr.show"){
		for (var i = 1; i <= imgtotal; i++){
			obja1 = document.getElementById('imgr'+i)
			if (obja1 != null) {
				obja1.style.display = 'block'
			}
		}
	}
}// JavaScript Document