/*-----------------------------------------------
| Version          : 01.00
-------------------------------------------------*/

function validateEnquiry()
	{
	
		//---------- FName  ----------
		if ( document.frmenquiry.fromname.value == ""  )
		{if (!(PrintMesg(document.frmenquiry.fromname,"Please enter the Name.")))
		{return false;}}
		else  { 
		if (!SpaceChk(document.frmenquiry.fromname))
		{if (!(PrintMesg(document.frmenquiry.fromname,"Please enter the First Name.")))
		{return false;}}
		}
		
		//---------- Email  ----------
		mail = ""
		mail = document.frmenquiry.from.value
		if (mail  == "")
		{if (!(PrintMesg(document.frmenquiry.from,"Please enter E-mail Address.")))
		{return false;}}
		else { 
		n = mail.indexOf("@")
		if (n >= 0)
		{ newstr = mail.substring(n)
		n= newstr.indexOf(".")
		if (n<0)
		{if (!(PrintMesg(document.frmenquiry.from,"Please enter a valid E-mail Address.")))
		{return false;}}
		} 
		else
		{if (!(PrintMesg(document.frmenquiry.from,"Please enter a valid E-mail Address.")))
		{return false;}}
		}
		
		
		if ( document.frmenquiry.verif_box.value == ""  )
		{if (!(PrintMesg(document.frmenquiry.verif_box,"Please enter the verification code")))
		{return false;}}
		else  { 
		if (!SpaceChk(document.frmenquiry.verif_box))
		{if (!(PrintMesg(document.frmenquiry.verif_box,"Please enter the verification code")))
		{return false;}}
		}

		//---------- Please specify your enquiry

		if ( document.frmenquiry.message.value == ""  )
		{if (!(PrintMesg(document.frmenquiry.message,"Please enter the enquiry")))
		{return false;}}
		else  { 
		if (!SpaceChk(document.frmenquiry.message))
		{if (!(PrintMesg(document.frmenquiry.message,"Please enter the enquiry")))
		{return false;}}
		}
	
	

	return true;
	}
	

//prints messages
function PrintMesg(ctrlvar,mesg)
{ alert(mesg); ctrlvar.focus(); return false }

// function to check spaces
function SpaceChk(ctrlvar)
{
   chkstr     = ctrlvar.value
   stlength   = chkstr.length
   spacecount = 0
   if (stlength >0)  {
    for(i=0;i<=stlength;i++)
     if ( chkstr.charAt(i)==" ") { spacecount=spacecount+1  }
    if (stlength == spacecount) { return false }
   return true }
}

function popimage(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=750,height=730,scrollbars=Yes');
return false;
}

function popvideo(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=435,height=370,scrollbars=No');
return false;
}

//---------------
function tellpopup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=600,height=600,scrollbars=No');
return false;
}


function validateFeedback()
	{
	
		//---------- FName  ----------
		if ( document.frmfeedback.yName.value == ""  )
		{if (!(PrintMesg(document.frmfeedback.yName,"Bitte geben Sie Name.")))
		{return false;}}
		else  { 
		if (!SpaceChk(document.frmfeedback.yName))
		{if (!(PrintMesg(document.frmfeedback.yName,"Bitte geben Sie Name.")))
		{return false;}}
		}
		
		//---------- Email  ----------
		mail = ""
		mail = document.frmfeedback.yEmail.value
		if (mail  == "")
		{if (!(PrintMesg(document.frmfeedback.yEmail,"Bitte geben Sie E-Mail-Adresse.")))
		{return false;}}
		else { 
		n = mail.indexOf("@")
		if (n >= 0)
		{ newstr = mail.substring(n)
		n= newstr.indexOf(".")
		if (n<0)
		{if (!(PrintMesg(document.frmfeedback.yEmail,"Bitte geben Sie eine gültige E-Mail-Adresse.")))
		{return false;}}
		} 
		else
		{if (!(PrintMesg(document.frmfeedback.yEmail,"Bitte geben Sie eine gültige E-Mail-Adresse.")))
		{return false;}}
		}
		
		
		
		//---------- Please specify your Feedback

		if ( document.frmfeedback.contactsMessage.value == ""  )
		{if (!(PrintMesg(document.frmfeedback.contactsMessage,"Bitte geben Sie Feedback")))
		{return false;}}
		else  { 
		if (!SpaceChk(document.frmfeedback.contactsMessage))
		{if (!(PrintMesg(document.frmfeedback.contactsMessage,"Bitte geben Sie Feedback")))
		{return false;}}
		}
	
	

	return true;
	}

