
function fnc_Validate()
{
	var frmObj=document.frmnhs;
	 
	if(frmObj.textName.value=="")
	  {
	   	alert("Please Enter Name");
	   	frmObj.textName.focus();
	  	return false;
	  }
  if(frmObj.textSiteUrl.value=="")
	  {
		  alert("Please Enter Site Address");
			frmObj.textSiteUrl.focus();
			return false;
	  }
	if(frmObj.textTitle.value=="")
	  {
		  alert("Please Enter Title");
			frmObj.textTitle.focus();
			return false;
	  }
	if(frmObj.textDesc.value=="")
	  {
	    alert("Please Enter Description");
			frmObj.textDesc.focus();
			return false;
	  }
	if(frmObj.textEmail.value=="")
	 {
		  alert("Please Enter Email Address");
			frmObj.textEmail.focus();
			return false;
	 }
	 if(validateEmail(frmObj.textEmail)==false)
	 {
		 return false;
	 }
	if(frmObj.textLinkUrl.value=="")
	 {
		  alert("Please Enter URL");
		  frmObj.textLinkUrl.focus();
			return false;
	 }
	if(frmObj.textDesc.value.length>300)
   {
		  alert("Please Enter Description of 300 characters");
			frmObj.textDesc.focus();
			return false; 
	 }

  return true;
} 
function validateText(text)
 { 
   invalidChars = "/\:,;'+-*!#&*()><{}[]^`~=_"
       for(i=0; i<text.value.length; i++)
        { 
        	//check for invalid characters 	
          for(j=0;j<invalidChars.length;j++)
          { 
              if(text.value.charAt(i)==invalidChars.charAt(j))
               { 
     	           alert("Special Characters Not Allowed"); 
     	           text.focus();
     	           return false;
     	           break;
               }
              else
               {
            	   continue;
               } 
           }  
        } 
  return true;
 } 
 function validateEmail(email)
 {
	invalidChars = " /:,;'\"!#&*()"
    if(email.value== "")
	{                 //email cannot be empty
        return false;
    }

    for(i=0; i<invalidChars.length; i++)
        { //check for invalid characters
           badChar = invalidChars.charAt(i);
            if(email.value.indexOf(badChar,0) != -1)
            {alert("Invalid Email Address");
		        	email.focus();
               return false;
            } 
        }

    atPos = email.value.indexOf("@",1);         //there must be one "@" symbol
    if(atPos == -1)
     {
    	  alert("Invalid Email Address");
		    email.focus();
        return false;
     }
    if(email.value.indexOf("@",atPos+1) != -1)
     { //check to make sure only one "@" symbol
        alert("Invalid Email Address");
		    email.focus();
        return false;
     }

    periodPos = email.value.indexOf(".",atPos);
    if (periodPos == -1)
     { // make sure there is one "." after the "@"
        alert("Invalid Email Address");
		    email.focus();    
        return false;
    }

    if(periodPos+3 > email.value.length)
     { // must be at least 2 chars after the "."
       alert("Invalid Email Address");
		   email.focus();    
       return false;
     }
    //return true;
}

/************************************************************************************************************
(C) www.dhtmlgoodies.com, November 2005

This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.	

Terms of use:
You are free to use this script as long as the copyright message is kept intact. However, you may not
redistribute, sell or repost it without our permission.

Thank you!

www.dhtmlgoodies.com
Alf Magne Kalleland

************************************************************************************************************/

var dhtmlgoodies_slideSpeed = 10;	// Higher value = faster
var dhtmlgoodies_timer = 10;	// Lower value = faster

var objectIdToSlideDown = false;
var dhtmlgoodies_activeId = false;
var dhtmlgoodies_slideInProgress = false;
function showHideContent(e,inputId)
{
	if(dhtmlgoodies_slideInProgress)return;
	dhtmlgoodies_slideInProgress = true;
	if(!inputId)inputId = this.id;
	inputId = inputId + '';
	var numericId = inputId.replace(/[^0-9]/g,'');
	var answerDiv = document.getElementById('dhtmlgoodies_a' + numericId);

	objectIdToSlideDown = false;
	//alert(numericId);
	//alert(answerDiv);
	if(!answerDiv.style.display || answerDiv.style.display=='none'){		
		if(dhtmlgoodies_activeId & dhtmlgoodies_activeId!=numericId){			
			objectIdToSlideDown = numericId;
			slideContent(dhtmlgoodies_activeId,(dhtmlgoodies_slideSpeed*-1));
		}else{
			
			answerDiv.style.display='block';
			answerDiv.style.visibility = 'visible';
			
			slideContent(numericId,dhtmlgoodies_slideSpeed);
		}
	}else{
		slideContent(numericId,(dhtmlgoodies_slideSpeed*-1));
		dhtmlgoodies_activeId = false;
	}	
}

function slideContent(inputId,direction)
{
	
	var obj =document.getElementById('dhtmlgoodies_a' + inputId);
	var contentObj = document.getElementById('dhtmlgoodies_ac' + inputId);
	height = obj.clientHeight;
	if(height==0)height = obj.offsetHeight;
	height = height + direction;
	rerunFunction = true;
	if(height>contentObj.offsetHeight){
		height = contentObj.offsetHeight;
		rerunFunction = false;
	}
	if(height<=1){
		height = 1;
		rerunFunction = false;
	}

	obj.style.height = height + 'px';
	var topPos = height - contentObj.offsetHeight;
	if(topPos>0)topPos=0;
	contentObj.style.top = topPos + 'px';
	if(rerunFunction){
		setTimeout('slideContent(' + inputId + ',' + direction + ')',dhtmlgoodies_timer);
	}else{
		if(height<=1){
			obj.style.display='none'; 
			if(objectIdToSlideDown && objectIdToSlideDown!=inputId){
				document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.display='block';
				document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.visibility='visible';
				slideContent(objectIdToSlideDown,dhtmlgoodies_slideSpeed);				
			}else{
				dhtmlgoodies_slideInProgress = false;
			}
		}else{
			dhtmlgoodies_activeId = inputId;
			dhtmlgoodies_slideInProgress = false;
		}
	}
}



function initShowHideDivs()
{
	var divs = document.getElementsByTagName('DIV');
	var divCounter = 1;
	for(var no=0;no<divs.length;no++){
		if(divs[no].className=='dhtmlgoodies_question'){
			
			


			divs[no].onclick = showHideContent;
			divs[no].id = 'dhtmlgoodies_q'+divCounter;
			var answer = divs[no].nextSibling;
			while(answer && answer.tagName!='DIV'){
				answer = answer.nextSibling;
			}
			answer.id = 'dhtmlgoodies_a'+divCounter;	
			contentDiv = answer.getElementsByTagName('DIV')[0];
			contentDiv.style.top = 0 - contentDiv.offsetHeight + 'px'; 	
			contentDiv.className='dhtmlgoodies_answer_content';
			contentDiv.id = 'dhtmlgoodies_ac' + divCounter;
			answer.style.display='none';
			answer.style.height='1px';
			divCounter++;
		}		
	}	
}
//window.onload = initShowHideDivs;

// JavaScript Document


/* code for rollover images */
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); 
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}   
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->




/* code for showing new media section */
function show_hide(d1,d2)
{
	document.getElementById(d1).style.visibility="VISIBLE";
	document.getElementById(d2).style.visibility="HIDDEN";	
}



 



function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
//-->

/* code for rollover images */
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
// start of custom pop-out code
//
var timerID = "global";
function hideMenus() 
{
MM_showHideLayers('aboutSub','','hide');MM_showHideLayers('solutionSub','','hide');
}
function startTimer()
{
   stopTimer();
   // the number "1000" is the number of thousands-of-a-second

   timerID = setTimeout("hideMenus()", 500);
}
function stopTimer()
{
   clearTimeout(timerID);
}
// end of custom code
//-->

