
c1=0;
var pagtitle="Home page";
function change2blue(vendid,vendimg)
{
document.getElementById(vendid).src=vendimg;
}

function change2orange(vendid,vendimg)
{
document.getElementById(vendid).src=vendimg;
}

function buttonchange(bt,btpos)
{
document.getElementById(bt).src=btpos;
}

function cursorhand(curid)
{
document.getElementById(curid).style.cursor="pointer";
}
function textcolor()
{
document.getElementById('colorblue').style.color="#1C5FA8";
document.getElementById('colororange').style.color="#FF8000";

document.getElementById('colorblue').style.cursor="pointer";
document.getElementById('colororange').style.cursor="pointer";

}

function textcolorremove()
{
document.getElementById('colorblue').style.color="#844E1C";
document.getElementById('colororange').style.color="#844E1C";
}

function hideshow()
{
	
if (c1==0) 
  {
  c1=1;
  document.getElementById('colorblue').style.display="none";
    document.getElementById('colororange').style.display="none";

  }
else
  {
  c1=0;
  document.getElementById('colorblue').style.display="block";
  document.getElementById('colororange').style.display="block";
}
}

var a1=new Array(6);
a1[0]=0;
a1[1]=0;
a1[2]=0;
a1[3]=0;
a1[4]=0;
  
function showhide(id1,id2,n)
{
if (a1[n]==0) 
{
  document.getElementById(id1).style.display="block";
  document.getElementById(id2).src="images/arrow-minus.jpg";
  a1[n]=1;
}
else 
{
  document.getElementById(id1).style.display="none";
  document.getElementById(id2).src="images/arrow-plus.jpg";
  a1[n]=0;
}
}
 
function hidetree()
{
document.getElementById('home-subelm').style.display="none";
document.getElementById('product-sub').style.display="none";
document.getElementById('publication-sub').style.display="none";
document.getElementById('testimonial-sub').style.display="none";

document.getElementById('home-plus').src="images/arrow-plus.jpg";
document.getElementById('product-plus').src="images/arrow-plus.jpg";
document.getElementById('publication-plus').src="images/arrow-plus.jpg";
document.getElementById('testimonial-plus').src="images/arrow-plus.jpg";

a1[1]=0;
a1[2]=0;
a1[3]=0;
a1[4]=0;
}

function showtree()
{
document.getElementById('home-subelm').style.display="block";
document.getElementById('product-sub').style.display="block";
document.getElementById('publication-sub').style.display="block";
document.getElementById('testimonial-sub').style.display="block";

document.getElementById('home-plus').src="images/arrow-minus.jpg";
document.getElementById('product-plus').src="images/arrow-minus.jpg";
document.getElementById('publication-plus').src="images/arrow-minus.jpg";
document.getElementById('testimonial-plus').src="images/arrow-minus.jpg";

a1[1]=1;
a1[2]=1;
a1[3]=1;
a1[4]=1;
}
 
/* form validation script */

var r;
var ck=0;
var sc=new Array(10);
sc[0]="hj2c13";
sc[1]="mkp39a";
sc[2]="p3qw19";
sc[3]="7yuxk8";
sc[4]="5uh9ws";
sc[5]="8qwr2p";
sc[6]="gk541m";
sc[7]="pmba2s";
sc[8]="sd8xvn";
sc[9]="v2c4as";
sc[10]="zgd4tm";


var scimg=new Array(10);
scimg[0]="scode0.jpg";
scimg[1]="scode1.jpg";
scimg[2]="scode2.jpg";
scimg[3]="scode3.jpg";
scimg[4]="scode4.jpg";
scimg[5]="scode5.jpg";
scimg[6]="scode6.jpg";
scimg[7]="scode7.jpg";
scimg[8]="scode8.jpg";
scimg[9]="scode9.jpg";
scimg[10]="scode10.jpg";

function scodeimg(img1)
{
	r=Math.floor(Math.random()*11);
	document.getElementById(img1).src=scimg[r];
}

function codecheck(code)
{
	var c=document.getElementById(code).value;
		c=c.toLowerCase();

	if(sc[r]==c)
	 {
	  return true;
	 }
	else 
	 {
	  return false;
	 }
}

function validate(id1,id2,id3,id4,id5,id6) 
{

if(document.getElementById(id1).value=="" || 
document.getElementById(id2).selectedIndex=="0" ||
document.getElementById(id3).value=="" ||
document.getElementById(id4).value=="" ||
!check_mail(document.getElementById(id5).value))
{
alert("Please enter the Mandatory fields");
return false;
}
	
	
if(!codecheck(id6))
 {
	 alert("Security code in invalid");
  return false;
 }

else
 
   return true;
   
}

function checknum(id1)
{
var num=document.getElementById(id1).value;
var n=num.length;
var i;
var m = "1234567890";

for(i=0;i<n;i++)
 {
		if(m.indexOf(num.charAt(i))<0)
		{ 
			alert("invalid number");	
			return false;
		}	
 }
								
}

function check_mail()
{
	
			var e=document.getElementById('mail').value;
			ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
			for(i=0; i < e.length ;i++)
			{
				if(ok.indexOf(e.charAt(i))<0)
				{ 
					return (false);
				}	
			} 
			if (document.images) 
			{
				re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
				re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
				if (!e.match(re) && e.match(re_two)) 
				{
					return (-1);		
				} 
			}

	
}


