function showhideRow(iID){
	var cRow = document.getElementById("row"+iID)
	var cSpan = document.getElementById("span"+iID)
	if(cSpan){
		if(cSpan.style.display=="none"){
			cSpan.style.display="block";
			cSpan.style.visibility = "visible";
			cRow.style.paddingBottom = 2;
		}
		else{
			cSpan.style.display="none";
			cSpan.style.visibility = "hidden";
			cRow.style.paddingBottom = 0;
		}
	}
}

function showRow(iID){
	var numargs = arguments.length
	for(i=0;i<numargs;i++){ 
		var cRow = document.getElementById("row"+arguments[i])
		var cSpan = document.getElementById("span"+arguments[i])
		if(cSpan){
			cSpan.style.display="block";
			cSpan.style.visibility = "visible";
			cRow.style.paddingBottom = 2;
		}
	}
}

function Contact(oID, sName, sPicture, sPhone, sNickName, sMailImg, sMailImgHover){
	this.id = oID;
	this.Name = sName;
	this.Picture = sPicture;
	this.Phone = sPhone;
	this.Nickname = sNickName;
	this.MailImg = sMailImg;
	this.MailImgHover = sMailImgHover;
	
	this.getContact = Contact_GetContact;
	this.getContactWithPicture = Contact_GetContactWithPicture;	
	this.getContactList = Contact_GetContactList;
}

function Contact_GetContact(iTableWidth, iTD1Width, iTD2Width){
	var sContact = "";
	var iContactTableWidth = (iTableWidth!=null)? iTableWidth:""
	var iContactTD1Width = (iTD1Width!=null)? iTD1Width:""
	var iContactTD2Width = (iTD2Width!=null)? iTD2Width:""
	sContact = sContact + '<table cellpadding="0" cellspacing="5" width="'+iContactTableWidth+'"><tr><td valign="top" width="'+iTD1Width+'">'+this.Name+'</td><td valign="top" width="'+iTD2Width+'">'+this.Phone+'<br/><a href="'+protocol+':'+this.Nickname+'@'+contact_domain+'"><img src="'+this.MailImg+'" border="0" hspace="0" vspace="1"/></a><br/></td></tr></table>';	
	return sContact
}
function Contact_GetContactWithPicture(iTableWidth, iTD1Width, iTD2Width){
	var sContact = "";
	var iContactTableWidth = (iTableWidth!=null)? iTableWidth:"";
	var iContactTD1Width = (iTD1Width!=null)? iTD1Width:"";
	var iContactTD2Width = (iTD2Width!=null)? iTD2Width:"";
	var sPictureTag = (this.Picture!="")? '<img src="'+this.Picture+'" border="0" hspace="0" vspace="0"/>':'<img src="media/site/pixel.gif" border="1" width="100" height="150" hspace="0" vspace="0"/>'; 
	sContact = sContact + '<table cellpadding="0" cellspacing="5" width="'+iContactTableWidth+'"><tr><td valign="top" width="'+iTD1Width+'">'+sPictureTag+'</td><td valign="bottom" width="'+iTD2Width+'">'+this.Name+'<br/>'+this.Phone+'<br/><a href="'+protocol+':'+this.Nickname+'@'+contact_domain+'"><img src="'+this.MailImg+'" border="0" hspace="0" vspace="1"/></a><br/></td></tr></table>';	
	return sContact
}
function Contact_GetContactList(){}

function checkContactForm(oForm){
	var oForm = document.forms["contactForm"]
	return checkMail(oForm.Email.value, oForm.Email)
}

function checkTipsForm(){
	var oForm = document.forms["tipsForm"]
	if(checkMail(oForm.receiverEmail.value, oForm.receiverEmail)){
		return checkMail(oForm.senderEmail.value, oForm.senderEmail)
	}
	else return false
}

function checkMaillistForm(sInputValue){
	/*
	if(document.forms['maillistForm'].MemberName.value ==""){
		alert(noNameML);
		document.forms['maillistForm'].MemberName.focus();
		return false;
	}
	else{
		*/
		var myRe = /[a-z0-9_.=-]+@([a-z0-9-]+\.)+([a-z]{2,3})/i;
		if (!(sInputValue).match(myRe))	{
			alert(emailErrorML);
			document.forms['maillistForm'].MemberEmail.focus()
			return false
		}
		else {
			if(document.forms['maillistForm'].Status[0]!=null) document.forms['maillistForm'].SubmitMode.value = (document.forms['maillistForm'].Status[0].checked)? "create":"delete"
			return true
		}
	//}
}		

function checkMail(sInputValue,oFormField){
	var myRe = /[a-z0-9_.=-]+@([a-z0-9-]+\.)+([a-z]{2,3})/i;
	if (!(sInputValue).match(myRe))	{
		alert(emailErrorML)
		oFormField.focus()
		return false
	}
	else {
		return true
	}
}

function showToPrint(){
	//window.open(hostPath + "/web/print.asp?artID=" +artID);
	window.print();
}
function showTips(){
	window.open(hostPath + "/web/tips.asp?artID=" +artID);
}

function toggleContent(sID){
	var objContent = document.getElementById("artContent"+sID)
	var objTitle = document.getElementById("divTitle"+sID)
	for(i=1; i<=6;i++){
		if(sID!=i){
			if(document.getElementById("divTitle"+i)!=null&document.getElementById("divTitle"+i)!="undefined"){
				document.getElementById("artContent"+i).style.display = "none";
				document.getElementById("divTitle"+i).className = "divTitleLink";
			}
		}
		else{
			objTitle.className = "divTitleSelectedLink";
			objContent.style.display = "block";
		}
	}
}	