/*function FP_preloadImgs() {//v1.0
 var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array();
 for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; }
}

function FP_swapImg() {//v1.0
 var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;
 n+=2) { elm=FP_getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;
 elm.$src=elm.src; elm.src=args[n+1]; } }
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}
function change_photo(temp_img_name)
 {
 document.getElementById("portfolio").style.display="none";
 document.getElementById("main_port").innerHTML="<img src='../images2/"+temp_img_name+"'>";
 }*/
 
 
 <!-- to change the menu bar images -->
 
function change_me(temp_name,temp_img)
  {
   document.getElementById(temp_name).src=temp_img;
  }
  
<!-- to change the menu bar images -->

var menu1=new Array()
menu1[0]='<a href="history.html" class="dropmenu">HISTORY</a>'
menu1[1]='<a href="mission.html" class="dropmenu">MISSION & VISION</a>'
menu1[2]='<a href="policy.html" class="dropmenu">QUALITY POLICY</a>'
menu1[3]='<a href="focus.html" class="dropmenu">FOCUS ON</a>'
menu1[4]='<a href="our_team.html" class="dropmenu">OUR TEAM</a>'

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="aluminium.html" class="dropmenu">ALUMINIUM</a>'
menu2[1]='<a href="steel.html" class="dropmenu">STAINLESS STEEL</a>'
menu2[2]='<a href="brass.html" class="dropmenu">BRASS</a>'

//contents for third menu
var menu3=new Array()
menu3[0]='<a href="domestic_clients.html" class="dropmenu">DOMESTIC</a>'  
menu3[1]='<a href="international_clients.html" class="dropmenu">INTERNATIONAL</a>'  
menu3[2]='<a href="testimonials_clients.html" class="dropmenu">TESTIMONIALS</a>'  

var menu4=new Array()
menu4[0]='<a href="domestic_faqs.html" class="dropmenu">DOMESTIC</a>'  
menu4[1]='<a href="international_faqs.html" class="dropmenu">INTERNATIONAL</a>'   
		
var menuwidth='165px' //default menu width
var menubgcolor='lightyellow'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)

dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

function chkval(){
	if (document.equote.pro_mat.value=="OTHERS") {
		document.getElementById("others").style.display=""
	}
	
	if (document.equote.pro_mat.value!="OTHERS") {
		document.getElementById("others").style.display="none"
	}	
}
/*
Live Date Script- 
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions, 100's more DHTML scripts, and Terms Of Use,
visit http://www.dynamicdrive.com
*/

<!-- to show live date n time -->
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")

function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
if (hours>=12)
dn="PM"
if (hours>12){
hours=hours-12
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//change font size here
var cdate="<font color='000000' face='Verdana' size='1'>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"</font>"
if (document.all)
document.all.clock.innerHTML=cdate
else if (document.getElementById)
document.getElementById("clock").innerHTML=cdate
else
document.write(cdate)
}
if (!document.all&&!document.getElementById)
getthedate()
function goforit(){
if (document.all||document.getElementById)
setInterval("getthedate()",1000)
}
function mypopup(url1)
 {
   mywindow = window.open (url1,"mywindow","location=0,status=0,scrollbars=1,width=700,height=700,directory=0,left=20,top=20");
 } 

//form validation
function validate_form() 
	{
		d=document.equote;
		
		if(d.name.value=="")
		{
		alert("enter your name");
		d.name.focus();
		return false;
		}
		
		if(d.cname.value=="")
		{
		alert("enter your company name")
		d.cname.focus();
		return false;
		}
		
		if(d.add1.value=="")
		{
		alert("enter your address");
		d.add1.focus();
		return false;
		}
		
		if(d.city.value=="")
		{
		alert("enter your city");
		d.city.focus();
		return false;
		}
		
		if(d.zip.value=="")
		{
		alert("enter your zipcode number");
		d.zip.focus();
		return false;
		}
		
		if(d.country.value=="")
		{
		alert("enter your country name");
		d.country.focus();
		return false;
		}
		
		if(d.number.value=="")
		{
		alert("enter your contact number");
		d.number.focus();
		return false;
		}
		
		if(d.email.value=="")
		{
		alert("please enter ur e-mail id");
		d.email.focus();
		return false;
		}
		
		if((!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(d.email.value))))
		{
		alert("enter your email in the followimg form abc@xyz.com");
		d.email.focus();
		return false;
		}
		
		if(d.thickness.value=="")
		{
		alert("enter your material thickness");
		d.thickness.focus();
		return false;
		}
		
		if(d.height.value=="")
		{
		alert("enter your valid height");
		d.height.focus();
		return false;
		}
		
		if(d.width.value=="")
		{
		alert("enter your valid width");
		d.width.focus();
		return false;
		}
	}
