function ShowVideo()
{
    document.getElementById("imgDoctor").style.display = "none";
	document.getElementById("imgDoctor").style.visibility = "visible";
	document.getElementById("mmDoctor").style.visibility = "visible";
    document.getElementById("mmDoctor").style.display = "";	
    document.getElementById("mmDoctor").play();
}


function SubCatDetail(scid)
{
	if(scid!="")
	{
		document.frmSubcats.scid.value=scid;
		document.frmSubcats.submit();
	}
}
function picturesDetail(picid,url)
{
	if(picid!="")
	{
		document.frmPictures.scid.value=picid;
		document.frmPictures.action=url;
		document.frmPictures.submit();
	}
}

function cdetail(cid)
{
	if(cid!="")
	{
		document.frmSearch.cid.value=cid;
		document.frmSearch.action="Titan_Category_Detail.asp";
		document.frmSearch.submit();
	}
}
function cpicture(cid)
{
	if(cid!="")
	{
		document.frmSearch.cid.value=cid;
		document.frmSearch.action="Titan_Category_Picture.asp";
		document.frmSearch.submit();
	}
}
function ProductDetail(prdid)
{
	if(prdid!="")
	{
		document.frmProducts.prdid.value=prdid;
		document.frmProducts.submit();
	}
}
function ProductDetails(prdid)
{
	if(prdid!="")
	{
		document.frmSearch.prdid.value=prdid;
		document.frmSearch.action="Titan_Products_Detail.asp";
		document.frmSearch.submit();
	}
}
function ProductTypeDetail(scid,prdTypeID)
{
	if(scid!="")
	{
		document.frmProducts.scid.value=scid;
		document.frmProducts.prdTypeID.value=prdTypeID;
		document.frmProducts.action="Titan_ProductType_Detail.asp";
		document.frmProducts.submit();
	}
}

function verify_application()
{
	if(document.frmAplicacion.txtName.value=="")
	{
		alert("Por favor, introduzca su nombre !!!");
		document.frmAplicacion.txtName.focus();
		return false;
	}
	if(document.frmAplicacion.txtLastName.value=="")
	{
		alert("Por favor, introduzca su apellido !!!");
		document.frmAplicacion.txtLastName.focus();
		return false;
	}
	if(document.frmAplicacion.txtYearOfBirth.value=="")
	{
		alert("Por favor, introduzca el año de nacimiento !!!");
		document.frmAplicacion.txtYearOfBirth.focus();
		return false;
	}

	if(document.frmAplicacion.txtAge.value=="")
	{
		alert("Por favor, introduzca su edad !!!");
		document.frmAplicacion.txtAge.focus();
		return false;
	}

	if(document.frmAplicacion.txtEducation.value=="")
	{
		alert("Por favor, introduzca su educación !!!");
		document.frmAplicacion.txtEducation.focus();
		return false;
	}
	if(document.frmAplicacion.txtEmail.value=="")
	{
		alert("Por favor, introduzca su dirección de correo electrónico !!!");
		document.frmAplicacion.txtEmail.focus();
		return false;
	}
	if (!isEleEmailValid())
	{
    	alert("Por favor, introduzca una dirección de correo electrónico válida!!!");
    	document.frmAplicacion.txtEmail.focus();
    	return false;
	}
	if(document.frmAplicacion.txtPhone.value=="")
	{
		alert("Por favor, introduzca su teléfono !!!");
		document.frmAplicacion.txtPhone.focus();
		return false;
	}
	if(document.frmAplicacion.txtCV.value=="")
	{
		alert("Por favor, cargue su CV !!!");
		document.frmAplicacion.txtCV.focus();
		return false;
	}
	return true;
}

function isvalidDigitsInEmail(){
	var digits="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@_.-";
	var temp;
	for(var i=0;i<document.frmAplicacion.txtEmail.value.length;i++){
		temp=document.frmAplicacion.txtEmail.value.substring(i,i+1);
		if(digits.indexOf(temp)==-1){
			return (false);
		}
	}
	return (true);
}

/*function for checking Email address*/
function isEleEmailValid(){
	if (!isvalidDigitsInEmail()){
		return (false);
	}
	var EmailOk  = true;
	var Temp     = document.frmAplicacion.txtEmail;
	var AtSym    = Temp.value.indexOf('@');
	var Period   = Temp.value.lastIndexOf('.');
	var Space    = Temp.value.indexOf(' ');
	var Dot      = Temp.value.indexOf('.');
	var Length   = Temp.value.length - 1;   // Array is from 0 to length-1

	if ((AtSym < 1) ||                     // '@' cannot be in first position
	    (Period <= AtSym+1) ||             // Must be atleast one valid char btwn '@' and '.'
	    (Period == Length ) ||             // Must be atleast one valid char after '.'
	    (Space  != -1)      ||              // No empty spaces permitted
	    (Dot ==0 )          ||            // No Dot on first position permitted
	    (Dot+1 ==AtSym ))                      // No Dot on first position permitted
	   {
	      EmailOk = false;
	   }
	return (EmailOk);
}

function popup1()
{
	newwin=window.open("uploadcv.asp","displayWindow","toolbar=no,scrollbars=0,width=399,height=370,top=100,left=200");
}

function verify_contactus()
{
	if(document.frmContectenos.Name.value=="")
	{
		alert("Por favor, introduzca su nombre !!!");
		document.frmContectenos.Name.focus();
		return false;
	}
	
	if(document.frmContectenos.phone.value=="")
	{
		alert("Por favor, introduzca su teléfono !!!");
		document.frmContectenos.phone.focus();
		return false;
	}

	if(document.frmContectenos.email.value=="")
	{
		alert("Por favor, introduzca su dirección de correo electrónico !!!");
		document.frmContectenos.email.focus();
		return false;
	}
	if (!isEmailValid())
	{
    	alert("Por favor, introduzca una dirección de correo electrónico válida!!!");
    	document.frmContectenos.email.focus();
    	return false;
	}
	
	return true;
}

function isvalidDigits(){
	var digits="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@_.-";
	var temp;
	for(var i=0;i<document.frmContectenos.email.value.length;i++){
		temp=document.frmContectenos.email.value.substring(i,i+1);
		if(digits.indexOf(temp)==-1){
			return (false);
		}
	}
	return (true);
}

/*function for checking Email address*/
function isEmailValid(){
	if (!isvalidDigits()){
		return (false);
	}
	var EmailOk  = true;
	var Temp     = document.frmContectenos.email;
	var AtSym    = Temp.value.indexOf('@');
	var Period   = Temp.value.lastIndexOf('.');
	var Space    = Temp.value.indexOf(' ');
	var Dot      = Temp.value.indexOf('.');
	var Length   = Temp.value.length - 1;   // Array is from 0 to length-1

	if ((AtSym < 1) ||                     // '@' cannot be in first position
	    (Period <= AtSym+1) ||             // Must be atleast one valid char btwn '@' and '.'
	    (Period == Length ) ||             // Must be atleast one valid char after '.'
	    (Space  != -1)      ||              // No empty spaces permitted
	    (Dot ==0 )          ||            // No Dot on first position permitted
	    (Dot+1 ==AtSym ))                      // No Dot on first position permitted
	   {
	      EmailOk = false;
	   }
	return (EmailOk);
}

//This for fading the scrolling images
maxOpac=100
minOpac=70

maxOpac1=70
minOpac1=100

function toggleOpac(obj)
{
if(obj.filters)
	{
		if(obj.style.filter=="alpha(opacity:"+minOpac+")")
		{
			obj.style.filter = "alpha(opacity:"+maxOpac+")"
		}
		else
		{
			obj.style.filter = "alpha(opacity:"+minOpac+")"
		}
	}
else
	{
		if(obj.style.opacity == maxOpac1/100){
		obj.style.opacity = minOpac1/100}
		else{obj.style.opacity = maxOpac1/100}
	}
}

// IE/Win
//  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
//  obj.style.KHTMLOpacity = opacity/100;
  
  // Older Mozilla and Firefox
//  obj.style.MozOpacity = opacity/100;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
//  obj.style.opacity = opacity/100;

//***************************************************
// This function works by finding the "MSIE "
// string and extracting the version number
// following the space, up to the decimal point
// for the minor version, which is ignored.
function msieversion()
// return Microsoft Internet Explorer (major)
// version number, or 0 for others.
{
var ua = window.navigator.userAgent
var msie = ua.indexOf ( "MSIE " )
if ( msie > 0 ){      // is Microsoft Internet Explorer; return version number
//   return parseInt ( ua.substring ( msie+5, ua.indexOf ( ".", msie ) ) )
//   alert(parseInt ( ua.substring ( msie+5, ua.indexOf ( ".", msie ) ) ));
   document.getElementById("vmarquee").style.position = "absolute";
   document.getElementById("marqueecontainer").style.position = "absolute";   
}
else
{
  // return 0          // is other browser
//  alert("Opera");
  document.getElementById("vmarquee").style.position = "absolute";
}
}

//End Of msieversion() Function
function verifySubscriber()
{
	if(document.frmNewsletter.txtSubscribeEmail.value=="")
	{
		alert("Por favor, introduzca su dirección de correo electrónico !!!");
		document.frmNewsletter.txtSubscribeEmail.focus();
		return false;
	}
	if (!isEmailSubscriberValid())
	{
    	alert("Por favor, introduzca una dirección de correo electrónico válida!!!");
    	document.frmNewsletter.txtSubscribeEmail.focus();
    	return false;
	}
	
	return true;
}

function isvalidSubscriberDigits(){
	var digits="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@_.-";
	var temp;
	for(var i=0;i<document.frmNewsletter.txtSubscribeEmail.value.length;i++){
		temp=document.frmNewsletter.txtSubscribeEmail.value.substring(i,i+1);
		if(digits.indexOf(temp)==-1){
			return (false);
		}
	}
	return (true);
}

/*function for checking Email address*/
function isEmailSubscriberValid(){
	if (!isvalidSubscriberDigits()){
		return (false);
	}
	var EmailOk  = true;
	var Temp     = document.frmNewsletter.txtSubscribeEmail;
	var AtSym    = Temp.value.indexOf('@');
	var Period   = Temp.value.lastIndexOf('.');
	var Space    = Temp.value.indexOf(' ');
	var Dot      = Temp.value.indexOf('.');
	var Length   = Temp.value.length - 1;   // Array is from 0 to length-1

	if ((AtSym < 1) ||                     // '@' cannot be in first position
	    (Period <= AtSym+1) ||             // Must be atleast one valid char btwn '@' and '.'
	    (Period == Length ) ||             // Must be atleast one valid char after '.'
	    (Space  != -1)      ||              // No empty spaces permitted
	    (Dot ==0 )          ||            // No Dot on first position permitted
	    (Dot+1 ==AtSym ))                      // No Dot on first position permitted
	   {
	      EmailOk = false;
	   }
	return (EmailOk);
}

function makeSelection(selType)
{
	var iLoop = 0;
	
	//Check If Selection Checkboxes Exist on Page or Not
	if(typeof document.frmSelectProperty.rdnSelect != "undefined")
	{
		//Check If Selection Checkboxes are in Array or Not
		if(typeof document.frmSelectProperty.rdnSelect.length != "undefined")
		{
			//Yes, They are in Array So Loop through Each Possible Checkbox
			//And Select them Accordingly
			for(iLoop=0; iLoop<document.frmSelectProperty.rdnSelect.length; iLoop++)
			{
				document.frmSelectProperty.rdnSelect[iLoop].checked = selType;
			}
		}
		else
		{
			//No, There is only One Selection Checkbox
			//So Select it Accordingly
			document.frmSelectProperty.rdnSelect.checked = selType;
		}
	}
}
