 var toptime;
 var cross_scroll2;
 var a=75,y;
 var imgElements;
 function movetop(){
 var k=77;
 var m;
 	var curtop;
	cross_scroll2=document.getElementById('imgslide');
	curtop=parseInt(cross_scroll2.style.top)-1;
	if(Math.abs(parseInt(cross_scroll2.style.top))== parseInt(cross_scroll2.offsetHeight)){
		cross_scroll2.style.top=0+"px";
		clearTimeout(toptime);
			toptime=setTimeout("movetop();",3000);
			m=1;
	}
	else{
		cross_scroll2.style.top=curtop+"px";
		m=Math.abs(parseInt(cross_scroll2.style.top))% k; 
		//alert(cross_scroll2.style.top);
		if(m!=0){
			m=1;
			toptime=setTimeout("movetop()",50);
		}
		if(m==0){
			clearTimeout(toptime);
			toptime=setTimeout("movetop();",3000);
			m=1;
		}
	}
}

var fromHeight = 72;
var toHeight = 250;
function expandForm(par)
{
var obj = document.getElementById('expand-container');
if(par==1)
	obj.style.display = 'block';
else
{
	obj.style.display = 'none';
	resetForm();
}	
}

function postForm()
{
	var Name = document.signup.Name;
	var Email = document.signup.Email;
	var Address = document.signup.Address;
	var ContactNo = document.signup.ContactNo;
	var Country = document.signup.Country;
	var Comments = document.signup.Comments;
if((!Name.value) || (Name.value=='Your Name'))
{
	alert("Please enter the Name");
	Name.focus();
	 return false;
}
if((!Email.value) || (Email.value=='Your Email Address'))
{
	alert("Please enter the Email");
	Email.focus();
	 return false;
}
var emailChar = /^[^@]+@[^@.]+\.[^@]*\w\w$/  ;
 	if (!emailChar.test(Email.value)) 
 	{
		alert("Please check the Email format");
		Email.select();
		return false;
	 } 
	 
	 if((!Address.value) || (Address.value=='Address'))
	{
		alert("Please enter the Address");
		Address.focus();
		return false;
	}
	
	if((!ContactNo.value) || (ContactNo.value=='Contact Number'))
	{
		alert("Please enter the Contact Number");
		ContactNo.focus();
		return false;
	}
	if(isNaN(ContactNo.value)==true)
	{
		alert("Contact Number should be numeric");
		ContactNo.focus();
		return false;
	}
	if((!Country.value) || (Country.value=='Country'))
	{
		alert("Please enter the Country");
		Country.focus();
		return false;
	}
	
	var qstr = '';
	qstr = 'Name='+Name.value+'&Email='+Email.value+'&Address='+Address.value+'&ContactNo='+ContactNo.value+'&Country='+Country.value;
	if(Comments.value && Comments.value!="Comments")
	qstr += '&Comments='+Comments.value;
	
	submitForm('sendmail.php',qstr);
}



function resetForm()
{    
    document.getElementById('msg').innerHTML='';
	document.getElementById('msg').style.display='none';
	var Name = document.signup.Name;
	var Email = document.signup.Email;
	var Address = document.signup.Address;
	var ContactNo = document.signup.ContactNo;
	var Country = document.signup.Country;
	var Comments = document.signup.Comments;
		Name.value = 'Your Name';
		Email.value = 'Your Email Address';
		Address.value = 'Address';
		ContactNo.value = 'Contact Number';
		Country.value = 'Country';
		Comments.value = 'Comments';
var formEle = document.signup.elements;	
for(i=0;i<formEle.length-2;i++)	
{
	formEle[i].removeAttribute("class");
}
}




function onFocus(thisObj,val)
		  {
		  	if(thisObj.value==val)
			thisObj.value = '';
			thisObj.className = 'focus';
		  }
		  
		   function onBlur(thisObj,val)
		  {
		  	if(!thisObj.value)
			{
				thisObj.value = val;
				thisObj.className = '';
			}
			else if(thisObj.value && thisObj.value!=val)
			thisObj.className = 'focus';
		  }





   function alertContents() {
      if (req.readyState == 4) {
         if (req.status == 200) {
            result = req.responseText;
            document.getElementById('msg').innerHTML = result; 
             document.getElementById('msg').style.display='block';
			setTimeout("resetForm();expandForm(2);",1500);           
         } else {
            alert('There was a problem with the request.');
         }
      }
   }

var req = null; 
function submitForm(url,data)
	{ 
		if (window.XMLHttpRequest)
		{
 			req = new XMLHttpRequest();

		} 
		else if (window.ActiveXObject) 
		{
			try {
				req = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e)
			{
				try {
					req = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {}
			}
        	}

		req.onreadystatechange = alertContents;
		req.open("POST", url, true); 
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
		req.send(data); 
	} 
	
