/* determining whether msie or netscape being used and what versions */
var IE4 = (document.all && !document.getElementById) ? 1 : 0;
var NS4 = (document.layers) ? 1 : 0;
var IE5 = (document.all && document.getElementById) ? 1 : 0;
var N6 = (document.getElementById && !document.all) ? 1 : 0;
var ie = (IE4 || IE5) ? 1 : 0;
var n = (NS4 || N6) ? 1 : 0;
var IE5MAC = false;
var NS4MAC = false;

/* Image rollover & preloads for images */
function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "'+imgSrc+'"')
	}
}

function changeImage(imgName,imgObj) {
	document.images[imgName].src = eval(imgObj+".src")
}
function activeImage(imgObj) {
	document.images[imgObj].src = eval(imgObj+"On.src")
}
function resetImage(imgObj) {
	document.images[imgObj].src = eval(imgObj+"Off.src")
}

/* Pop Up Code */
function PopUp(url,width,height)	{
	if (width=="new") {
		var newWindow = open (url, '_blank','width=740,height=410,location=1,status=1,toolbar=1,menubar=1,scrollbars=1,resizable=1');
	} else {
		if (width==null) width=437
		if (height==null) height=420
		var newWindow = open (url, '_blank','width='+width+',height='+height+',location=0,status=0,toolbar=0,menubar=0,scrollbars=1,resizable=1');
	}
	newWindow.focus ();
}

/**************  FAQ SCRIPTS  **************/
function ClearSearchForm() {
	if(document.forms["daForm"].SearchTerms.value == "search faqs") {
		document.forms["daForm"].SearchTerms.value = "";
	}
}
function ResetSearchForm() {
	if(document.forms["daForm"].SearchTerms.value == "" || document.forms["daForm"].SearchTerms.value == " ") {
		document.forms["daForm"].SearchTerms.value = "search faqs";
	}
}

//  Show / Hide the answer
function ShowAnswer(item) {
	ThisObj = document.getElementById('A' + item);
	visible = (ThisObj.style.display != 'none');
	QLink = document.getElementById('Q' + item);

	if (visible) {
		ThisObj.style.display = 'none';
 		QLink.style.fontWeight = 'normal';
	} else {
		ThisObj.style.display = 'block';
		QLink.style.fontWeight = 'bold';
	}
}
/* --------------- END --------------- */


/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu
var menuservice=new Array()
menuservice[0]='<a href="/service/index.php" class="dropmenu" target="_parent">contactar</a><br>'
menuservice[1]='<a href="/manual/strida5.php" class="dropmenu" target="_parent">manual de usuario strida5</a><br>'
menuservice[2]='<a href="/manual/strida3.php" class="dropmenu" target="_parent">manual de usuario strida3</a><br>'

//Contents for menu 2, and so on
var menubike=new Array()
menubike[0]='<a href="/bike/index.php" class="dropmenu" target="_parent">imágenes</a><br>'
menubike[1]='<a href="/bike/designfeatures.php" class="dropmenu" target="_parent">características</a><br>'
menubike[2]='<a href="/bike/top10.php" class="dropmenu" target="_parent">por qué elegir strida</a><br>'
menubike[3]='<a href="/bike/performancekit.php" class="dropmenu" target="_parent">kit premium</a><br>'


var menudemo=new Array()
menudemo[0]='<a href="/demo/index.php" class="dropmenu" target="_parent">demo 3D</a><br>'
menudemo[1]='<a href="/demo/spin.php" class="dropmenu" target="_parent">demo plegado strida</a><br>'


var menuimages=new Array()
menuimages[0]='<a href="/images/index.php" class="dropmenu" target="_parent">imágenes</a><br>'

var menufaqs=new Array()
menufaqs[0]='<a href="/faqs/index.php" class="dropmenu" target="_parent">faqs</a><br>'
menufaqs[1]='<a href="/faqs/links.php" class="dropmenu" target="_parent">enlaces</a><br>'
menufaqs[2]='<a href="/faqs/search.php" class="dropmenu" target="_parent">búsqueda</a><br>'

var menunews=new Array()
menunews[0]='<a href="/news/index.php" class="dropmenu" target="_parent">noticias</a><br>'
menunews[1]='<a href="/news/media.php" class="dropmenu" target="_parent">strida en los medios</a><br>'
menunews[2]='<a href="/news/awards.php" class="dropmenu" target="_parent">premios</a><br>'
menunews[3]='<a href="/news/testimonials.php" class="dropmenu" target="_parent">comentarios</a><br>'
menunews[4]='<a href="/news/video.php" class="dropmenu" target="_parent">vídeos</a><br>'

var menucontact=new Array()
menucontact[0]='<a href="/contact/index.php" class="dropmenu" target="_parent">contacto</a><br>'

var menubuy=new Array()
menubuy[0]='<a href="/shop/index.php" class="dropmenu" target="_parent">strida 5.2</a><br>'
menubuy[1]='<a href="/shop/stridasx.php" class="dropmenu" target="_parent">strida SX</a><br>'
menubuy[2]='<a href="/shop/stridamas.php" class="dropmenu" target="_parent">strida MAS</a><br>'
menubuy[3]='<a href="/shop/promociones.php" class="dropmenu" target="_parent">strida mini</a><br>'
menubuy[4]='<a href="/shop/accessories.php" class="dropmenu" target="_parent">accesorios</a><br>'
menubuy[5]='<a href="/shop/partkits.php" class="dropmenu" target="_parent">recambios</a><br>'
menubuy[6]='<a href="/shop/warranties.php" class="dropmenu" target="_parent">garantia</a><br>'
menubuy[7]='<a href="/shop/shipping.php" class="dropmenu" target="_parent">gastos de envio</a><br>'
menubuy[8]='<a href="/shop/formasdepago.php" class="dropmenu" target="_parent">formas de pago</a><br>'
menubuy[9]='<a href="/shop/checkout.php" class="dropmenu" target="_parent">mi cuenta</a><br>'
menubuy[10]='<a href="/shop/pruebala.php" class="dropmenu" target="_parent">prúebala sin compromiso</a><br>'
menubuy[11]='<a href="/shop/howtoreturn.php" class="dropmenu" target="_parent">devoluciones</a><br>'
/**/


var menuwidth='130px' //default menu width
var menubgcolor='#999999'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(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;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu


//	Check form field is valid email address
function EmailCheck(str) {
		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		if (str.indexOf(at)==-1){
		   return false;
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false;
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false;
		}
		 if (str.indexOf(at,(lat+1))!=-1){
		    return false;
		 }
		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false;
		 }
		 if (str.indexOf(dot,(lat+2))==-1){
		    return false;
		 }
		 if (str.indexOf(" ")!=-1){
		    return false;
		 }
 		 return true;
	}