FadeTime=8000;FadeTime2=2000; chiliMouseX=0; chiliMouseY=0; function getMousePosition (Ereignis) { if (!Ereignis) Ereignis = window.event; chiliMouseX = Ereignis.clientX; chiliMouseY = Ereignis.clientY; } document.onmousemove = getMousePosition; var resize = false; var boxIndex = new Array(); var boxPosition = new Array(); var MouseX=0; var MouseY=0; var MB=new Array(); function stopBox(id) { window.clearInterval(MB[id]); document.getElementById(id+'Play').style.display='block'; document.getElementById(id+'Pause').style.display='none'; } function startBox(id) { MB[id] = setInterval('moveBoxRight2015(\''+id+'\')',FadeTime); document.getElementById(id+'Play').style.display='none'; document.getElementById(id+'Pause').style.display='block '; } function chckMouseMove(start,id) { end=chiliMouseX; if(start != end) { if((start-end)<0) { moveBoxLeft2015(id); stopBox(id); } else { moveBoxRight2015(id); stopBox(id); } clearInterval(abcdefg); } } abcdefg=''; function testfunc(id) { start=chiliMouseX; end=chiliMouseX; abcdefg= setInterval("chckMouseMove("+start+",'"+id+"')",50); } function testfunc2() { clearInterval(abcdefg); } var Tstart = ''; var Tend = ''; function testfunc3(event,id) { Tstart=event.touches[0].pageX; } touchE = true; function testfunc4(event,id) { Tend = event.touches[0].pageX; if(touchE==true) { if((Tend-Tstart)<-1) { moveBoxRight2015(id); stopBox(id); } if((Tend-Tstart) > 1) { moveBoxLeft2015(id); stopBox(id); } touchE=false; setTimeout('clearTouchE()',500); } } function clearTouchE() { touchE=true; } function moveBoxLeft2015(Bid) { element = document.getElementById(Bid); elements = element.getElementsByClassName('aw_BoxContentNavActive'); if( elements.length > 0 ) { elements[0].className='aw_BoxContentNavLink'; } curBox=element.getElementsByClassName('awBoxContent boxSelected')[0]; elements=element.getElementsByClassName('awBoxContent'); for( i = 0 ; i < elements.length ; i++ ) { elements[i].className = 'awBoxContent'; } if( curBox.previousSibling.className == 'awBoxContent' ) { curBox.previousSibling.className = 'awBoxContent boxSelected'; if(curBox.previousSibling.previousSibling.className == 'awBoxContent') { curBox.previousSibling.previousSibling.className = 'awBoxContent previousBox'; } else { elements[(elements.length)-1].className = 'awBoxContent previousBox'; } } else { elements[(elements.length)-1].className = 'awBoxContent boxSelected'; elements[(elements.length)-2].className = 'awBoxContent previousBox'; } curBox.className = 'awBoxContent nextBox'; document.getElementById(element.getElementsByClassName('awBoxContent boxSelected')[0].id+'Nav').className='aw_BoxContentNavActive'; } function moveBoxRight2015(Bid) { element = document.getElementById(Bid); elements = element.getElementsByClassName('aw_BoxContentNavActive'); if( elements.length > 0 ) { elements[0].className = 'aw_BoxContentNavLink'; } curBox = element.getElementsByClassName('awBoxContent boxSelected')[0]; elements = element.getElementsByClassName('awBoxContent'); for(i=0;i< elements.length;i++) { elements[i].className='awBoxContent'; } if(curBox.nextSibling.className=='awBoxContent') { curBox.nextSibling.className='awBoxContent boxSelected'; if(curBox.nextSibling.nextSibling.className=='awBoxContent') { curBox.nextSibling.nextSibling.className='awBoxContent nextBox'; } else { elements[0].className='awBoxContent nextBox'; } } else { elements[0].className='awBoxContent boxSelected'; elements[1].className='awBoxContent nextBox'; } curBox.className = 'awBoxContent previousBox'; document.getElementById(element.getElementsByClassName('awBoxContent boxSelected')[0].id+'Nav').className = 'aw_BoxContentNavActive'; } function resetBox(Bid,Element,nav) { element = document.getElementById(Bid); elements = element.getElementsByClassName('aw_BoxContentNavActive'); curBox = document.getElementById(Element); elements = element.getElementsByClassName('awBoxContent'); if(elements.length>0) { elements[0].className = 'aw_BoxContentNavLink'; } for(i=0;i< elements.length;i++) { elements[i].className='awBoxContent'; } curBox.className='awBoxContent boxSelected'; if(curBox.nextSibling.tagName=='DIV') { curBox.nextSibling.className='awBoxContent nextBox'; } else { elements[0].className='awBoxContent nextBox'; } if(curBox.previousSibling.tagName=='DIV') { curBox.previousSibling.className='awBoxContent previousBox'; } else { elements[elements.length-1].className='awBoxContent previousBox'; } document.getElementById(element.getElementsByClassName('awBoxContent boxSelected')[0].id+'Nav').className='aw_BoxContentNavActive'; return false; } function createBox () { Bid = ''; i = 0; boxID = 0; while( document.getElementsByTagName('div')[i] ) { if(document.getElementsByTagName('div')[i].className.match('awContentBox')) { var boxContents = new Array(); var klasse = 'aw_BoxContentNavActive'; var varClassName = 'awBoxContent boxSelected'; LINKS = ''; c = 0; box = document.getElementsByTagName('div')[i]; var arrows = box.innerHTML.search(//); var navigation = box.innerHTML.search(//); var play = box.innerHTML.search(//); var fade = box.innerHTML.search(//); var slow = box.parentNode.innerHTML.search(//); Bid = 'ContentBox'+i; box.id = Bid; OL = document.createAttribute("onmousedown"); OL.nodeValue = "testfunc('"+Bid+"')"; box.setAttributeNode(OL); OL = document.createAttribute("onmouseup"); OL.nodeValue = "testfunc2()"; box.setAttributeNode(OL); OL = document.createAttribute("ontouchstart"); OL.nodeValue = "testfunc3(event,'"+Bid+"')"; box.setAttributeNode(OL); OL = document.createAttribute("ontouchmove"); OL.nodeValue = "testfunc4(event,'"+Bid+"')"; box.setAttributeNode(OL); OL = ''; box.style.cursor = "pointer"; w = box.offsetWidth; h = box.style.height; h = h.replace('px',''); h = parseInt(h); for( b = 0 ; box.getElementsByTagName('div')[b] ; b++ ) { if(box.getElementsByTagName('div')[b].className=='awBoxContent') { box.getElementsByTagName('div')[b].id=Bid+'elm'+c; box.getElementsByTagName('div')[b].className=varClassName; boxContents.push(box.getElementsByTagName('div')[b].id); box.getElementsByTagName('div')[b].style.position='absolute'; box.getElementsByTagName('div')[b].style.top='0px'; LINKS+='
'+box.getElementsByTagName('div')[b].title+''+(c+1)+'
'; klasse='aw_BoxContentNavLink'; varClassName='awBoxContent'; if(c==-1) { varClassName = 'awBoxContent boxSelected'; } if(c==0) { varClassName='awBoxContent nextBox'; } if(c==(box.getElementsByClassName('awBoxContent').length-2)) { varClassName='awBoxContent previousBox'; } c++; } } if (arrows == -1) { box.innerHTML+='
'; } boxIndex[i]= boxContents; if (navigation == -1) { box.innerHTML+='
'+LINKS+'
'; } else { box.innerHTML+=''; } if( play == -1 ) { } else { if (slow == -1) { if (fade == -1) { MB[Bid] = setInterval('moveBoxRight2015(\''+Bid+'\')',FadeTime); } else { boxPosition[i] = 0; MB[Bid] = setInterval('FadeBox(\''+Bid+'\','+i+')',FadeTime); } } else { MB[Bid] = setInterval('moveBoxRight2015(\''+Bid+'\')',(FadeTime*4)); } } box.innerHTML += ''; box.innerHTML += '
'; items= document.getElementById(Bid).getElementsByClassName('aw_BoxContentNav')[0].getElementsByTagName('div'); navigationBox=document.getElementById(Bid).getElementsByClassName('aw_BoxContentNav')[0]; navigationBox.style.width=document.getElementById(Bid).getElementsByClassName('aw_BoxContentNav')[0].getElementsByTagName('div')[0].offsetWidth * (items.length + 2) + 'px'; } boxID++; i++; } } function setNavigationPosition(elm) { navigation=elm.parentNode; diffWidth=navigation.offsetWidth-navigation.parentNode.offsetWidth; items=navigation.getElementsByTagName('div'); for(i=0;i < items.length;i++) { if(items[i]===elm) { itemNumber=i; navigation.style.left='-'+diffWidth*(1/items.length*itemNumber)+'px'; } } } /* function FadeBox(boxId,dex) { boxPosition[dex]=boxPosition[dex]+1; if(boxPosition[dex]>(boxIndex[dex].length-1)) { boxPosition[dex]=0; } moveBoxTo(boxId,boxIndex[dex][boxPosition[dex]]); } */ R = null; function resizeBox () { resize = true; clearTimeout(R); R = setTimeout('resizeBox2()',20); } function resizeBox2 () { sortElements=new Array(); i=0; while(document.getElementsByTagName('div')[i]) { if(document.getElementsByTagName('div')[i].className.match('awContentBox')){ c=0; box=document.getElementsByTagName('div')[i]; w=box.offsetWidth; h=box.style.height; h=h.replace('px',''); h=parseInt(h); sortElements[box.id]=new Array; for(b=0;box.getElementsByTagName('div')[b];b++){ if(box.getElementsByTagName('div')[b].className=='awBoxContent'){ sortElements[box.id][box.getElementsByTagName('div')[b].style.left]=box.getElementsByTagName('div')[b].id; //alert(box.getElementsByTagName('div')[b].style.left); c++; } } //alert(c*w); } i++; } c2=c; i=0; while(document.getElementsByTagName('div')[i]){ if(document.getElementsByTagName('div')[i].className.match('awContentBox')){ c=0; box=document.getElementsByTagName('div')[i]; w=box.offsetWidth; h=box.style.height; h=h.replace('px',''); h=parseInt(h); ELM=0; resortElements=new Array; EC=0; while(ELM<(w*c2)){ if(sortElements[box.id][ELM+'px']){ resortElements[EC]=sortElements[box.id][ELM+'px']; EC++; } ELM++; } for(b=0;b