// JavaScript Document

function validar(){
var n=0
var vec = new Array('nombre','msj','email2')
for ( var i=0; i<3;i++){
	if(document.all[vec[i]].value=='' || document.all[vec[i]].value=='Dato Requerido' || document.all[vec[i]].value== 'Dirección Invalida')
	{	document.all[vec[i]].value="Dato Requerido"
		document.all[vec[i]].style.color="#ff0000"
		n++
	}
	else{ 
			document.all[vec[i]].style.color="#333333"
			if(vec[i]=='email2')//if(document.all['email2'].value!='' && document.all[vec[i]].value!='REQ')
			{
				if ((document.all['email2'].value.indexOf("@") == -1) || (document.all['email2'].value.charAt(0) == ".") || (document.all['email2'].value.charAt(0) == "@") || (document.all['email2'].length < 6) || (document.all['email2'].value.indexOf(".") == -1) || (document.all['email2'].value.charAt(document.all['email2'].value.indexOf("@")+1) == ".") || (document.all['email2'].value.charAt(document.all['email2'].value.indexOf("@")-1) == ".")) { 
					document.all['email2'].value = 'Dirección Invalida'
					document.all['email2'].style.color="#ff0000"
					n++
		 		}
			}
		}
}
	if(n==0){ return true}
	else{ return false}	
}
function borrar(obj)
{
	if(obj.value== 'Dato Requerido' || obj.value== 'Dirección Invalida'){ obj.value =''
	obj.style.color="#000000"}
}

function enviar2(){
var n=0
		if ((document.all['email'].value.indexOf("@") == -1) || (document.all['email'].value.charAt(0) == ".") || (document.all['email'].value.charAt(0) == "@") || (document.all['email'].length < 6) || (document.all['email'].value.indexOf(".") == -1) || (document.all['email'].value.charAt(document.all['email'].value.indexOf("@")+1) == ".") || (document.all['email'].value.charAt(document.all['email'].value.indexOf("@")-1) == ".")) { 
				document.all['email'].value = 'Dirección Invalida'
				document.all['email'].style.color="#ff0000"
				n++
	 		}

	if(n==0){ return true;
	}else{ return false;}	
}

function open1(ima)
{
	var ar = window.open("popup.php?ima="+ima,'1',"width=100, height=100, menu=no, status=no, fullscreen=2, scrollbars=no, resizable=yes");	
}

function open2(a,ima)
{
	var ar = window.open("popup2.php?a="+a+"&ima="+ima,'1',"width=100, height=100, menu=no, status=no, fullscreen=2, scrollbars=no, resizable=yes");	
}

var photos1=new Array();
var photos2=new Array();
var vec = new Array("01.jpg","01.jpg","01.jpg","01.jpg","01.jpg","01.jpg","01.jpg","01.jpg","01.jpg","01.jpg","01.jpg","01.jpg","01.jpg","01.jpg","01.jpg","01.jpg","01.jpg","01.jpg","01.jpg","01.jpg","01.jpg","01.jpg","01.jpg","01.jpg", "01.jpg","01.jpg", "01.jpg");
for(p=1;p<27;p++){
	photos1[p]=new Image();
	photos1[p].src=("images/artistas/"+ p + ".jpg");
	photos2[p]=new Image();
	photos2[p].src=("images/artistas/"+p+"/"+vec[p-1]);
}

function poner(cual)
{
	document.images["grande"].src=photos2[cual].src;
	document.images["nombre"].src=photos1[cual].src;
}

function CargarCurriculum(id)
{
    document.getElementById('tdImageId').style.display = "none";
    document.getElementById('tdImageId1').style.display = "none";
    document.getElementById('tdIframeId').style.display="inline";
    document.getElementById('iFrameId').src="artistas/" + id + ".aspx"
}

function Resizeframe(){
var myWidth = 0,myHeight = 0;
var objTabla = document.getElementById('TblMain');


if( typeof( window.innerWidth ) == 'number' )
{
//Non-IE
myHeight = window.innerHeight;
}
else
if ( document.documentElement && (document.documentElement.clientHeight))
{
//IE 6+ in 'standards compliant mode'
myHeight = document.documentElement.clientHeight;
}
else
if( document.body && ( document.body.clientWidth ||document.body.clientHeight ) )
{
//IE 4 compatible
myHeight = document.body.clientHeight;
}
else
myHeight = document.body.clientHeight;
parent.document.getElementById("iFrameId").height=objTabla.offsetHeight+50;
}

