<!--
// FOR FIRST MENU CODE--->

ddaccordion.init({
	headerclass: "expandable", //Shared CSS class name of headers group that are expandable
	contentclass: "categoryitems", //Shared CSS class name of contents group
	revealtype: "mouseover", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover
	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
	defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
	onemustopen: true, //Specify whether at least one header should be open always (so never all headers closed)
	animatedefault: false, //Should contents open by default be animated into view?
	persiststate: true, //persist state of opened contents within browser session?
	toggleclass: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	togglehtml: ["prefix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "normal", //speed of animation: "fast", "normal", or "slow"
	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
		//do nothing
	},
	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
		//do nothing
	}
})

// FOR SECOND MENU CODE--->

ddaccordion.init({ //2nd level headers initialization
	headerclass: "subexpandable", //Shared CSS class name of sub headers group that are expandable
	contentclass: "subcategoryitems", //Shared CSS class name of sub contents group
	revealtype: "mouseover", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover"
	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
	defaultexpanded: [], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
	onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
	animatedefault: false, //Should contents open by default be animated into view?
	persiststate: true, //persist state of opened contents within browser session?
	toggleclass: ["opensubheader", "closedsubheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	togglehtml: ["none", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "normal", //speed of animation: "fast", "normal", or "slow"
	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
		//do nothing
	},
	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
		//do nothing
	}
})

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

function blurfield(object,against){
	if (object.value==''+against){ object.value=''; }
}

/******* Validations ******/

function validate_name_footer(field,alerttxt)
{
 with (field)
  { 
    var str =value;
    var re =/^[a-zA-Z]/;
    str = str.toString();
    if (value==null||value==""||value=="Name") 
    {alert(alerttxt);return false}
    else if (!str.match(re)) 
     {alert("Enter only characters into the name field.");return false}
    else {return true}
  }
}
function validate_email_footer(field,alerttxt)
{
with (field)
{
var str =value;
 str = str.toString();
  if (value==null||value=="") 
    {alert("please Enter Email Address.");return false}
   
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos<1||dotpos-apos<2) 
  {alert(alerttxt);return false;}
else {return true;}
}
}
function validate_phone_footer(field,alerttxt)
{
 with (field)
  {
    var str =value;
    var re = /^[-]?\d*\.?\d*$/;
    str = str.toString();
     if (value==null||value=="")
    {alert(alerttxt);return false}
    else if (!str.match(re)) 
       {alert("Please specify your Phone Number! Numbers Only");return false}
	else if(value.length >"10" )
	{ alert("Enter correct Phone No.");return false}
	else {return true}
  }
}
/*function validate_Captcha(field,alerttxt)
{

 with (field)
{
    var str=value;
   
    if (value==null||value=="") 
    {alert(alerttxt);return false}
    else if(value.length !="5" )
	{ alert("Enter correct Security code.");return false}
	else {return true}
  }
}*/
function validate_form_footer(thisform)
{
with (thisform)
{
if (validate_name_footer(Name,"Please Enter the Name")==false)
   {Name.focus();return false}
if (validate_email_footer(e_mail,"Not a valid e-mail address!")==false)
   {e_mail.focus();return false;}
if (validate_phone_footer(Contact_Number,"Please specify your Phone Number!")==false)
  {Contact_Number.focus();return false} 

  
 /*if (validate_Captcha(txtCaptcha,"Please specify Security Code!")==false)
   {txtCaptcha.focus();return false}  
  if ( test()==false)
   {txtCaptcha.focus();return false}  
*/ }
}

/******* Validations ends ******/

/********* Mega Menu hidden div script **********/

	function doHide(elementId){
		document.getElementById(elementId).style.display = 'none';
	}
	function doShow(elementId){
		document.getElementById(elementId).style.display = 'block';
	}
