// Is used by the v12 flash object
function writeFlashObj(str) 
{
	document.write(str); 
}

function dolink(id){
	if (id == 1)
	   window.location='BatavusCollectie2006-fitness.aspx';
}

function DoLink(id){
	if (id == 2	)
	   window.location='BatavusFiets.aspx?bikeGroupId=395';
}

function topGoTo(pageId){
	parent.middle.location.href='../main.aspx?p='+pageId;
	return;
}

function batavusSelect(selectBox,value){
	var curVal = document.getElementById(selectBox);
	var changed= (curVal.value!=value);
	if (changed)	curVal.value=value;
	else curVal.value="-1";
	__doPostBack(selectBox.replace(':','$'),'');
}

	function ShowMe(){
		url = document.images['bikeImage'].src
		url = url.replace("formatId=2","formatId=4");
		newWindow=window.open(url,'Fiets','toolbar=no,width=600,height=414')
		newWindow.focus()
	}
	

	
	function changeActionOption(optionNumber){
	hideActionAll();
	showActionDiv(optionNumber);
	}
	
	function hideActionAll(){
	actieDiv1.style.display="none";
	actieDiv2.style.display="none";
	actieDiv3.style.display="none";
	}
	
	function showActionDiv(optionNumber){
	if(optionNumber==1)
		{
		actieDiv1.style.display="inline";
		}
	else if(optionNumber==2)
		{
		actieDiv2.style.display="inline";
		}
	else if(optionNumber==3)
		{
		actieDiv3.style.display="inline";
		}
	}
	
	function Display(id)
{	
	eval("window.clearTimeout(window.myTimeout"+id+");");
	var image = document.getElementById('img' + id);
	if(image.className=='imgInactive')
	{
	Mouseover(id);
	}
	else{
		var oldSrc = image.src;
		if(oldSrc.indexOf('Over.gif')<0)image.src=oldSrc.replace('Active.gif','Over.gif');
	}
	var myDisplay = document.getElementById('sub' + id);
	if(myDisplay!=null)myDisplay.style.display='block';	
}


function Mouseover(id)
{
	var myMouseover = document.getElementById('img' + id);
	var oldSrc = myMouseover.src;
	if(oldSrc.indexOf('Over.gif')<0)oldSrc = oldSrc.replace('.gif','Over.gif');
	myMouseover.src=oldSrc;	

}


function Mouseoverclear(id)
{
	var myMouseover = document.getElementById('img' + id);
	var oldSrc = myMouseover.src;
	if(oldSrc.indexOf('Over.gif')>-1)oldSrc = oldSrc.replace('Over.gif','.gif');
	
	myMouseover.src=oldSrc;	
	


}



function Clear(id)
{
	eval("window.myTimeout"+id+"=window.setTimeout('clear2("+id+")',100);");
}
	
	function clear2(id){
	var image = document.getElementById('img' + id);
	if(image.className=='imgInactive')
	{
	Mouseoverclear(id);
	}
	else{
		var oldSrc = image.src;
		image.src=oldSrc.replace('Over.gif','Active.gif');
		}
	var myDisplay = document.getElementById('sub' + id);
	if(myDisplay!=null)myDisplay.style.display='none';
}

function setClass(){
   var activeId = getURLParam("activeOption");

   if(activeId!=null&&activeId!=""){
   var image = document.getElementById('img' + activeId);
   image.className = 'imgActive';
   var oldSrc = image.src;
   if(oldSrc.indexOf('Over.gif')>0)oldSrc=oldSrc.replace('Over.gif','.gif');
   if(oldSrc.indexOf('Active.gif')>0)oldSrc=oldSrc.replace('Active.gif','.gif');
   image.src=oldSrc.replace('.gif','Active.gif');
   }

}

    function getURLParam(strParamName){
      var strReturn = "";
      var strHref = window.location.href;
      if(strHref.indexOf(strParamName)>-1){
		strReturn = queryString(strParamName);
      }
     return strReturn;
    }
    
     function queryString(key){
		var page = new PageQuery(window.location.search);
		
		return unescape(page.getValue(key));
}

	function PageQuery(q) {
	if(q.length > 1) this.q = q.substring(1, q.length);
	else this.q = null;
	this.keyValuePairs = new Array();
	if(q) {
	for(var i=0; i < this.q.split("&").length; i++) {
	this.keyValuePairs[i] = this.q.split("&")[i];
	}
	}
	this.getKeyValuePairs = function() { return this.keyValuePairs; }
	this.getValue = function(s) {
	for(var j=0; j < this.keyValuePairs.length; j++) {
	if(this.keyValuePairs[j].split("=")[0] == s)
	return this.keyValuePairs[j].split("=")[1];
	}
	return false;
	}
	this.getParameters = function() {
	var a = new Array(this.getLength());
	for(var j=0; j < this.keyValuePairs.length; j++) {
	a[j] = this.keyValuePairs[j].split("=")[0];
	}
	return a;
	}
	this.getLength = function() { return this.keyValuePairs.length; }
	}
	
	function queryString(key){
	var page = new PageQuery(window.location.search);
	return unescape(page.getValue(key));
	}



