function _void()
{
}

function change_country(obj){
	var js_default_country_id = 150;
	var str_land = obj.value;
	var el_number = document.getElementById('number_row');

	if (str_land == js_default_country_id){
		el_number.className='';
	}else{
		el_number.className='hide';
	}
}

function stripslashes(str)
{
  str=str.replace(/\\'/g,'\'');
  str=str.replace(/\\"/g,'"');
  str=str.replace(/\\\\/g,'\\');
  str=str.replace(/\\0/g,'\0');
  return str;
}

function onlyNumbers(srcevent, show_alert)
{
	keyUpCode = (srcevent.keyCode ? srcevent.keyCode : srcevent.which);

	if ((keyUpCode>=48 && keyUpCode<=57) || keyUpCode==8 || keyUpCode==9 || (keyUpCode>=35 && keyUpCode<=40) )
	{
		return true;
  }
	else
	{
		if (show_alert)
		{
			alert('Alleen cijfers toegestaan! Toevoegingen in het volgende veld invullen.');
		}
		return false;
	}
}

function onlyNumbers2(srcevent)
{
	keyUpCode = (srcevent.keyCode ? srcevent.keyCode : srcevent.which);

	if ((keyUpCode>=48 && keyUpCode<=57) || keyUpCode==8  || keyUpCode==46 )
	{
		return true;
  }
	return false;
}


function show_otherwise(o, inpids)
{
	ids = inpids.split(",");

	if (ids.length)
	{
		for (var i = 0; i < ids.length; i++)
		{
			if (o.value == ids[i])
			{
				document.getElementById('know_us_freeinput').style.display = 'inline';
				document.getElementById('theother').focus();
				break;
			}
			else
			{
				document.getElementById('know_us_freeinput').style.display = 'none';
			}
		}
	}
}

function check_kmi()
{
	if (document.getElementById('txt_your_name').value=='' || document.getElementById('txt_your_mail').value=='')
	{
		alert('Geef uw naam en (een geldig) e-mail adres op.');
		return false;
	}
	else
	{
		var str = document.getElementById('txt_your_mail').value;
		var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if (!filter.test(str))
		{
			alert('Geef uw naam en (een geldig) e-mail adres op.');
			return false;
		}
	}
	
	if (document.getElementById('txt_your_mail').value != document.getElementById('txt_your_mail_confirm').value)
	{
		alert('Het bevestigings e-mail adres komt niet overeen met uw eerder ingevoerde e-mail adres.');
		return false;
	}

	document.getElementById('todo').value = 'process_kmi';
	document.getElementById('frm_add_to_cart').submit();
	return true;
}

function readmore(o, show)
{
	if (typeof(document.getElementById('rm'))!="undefined")
	{
		if (show==1)
		{
			document.getElementById('rm').innerHTML = '<a href="#" onclick="readmore(this,0);return false" rel="nofollow" style="margin-left:4px;">(lees minder)</a>';
			document.getElementById('fulltext').style.display = 'inline';
		}
		else
		{
			document.getElementById('rm').innerHTML = '<a href="#" onclick="readmore(this,1);return false" rel="nofollow" style="margin-left:4px;">(lees meer).</a>';
			document.getElementById('fulltext').style.display = 'none';
		}
	}
}

function check_search_form()
{
	if ($('q').value=="" || $('q').value=="Zoekterm")
	{
		return false;
	}
	return true;
}

function check_search_form2()
{
	if ($('q2').value=="" || $('q2').value=="Zoekterm")
	{
		return false;
	}
	return true;
}

/* popup functies */
var _popupDiv = '';
var _popupIframe = '';

function prod_popup(url)
{
  document.getElementsByTagName('html')[0].style.overflow = 'hidden';

  if (!_popupDiv)
  {
    _popupDiv = new Element('div').addClass('overaldiv').setStyle('opacity', .5).setStyle('height', window.getHeight()).setStyle('width', (window.getWidth()+12)+'px').injectInside(document.body).addEvent('click', function() {
      close_prod_popup();
    });
  }

  _popupDiv.setStyle('display','block');

	if (!_popupIframe)
  {
    _popupIframe = new Element('iframe').addClass('popup').setProperties({'frameBorder': 0}).setStyle('left', ((window.getWidth()-800)/2)+'px').setStyle('top', ((window.getHeight()-500)/2)+'px').injectInside(document.body);
  }

  window.scrollTo(0,0);

  _popupIframe.setStyle('display','block');
  _popupIframe.setAttribute('src', url);
}

function close_prod_popup()
{
  _popupDiv.setStyle('display','none');
  _popupIframe.setStyle('display','none');
  _popupIframe.setAttribute('src', '');
  document.getElementsByTagName('html')[0].style.overflow = 'auto';
  document.getElementsByTagName('html')[0].style.overflowX = 'hidden';
}


function info_popup(url, chk_fld)
{
	if (chk_fld && chk_fld!='')
	{
		url = url + "&" + chk_fld + "=" + get_radiofield_value(chk_fld);
	}

  document.getElementsByTagName('html')[0].style.overflow = 'hidden';

  if (!_popupDiv)
  {
    _popupDiv = new Element('div').addClass('overaldiv').setStyle('opacity', .5).setStyle('height', window.getHeight()).setStyle('width', (window.getWidth()+12)+'px').injectInside(document.body).addEvent('click', function() {
      close_info_popup();
    });
  }

  _popupDiv.setStyle('display','block');

	if (!_popupIframe)
  {
    _popupIframe = new Element('iframe').addClass('popup').setProperties({'frameBorder': 0}).setStyle('left', ((window.getWidth()-800)/2)+'px').setStyle('top', ((window.getHeight()-500)/2)+'px').injectInside(document.body);
  }

  window.scrollTo(0,0);

  _popupIframe.setStyle('display','block');
  _popupIframe.setAttribute('src', url);
}

function close_info_popup()
{
  _popupDiv.setStyle('display','none');
  _popupIframe.setStyle('display','none');
  _popupIframe.setAttribute('src', '');
  document.getElementsByTagName('html')[0].style.overflow = 'auto';
  document.getElementsByTagName('html')[0].style.overflowX = 'hidden';
}

function show_filter_dialog(i_id, s_cat_url, s_param)
{
	var s_url = 'http://www.coolsound.nl/filter_popup.php?redirect='+s_cat_url+'&id='+i_id+s_param;
  document.getElementsByTagName('html')[0].style.overflow = 'hidden';

	_popupDiv = new Element('div').addClass('filter_div').setStyle('opacity', .5).setStyle('height', window.getHeight()).setStyle('width', (window.getWidth()+12)+'px').injectInside(document.body);
  _popupDiv.setStyle('display','block');

	_popupIframe = new Element('iframe').addClass('filter_frame').setProperties({'frameBorder': 0}).setStyle('left', ((window.getWidth()-700)/2)+'px').setStyle('top', ((window.getHeight()-450)/2)+'px').injectInside(document.body);
  _popupIframe.setStyle('display','block');
  _popupIframe.setAttribute('src', s_url);

  window.scrollTo(0,0);

}





/* einde popup functies */

function get_radiofield_value(field)
{
  var x=document.getElementsByName(field);
	for (var i=0; i < x.length; i++)
	{
		if (x[i].checked)
		{
			return x[i].value;
		}
	}
	return false;
}


function submit_on_enter(srcevent, str_frmname)
{
	var keyUpCode = (srcevent.keyCode ? srcevent.keyCode : srcevent.which);
	if (keyUpCode == 13)
	{
		document.getElementById(str_frmname).submit();
	}
}

function show_full_text(o,i)
{
  o.style.display = 'none';
  if (i)
  {
		if ($('product_omschrijving'))
		{
			var slider = new Fx.Slide('product_omschrijving', {mode: 'vertical'}).hide();
			$('product_omschrijving').style.display = 'none';
			slider.slideOut();
		}

  	var slider = new Fx.Slide('txt'+i, {mode: 'vertical'}).hide();
    $('txt'+i).style.display = 'block';
    slider.slideIn();
  }
}

function open_demo(str_file, i_width, i_height)
{
	if (!i_width)
	{
		i_width = 570;
	}
	if (!i_height)
	{
		i_height = 620;
	}
	if (pageTracker)
	{
		pageTracker._trackPageview('/click/demo_navigon_'+str_file);
	}
 window.open('http://www.coolsound.nl/movies/movie.php?f='+str_file,'mymovies','toolbar=0,location=0,status=1,menubar=0,width='+i_width+',height='+i_height+',scrollbars=1,resizable=1');
}


function open_movie_popup(str_movie)
{
	//var str_url = 'http://www.coolsound.nl/movies/movie.php?f='+str_movie;
	var str_url = 'http://www.coolsound.nl/movies/movie.php?f=1300_506';

  document.getElementsByTagName('html')[0].style.overflow = 'hidden';

  if (!_popupDiv)
  {
    _popupDiv = new Element('div').addClass('overaldiv').setStyle('opacity', .5).setStyle('height', window.getHeight()).setStyle('width', (window.getWidth()+12)+'px').injectInside(document.body).addEvent('click', function() {
      close_info_popup();
    });
  }

  _popupDiv.setStyle('display','block');

	if (!_popupIframe)
  {
    _popupIframe = new Element('iframe').addClass('popup').setProperties({'frameBorder': 0}).setStyle('left', ((window.getWidth()-800)/2)+'px').setStyle('top', ((window.getHeight()-500)/2)+'px').injectInside(document.body);
  }

  window.scrollTo(0,0);

  _popupIframe.setStyle('display','block');
  _popupIframe.setAttribute('src', url);
}