// JavaScript Document
<!--

var select = 0;
function selectAll() {
select = !select;
for (i=0; i<document.AlbumsEdit.length; i++)
if (document.AlbumsEdit.elements[i].type == 'checkbox')
document.AlbumsEdit.elements[i].checked = select;
}

function getRef(elementId) {
	var ref;
	if (document.getElementById){ 
		/* Recent specific code */ 
		ref = document.getElementById(elementId); 
	} 
	else if (document.all){ 
		/* IE4+ specific code */ 
		ref = document.all[elementId];	
	} 
	else if (document.forms){ 
		/* Netscape 4 specific code */ 
		ref = document.forms[elementId]; 
	}
	return ref;
}

function setForm(myValue,elementId) {
	getRef(elementId).value = myValue;
}

function show(elementId) {
	getRef(elementId).style.display = "";
}

function hide(elementId) {
	getRef(elementId).style.display = "none";
}

function show_hide(elementId){
	obj = getRef(elementId);
	obj.style.display = obj.style.display == 'none' ? '' : 'none';
}

function show_hide_arrow(id)
{	var elementId='FAQ_arrow_left_'+id;
	obj = getRef(elementId);
	obj.style.display = obj.style.display == 'none' ? '' : 'none';
	
	var elementId2='FAQ_arrow_bottom_'+id;
	obj2 = getRef(elementId2);
	obj2.style.display = obj.style.display == 'none' ? '' : 'none';
}

function showALL() {
	show('hideALL');
	hide('showALL');
	for(i=1;i<100;i++)
	{	var dsp='FAQ'+i;
		show(dsp);
		show('FAQ_arrow_bottom_'+i);
		hide('FAQ_arrow_left_'+i);
	}
}

function hideALL() {
	hide('hideALL');
	show('showALL');
	for(i=1;i<100;i++)
	{	var dsp='FAQ'+i;
		hide(dsp);
		hide('FAQ_arrow_bottom_'+i);
		show('FAQ_arrow_left_'+i);
	}
}

function probiotics_show_hide_arrow(id)
{	var elementId='probiotics_FAQ_arrow_left_'+id;
	obj = getRef(elementId);
	obj.style.display = obj.style.display == 'none' ? '' : 'none';
	
	var elementId2='probiotics_FAQ_arrow_bottom_'+id;
	obj2 = getRef(elementId2);
	obj2.style.display = obj.style.display == 'none' ? '' : 'none';
}

function probiotics_showALL() {
	show('hideALL');
	hide('showALL');
	for(i=1;i<100;i++)
	{	var dsp='probiotics_FAQ'+i;
		show(dsp);
		show('probiotics_FAQ_arrow_bottom_'+i);
		hide('probiotics_FAQ_arrow_left_'+i);
	}
}

function probiotics_hideALL() {
	hide('hideALL');
	show('showALL');
	for(i=1;i<100;i++)
	{	var dsp='probiotics_FAQ'+i;
		hide(dsp);
		hide('probiotics_FAQ_arrow_bottom_'+i);
		show('probiotics_FAQ_arrow_left_'+i);
	}
}

var xmlHttp;
function hint(str,place)
{ 	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Your browser does not support AJAX!");
		return;
	} 
	var url="show.php";
	url=url+"?type="+str+"&place="+place;
	xmlHttp.onreadystatechange = stateChange;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);

	function stateChange() {
 getRef(place).innerHTML=xmlHttp.responseText;
		if (xmlHttp.readyState==4) { getRef(place).innerHTML=xmlHttp.responseText; }
	}
}

function GetXmlHttpObject()
{	var xmlHttp=null;
	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e) {
		// Internet Explorer
		try 		{	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");	}
		catch (e)	{	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");	}
	}
	return xmlHttp;
}

function setText(myValue, myField) {
	//IE support
	if (document.selection && myField.lenght<5) {
		myField.focus();
		sel = document.selection.createRange();
		sel.text = myValue;
	}
	//MOZILLA/NETSCAPE support
	else if (myField.selectionStart || myField.selectionStart == '0') {
		var startPos = myField.selectionStart;
		myField.value = myField.value.substring(0, 0) + myValue;
	} else {
		myField.value = myValue;
	}
}

function Video_Form_Validator()
{ var theForm = getRef('MainForm');

  if (theForm.username.value == "")
  { alert("Please enter a value for the \"E-mail\" field.");
    theForm.username.focus();
    return false;
  }
  if(theForm.email.value!="") { return true; }
}

function Feedback_Form_Validator(theForm)
{	var theForm=getRef('MainForm');

	if (theForm.firstname.value == "")
  { alert("Please enter a value for the \"First Name\" field.");
    getRef('firstname_text').style.color = 'red';
    theForm.firstname.focus();
    return (false);
  }
  if (theForm.lastname.value == "")
  { alert("Please enter a value for the \"Last Name\" field.");
    getRef('lastname_text').style.color = 'red';
    theForm.lastname.focus();
    return (false);
  }
  if (theForm.email.value == "")
  { alert("Please enter a value for the \"E-mail\" field.");
    getRef('email_text').style.color = 'red';
    theForm.email.focus();
    return false;
  }
  if (theForm.password.value == "")
  { alert("Please enter a value for the \"Password\" field.");
    getRef('password_text').style.color = 'red';
    theForm.password.focus();
    return false;
  }
  if (theForm.repassword.value == "")
  { alert("Please enter a value for the \"rePassword\" field.");
    getRef('repassword_text').style.color = 'red';
    theForm.repassword.focus();
    return false;
  }
  if (theForm.password.value != theForm.repassword.value)
  { alert("\"Password\" and \"RePassword\" are not equal!");
    getRef('password_text').style.color = 'red';
    getRef('repassword_text').style.color = 'red';
    theForm.password.focus();
    return false;
  }
  if (theForm.country.value == "")
  { alert("Please select a value for the \"Country\" field.");
    getRef('country_text').style.color = 'red';
    theForm.country.focus();
    return (false);
  }
  if (theForm.occupation.value == "")
  { alert("Please select a value for the \"Occupation\" field.");
    getRef('occupation_text').style.color = 'red';
    theForm.occupation.focus();
    return (false);
  }
  if (theForm.company.value == "")
  { alert("Please enter a value for the \"Company\" field.");
    theForm.company.focus();
    getRef('company_text').style.color = 'red';
    return (false);
  }
  if (theForm.keystring.value == "")
  { alert("Please enter a value from image into input box.");
    theForm.keystring.focus();
    getRef('keystring_text').style.color = 'red';
    return (false);
  }
  if(theForm.email.value!="") { return true; }
}

function User_Form_Validator(theForm)
{	var theForm = getRef('MainForm');

	if (theForm.name.value == "")
  { alert("Please enter a value for the \"Name\" field.");
    getRef('name_text').style.color = 'red';
    theForm.name.focus();
    return (false);
  }
  if (theForm.password.value != theForm.repassword.value)
  { alert("\"Password\" and \"RePassword\" are not equal!");
    getRef('password_text').style.color = 'red';
    getRef('repassword_text').style.color = 'red';
    theForm.password.focus();
    return false;
  }
  if (theForm.company.value == "")
  { alert("Please enter a value for the \"Company\" field.");
    theForm.company.focus();
    getRef('company_text').style.color = 'red';
    return (false);
  }
  if(theForm.check.value != "") { return true; }
}

function MM_openBrWindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}

