/*



	This script is a part of DocReactor [+http://www.docreactor.com]
	DocReactor is developed by Orcapia [+http://www.orcapia.com]
	DocReactor is copyright 2006-2010 of ORCAPIA Per Bang. Extensions are copyright of their respective owners.




*/
var osmslides = new Array();var osmslidectl = new Array();osmslidectl['z'] = 10001;osmslidectl['globalpause'] = 0;function orcapia_changeopac(opacity, id) {var object = $(id).style;if (object.opacity != 'undefined') object.opacity = (opacity / 100);object.MozOpacity = (opacity / 100);object.KhtmlOpacity = (opacity / 100);object.filter = 'alpha(opacity=' + opacity + ')';};function osmslidesInit(id) {$(id).style.backgroundImage = 'none';$(id).style.background = 'transparent';osmslidectl[id]['top'] = $(id).offsetTop;osmslidectl[id]['left'] = $(id).offsetLeft;osmslidectl[id]['slide'] = osmadjrange(id,osmslidectl[id]['offset']);if (osmslidectl[id]['p'] == 'on' || osmslidectl[id]['p'] == 'loop') osmslidectl[id]['play'] = 1;else osmslidectl[id]['play'] = 0;$(osmslides[id][osmslidectl[id]['slide']][0]).style.visibility = 'visible';osmslidectl[id]['smethod'] = 1;if ($('status' + id)) {$('status' + id).value = (osmslidectl[id]['slide']+1) + ' / ' + osmslides[id].length;osmslidectl[id]['cnt'] = osmslides[id][0][1]*1000;osmcount(id);} osmslidectl[id]['otop'] = $('o' + osmslides[id][osmslidectl[id]['slide']][0]).offsetTop;osmslidectl[id]['oleft'] = $('o' + osmslides[id][osmslidectl[id]['slide']][0]).offsetLeft;osmslidectl[id]['tu'] = window.setTimeout('osmslidenew(\''+ id +'\',' + osmslidectl[id]['slide'] + ')',osmslides[id][0][1]*1000);};function osmcount(id) {if ($('cnt' + id)) {if (osmslidectl[id]['cnt'] > 100) {osmslidectl[id]['cnt']-= 100;var cntv = osmslidectl[id]['cnt'] + 0;var mins = Math.floor(cntv/60000);var sec = Math.floor((cntv-(mins*60000))/1000);if (sec < 10) sec = '0' + sec;var value = mins + ':' + sec;} else {var value = '0:00';};$('cnt' + id).value = value;setTimeout('osmcount(\''+ id +'\')',100);}};function osmslidenew(id,slide) {if (osmslidectl[id]['pause'] != 1 && osmslidectl['globalpause'] != 1) {if (osmslidectl[id]['play'] == 1) {if ($('play' + id)) $('play' + id).disabled = true;if ($('as' + id)) {if ($('as' + id).checked == false) {if ($('stop' + id)) $('stop' + id).disabled = false;}} else {if ($('stop' + id)) $('stop' + id).disabled = false;};osmslidectl[id]['slide']++; if (osmslidectl[id]['slide'] == (osmslides[id].length-1) && osmslidectl[id]['p'] != 'loop') osmslidectl[id]['play'] = 0;if (osmslidectl[id]['slide'] >= osmslides[id].length) osmslidectl[id]['slide'] = 0; osmslidectl['z']++; if (osmslidectl[id]['mcyc']) {osmslides[id][osmslidectl[id]['slide']]['2'] = osmslidectl[id]['mcyc'][osmslidectl[id]['mpos']];osmslidectl[id]['mpos']++;if (osmslidectl[id]['mpos'] >= osmslidectl[id]['mcyc'].length) osmslidectl[id]['mpos'] = 0;} osmslidectl[id]['smethod'] = osmslides[id][osmslidectl[id]['slide']]['2'];if (osmslidectl[id]['smethod'] == 0) osmslidectl[id]['smethod'] = Math.floor(Math.random()*16)+1;if (osmslidectl[id]['smethod'] == -2) osmslidectl[id]['smethod'] = Math.floor(Math.random()*8)+9;if (osmslidectl[id]['smethod'] == -3) osmslidectl[id]['smethod'] = Math.floor(Math.random()*8)+1; osmslidectl[id]['sfadi'] = osmslides[id][osmslidectl[id]['slide']]['3']; if (osmslidectl[id]['smethod'] == -1 && osmslidectl[id]['sfadi'] == 0 && osmslides[id][osmslidectl[id]['slide']]['1'] == 0) osmslides[id][osmslidectl[id]['slide']]['1'] = 1; osmslidectl[id]['spush'] = osmslides[id][osmslidectl[id]['slide']]['4'];$(osmslides[id][osmslidectl[id]['slide']][0]).style.visibility = 'visible';orcapia_changeopac(0, osmslides[id][osmslidectl[id]['slide']][0]);$('o'+osmslides[id][osmslidectl[id]['slide']][0]).style.zIndex = osmslidectl['z'];osmslidectl[id]['opac'] = 0;osmslidectl[id]['mv'] = 0;if ($('status' + id)) $('status' + id).value = (osmslidectl[id]['slide']+1) + ' / ' + osmslides[id].length; if ($(id+'indic')) $(id+'indic').innerHTML = osmslidectl[id]['btns'];osmslidectl[id]['tu'] = window.osmslidemoveit(id,osmslidectl[id]['slide']);} else {if ($('play' + id)) $('play' + id).disabled = false;}} else {if ($('status' + id)) $('status' + id).value = osmslidectl[id]['pt'];if ($(id+'indic')) $(id+'indic').innerHTML = osmslidectl[id]['pt'];osmslidectl[id]['tu'] = window.setTimeout('osmslidenew(\''+ id +'\',' + slide + ')',100);} };function osmstop(id) { clearTimeout(osmslidectl[id]['tu']); if ($('play' + id)) $('play' + id).disabled = false; osmslidectl[id]['cnt'] = 0; osmslidectl[id]['play'] = 0; if ($('stop' + id)) $('stop' + id).disabled = true;};function osmplay(id) {if (osmslidectl[id]['play'] == 0) {if ($('as' + id)) $('as' + id).checked = false;osmslidectl[id]['play'] = 1 ;osmslidenew(id,osmslidectl[id]['slide']);};};function osmff(id) {if ($('as' + id)) $('as' + id).checked = true; osmslidectl[id]['cnt'] = 0;osmslidectl[id]['play'] = 1;$('rew' + id).disabled = true;$('ff' + id).disabled = true;clearTimeout(osmslidectl[id]['tu']);osmslidenew(id,osmslidectl[id]['slide']);};function osmindijmp(id,jump) {for ( var i in osm_segment[ osmslidectl[id]['segment'] ] ){var topid = osm_segment[ osmslidectl[id]['segment'] ][i];osmslidectl[topid]['play'] = 0;} for ( var i in osm_segment[ osmslidectl[id]['segment'] ] ){var topid = osm_segment[ osmslidectl[id]['segment'] ][i];if (osmslidectl[topid]['slide'] == osmadjrange(topid,jump+osmslidectl[topid]['offset']+1) || osmslidectl[topid]['opac'] < 100) return false;};for ( var i in osm_segment[ osmslidectl[id]['segment'] ] ){var topid = osm_segment[ osmslidectl[id]['segment'] ][i];if ($(topid+'indic')) $(topid+'indic').innerHTML = osmslidectl[topid]['btnp'];osmstop(topid);if ($('as' + topid)) $('as' + topid).checked = true;clearTimeout(osmslidectl[topid]['tu']);osmslidectl[topid]['play'] = 1;osmslidectl[topid]['slide'] = osmadjrange(topid,jump+osmslidectl[topid]['offset']);osmslidenew(topid,osmslidectl[id]['slide']);osmslidectl[topid]['play'] = 0;if ($(topid+'indic')) $(topid+'indic').innerHTML = osmslidectl[topid]['btnp'];}};function osmslidesegmentnew(id,jump) {for ( var i in osm_segment[ osmslidectl[id]['segment'] ] ){var topid = osm_segment[ osmslidectl[id]['segment'] ][i];if (osmslidectl[topid]['slide'] == osmadjrange(topid,jump+osmslidectl[topid]['offset']+1) || osmslidectl[topid]['opac'] < 100) return false;};for ( var i in osm_segment[ osmslidectl[id]['segment'] ] ){var topid = osm_segment[ osmslidectl[id]['segment'] ][i];clearTimeout(osmslidectl[topid]['tu']);osmslidenew(topid,osmslidectl[id]['slide']);}};function osmadjrange(id,pos) {while(pos >= osmslides[id].length) {pos -= osmslides[id].length;};return pos;};function osmindictl(id) {for ( var i in osm_segment[ osmslidectl[id]['segment'] ] ){var id = osm_segment[ osmslidectl[id]['segment'] ][i];clearTimeout(osmslidectl[id]['tu']);if (osmslidectl[id]['play'] == 1) {if ($(id+'indic')) $(id+'indic').innerHTML = osmslidectl[id]['btnp'];osmslidectl[id]['play'] = 0;osmslidectl[id]['opac'] = 100;osmstop(id);} else if (osmslidectl[id]['opac'] == 100) { if ($(id+'indic')) $(id+'indic').innerHTML = osmslidectl[id]['btns'];osmslidectl[id]['play'] = 1; osmslidenew(id,osmslidectl[id]['slide']);}};};function osmrew(id) {if (osmslidectl[id]['slide'] >= 1) { osmslidectl[id]['cnt'] = 0;if ($('as' + id)) $('as' + id).checked = true;if ($('rew' + id)) $('rew' + id).disabled = true;if ($('ff' + id)) $('ff' + id).disabled = true;osmslidectl[id]['play'] = 1;clearTimeout(osmslidectl[id]['tu']);osmslidectl[id]['slide'] -= 2;osmslidenew(id,osmslidectl[id]['slide']);}};function osmfindpos(obj) {var curleft = curtop = 0;if (obj.offsetParent) {curleft = obj.offsetLeft;curtop = obj.offsetTop;while(1) {curtop += obj.offsetTop;curleft += obj.offsetLeft;if(!obj.offsetParent) break;obj = obj.offsetParent;}};return [curleft,curtop];};function osmslidemoveit(id,slide) {var lastslide = slide - 1;lastslide=osmslidectl[id]['push']-1; for (t = 0; t < osmslides[id].length; t++) {if ($(id+'indi'+t)) {if (osmslidectl[id]['slide'] == t) $(id+'indi'+t).className = 'slideindiact';else $(id+'indi'+t).className = 'slideindiinact';}};if (osmslidectl[id]['play'] == 1) osmslidectl[id]['mv'] += osmslidectl[id]['s']/osmslidectl[id]['tt'];else osmslidectl[id]['mv'] += osmslidectl[id]['s']/350;if (osmslidectl[id]['a'] == 'none') osmslidectl[id]['opac'] = osmslidectl[id]['mv']*100; else if (osmslidectl[id]['a'] == 'd') osmslidectl[id]['opac'] = Math.pow(Math.sin(osmslidectl[id]['mv']*(Math.PI / 2)),1/2)*100; else if (osmslidectl[id]['a'] == 'a') osmslidectl[id]['opac'] = Math.pow(1-Math.cos(osmslidectl[id]['mv']*(Math.PI / 2)),2)*100; else osmslidectl[id]['opac'] = (1-(1+Math.sin(osmslidectl[id]['mv']*Math.PI+(Math.PI/2)))/2)*100; osmslidectl[id]['opac']=Math.ceil(osmslidectl[id]['opac']);if (osmslidectl[id]['opac'] > 100) osmslidectl[id]['opac'] = 100;if ((osmslidectl[id]['opac']) < 100 && osmslidectl[id]['opac'] >= 0) { if (osmslidectl[id]['smethod'] == 2 || osmslidectl[id]['smethod'] == 6 || osmslidectl[id]['smethod'] == 8) { $(osmslides[id][osmslidectl[id]['slide']][0]).style.left = Math.floor(osmslidectl[id]['w']-(osmslidectl[id]['w']*osmslidectl[id]['opac']/100)) + 'px';if (osmslidectl[id]['spush'] == 1) $(osmslides[id][lastslide][0]).style.left = Math.floor(0-(osmslidectl[id]['w']*osmslidectl[id]['opac']/100)) + 'px';} else if (osmslidectl[id]['smethod'] == 1 || osmslidectl[id]['smethod'] == 5 || osmslidectl[id]['smethod'] == 7) { $(osmslides[id][osmslidectl[id]['slide']][0]).style.left = Math.floor(-osmslidectl[id]['w']+(osmslidectl[id]['w']*osmslidectl[id]['opac']/100)) + 'px';if (osmslidectl[id]['spush'] == 1) $(osmslides[id][lastslide][0]).style.left = Math.floor(osmslidectl[id]['w']*osmslidectl[id]['opac']/100) + 'px';} else if (osmslidectl[id]['smethod'] == 9 || osmslidectl[id]['smethod'] == 13 || osmslidectl[id]['smethod'] == 15) { $('o' + osmslides[id][osmslidectl[id]['slide']][0]).style.width = Math.floor(osmslidectl[id]['w']*osmslidectl[id]['opac']/100) + 'px';$(osmslides[id][osmslidectl[id]['slide']][0]).style.left = '0px';if (osmslidectl[id]['spush'] == 1) $(osmslides[id][lastslide][0]).style.left = Math.floor(osmslidectl[id]['w']*osmslidectl[id]['opac']/100) + 'px';} else if (osmslidectl[id]['smethod'] == 10 || osmslidectl[id]['smethod'] == 14 || osmslidectl[id]['smethod'] == 16) { var leftoffset = osmslidectl[id]['oleft']; $('o' + osmslides[id][osmslidectl[id]['slide']][0]).style.width = Math.ceil(osmslidectl[id]['w']*osmslidectl[id]['opac']/100) + 'px';$('o' + osmslides[id][osmslidectl[id]['slide']][0]).style.left = Math.ceil(leftoffset + osmslidectl[id]['w'] - (osmslidectl[id]['w']*osmslidectl[id]['opac']/100)) + 'px';$(osmslides[id][osmslidectl[id]['slide']][0]).style.left = Math.floor(- osmslidectl[id]['w'] + (osmslidectl[id]['w']*osmslidectl[id]['opac']/100)) + 'px';if (osmslidectl[id]['spush'] == 1) $(osmslides[id][lastslide][0]).style.left = Math.ceil(-(osmslidectl[id]['w']*osmslidectl[id]['opac']/100)) + 'px';} else {$(osmslides[id][osmslidectl[id]['slide']][0]).style.left = '0px'; };if (osmslidectl[id]['smethod'] == 3 || osmslidectl[id]['smethod'] == 5 || osmslidectl[id]['smethod'] == 6) { $(osmslides[id][osmslidectl[id]['slide']][0]).style.top = Math.floor(-osmslidectl[id]['h']+(osmslidectl[id]['h']*osmslidectl[id]['opac']/100)) + 'px';if (osmslidectl[id]['spush'] == 1) $(osmslides[id][lastslide][0]).style.top = Math.floor(osmslidectl[id]['h']*osmslidectl[id]['opac']/100) + 'px';} else if (osmslidectl[id]['smethod'] == 4 || osmslidectl[id]['smethod'] == 7 || osmslidectl[id]['smethod'] == 8) { $(osmslides[id][osmslidectl[id]['slide']][0]).style.top = Math.floor(osmslidectl[id]['h']-(osmslidectl[id]['h']*osmslidectl[id]['opac']/100)) + 'px';if (osmslidectl[id]['spush'] == 1) $(osmslides[id][lastslide][0]).style.top = Math.floor(-(osmslidectl[id]['h']*osmslidectl[id]['opac']/100)) + 'px';} else if (osmslidectl[id]['smethod'] == 11 || osmslidectl[id]['smethod'] == 13 || osmslidectl[id]['smethod'] == 14) { $(osmslides[id][osmslidectl[id]['slide']][0]).style.top = '0px';$('o' + osmslides[id][osmslidectl[id]['slide']][0]).style.height = Math.floor(osmslidectl[id]['h']*osmslidectl[id]['opac']/100) + 'px';if (osmslidectl[id]['spush'] == 1) $(osmslides[id][lastslide][0]).style.top = Math.floor(osmslidectl[id]['h']*osmslidectl[id]['opac']/100) + 'px';} else if (osmslidectl[id]['smethod'] == 12 || osmslidectl[id]['smethod'] == 15 || osmslidectl[id]['smethod'] == 16) { var leftoffset = osmslidectl[id]['otop'];$(osmslides[id][osmslidectl[id]['slide']][0]).style.top = Math.floor(-osmslidectl[id]['h'] + (osmslidectl[id]['h']*osmslidectl[id]['opac']/100)) + 'px';$('o' + osmslides[id][osmslidectl[id]['slide']][0]).style.top = Math.ceil(leftoffset + osmslidectl[id]['h'] - (osmslidectl[id]['h']*osmslidectl[id]['opac']/100)) + 'px';$('o' + osmslides[id][osmslidectl[id]['slide']][0]).style.height = Math.ceil(osmslidectl[id]['h']*osmslidectl[id]['opac']/100) + 'px';if (osmslidectl[id]['spush'] == 1) $(osmslides[id][lastslide][0]).style.top = Math.ceil(-(osmslidectl[id]['h']*osmslidectl[id]['opac']/100)) + 'px';} else {$(osmslides[id][osmslidectl[id]['slide']][0]).style.top = '0px';};if (osmslidectl[id]['sfadi'] == 1) orcapia_changeopac(osmslidectl[id]['opac'], osmslides[id][osmslidectl[id]['slide']][0]);else orcapia_changeopac(100, osmslides[id][osmslidectl[id]['slide']][0]);setTimeout('osmslidemoveit(\''+ id +'\',' + slide + ')',osmslidectl[id]['s']);} else {if ($('ff' + id)) {if (slide+1 < osmslides[id].length) $('ff' + id).disabled = false;else $('ff' + id).disabled = true;};if ($('rew' + id)) {if (slide >= 1) $('rew' + id).disabled = false;else $('rew' + id).disabled = true;};$('o' + osmslides[id][osmslidectl[id]['slide']][0]).style.width = osmslidectl[id]['w'] + 'px';$(osmslides[id][osmslidectl[id]['slide']][0]).style.width = osmslidectl[id]['w'] + 'px';$('o' + osmslides[id][osmslidectl[id]['slide']][0]).style.height = osmslidectl[id]['h'] + 'px';$(osmslides[id][osmslidectl[id]['slide']][0]).style.height = osmslidectl[id]['h'] + 'px';$('o' + osmslides[id][osmslidectl[id]['slide']][0]).style.left = $(id).style.left;$(osmslides[id][osmslidectl[id]['slide']][0]).style.left = $(id).style.left;$('o' + osmslides[id][osmslidectl[id]['slide']][0]).style.top = $(id).style.top;$(osmslides[id][osmslidectl[id]['slide']][0]).style.top = $(id).style.top;osmslidectl[id]['push'] = osmslidectl[id]['slide']+1;orcapia_changeopac(100, osmslides[id][osmslidectl[id]['slide']][0]);$(osmslides[id][lastslide][0]).style.visibility = 'hidden'; if ($('as' + id)) {if ($('as' + id).checked == true) {osmslidectl[id]['play'] = 0;if ($('play' + id)) $('play' + id).disabled = false;if ($('stop' + id)) $('stop' + id).disabled = true;} else {if ($('play' + id) && osmslidectl[id]['play'] == 0) $('play' + id).disabled = false;osmslidectl[id]['cnt'] = osmslides[id][osmslidectl[id]['slide']]['1']*1000;osmslidectl[id]['tu'] = window.setTimeout('osmslidesegmentnew(\''+ id +'\',' + slide + ')',osmslides[id][osmslidectl[id]['slide']]['1']*1000+45);} } else if ($('as' + id) || osmslidectl[id]['ctlson'] == 0) {osmslidectl[id]['cnt'] = osmslides[id][osmslidectl[id]['slide']]['1']*1000;osmslidectl[id]['tu'] = window.setTimeout('osmslidesegmentnew(\''+ id +'\',' + slide + ')',osmslides[id][osmslidectl[id]['slide']]['1']*1000+45);}};}