/*************
* Print tool
*************/
function showPrint(path) {
	var printLayer = document.getElementById("content");
	var head = document.getElementsByTagName('head');
	newWindow = window.open( "", "", "width=700, height=800,location=no,toolbar=no,menubar=no");
	newWindow.document.writeln("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'>");
	newWindow.document.writeln("<html><head> <!-- test -->");
	newWindow.document.writeln( head[0].innerHTML);
	newWindow.document.writeln("</head><body>");
	newWindow.document.writeln("<div id='content' class='printLayer'>");
	newWindow.document.writeln( printLayer.innerHTML);
	newWindow.document.writeln("</div>");
	newWindow.document.writeln("</body>");
	newWindow.document.writeln("</html>");
	if (navigator.appName=="Netscape" || navigator.appName=="Mozilla"){   
			newWindow.document.close();
		} else {
			newWindow.document.location.reload();
	}
	newWindow.print();

	//dummyWindow = window.open(path + "/printHit.html?" + document.location, "printHit", "height=1, width=1, top=2000, location=no,toolbar=no,menubar=no");
}
/*************
* Set Bookmark
*************/
function setBookmark() {
	var url = parent.document.location.href;
	var title = document.title;
	if (navigator.appName.indexOf("Explorer")>-1) {
		window.external.AddFavorite(url, title);
	} else {
		window.sidebar.addPanel(title, url, "");
	}
}
/**************
Form validation 
contact/enviar
***************/
function validForm(formName){
	var i;
	var empty;
	for(i=0;i<document.forms[formName].length;i++){
		if((document.forms[formName].elements[i].value=='') && (document.forms[formName].elements[i].name!='comment')){
			empty=true;
		}
	}
	if(empty==true){
		alert('- Por favor, rellena todo los campos');
	}
	else{
		var validMailFrom=checkEmail(document.forms[formName].elements['mailFrom'].value);		
		if(formName=='contactForm'){
			var validMailFriend=true;
		}
		else var validMailFriend=checkEmail(document.forms[formName].elements['mailFriend'].value);
		
		if((validMailFrom==true) && (validMailFriend==true)){
			document.forms[formName].submit();
		}
		else alert('- La direccion de correo electronico no es valida');
	}

}

function checkEmail(str){
  var filter=/^.+@.+\..{2,3}$/;
  return (filter.test(str));
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}





