//** Tab Content script v2.0- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
/*tabcontent.js*/
function ddtabcontent(tabinterfaceid){
	this.tabinterfaceid=tabinterfaceid 
	this.tabs=document.getElementById(tabinterfaceid).getElementsByTagName("a") 
	this.enabletabpersistence=true
	this.hottabspositions=[] 
	this.subcontentids=[] 
	this.revcontentids=[] 
	this.selectedClassTarget="link" 
}

ddtabcontent.getCookie=function(Name){ 
	var re=new RegExp(Name+"=[^;]+", "i"); 
	if (document.cookie.match(re)) 
		return document.cookie.match(re)[0].split("=")[1] 
	return ""
}

ddtabcontent.setCookie=function(name, value){
	document.cookie = name+"="+value+";path=/" 
}

ddtabcontent.prototype={

	expandit:function(tabid_or_position){ //PUBLIC function to select a tab either by its ID or position(int) within its peers
		this.cancelautorun() 
		var tabref=""
		try{
			if (typeof tabid_or_position=="string" && document.getElementById(tabid_or_position).getAttribute("rel")) //if specified tab contains "rel" attr
				tabref=document.getElementById(tabid_or_position)
			else if (parseInt(tabid_or_position)!=NaN && this.tabs[tabid_or_position].getAttribute("rel")) //if specified tab contains "rel" attr
				tabref=this.tabs[tabid_or_position]
		}
		catch(err){alert("Invalid Tab ID or position entered!")}
		if (tabref!="")
			this.expandtab(tabref) 
	},

	setpersist:function(bool){
			this.enabletabpersistence=bool
	},

	setfade:function(bool){ 
			this.enablefade=bool
	},
	setselectedClassTarget:function(objstr){ //PUBLIC function to set which target element to assign "selected" CSS class ("linkparent" or "link")
		this.selectedClassTarget=objstr || "link"
	},

	getselectedClassTarget:function(tabref){ 
		return (this.selectedClassTarget==("linkparent".toLowerCase()))? tabref.parentNode : tabref
	},

	expandtab:function(tabref){
		var subcontentid=tabref.getAttribute("rel") 
		
		var associatedrevids=(tabref.getAttribute("rev"))? ","+tabref.getAttribute("rev").replace(/\s+/, "")+"," : ""
		this.expandsubcontent(subcontentid)
		this.expandrevcontent(associatedrevids)
		for (var i=0; i<this.tabs.length; i++){ //Loop through all tabs, and assign only the selected tab the CSS class "selected"


			this.getselectedClassTarget(this.tabs[i]).className=(this.tabs[i].getAttribute("rel")==subcontentid)? "selected" : ""
		}
		if (this.enabletabpersistence) //if persistence enabled, save selected tab position(int) relative to its peers
			ddtabcontent.setCookie(this.tabinterfaceid, tabref.tabposition)
	},

	expandsubcontent:function(subcontentid){
		for (var i=0; i<this.subcontentids.length; i++){

			var subcontent=document.getElementById(this.subcontentids[i]) //cache current subcontent obj (in for loop)	

			subcontent.style.display=(subcontent.id==subcontentid)? "block" : "none" //"show" or hide sub content based on matching id attr value

			if(this.enablefade){
			fadeFx = new Fx.Style(this.subcontentids[i], 'opacity', {
				duration: 1000, 
				transition: Fx.Transitions.Quart.easeInOut
			});

			fadeFx.start(0.2,1); 

			}
		}
	},


	expandrevcontent:function(associatedrevids){
		var allrevids=this.revcontentids
		for (var i=0; i<allrevids.length; i++){ //Loop through rev attributes for all tabs in this tab interface
			//if any values stored within associatedrevids matches one within allrevids, expand that DIV, otherwise, contract it

			document.getElementById(allrevids[i]).style.display=(associatedrevids.indexOf(","+allrevids[i]+",")!=-1)? "block" : "none"

		}
	},

	autorun:function(){ //function to auto cycle through and select tabs based on a set interval
		var currentTabIndex=this.automode_currentTabIndex //index within this.hottabspositions to begin
		var hottabspositions=this.hottabspositions //Array containing position numbers of "hot" tabs (those with a "rel" attr)
		this.expandtab(this.tabs[hottabspositions[currentTabIndex]])
		this.automode_currentTabIndex=(currentTabIndex<hottabspositions.length-1)? currentTabIndex+1 : 0 //increment currentTabIndex
	},

	cancelautorun:function(){
		if (typeof this.autoruntimer!="undefined")
			clearInterval(this.autoruntimer)
	},

	init:function(automodeperiod){
		var persistedtab=ddtabcontent.getCookie(this.tabinterfaceid) //get position of persisted tab (applicable if persistence is enabled)
		var persisterror=true //Bool variable to check whether persisted tab position is valid (can become invalid if user has modified tab structure)
		this.automodeperiod=automodeperiod || 0
		for (var i=0; i<this.tabs.length; i++){



			this.tabs[i].tabposition=i //remember position of tab relative to its peers
			if (this.tabs[i].getAttribute("rel")){
				var tabinstance=this
				this.hottabspositions[this.hottabspositions.length]=i //store position of "hot" tab ("rel" attr defined) relative to its peers
				this.subcontentids[this.subcontentids.length]=this.tabs[i].getAttribute("rel") //store id of sub content ("rel" attr value)
				this.tabs[i].onclick=function(){
					tabinstance.expandtab(this)
					tabinstance.cancelautorun() //stop auto cycling of tabs (if running)
					return false
				}
				if (this.tabs[i].getAttribute("rev")){ //if "rev" attr defined, store each value within "rev" as an array element
					this.revcontentids=this.revcontentids.concat(this.tabs[i].getAttribute("rev").split(/\s*,\s*/))
				}
				if (this.enabletabpersistence && parseInt(persistedtab)==i || !this.enabletabpersistence && this.getselectedClassTarget(this.tabs[i]).className=="selected"){
					this.expandtab(this.tabs[i]) //expand current tab if it's the persisted tab, or if persist=off, carries the "selected" CSS class
					persisterror=false //Persisted tab (if applicable) was found, so set "persisterror" to false
					//If currently selected tab's index(i) is greater than 0, this means its not the 1st tab, so set the tab to begin in automode to 1st tab:
					this.automode_currentTabIndex=(i>0)? 0 : 1
				}
			}
		} //END for loop
		if (persisterror) //if an error has occured while trying to retrieve persisted tab (based on its position within its peers)
			this.expandtab(this.tabs[this.hottabspositions[0]]) //Just select first tab that contains a "rel" attr
		if (parseInt(this.automodeperiod)>500 && this.hottabspositions.length>1){
			this.automode_currentTabIndex=this.automode_currentTabIndex || 0
			this.autoruntimer=setInterval(function(){tabinstance.autorun()}, this.automodeperiod)
		}
	} 

} 

// sliding-tabs.js DEPAN the Sliding Tabs mootools plugin is a creation of Jenna â€œBlueberryâ€ Fox!

var SlidingTabs = new Class({
	options: {
		startingSide: false, // sets the slide to start on, either an element or an id 
		activeButtonClass: 'active', // class to add to selected button
		activationEvent: 'click', // you can set this to â€˜mouseoverâ€™ or whatever you like
		wrap: false, // calls to previous() and next() should wrap around?
		slideEffect: { // options for effect used to animate the sliding, see Fx.Base in mootools docs
			duration: 400 // half a second
		}
	},
	current: null, 
	buttons: false,
	outerSlidesBox: null,
	innerSlidesBox: null,
	panes: null,
	fx: null,
	
	
	initialize: function(buttonContainer, slideContainer, options) {
		if (buttonContainer) { this.buttons = $(buttonContainer).getChildren(); }
		this.outerSlidesBox = $(slideContainer);
		this.innerSlidesBox = this.outerSlidesBox.getFirst();
		this.panes = this.innerSlidesBox.getChildren();
		
		this.setOptions(options);
		
		this.fx = new Fx.Scroll(this.outerSlidesBox, this.options.slideEffect);
		
		this.current = this.options.startingSlide ? this.panes.indexOf($(this.options.startingSlide)) : 0;
		if (this.buttons) { this.buttons[this.current].addClass(this.options.activeButtonClass); }
		
		this.outerSlidesBox.setStyle('overflow', 'hidden');
		this.panes.each(function(pane, index) {
			pane.setStyles({
			 'float': 'left',
			 'width': this.outerSlidesBox.getStyle('width'),
			 'overflow': 'hidden'
		  });
		}.bind(this));
		
		this.innerSlidesBox.setStyle('float', 'left');
		
		this.innerSlidesBox.setStyle(
			'width', (this.outerSlidesBox.offsetWidth.toInt() * this.panes.length) + 'px'
		);
		
		if (this.options.startingSlide) this.fx.toElement(this.options.startingSlide);
		
		if (this.buttons) this.buttons.each( function(button) {
		  button.addEvent(this.options.activationEvent, this.buttonEventHandler.bindWithEvent(this, button));
		}.bind(this));
	},
	
	
	changeTo: function(element) {
		var event = { cancel: false, target: $(element) };
		this.fireEvent('change', event);
		if (event.cancel == true) { return; };
		
		if (this.buttons) { this.buttons[this.current].removeClass(this.options.activeButtonClass); };
		this.current = this.panes.indexOf($(event.target));
		if (this.buttons) { this.buttons[this.current].addClass(this.options.activeButtonClass); };
		this.fx.stop();
		this.fx.toElement(event.target);
	},
	
	buttonEventHandler: function(event, button) {
		if (event.target == this.buttons[this.current]) return;
		this.changeTo(this.panes[this.buttons.indexOf($(button))]);
	},
	
	next: function() {
		var next = this.current + 1;
		if (next == this.panes.length) {
			if (this.options.wrap == true) { next = 0 } else { return }
		}
		
		this.changeTo(this.panes[next]);
	},
	
	previous: function() {
		var prev = this.current - 1
		if (prev < 0) {
			if (this.options.wrap == true) { prev = this.panes.length - 1 } else { return }
		}
		
		this.changeTo(this.panes[prev]);
	}
});

SlidingTabs.implement(new Options, new Events);

//--- icarousel.js DEPAN ---
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p;}('q Z=C z({5:{7:{i:"1x",D:"18",s:1,r:13.12.1I.14,u:1K,l:{i:"1J",R:1X,1z:"G"}},j:{W:"j",p:1T},P:"1Y",S:"1H",T:"21",1d:z.H,1b:z.H,1F:z.H,1t:z.H,1A:z.H},1L:8(1i,1k){4.1N(1k);4.m=$(1i);4.9=$A($$("."+4.5.j.W));4.x=U;d(4.5.P!="10"&&$(4.5.P)){$(4.5.P).17("11",8(1o){C 1a(1o).G();4.1B();4.J("1d",4,20)}.h(4))}d(4.5.S!="10"&&$(4.5.S)){$(4.5.S).17("11",8(1g){C 1a(1g).G();4.15();4.J("1b",4,20)}.h(4))}d(4.5.T!="10"&&$(4.5.T)){$(4.5.T).17("11",8(1e){C 1a(1e).G();4.1r()}.h(4))}q w=4.5.7;K(4.5.7.i.N()){t"L":4.9.Y(8(E){E.e=E.19("B",{u:w.u,r:w.r});E.O("B",0);E.1l({"1n":8(){4.x=1m;d(4.5.7.l.i=="I"){4.v=$1h(4.v)}}.h(4),"1c":8(){4.x=U;d(4.5.7.l.i=="I"){4.v=4.V.X(4.5.7.l.R,4)}}.h(4)})}.h(4));4.y=4.m.1p("y").1q();4.6=0;4.o(4.6);k;M:(2).1R(8(){4.9.Y(8(1f){1f.1V().1U(4.m)}.h(4))}.h(4));4.9=$A($$("."+4.5.j.W));4.9.Y(8(1j){1j.1l({"1n":8(){4.x=1m;d(4.5.7.l.i=="I"){4.v=$1h(4.v)}}.h(4),"1c":8(){4.x=U;d(4.5.7.l.i=="I"){4.v=4.V.X(4.5.7.l.R,4)}}.h(4)})}.h(4));4.e=4.m.1S({u:w.u,r:w.r,1Z:U});4.6=4.9.g/3;4.m.O(w.D,-4.6*4.5.j.p);k}d(4.5.7.l.i=="I"){4.v=4.V.X(4.5.7.l.R,4)}},1P:8(n){K(4.5.7.i.N()){t"L":q 1D=4.6;4.6=1E.1C(n%(4.9.g/3));4.o(4.6,1D);k;M:4.6=1E.1C(n%(4.9.g/3));4.6+=4.9.g/3;4.o(4.6);k}4.J("1A",4,20)},1B:8(){K(4.5.7.i.N()){t"L":q 1G=4.6;4.6-=4.5.7.s;d(4.6<0){4.6=(4.9.g-1)}4.o(4.6,1G);k;M:4.6-=4.5.7.s;d(4.6<4.9.g/3){4.m.O(4.5.7.D,-4.5.j.p*4.9.g*2/3);4.6=4.9.g*2/3-4.5.7.s}4.o(4.6);k}4.J("1F",4,20)},15:8(){K(4.5.7.i.N()){t"L":q 1s=4.6;4.6+=4.5.7.s;d(4.6>=4.9.g){4.6=0}4.o(4.6,1s);k;M:4.6+=4.5.7.s;d(4.6>4.9.g*2/3){4.m.O(4.5.7.D,-4.5.j.p*4.9.g/3);4.6=4.9.g/3+4.5.7.s}4.o(4.6);k}4.J("1t",4,20)},1r:8(){(4.m.1p("y").1q()==0)?4.m.19("y",{u:1u,r:13.12.1y.14}).f(4.y):4.m.19("y",{u:1u,r:13.12.1y.14}).f(0)},V:8(){d(4.5.7.l.1z=="G"&&!4.x){4.15()}},o:8(a,b){K(4.5.7.i){t"L":d($1W(b)){4.9[b].e.f(0).F(8(){4.9[a].e.f(1)}.h(4))}16{4.9[a].e.f(1)}k;t"1Q":q c=4;d(c.5.7.D=="Q"){c.e.f({"Q":-a*c.5.j.p})}16{c.e.f({"18":-a*c.5.j.p})}k;t"1x":q c=4;d(c.5.7.D=="Q"){c.e.f({"B":0.1v}).F(8(){c.e.f({"Q":-a*c.5.j.p}).F(8(){c.e.f({"B":1})})})}16{c.e.f({"B":0.1v}).F(8(){c.e.f({"18":-a*c.5.j.p}).F(8(){c.e.f({"B":1})})})}k}}});Z.1w(C 1O);Z.1w(C 1M);',62,126,'||||this|options|atScreen|animation|function|aItems|||_10|if|fx|start|length|bind|type|item|break|rotate|container||_animate|size|var|transition|amount|case|duration|timer|_6|isMouseOver|height|Class||opacity|new|direction|_7|chain|stop|empty|auto|fireEvent|switch|fade|default|toLowerCase|setStyle|idPrevious|top|interval|idNext|idToggle|false|_autoRotate|klass|periodical|each|iCarousel|undefined|click|Transitions|Fx|easeInOut|_next|else|addEvent|left|effect|Event|onClickNext|mouseleave|onClickPrevious|_5|_8|_4|clear|_1|_9|_2|addEvents|true|mouseenter|_3|getStyle|toInt|_toggle|_d|onNext|1000|75|implement|fadeNscroll|Sine|onMouseOver|onGoTo|_previous|abs|_b|Math|onPrevious|_c|next|Cubic|manual|500|initialize|Options|setOptions|Events|goTo|scroll|times|effects|100|injectInside|clone|defined|5000|previous|wait||toggle'.split('|'),0,{}))

//------- tooltip.js DEPAN -------
var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip

var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
document.write('<img id="dhtmlpointer" src="http://www.kompas.com/data/images/tiparrow.gif">') //write out pointer image

var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

var pointerobj=document.all? document.all["dhtmlpointer"] : document.getElementById? document.getElementById("dhtmlpointer") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thewidth, thecolor){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth){
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
else if (curX<leftedge)
tipobj.style.left="5px"
else{
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip