function init()
{
	P7_Uberlink('active','topnavigatie');
	openMainMenu('active','topnavigatie', '');
}
function removeLine(id) 
{
	var obj = document.getElementById('div_rma_notification_product_'+id);
	if (obj)
	{
		obj.style.display = 'none';	
	}
}

function P7_Uberlink(cl,d){
	var i,ob,tA,h=document.location.href;
	if(document.getElementById){
	ob=(d)?document.getElementById(d):document;
	if(ob){
	tA=ob.getElementsByTagName('A');
	for(i=0;i<tA.length;i++){
	if(tA[i].href==h){
	tA[i].className=cl;
}}}}}

function openMainMenu(cl,d, url){
	var i,ob,tA,h=document.location.href;
	if(document.getElementById){
	ob=(d)?document.getElementById(d):document;
	if (url == ''){
		var splitter = h.split('/');
		var new_link = 'http:/';
		for(i=2;i<5;i++){
			new_link += '/'+splitter[i]	
		}
		new_link = new_link+'.php';
	}
	else
	{
		new_link = url;
	}
	if(ob){
	tA=ob.getElementsByTagName('A');
	for(i=0;i<tA.length;i++){
	if(tA[i].href==new_link){
	tA[i].className=cl;
}}}}}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var p7AB=false;
var p7ABi=false;
function P7_setAB(){
	if(!document.getElementById){
		return;
	}
	var h,tA=navigator.userAgent.toLowerCase();
	if(window.opera){
		if(tA.indexOf("opera 5")>-1 || tA.indexOf("opera 6")>-1){
			return;
		}
	}
	h=String.fromCharCode(60,115,116,121,108,101,32,116,121,112,101,61,34,116,101,120,116,47,99,115,115,34,62,46,112,55,65,66,99,111,110,116,101,110,116,123,100,105,115,112,108,97,121,58,110,111,110,101,59,125,60,47,115,116,121,108,101,62);
	h+='\n'+String.fromCharCode(60,33,45,45,91,105,102,32,108,116,101,32,73,69,32,55,93,62,60,115,116,121,108,101,62,46,112,55,65,66,44,46,112,55,65,66,32,100,105,118,123,122,111,111,109,58,49,48,48,37,59,125,60,47,115,116,121,108,101,62,60,33,91,101,110,100,105,102,93,45,45,62);
	h+='\n'+String.fromCharCode(60,33,45,45,91,105,102,32,108,116,101,32,73,69,32,54,93,62,60,115,116,121,108,101,62,46,112,55,65,66,44,46,112,55,65,66,99,111,110,116,101,110,116,44,46,112,55,65,66,116,114,105,103,32,97,123,104,101,105,103,104,116,58,49,37,59,125,60,47,115,116,121,108,101,62,60,33,91,101,110,100,105,102,93,45,45,62);
	document.write(h);
}

P7_setAB();
function P7_opAB(){
	var x,c,tC,ab,tB;
	if(document.getElementById){
		ab='p7ABW'+arguments[0];
		tB=document.getElementById(ab);
		tB.p7Aba=arguments;
		x=arguments[3];
		if(x>0&&x<11){
			c='p7ABc'+arguments[0]+'_'+x;
			tC=document.getElementById(c);
			if(tC){
				tC.style.display='block';
			}
		}
		if(!p7ABi){
			p7ABi=true;
			if(window.addEventListener){
				window.addEventListener("load",P7_initAB,false);
			}
			else if(document.addEventListener){
				document.addEventListener("load",P7_initAB,false);
			}
			else if(window.attachEvent){
				window.attachEvent("onload",P7_initAB);
			}
			else if(typeof window.onload=='function'){
				var p7loadit=onload;
				window.onload=function(){
					p7loadit();
					P7_initAB();
				};
			}
			else{
				window.onload=P7_initAB;
			}
		}
	}
}
function P7_initAB(){
	var i,j,ab,tB,tD,tA,op,ob,tg;
	if(!document.getElementById){
		return;
	}
	for(i=10;i>0;i--){
		ab='p7ABW'+i;
		tB=document.getElementById(ab);
		if(tB){
			tA=tB.getElementsByTagName("A");
			tg='p7ABt'+i;
			for(j=0;j<tA.length;j++){
				if(tA[j].id && tA[j].id.indexOf(tg)==0){
					tA[j].onclick=function(){
						return P7_ABtrig(this);
					};
					tA[j].p7ABstate=0;
					tA[j].p7ABpr=ab;
				}
			}
			ob=i+'_'+tB.p7Aba[3];
			P7_ABopen(ob);
		}
	}
	p7AB=true;
	P7_ABurl();
	P7_ABauto();
}
function P7_ABopen(s){
	var a,g,d='p7ABt'+s;
	a=document.getElementById(d);
	g=s.split("_");
	if(g&&g.length>1&&g[1]==99){
		a=P7_randAB(g[0]);
	}
	if(g&&g.length>1&&g[1]=='a'){
		P7_ABall(s);
	}
	else{
		if(a&&a.p7ABpr){
			if(a.p7ABstate==0){
				P7_ABtrig(a);
			}
		}
	}
}
function P7_ABclose(s){
	var a,d='p7ABt'+s;
	a=document.getElementById(d);
	if(a&&a.p7ABpr){
		if(a.p7ABstate==1){
			P7_ABtrig(a);
		}
	}
}
function P7_ABclick(s){
	var a,d='p7ABt'+s;
	a=document.getElementById(d);
	if(a&&a.p7ABpr){
		P7_ABtrig(a);
	}
}
function P7_randAB(r){
	var i,k,j=0,d,dd,tA,a,rD=new Array();
	dd='p7ABW'+r;
	d=document.getElementById(dd);
	if(d){
		tA=d.getElementsByTagName("A");
		for(i=0;i<tA.length;i++){
			if(tA[i].p7ABpr && tA[i].p7ABpr==dd){
				rD[j]=tA[i].id;
				j++;
			}
		}
		if(j>0){
			k=Math.floor(Math.random()*j);
			a=document.getElementById(rD[k]);
		}
	}
	return a;
}
function P7_ABall(s){
	var i,m,d,dd,st,et,tA,g=s.split("_");
	if(g&&g.length==2){
		st=parseInt(g[0]);
		if(st){
			et=st+1;
		}
		else{
			st=1;
			et=11;
		}
		m=p7AB;
		p7AB=false;
		for(i=st;i<et;i++){
			dd='p7ABW'+i;
			d=document.getElementById(dd);
			if(d){
				tA=d.getElementsByTagName("A");
				for(j=0;j<tA.length;j++){
					if(tA[j].p7ABpr && tA[j].p7ABpr==dd){
						if(g[1]=='a' && tA[j].p7ABstate==0){
							P7_ABtrig(tA[j]);
						}
						else if(g[1]=='c' && tA[j].p7ABstate==1){
							P7_ABtrig(tA[j]);
						}
					}
				}
			}
		}
		p7AB=m;
	}
}
function P7_ABurl(){
	var i,h,s,x,d='pab';
	if(document.getElementById){
		h=document.location.search;
		if(h){
			h=h.replace('?','');
			s=h.split(/[=&]/g);
			if(s&&s.length){
				for(i=0;i<s.length;i+=2){
					if(s[i]==d){
						x=s[i+1];
						if(x){
							P7_ABopen(x);
						}
					}
				}
			}
		}
		h=document.location.hash;
		if(h){
			x=h.substring(1,h.length);
			if(x && x.indexOf("pab")==0){
				P7_ABopen(x.substring(3));
			}
			if(x && x.indexOf("sales")==0){
				P7_ABopen('1_9999');
			}
		}
	}
}
function P7_ABtrig(a){
	var i,j=null,op,pD,ad,aT,m=true,cp='p7ABc'+a.p7ABpr.substring(a.p7ABpr.length-1);
	var iD=a.id.replace('t','c'),tD=document.getElementById(iD);
	if(tD){
		m=false;
		pD=document.getElementById(a.p7ABpr);
		op=pD.p7Aba;
		if(op[4]==1&&op[1]==1&&a.p7ABstate==1){
			return m;
		}
		tD=pD.getElementsByTagName("DIV");
		for(i=0;i<tD.length;i++){
			if( tD[i].id && tD[i].id.indexOf(cp)>-1 ){
				if(tD[i].id==iD){
					j=i;
					if( a.className=="p7ABtrig_down"){
						a.p7ABstate=0;
						a.className='';
						P7_ABhide(tD[j],op);
					}
					else{
						a.p7ABstate=1;
						a.className="p7ABtrig_down";
						P7_ABshow(tD[j],op);
					}
				}
				else{
					if(op[1]==1){
						ad=tD[i].id.replace('c','t');
						aT=document.getElementById(ad);
						aT.className='';
						aT.p7ABstate=0;
						P7_ABhide(tD[i],op);
					}
				}
			}
		}
	}
	P7_checkEQH();
	return m;
}
function P7_checkEQH(){
	if(typeof(P7_colH2)=='function'){
		P7_colH2();
	}
	if(typeof(P7_colH)=='function'){
		P7_colH();
	}
}
function P7_ABshow(d,op){
	var h,wd,wP,isIE5=(navigator.appVersion.indexOf("MSIE 5")>-1);
	if(p7AB&&op[2]==3){
		d.style.display='block';
		P7_ABfadeIn(d.id,0);
	}
	else if( (p7AB&&op[2]==1||p7AB&&op[2]==2) && !isIE5 ){
		wd=d.id.replace("c","w");
		wP=document.getElementById(wd);
		if(P7_hasOverflow(d)||P7_hasOverflow(wP)){
			d.style.display='block';
			return;
		}
		wP.style.overflow="hidden";
		wP.style.height="1px";
		d.style.display='block';
		h=d.offsetHeight;
		P7_ABglide(wd,1,h,op[2]);
	}
	else{
		d.style.display='block';
	}
}
function P7_ABhide(d,op){
	var h,wd,wP,isIE5=(navigator.appVersion.indexOf("MSIE 5")>-1);
	if((p7AB&&op[2]==1||p7AB&&op[2]==2)&&!isIE5){
		wd=d.id.replace("c","w");
		wP=document.getElementById(wd);
		if(d.style.display!="none"){
			if(P7_hasOverflow(d)||P7_hasOverflow(wP)){
				d.style.display='none';
				return;
			}
			h=wP.offsetHeight;
			wP.style.overflow="hidden";
			P7_ABglide(wd,h,0,op[2]);
		}
	}
	else{
		d.style.display='none';
	}
}
function P7_hasOverflow(ob){
	var s,m;
	s=ob.style.overflow;
	if(!s){
		if(ob.currentStyle){
			s=ob.currentStyle.overflow;
		}
		else if(document.defaultView.getComputedStyle(ob,"")){
			s=document.defaultView.getComputedStyle(ob,"").getPropertyValue("overflow");
		}
	}
	m=(s&&s=='auto')?true:false;
	return m;
}
function P7_ABfadeIn(id,op){
	var d=document.getElementById(id);
	op+=.05;
	op=(op>=1)?1:op;
	if((navigator.appVersion.indexOf("MSIE")>-1)){
		d.style.filter='alpha(opacity='+op*100+')';
	}
	else{
		d.style.opacity=op;
	}
	if(op<1){
		setTimeout("P7_ABfadeIn('"+id+"',"+op+")",40);
	}
}
function P7_ABglide(dd,ch,th,p){
	var w,m,d,wd,wC,tt,dy=10,inc=10,pc=.15;
	d=document.getElementById(dd);
	m=(ch<=th)?0:1;
	if(p==1){
		tt=Math.abs( parseInt( Math.abs(th)-Math.abs(ch) ) );
		inc=(tt*pc<1)?1:tt*pc;
	}
	inc=(m==1)?inc*-1:inc;
	d.style.height=ch+"px";
	if(ch==th){
		if(th==0){
			wd=d.id.replace("w","c");
			wC=document.getElementById(wd);
			wC.style.display="none";
			d.style.height="auto";
		}
		else{
			d.style.height="auto";
		}
		P7_checkEQH();
	}
	else{
		ch+=inc;
		if(m==0){
			ch=(ch>=th)?th:ch;
		}
		else{
			ch=(ch<=th)?th:ch;
		}
		if(d.p7abG){
			clearTimeout(d.p7abG);
		}
		d.p7abG=setTimeout("P7_ABglide('"+dd+"',"+ch+","+th+","+p+")",dy);
	}
}
function P7_ABauto(){
	var i,k,ab,tB,wH,tr,pp;
	wH=window.location.href;
	for(k=1;k<11;k++){
		tr=null;
		ab='p7ABW'+k;
		tB=document.getElementById(ab);
		if(tB&&tB.p7Aba[5]&&tB.p7Aba[5]==1){
			tA=tB.getElementsByTagName('A');
			if(tA){
				for(i=0;i<tA.length;i++){
					if(tA[i].href==wH){
						if(tA[i].p7ABpr){
							tr=tA[i].id.replace('p7ABt','');
							break;
						}
						else{
							tA[i].className="p7ap_currentmark";
							pp=tA[i].parentNode;
							while(pp){
								if(pp.id&&pp.id.indexOf('p7ABc')==0){
									tr=pp.id.replace('p7ABc','');
									break;
								}
								pp=pp.parentNode;
							}
							break;
						}
					}
				}
				if(tr){
					P7_ABopen(tr);
				}
				else{
					if(typeof(p7ABcm)!='undefined'&&p7ABcm.length){
						for(i=0;i<p7ABcm.length;i++){
							if(p7ABcm[i]&&p7ABcm[i].length>0){
								if(k==p7ABcm[i].charAt(0)){
									P7_ABopen(p7ABcm[i]);
								}
							}
						}
					}
				}
			}
		}
	}
}

function togglePurchasingTable() 
{	
	var value = '';
	var radios = document.getElementsByName('company_purchasing');
	
	for( i = 0; i < radios.length; i++ )
	{
		if( radios[i].checked == true)
		{
			value = radios[i].value;
		}
	}
	
	document.getElementById('company_purchasing_0').style.display = 'none';
	document.getElementById('company_purchasing_1').style.display = 'none';	
	
	if (value == 0 || value == 1)
	{
		document.getElementById('company_purchasing_'+value).style.display = 'block';
	}
}

function toggleComparisonTable() 
{	
	var value = '';
	var radios = document.getElementsByName('type');
	
	for( i = 0; i < radios.length; i++ )
	{
		if( radios[i].checked == true)
		{
			value = radios[i].value;
		}
	}
	
	document.getElementById('comparison_type_1').style.display = 'none';
	document.getElementById('comparison_type_2').style.display = 'none';	
	
	if (value == 1 || value == 2)
	{
		document.getElementById('comparison_type_'+value).style.display = 'block';
	}
}

function toggleHelpdeskTable() 
{	
	var value = '';
	var radios = document.getElementsByName('helpdesk_type');
	
	for( i = 0; i < radios.length; i++ )
	{
		if( radios[i].checked == true)
		{
			value = radios[i].value;
		}
	}
	
	document.getElementById('helpdesk_enduser_login').style.display = 'none';
	document.getElementById('helpdesk_dealer_login').style.display = 'none';	
	
	if (value == 'enduser' || value == 'dealer')
	{
		document.getElementById('helpdesk_'+value+'_login').style.display = 'block';
	}
}

function toggleProductNumberTable() 
{	
	var value = '';
	var radios = document.getElementsByName('helpdesk_number_exists');
	
	for( i = 0; i < radios.length; i++ )
	{
		if( radios[i].checked == true)
		{
			value = radios[i].value;
		}
	}
	
	document.getElementById('helpdesk_number_table').style.display = 'none';
	
	if (value == '0')
	{
		document.getElementById('helpdesk_number_table').style.display = 'block';
	}
}

function toggleContent(div) 
{	
	if ($('#'+div)) {
		if ($('#'+div).hasClass('unfolded')) {
			$('#'+div).removeClass('unfolded').slideUp();
		} else {
			$('#'+div).addClass('unfolded').slideDown();
		}
	}
	/*
	if (div != '')
	{
		var obj_div = document.getElementById(div);
		
		if (obj_div)
		{
			if (obj_div.style.display == 'none')
			{
				obj_div.style.display = 'block';
			}
			else
			{
				obj_div.style.display = 'none';
			}
		}
	}
	*/
}

function toggleDIV(div) 
{	
	if (document.getElementById('faq_product_a_'+div))
	{
		var this_div = document.getElementById('faq_product_a_'+div);
		var class_name = 'faq_product_';
	}
	else if (document.getElementById('faq_type_a_'+div))
	{
		var this_div = document.getElementById('faq_type_a_'+div);
		var class_name = 'faq_type_';
	}
	else if (document.getElementById('faq_a_'+div)) 
	{
		var this_div = document.getElementById('faq_a_'+div);
		var class_name = 'faq_';
	}
	
	if (this_div)
	{
		var all_divs = this_div.parentNode.getElementsByTagName('DIV');
		
		for( i = 0; i < all_divs.length; i++ )
		{
			if( all_divs[i].className == class_name+'a' && all_divs[i].id != this_div.id)
			{
				all_divs[i].style.display = 'none';
				var trigger = all_divs[i].id;
				trigger = trigger.replace('_a_', '_q_');
				document.getElementById(trigger).className = class_name+'q';
			}
		}
		
		if (this_div.style.display == 'block')
		{
			this_div.style.display = 'none';
			document.getElementById(class_name+'q_'+div).className = class_name+'q';
		}
		else
		{
			this_div.style.display = 'block';
			document.getElementById(class_name+'q_'+div).className = 'faq_trigger';
		}
	}
}

function NewWindow(mypage,myname,w,h,scrol) 
{
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	win = window.open(mypage,myname,"height="+h+",width="+w+",top="+TopPosition+",left="+LeftPosition+",scrollbars="+scrol+",status=0,resizable=1");
	win.focus();
}


function in_array(needle, haystack) {
    var key = ''; 
	for (key in haystack) {
		if (haystack[key] == needle) {
			return true;
		}
	} 
    return false;
}

$('.question').each(function() {
    $(this).simpletip({
		offest: [10, 10],
        content : $(this).children('div').html()
    });
});

function compareNow() 
{
	$.ajax({
		type: 'GET',
		url: '/inc/ajax/load_comparison_questions.php',
		data: $('#comparison_questions *').serialize(),
		beforeSend: function( ) {
			$('#comparison_questions').html('<p align="center"><img src="/templates/frontend/images/highslide/loader.big.white.gif"></p>');			
		},
		success: function( data ) {
			$('#comparison_questions').html(data);
		},
		complete: function( ) {
			var i = 0;
			var musthaves = Array();
			var nonproduct = true;
			$('#nonproduct').hide(); 
			$('.comparison_level_2:checked').each(function(){
				musthaves[i] = $(this).val();
				i++;
			});
			$('.product').each(function() {
				var accepted = true;
				var product = $(this).attr('comparison');
				var has = product.split(';');
				for (m in musthaves) {
					if (!in_array(musthaves[m], has)) {
						accepted = false;
					}
				}
				if (accepted) {
					//$(this).fadeIn(); 
					$(this).show(300);
					nonproduct = false; 
				} else {
					//$(this).fadeOut();
					$(this).hide(300); 
				}
			});
			if (nonproduct) {
				$('#nonproduct').show(); 
			}
		}
	});	
}




// rollover image for any image in the normal state
var p7TMMover='_over';
// image for any trigger that has an open sub menu -no rollover
var p7TMMopen='_overdown';
// image to be used for current marker -no roll over
var p7TMMmark='_down';

var p7TMMi=false,p7TMMa=false,p7TMMctl=[],p7TMMadv=[];
function P7_TMMset(){
	var i,h,sh,hd,x,v;
	if(!document.getElementById){
		return;
	}
	sh='.p7TMM div {display:none;overflow:hidden;}\n';
	sh+='.p7TMMtoggle {display:block !important;}\n';
	if(document.styleSheets){
		h='\n<st' + 'yle type="text/css">\n'+sh+'\n</s' + 'tyle>';
		document.write(h);
	}
	else{
		h=document.createElement('style');
		h.type='text/css';
		h.appendChild(document.createTextNode(sh));
		hd=document.getElementsByTagName('head');
		hd[0].appendChild(h);
	}
}
//P7_TMMset();
function P7_TMMaddLoad(){
	if(window.addEventListener){
		window.addEventListener("load",P7_TMMinit,false);
		window.addEventListener("unload",P7_TMMbb,false);
	}
	else if(window.attachEvent){
		window.attachEvent("onload",P7_TMMinit);
	}
	else{
		window.onload=P7_TMMinit;
	}
}
//P7_TMMaddLoad();
function P7_TMMbb(){
	return;
}
function P7_TMMop(){
	if(!document.getElementById){
		return;
	}
	p7TMMctl[p7TMMctl.length]=arguments;
}
function P7_TMMinit(){
	var i,j,jj,k,tM,tA,tU,lv,pp,clv,fs,tS,d=1,cl,tp,uh=0,cN,tw,ow,oh,sP,cA,oA;
	if(p7TMMi){
		return;
	}
	p7TMMi=true;
	document.p7TMMpreload=[];
	for(k=0;k<p7TMMctl.length;k++){
		tM=document.getElementById(p7TMMctl[k][0]);
		if(tM){
			tM.p7opt=p7TMMctl[k];
			if(navigator.appVersion.indexOf("MSIE 5")>-1){
				tM.p7opt[1]=0;
			}
			tM.p7TMMtmr=null;
			tD=tM.getElementsByTagName("DIV");
			for(i=0;i<tD.length;i++){
				tD[i].setAttribute("id",tM.id+'d'+(i+2));
				tD[i].p7state='closed';
				tD[i].tmmmenu=tM.id;
			}
			tU=tM.getElementsByTagName("UL");
			for(i=0;i<tU.length;i++){
				tU[i].setAttribute("id",tM.id+'u'+(i+1));
				lv=1;
				pp=tU[i].parentNode;
				while(pp){
					if(pp.id&&pp.id==tM.id){
						break;
					}
					if(pp.tagName&&pp.tagName=="UL"){
						lv++;
					}
					pp=pp.parentNode;
				}
				tU[i].tmmlevel=lv;
				clv='level_'+lv;
				P7_TMMsetClass(tU[i],clv);
				tN=tU[i].childNodes;
				if(tN){
					fs=-1;
					jj=0;
					for(j=0;j<tN.length;j++){
						if(tN[j].tagName&&tN[j].tagName=="LI"){
							jj++;
							tA=tN[j].getElementsByTagName("A")[0];
							if(fs<0){
								P7_TMMsetClass(tA,'tmmfirst');
								P7_TMMsetClass(tN[j],'tmmfirst');
							}
							tN[j].p7state='closed';
							fs=j;
							tA.setAttribute("id",tM.id+'a'+(d));
							tA.tmmlevel=lv;
							tA.tmmdiv=tU[i].parentNode.id;
							tA.tmmmenu=tM.id;
							if(i==0){
								P7_TMMsetClass(tN[j],('root_'+jj));
							}
							tS=tN[j].getElementsByTagName("UL");
							if(tS&&tS.length>0){
								tA.tmmsub=tS[0].parentNode.id;
								tA.p7state="closed";
								P7_TMMsetClass(tA,'trig_closed');
								P7_TMMsetClass(tA.parentNode,'trig_closed');
								tA.onclick=function(){
									return P7_TMMtrig(this);
								};
							}
							else{
								tA.tmmsub=false;
								P7_TMMsetClass(tA,'p7tmm_page');
								P7_TMMsetClass(tA.parentNode,'p7tmm_page');
							}
							d++;
							tA.hasImg=false;
							var sr,x,fnA,fnB,swp,s1,s2,s3;
							iM=tA.getElementsByTagName("IMG");
							if(iM&&iM[0]){
								sr=iM[0].getAttribute("src");
								swp=tM.p7opt[3];
								iM[0].tmmswap=swp;
								x=sr.lastIndexOf(".");
								fnA=sr.substring(0,x);
								fnB='.'+sr.substring(x+1);
								s1=fnA+p7TMMover+fnB;
								s2=fnA+p7TMMopen+fnB;
								s3=fnA+p7TMMmark+fnB;
								if(swp==1){
									iM[0].p7imgswap=[sr,s1,s1,s1];
									P7_TMMpreloader(s1);
								}
								else if(swp==2){
									iM[0].p7imgswap=[sr,s1,s2,s2];
									P7_TMMpreloader(s1,s2);
								}
								else if(swp==3){
									iM[0].p7imgswap=[sr,s1,s2,s3];
									P7_TMMpreloader(s1,s2,s3);
								}
								else{
									iM[0].p7imgswap=[sr,sr,sr,sr];
								}
								iM[0].p7state='closed';
								iM[0].mark=false;
								iM[0].rollover=tM.p7opt[10];
								if(swp>0){
									tA.hasImg=true;
									iM[0].onmouseover=function(){
										P7_TMMimovr(this);
									};
									iM[0].onmouseout=function(){
										P7_TMMimout(this);
									};
								}
							}
						}
					}
					if(fs>0){
						P7_TMMsetClass(tA,'tmmlast');
						P7_TMMsetClass(tN[fs],'tmmlast');
					}
				}
			}
			oA=document.getElementById(tM.id+'oa');
			if(oA){
				oA.onclick=function(){
					P7_TMMall(this.id.replace('oa',''),'open',0);
					return false;
				};
			}
			cA=document.getElementById(tM.id+'ca');
			if(cA){
				cA.onclick=function(){
					P7_TMMall(this.id.replace('ca',''),'close',0);
					return false;
				};
			}
			if(tM.p7opt[5]==1){
				P7_TMMcurrentMark(tM);
			}
			if(tM.p7opt[9]>-1){
				P7_TMMall(tM.id,'open',tM.p7opt[9]);
			}
		}
	}
	p7TMMa=true;
}
function P7_TMMpreloader(){
	var i,x;
	for(i=0;i<arguments.length;i++){
		x=document.p7TMMpreload.length;
		document.p7TMMpreload[x]=new Image();
		document.p7TMMpreload[x].src=arguments[i];
	}
}
function P7_TMMimovr(im){
	var m=false,a=im.parentNode,r=im.rollover;
	if(im.mark){
		m=(r>1)?true:false;
	}
	else if(im.p7state=='open'){
		m=(r==1||r==3)?true:false;
	}
	else{
		m=true;
	}
	if(m){
		im.src=im.p7imgswap[1];
	}
}
function P7_TMMimout(im){
	var a=im.parentNode,r=im.rollover;
	if(im.mark){
		if(im.p7state=='open'){
			im.src=im.p7imgswap[2];
		}
		else{
			im.src=im.p7imgswap[3];
		}
	}
	else if(im.p7state=='open'){
		if(r==1||r==3){
			im.src=im.p7imgswap[2];
		}
	}
	else{
		im.src=im.p7imgswap[0];
	}
}
function P7_TMMtrig(ob){
	var a,tM,wH,m=false;
	a=ob;
	tM=document.getElementById(a.tmmmenu);
	if(tM.p7opt[7]==1){
		wH=window.location.href;
		if(a.href!=wH&&a.href!=wH+'#'){
			if(a.href.toLowerCase().indexOf('javascript:')==-1){
				return true;
			}
		}
	}
	if(a.p7state=='closed'){
		P7_TMMopen(a);
	}
	else{
		P7_TMMclose(a);
	}
	return m;
}
function P7_TMMopen(a,bp){
	var sP,tM,tD,iM,op=0;
	if(a.p7state=='open'){
		return;
	}
	tM=document.getElementById(a.tmmmenu);
	tD=document.getElementById(a.tmmsub);
	if(!bp){
		if(tM.p7opt[8]==1){
			P7_TMMtoggle(a);
		}
	}
	a.p7state='open';
	a.parentNode.p7state='open';
	if(a.hasImg){
		iM=a.getElementsByTagName("IMG")[0];
		iM.p7state='open';
		iM.src=iM.p7imgswap[2];
	}
	sP=document.getElementById(a.tmmspan);
	a.className=a.className.replace('trig_closed','trig_open');
	a.parentNode.className=a.parentNode.className.replace('trig_closed','trig_open');
	tD.p7state='open';
	op=tM.p7opt[1];
	if(!bp&&p7TMMa&&op>0){
		var v,cl,cw,tw,ch,th,st,frh,dy=10,du=100,tU=tD.getElementsByTagName('UL')[0];
		st=du/dy;
		if(op==1||op==3){
			tD.style.height="1px";
		}
		tD.style.display="block";
		tU.style.visibility='hidden';
		tU.style.position='absolute';
		th=tU.offsetHeight;
		tw=tU.offsetWidth;
		tU.style.position='static';
		v=tw*-1;
		frh=parseInt(th/st);
		frh=(frh<1)?1:frh;
		if(op==1||op==3){
			cw=th;
			if(op==3){
				tU.style.marginLeft=v+'px';
			}
			tU.style.visibility='visible';
			P7_TMManimDown(tD.id,1,th,op,frh,v,tU.id,dy);
		}
		else if(op==2){
			tU.style.marginLeft=v+'px';
			tU.style.visibility='visible';
			P7_TMManimRight(tU.id,v,op);
		}
	}
	else{
		tD.style.display='block';
	}
}
function P7_TMMclose(a,bp){
	var sP,tM,tD,iM;
	if(a.p7state=='closed'){
		return;
	}
	tM=document.getElementById(a.tmmmenu);
	tD=document.getElementById(a.tmmsub);
	a.p7state='closed';
	a.parentNode.p7state='closed';
	if(a.hasImg){
		iM=a.getElementsByTagName("IMG")[0];
		iM.p7state='closed';
		if(iM.mark){
			iM.src=iM.p7imgswap[3];
		}
		else{
			iM.src=iM.p7imgswap[0];
		}
	}
	sP=document.getElementById(a.tmmspan);
	a.className=a.className.replace('trig_open','trig_closed');
	a.parentNode.className=a.parentNode.className.replace('trig_open','trig_closed');
	tD.p7state='closed';
	tD.style.display='none';
}
function P7_TMMtoggle(a,bp){
	var i,tC;
	tC=a.parentNode.parentNode.childNodes;
	for(i=0;i<tC.length;i++){
		if(tC[i].tagName&&tC[i].tagName=='LI'){
			if(tC[i].p7state&&tC[i].p7state=='open'&&tC[i]!=a.parentNode){
				P7_TMMclose(tC[i].getElementsByTagName('A')[0]);
			}
		}
	}
}
function P7_TMManimDown(id,ch,th,op,frh,v,tu,dy){
	var el,nh;
	el=document.getElementById(id);
	el.style.height=ch+'px';
	if(ch<th){
		nh=ch+frh;
		nh=(nh>=th)?th:nh;
		setTimeout("P7_TMManimDown('"+id+"',"+nh+","+th+","+op+","+frh+","+v+",'"+tu+"',"+dy+")",dy);
	}
	else{
		el.style.height='auto';
		if(op==3){
			P7_TMManimRight(tu,v,op);
		}
	}
}
function P7_TMManimRight(id,v,op){
	var el,tg=0,fr=8,dy=10;
	el=document.getElementById(id);
	el.style.marginLeft=v+'px';
	if(v!=tg){
		v+=fr;
		v=(v>=tg)?tg:v;
		setTimeout("P7_TMManimRight('"+id+"',"+v+","+op+")",dy);
	}
	else{
		el.style.leftMargin='0';
	}
}
function P7_TMMall(d,ac,lv){
	var i,tM,tA;
	lv=(lv>0)?lv:0;
	tM=document.getElementById(d);
	if(tM){
		tA=tM.getElementsByTagName("A");
		for(i=0;i<tA.length;i++){
			if(tA[i].tmmsub&&(lv==0||tA[i].tmmlevel<=lv)){
				if(ac=='open'){
					if(tA[i].p7state!='open'){
						P7_TMMopen(tA[i],1);
					}
				}
				else{
					if(tA[i].p7state!='closed'){
						P7_TMMclose(tA[i],1);
					}
				}
			}
		}
	}
}
function P7_TMMmark(){
	p7TMMadv[p7TMMadv.length]=arguments;
}
function P7_TMMcurrentMark(el){
	var j,i,k,wH,cm=false,mt=['',1,'',''],op,r1,k,kk,tA,aU,pp,a,im;;
	wH=window.location.href;
	
	if(el.p7opt[12!=1]){
		wH=wH.replace(window.location.search,'');
	}
	if(wH.charAt(wH.length-1)=='#'){
		wH=wH.substring(0,wH.length-1);
	}
	var links = wH.split('?');
	wH = links[0];
	
	for(k=0;k<p7TMMadv.length;k++){
		if(p7TMMadv[k][0]&&p7TMMadv[k][0]==el.id){
			mt=p7TMMadv[k];
			cm=true;
			break;
		}
	}
	op=mt[1];
	if(op<1){
		return;
	}
	r1=/index\.[\S]*/i;
	k=-1,kk=-1;
	tA=el.getElementsByTagName("A");
	for(j=0;j<tA.length;j++){
		aU=tA[j].href.replace(r1,'');
		if(op>0){
			if(tA[j].href==wH||aU==wH){
				k=j;
				kk=-1;
			}
		}
		if(op==2){
			if(tA[j].firstChild){
				if(tA[j].firstChild.nodeValue==mt[2]){
					kk=j;
				}
			}
		}
		if(op==3&&tA[j].href.indexOf(mt[2])>-1){
			kk=j;
		}
		if(op==4){
			for(x=2;x<mt.length;x+=2){
				if(wH.indexOf(mt[x])>-1){
					if(tA[j].firstChild&&tA[j].firstChild.nodeValue){
						if(tA[j].firstChild.nodeValue==mt[x+1]){
							kk=j;
						}
					}
				}
			}
		}
	}
	k=(kk>k)?kk:k;
	if(k>-1){
		pp=tA[k].parentNode;
		while(pp){
			if(pp.tagName&&pp.tagName=='LI'){
				P7_TMMsetClass(pp,'li_current_mark');
				a=pp.getElementsByTagName('A');
				if(a&&a[0]){
					P7_TMMsetClass(a[0],'current_mark');
					if(a[0].hasImg){
						im=a[0].getElementsByTagName('IMG')[0];
						im.mark=true;
						im.src=im.p7imgswap[3];
					}
					if(a[0].tmmsub){
						P7_TMMopen(a[0],1);
					}
				}
			}
			else{
				if(pp==el){
					break;
				}
			}
			pp=pp.parentNode;
		}
	}
}
function P7_TMMsetClass(ob,cl){
	var cc,nc,r=/\s+/g;
	cc=ob.className;
	nc=cl;
	if(cc&&cc.length>0&&cc.indexOf(cl)==-1){
		nc=cc+' '+cl;
	}
	nc=nc.replace(r,' ');
	ob.className=nc;
}
function P7_TMMremClass(ob,cl){
	var cc,nc,r=/\s+/g;;
	cc=ob.className;
	if(cc&&cc.indexOf(cl>-1)){
		nc=cc.replace(cl,'');
		nc=nc.replace(r,' ');
		ob.className=nc;
	}
}
function P7_TMMgetPropValue(ob,prop,prop2){
	var h,v=null;
	if(ob){
		if(ob.currentStyle){
			v=eval('ob.currentStyle.'+prop);
		}
		else if(document.defaultView.getComputedStyle(ob,"")){
			v=document.defaultView.getComputedStyle(ob,"").getPropertyValue(prop2);
		}
		else{
			v=eval("ob.style."+prop);
		}
	}
	return v;
}
