/*=======================================================================================
=                           VIA THEMA All Rights Reserved                               =
=======================================================================================*/
var str="";
var d=document;
var dr="www.viathema.com";
var myimages=new Array()
window!=top?top.location.href=location.href:0;
d.onselectstart=new Function("return false");


function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src="/core/"+preloadimages.arguments[i]
}
}

preloadimages("viathema_body.jpg","viathema-ferrari-daytona.jpg","logo.png","navigatie.png","shadow.jpg","shadow2.jpg")

function titel(){
d.title="VIA THEMA - "+d.title;
cssdropdown.startchrome("viathema-carros");
}


function tagimg(){
for(i=0;i<d.images.length;i++)
d.images[i].oncontextmenu=new Function("return false");}


function f2()
	{
	if(!frm.vraag.value)
		{
		frm.vraag.focus();
		frm.vraag.style.borderColor='#EB3F00';
		return false;
		}
	frm.vraag.style.borderColor='#c5c6c8';
	if(!frm.yourname.value)
		{
		frm.yourname.focus();
		frm.yourname.style.borderColor='#EB3F00';
		return false;
		}
	frm.yourname.style.borderColor='#c5c6c8';
	if(!frm.email.value)
		{
		frm.email.focus();
		frm.email.style.borderColor='#EB3F00';
		return false;
		}
	frm.email.style.borderColor='#c5c6c8';
	if(!frm.marque.value)
		{
		frm.marque.focus();
		frm.marque.style.borderColor='#EB3F00';
		return false;
		}
	else
		{
		d.frm.submit();
		}
	}

function Set_Cookie(name,value,expires,path,domain,secure)
{
var today = new Date();
today.setTime( today.getTime() );
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
window.location.reload(true);
}

var cssdropdown={
disappeardelay: 400, 
dropdownindicator: '', 
enablereveal: [true, 3], 
enableiframeshim: 0, 


dropmenuobj: null, asscmenuitem: null, domsupport: document.all || document.getElementById, standardbody: null, iframeshimadded: false, revealtimers: {},

getposOffset:function(what, offsettype){
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
	while (parentEl!=null){
		totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
		parentEl=parentEl.offsetParent;
	}
	return totaloffset;
},

css:function(el, targetclass, action){
	var needle=new RegExp("(^|\\s+)"+targetclass+"($|\\s+)", "ig")
	if (action=="check")
		return needle.test(el.className)
	else if (action=="remove")
		el.className=el.className.replace(needle, "")
	else if (action=="add" && !needle.test(el.className))
		el.className+=" "+targetclass
},

showmenu:function(dropmenu, e){
	if (this.enablereveal[0]){
		if (!dropmenu._trueheight || dropmenu._trueheight<10)
			dropmenu._trueheight=dropmenu.offsetHeight
		clearTimeout(this.revealtimers[dropmenu.id])
		dropmenu.style.height=dropmenu._curheight=0
		dropmenu.style.overflow="hidden"
		dropmenu.style.visibility="visible"
		this.revealtimers[dropmenu.id]=setInterval(function(){cssdropdown.revealmenu(dropmenu)}, 10)
	}
	else{
		dropmenu.style.visibility="visible"
	}
	this.css(this.asscmenuitem, "selected", "add")
},

revealmenu:function(dropmenu, dir){
	var curH=dropmenu._curheight, maxH=dropmenu._trueheight, steps=this.enablereveal[1]
	if (curH<maxH){
		var newH=Math.min(curH, maxH)
		dropmenu.style.height=newH+"px"
		dropmenu._curheight= newH + Math.round((maxH-newH)/steps) + 1
	}
	else{ //if done revealing menu
		dropmenu.style.height="auto"
		dropmenu.style.overflow="hidden"
		clearInterval(this.revealtimers[dropmenu.id])
	}
},

clearbrowseredge:function(obj, whichedge){
	var edgeoffset=0
	if (whichedge=="rightedge"){
		var windowedge=document.all && !window.opera? this.standardbody.scrollLeft+this.standardbody.clientWidth-15 : window.pageXOffset+window.innerWidth-15
		var dropmenuW=this.dropmenuobj.offsetWidth
		if (windowedge-this.dropmenuobj.x < dropmenuW)  
			edgeoffset=dropmenuW-obj.offsetWidth
	}
	else{
		var topedge=document.all && !window.opera? this.standardbody.scrollTop : window.pageYOffset
		var windowedge=document.all && !window.opera? this.standardbody.scrollTop+this.standardbody.clientHeight-15 : window.pageYOffset+window.innerHeight-18
		var dropmenuH=this.dropmenuobj._trueheight
		if (windowedge-this.dropmenuobj.y < dropmenuH){ 
			edgeoffset=dropmenuH+obj.offsetHeight
			if ((this.dropmenuobj.y-topedge)<dropmenuH) 
				edgeoffset=this.dropmenuobj.y+obj.offsetHeight-topedge
		}
	}
	return edgeoffset
},

dropit:function(obj, e, dropmenuID){
	if (this.dropmenuobj!=null) //hide previous menu
		this.hidemenu() 
	this.clearhidemenu()
	this.dropmenuobj=document.getElementById(dropmenuID) 
	this.asscmenuitem=obj 
	this.showmenu(this.dropmenuobj, e)
	this.dropmenuobj.x=this.getposOffset(obj, "left")
	this.dropmenuobj.y=this.getposOffset(obj, "top")
	this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"
	this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+2+"px"
	this.positionshim() 
},

positionshim:function(){ 
	if (this.iframeshimadded){
		if (this.dropmenuobj.style.visibility=="visible"){
			this.shimobject.style.width=this.dropmenuobj.offsetWidth+"px"
			this.shimobject.style.height=this.dropmenuobj._trueheight+"px"
			this.shimobject.style.left=parseInt(this.dropmenuobj.style.left)+"px"
			this.shimobject.style.top=parseInt(this.dropmenuobj.style.top)+"px"
			this.shimobject.style.display="block"
		}
	}
},

hideshim:function(){
	if (this.iframeshimadded)
		this.shimobject.style.display='none'
},

isContained:function(m, e){
	var e=window.event || e
	var c=e.relatedTarget || ((e.type=="mouseover")? e.fromElement : e.toElement)
	while (c && c!=m)try {c=c.parentNode} catch(e){c=m}
	if (c==m)
		return true
	else
		return false
},

dynamichide:function(m, e){
	if (!this.isContained(m, e)){
		this.delayhidemenu()
	}
},

delayhidemenu:function(){
	this.delayhide=setTimeout("cssdropdown.hidemenu()", this.disappeardelay) //hide menu
},

hidemenu:function(){
	this.css(this.asscmenuitem, "selected", "remove")
	this.dropmenuobj.style.visibility='hidden'
	this.dropmenuobj.style.left=this.dropmenuobj.style.top="-1000px"
	this.hideshim()
},

clearhidemenu:function(){
	if (this.delayhide!="undefined")
		clearTimeout(this.delayhide)
},

addEvent:function(target, functionref, tasktype){
	if (target.addEventListener)
		target.addEventListener(tasktype, functionref, false);
	else if (target.attachEvent)
		target.attachEvent('on'+tasktype, function(){return functionref.call(target, window.event)});
},

startchrome:function(){
	if (!this.domsupport)
		return
	this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
	for (var ids=0; ids<arguments.length; ids++){


/*242*/		var menuitems=document.getElementById(arguments[ids]).getElementsByTagName("a")
		for (var i=0; i<menuitems.length; i++){
			if (menuitems[i].getAttribute("rel")){
				var relvalue=menuitems[i].getAttribute("rel")
				var asscdropdownmenu=document.getElementById(relvalue)
				this.addEvent(asscdropdownmenu, function(){cssdropdown.clearhidemenu()}, "mouseover")
				this.addEvent(asscdropdownmenu, function(e){cssdropdown.dynamichide(this, e)}, "mouseout")
				this.addEvent(asscdropdownmenu, function(){cssdropdown.delayhidemenu()}, "click")
				try{
					menuitems[i].innerHTML=menuitems[i].innerHTML+" "+this.dropdownindicator
				}catch(e){}
				this.addEvent(menuitems[i], function(e){ 
					if (!cssdropdown.isContained(this, e)){
						var evtobj=window.event || e
						cssdropdown.dropit(this, evtobj, this.getAttribute("rel"))
					}
				}, "mouseover")
				this.addEvent(menuitems[i], function(e){cssdropdown.dynamichide(this, e)}, "mouseout") //hide drop down menu when main menu items are mouse out
				this.addEvent(menuitems[i], function(){cssdropdown.delayhidemenu()}, "click") 
			}
		} 
	} 
	if (this.enableiframeshim && document.all && !window.XDomainRequest && !this.iframeshimadded){ //enable iframe shim in IE5.5 thru IE7?
		document.write('<IFRAME id="iframeshim" src="about:blank" frameBorder="0" scrolling="no" style="left:0; top:0; position:absolute; display:none;z-index:90; background: transparent;"></IFRAME>')
		this.shimobject=document.getElementById("iframeshim") //reference iframe object
		this.shimobject.style.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)'
		this.iframeshimadded=true
	}
} 

}

var thumbnailviewer={
enableTitle:true,
enableAnimation:true,
//definefooter:'<div class="footerbar">close window</div><div id="d13"></div>',
defineLoading:'<img src="/core/35-0.gif" />',
scrollbarwidth:16,
opacitystring:'filter:progid:DXImageTransform.Microsoft.alpha(opacity=10); -moz-opacity: 0.1; opacity: 0.1',
targetlinks:[],

created14:function(){
d.write('<div id="d14"><div id="d12"></div><div id="d15"></div></div>')
d.write('<div id="d16">'+this.defineLoading+'</div>')
this.d12=d.getElementById("d12")
this.d13=d.getElementById("d13")
this.d14=d.getElementById("d14")
this.d15=d.getElementById("d15")
this.d16=d.getElementById("d16")
this.standardbody=(d.compatMode=="CSS1Compat")? d.documentElement : d.body
},

centerDiv:function(divobj){
var ie=d.all && !window.opera
var dom=d.getElementById
var scroll_top=(ie)? this.standardbody.scrollTop : window.pageYOffset
var scroll_left=(ie)? this.standardbody.scrollLeft : window.pageXOffset
var docwidth=(ie)? this.standardbody.clientWidth : window.innerWidth-this.scrollbarwidth
var docheight=(ie)? this.standardbody.clientHeight: window.innerHeight
var docheightcomplete=(this.standardbody.offsetHeight>this.standardbody.scrollHeight)? this.standardbody.offsetHeight : this.standardbody.scrollHeight
var objwidth=divobj.offsetWidth
var objheight=divobj.offsetHeight
var topposition=(docheight>objheight)? scroll_top+docheight/2-objheight/1.7+"px" : scroll_top+10+"px"
divobj.style.left=docwidth/2-objwidth/2+"px"
divobj.style.top=Math.floor(parseInt(topposition))+"px"
divobj.style.visibility="visible"

},

showd14:function(){
this.centerDiv(this.d14)
if (this.enableAnimation){
this.currentopacity=0.1
this.opacitytimer=setInterval("thumbnailviewer.opacityanimation()", 20)
}},

loadimage:function(link){
if (this.d14.style.visibility=="visible")
this.closeit()
str=link.getAttribute("href");
str=str.replace(/k.jpg/,".jpg")


var imageHTML='<img src="'+str+'" style="'+this.opacitystring+'" />'

if (this.enableTitle && link.getAttribute("title"))
var at='<span class="autotitel">'+link.getAttribute("title")+'</span>'
this.d15.innerHTML=imageHTML+'<div id="d13">'+at+'<span class="foot"><a onClick="thumbnailviewer.closeit()" title="Close Window">Close Window</a></span><span class="foot"><a href="http://www.viathema.com/contact/email/" title="Contact Us">Contact Us</a></span></div>'
/*
this.d15.innerHTML=imageHTML
*/
this.centerDiv(this.d16)
this.featureImage=this.d15.getElementsByTagName("img")[0]
this.featureImage.onload=function(){
thumbnailviewer.d16.style.visibility="hidden"
tagimg();
thumbnailviewer.showd14()
}
if (d.all && !window.createPopup)
this.featureImage.src=str
this.featureImage.onerror=function(){
thumbnailviewer.d16.style.visibility="hidden"
}},

setimgopacity:function(value){
var targetobject=this.featureImage
if (targetobject.filters && targetobject.filters[0]){
if (typeof targetobject.filters[0].opacity=="number")
targetobject.filters[0].opacity=value*100
else
targetobject.style.filter="alpha(opacity="+value*100+")"
}
else if (typeof targetobject.style.MozOpacity!="undefined")
targetobject.style.MozOpacity=value
else if (typeof targetobject.style.opacity!="undefined")
targetobject.style.opacity=value
else
this.stopanimation()
},

opacityanimation:function(){
this.setimgopacity(this.currentopacity)
this.currentopacity+=0.1
if (this.currentopacity>1)
this.stopanimation()
},

stopanimation:function(){
if (typeof this.opacitytimer!="undefined")
clearInterval(this.opacitytimer)
},

closeit:function(){
this.stopanimation()
this.d14.style.visibility="hidden"
this.d15.innerHTML=""
this.d14.style.left="-2000px"
this.d14.style.top="-2000px"
},

cleanup:function(){
this.d16=null
if (this.featureImage) this.featureImage.onload=null
this.featureImage=null
this.d15=null
for (var i=0; i<this.targetlinks.length; i++)
this.targetlinks[i].onclick=null
this.d14=null
},

dotask:function(target, functionref, tasktype){
var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
if (target.addEventListener)
target.addEventListener(tasktype, functionref, false)
else if (target.attachEvent)
target.attachEvent(tasktype, functionref)
},

init:function(){
if (!this.enableAnimation)
this.opacitystring=""
var pagelinks=d.getElementsByTagName("a")
for (var i=0; i<pagelinks.length; i++){
if (pagelinks[i].getAttribute("rel") && pagelinks[i].getAttribute("rel")=="viathema"){
pagelinks[i].onclick=function(){
thumbnailviewer.stopanimation()
thumbnailviewer.loadimage(this)
return false
}
this.targetlinks[this.targetlinks.length]=pagelinks[i]
}}

this.dotask(window, function(){if (thumbnailviewer.d14.style.visibility=="visible") thumbnailviewer.centerDiv(thumbnailviewer.d14)}, "resize")
}}

thumbnailviewer.created14()
thumbnailviewer.dotask(window, function(){thumbnailviewer.init()}, "load")
thumbnailviewer.dotask(window, function(){thumbnailviewer.cleanup()}, "unload")


var ss = {fixAllLinks: function() {
var allLinks = document.getElementsByTagName('a');
for (var i=0;i<allLinks.length;i++) {
var lnk = allLinks[i];
if ((lnk.href && lnk.href.indexOf('#') != -1) && ( (lnk.pathname == location.pathname) ||  ('/'+lnk.pathname == location.pathname) ) && (lnk.search == location.search)) {
ss.addEvent(lnk,'click',ss.smoothScroll);
      }
    }
  },
 smoothScroll: function(e) {
if (window.event) {
      target = window.event.srcElement;
    } else if (e) {
      target = e.target;
    } else return;
if (target.nodeName.toLowerCase() != 'a') {
      target = target.parentNode;
    }
if (target.nodeName.toLowerCase() != 'a') return;
anchor = target.hash.substr(1);
var allLinks = document.getElementsByTagName('a');
    var destinationLink = null;
    for (var i=0;i<allLinks.length;i++) {
      var lnk = allLinks[i];
      if (lnk.name && (lnk.name == anchor)) {
        destinationLink = lnk;
        break;
      }
    }
    if (!destinationLink) destinationLink = document.getElementById(anchor);
if (!destinationLink) return true;
var destx = destinationLink.offsetLeft; 
    var desty = destinationLink.offsetTop;
    var thisNode = destinationLink;
    while (thisNode.offsetParent && (thisNode.offsetParent != document.body)) {
      thisNode = thisNode.offsetParent;
      destx += thisNode.offsetLeft;
      desty += thisNode.offsetTop;
    }
clearInterval(ss.INTERVAL);
cypos = ss.getCurrentYPos();
ss_stepsize = parseInt((desty-cypos)/ss.STEPS);
ss.INTERVAL =setInterval('ss.scrollWindow('+ss_stepsize+','+desty+',"'+anchor+'")',10);
if (window.event) {
      window.event.cancelBubble = true;
      window.event.returnValue = false;
    }
    if (e && e.preventDefault && e.stopPropagation) {
      e.preventDefault();
      e.stopPropagation();
    }
  },
scrollWindow: function(scramount,dest,anchor) {
    wascypos = ss.getCurrentYPos();
    isAbove = (wascypos < dest);
    window.scrollTo(0,wascypos + scramount);
    iscypos = ss.getCurrentYPos();
    isAboveNow = (iscypos < dest);
    if ((isAbove != isAboveNow) || (wascypos == iscypos)) {
window.scrollTo(0,dest);
clearInterval(ss.INTERVAL);
location.hash = anchor;
}
},
getCurrentYPos: function() {
    if (document.body && document.body.scrollTop)
return document.body.scrollTop;
if (document.documentElement && document.documentElement.scrollTop)
      return document.documentElement.scrollTop;
    if (window.pageYOffset)
      return window.pageYOffset;
    return 0;
  },
addEvent: function(elm, evType, fn, useCapture) {
if (elm.addEventListener){
      elm.addEventListener(evType, fn, useCapture);
      return true;
    } else if (elm.attachEvent){
      var r = elm.attachEvent("on"+evType, fn);
      return r;
    } else {
      alert("Handler could not be removed");
    }  } }
ss.STEPS = 30;
ss.addEvent(window,"load",ss.fixAllLinks);


d.body.onload=titel;



/*=======================================================================================
=                Copyright © 2001 - 2010 VIA THEMA [http://www.viathema.com]            =
=======================================================================================*/