var prodcnt = 1;
var backmenu = 1;
var app  = 0;
var fra1 = 0, fra2 = 0, fra3 = 0, fra4 = 0, fra5 = 0, fra6 = 0, fra7 = 0;
var noOfButtons=7, w=98, h=124, h1=31, h2=27, lft=50, topOfButton=5;
/*
function refresh()
{
    if (app == 0 )
    {
        fra1.src = "profile.htm";
		app = 1;
	}	
}
*/

function refreshPage(pg)
{
    //alert(pg)
    switch(pg){
    case 2:  document.all("fra1").src = "profile.htm";break;
    case 3:  //alert(prodcnt);
             switch(prodcnt){
             case 1:  document.all("fra1").src = "DFTL_products1.htm";break; 
             case 2:  document.all("fra1").src = "DFTL_products2.htm";break; 
             case 3:  document.all("fra1").src = "DFTL_products3.htm";break; 
             case 4:  document.all("fra1").src = "DFTL_products4.htm";break; 
             case 5:  document.all("fra1").src = "DFTL_products5.htm";break; 
             case 6:  document.all("fra1").src = "DFTL_products6.htm";break; 
             case 7:  document.all("fra1").src = "DFTL_products7.htm";break; 
             case 8:  document.all("fra1").src = "DFTL_products8.htm";break; 
             case 9:  document.all("fra1").src = "DFTL_products9.htm";
             }break;
    case 4:  document.all("fra1").src = "Customers.htm";break;
    case 5:  document.all("fra1").src = "EnquiryForm.asp";break;
    case 6:  document.all("fra1").src = "GuestBook.asp";break;
    case 7:  document.all("fra1").src = "contacts.htm";
	}	
}

function chequeframe(activate)
{	
    var prodPage = new Array("Profile","Broaches","Customer","EnquiryForm","GuestBook","Contact");
    parent.window.location="DFTL_ProductFrame.ASP?pageNo=" +(activate-1)+"&prodNo=0"   ////"DFTL_"+prodPage[activate-2]+".htm"
    //alert("Activate:::" + activate + "BackMenu:::" + backmenu);
    /*if (fra2 == 0 && activate == 2)
	{	
		 bodymain.insertAdjacentHTML('AfterBegin' ,'<div name = "frame' + activate +'" id = "frame' + activate + '" style = "display: block" ><IFRAME style = "overflow:auto" src="profile.htm" width = "720"  border =0 frameborder="0" marginWidth=0 marginHeight=0 height ="1010" allowTransparency  scrolling = no ></IFRAME></div>');
		 fra2 = 1;
	}
	if (fra3 == 0 && activate == 3)
	{	
		 bodymain.insertAdjacentHTML('AfterBegin' ,'<div name = "frame' + activate +'" id = "frame' + activate + '" style = "display: block" ><IFRAME  style = "overflow:auto" src="DFTL_Products1.htm" width = "720"  border =0 frameborder="0" marginWidth=0 marginHeight=0 height ="1180" allowTransparency  scrolling = no ></IFRAME></div>');
		 fra3 = 1;
	} 
	if (fra4 == 0 && activate == 4)
	{	
		 bodymain.insertAdjacentHTML('AfterBegin' ,'<div name = "frame' + activate +'" id = "frame' + activate + '" style = "display: block" ><IFRAME  style = "overflow:auto" src="customers.htm" width = "720"  border =0 frameborder="0" marginWidth=0 marginHeight=0 height ="630" allowTransparency  scrolling = 0 ></IFRAME></div>');
		 fra4 = 1;
	}
	if(fra5 == 0 && activate == 5)
	{
		bodymain.insertAdjacentHTML('AfterBegin' ,'<div name = "frame' + activate +'" id = "frame' + activate + '" style = "display: block" ><IFRAME  style = "overflow:auto" src="EnquiryForm.asp" width = "720"  border =0 frameborder="0" marginWidth=0 marginHeight=0 height ="670" allowTransparency  scrolling = no ></IFRAME></div>'); 
		 fra5 = 1;
	}
	if (fra6 == 0 && activate == 6)
	{	 bodymain.insertAdjacentHTML('AfterBegin' ,'<div name = "frame' + activate +'" id = "frame' + activate + '" style = "display: block" ><IFRAME  style = "overflow:auto" src="GuestBook.asp" width = "720"  border =0 frameborder="0" marginWidth=0 marginHeight=0 height ="570" allowTransparency  scrolling = no ></IFRAME></div>');
		 fra6 = 1;
	}
	if (fra7 == 0 && activate == 7)
	{			 
		 bodymain.insertAdjacentHTML('AfterBegin' ,'<div name = "frame' + activate +'" id = "frame' + activate + '" style = "display: block" ><IFRAME  style = "overflow:auto" src="contacts.htm" width = "720"  border =0 frameborder="0" marginWidth=0 marginHeight=0 height ="700" allowTransparency  scrolling = no ></IFRAME></div>');
		 fra7 = 1;
	}*/
}

function menuchange(activate)
{ 
    var intActivate=parseInt(activate)
    chequeframe(intActivate);
	/*eval("frame" + backmenu + ".style.display = 'none'");
	eval("frame" + activate + ".style.display = 'block'");
	eval("deactive" + backmenu + ".style.visibility = 'hidden'");
	eval("active" + backmenu + ".style.visibility = 'visible'"); 
	eval("active" + activate +  ".style.visibility = 'hidden'");
	eval("deactive" + activate +  ".style.visibility = 'visible'");*/
}

function onlyMenuChange(activate)
{
    //alert(activate+1)
    if(activate < 7){
		activate=activate+1
		eval("active" + activate +  ".style.visibility = 'hidden'");
		eval("deactive" + activate +  ".style.visibility = 'visible'");
	}
	//refreshPage(activate);
}
var pch = 0

//setInterval('startTrans()',1000*90)  
function startTrans()
{
	{
		SampleID.filters.blendTrans.Apply();
		if (pch == 0 )
		{
		pch = 1
		SampleID.src = "images1/Dagfor TST3ba.jpg";
		}
		else
		{ 
		pch = 0
		SampleID.src = "images1/Dagfor TST5b.jpg";
		}
		SampleID.filters.blendTrans.Play()
	}
}
    
    var CommonCode ="<TR><TD align=center background=\"cuts/nv_bgpattern.gif\" vAlign=top width = \"780\" style=\"BACKGROUND-REPEAT: repeat-x\"><TABLE border=0 cellPadding=0 cellSpacing=0><TR><TD align=center background=\"cuts/bg_spacer.gif\" vAlign=top height=\"24\">";
    CommonCode+="<div name = \"active\" id = \"active\" width=\""+w+"\" height=\""+h2+"\"";
    CommonCode+="style = \"VISIBILITY: visible\">";
    CommonCode+="<a href=\"Index.htm\" target=\"_top\"><IMG alt=Home border = 0 height=\""+h2+"\" src=\"images1/mainbutt-up_01.gif\" style=\"CURSOR: hand; LEFT: "+lft+"; POSITION: absolute; TOP: "+ topOfButton +"px\"  title=ClickHere width="+w+"></a></div>";
    for(var i=2;i<=noOfButtons;i++){
        CommonCode+="<div name = \"deactive"+i+"\" id = \"deactive"+i+"\" width=\""+w+"\" height=\""+h1+"\"";
        if(i==backmenu){
            CommonCode+="style = \"VISIBILITY: visible\">";
        }
        else{ 
            CommonCode+="style = \"VISIBILITY: hidden\">";
        }
        CommonCode+="<IMG border = 0 src=\"images/mainbutt-over_0"+i+".gif\" style=\"LEFT: "+(lft + ((i-1)*w))+"px; POSITION: absolute; TOP: "+ topOfButton +"px\" width=\""+w+"\" height=\"31\" ></div>";
    }
    for(var i=2;i<=noOfButtons;i++){
        CommonCode+="<div name = \"active"+i+"\" id = \"active"+i+"\" width=\""+w+"\" height=\""+h2+"\"";
        if(i==backmenu)CommonCode+="style = \"VISIBILITY: hidden\">";
        else CommonCode+="style = \"VISIBILITY: visible\">";
        CommonCode+="<IMG alt=PROFILE border = 0 height=\""+h2+"\" onclick='menuchange(\""+i+"\");backmenu="+i+";' src=\"images1/mainbutt-up_0"+i+".gif\" style=\"CURSOR: hand; LEFT: "+(lft + ((i-1)*w))+"; POSITION: absolute; TOP: "+ topOfButton +"px\"  title=ClickHere width="+w+" ></div>";
    }
    for(i=11;i<=11;i++){
        CommonCode+="<div name = \"active"+i+"\" id = \"active"+i+"\" width=\""+w+"\" height=\""+h2+"\"";
        if(i==backmenu)CommonCode+="style = \"VISIBILITY: hidden\">";
        else CommonCode+="style = \"VISIBILITY: visible\">";
        CommonCode+="<IMG alt=PROFILE border = 0 height=\""+h2+"\" onclick='menuchange(\""+i+"\");backmenu="+i+";' src=\"images1/mainbutt-up_0"+i+".gif\" style=\"CURSOR: hand; LEFT: "+(lft + ((8-1)*w))+"; POSITION: absolute; TOP: "+ topOfButton +"px\"  title=ClickHere width="+w+" ></div>";
    }	
    CommonCode+="</TD></TR>"+
                "<TR><TD align=middle background=\"cuts/bg_spacer.gif\" vAlign=top><IMG border=0 src=\"cuts/nv_subs_right.gif\" width=\"100%\" height=30></TD></TR>"+
                "</TABLE></TD></TR>"+
                "<TR><TD align=middle bgColor=#ffffff height=\"3\" width=\"780\"><IMG border=0 height=3 src=\"cuts/spacer.gif\"></TD></TR>"+
                "</TABLE>"+
                "<TABLE border=0 cellPadding=0 cellSpacing=0 width=\"780\" style=\"background-image: url('cuts/box_mtl_ctr.gif'); padding-top: 0; padding-bottom: 0\">"+
                "<TR><TD height=\"12\" width=\"12\" valign=\"top\" style=\"padding: 0\"><IMG height=\"12\" width=\"12\" src=\"cuts/box_mtl_topl.gif\"></TD>"+
                "<TD height=\"12\" width=\"756\" style=\"background-image: url('cuts/box_mtl_top.gif'); background-repeat: repeat-x\"></TD>"+
                "<TD height=\"12\" width=\"12\"><IMG height=\"12\" width=\"12\" src=\"cuts/box_mtl_topr.gif\"></TD></TR>"+
                "<TR><TD height=\"70\" width=\"12\"  style=\"background-image: url('cuts/box_mtl_l.gif'); background-repeat: repeat-y\"></TD>"+
                "<TD height=\"70\" width=\"756\" style=\"padding-bottom: 6\">"+
                ///--This part provides the link for all products.
                '<table border="0" cellpadding="0" cellspacing="0" width="100">'+
                    '<tr>'+
                      '<td width="64"><img border="0" src="images/Dftl_logo.gif" width="64" height="64"></td>'+
                      '<td width="537"><map name="FPMap0">'+
        '<area href="Dftl_ProductFrame.ASP?pageNo=2&amp;prodNo=2" target="_top" shape="rect" coords="17, 13, 46, 24">'+
        '<area href="Dftl_ProductFrame.ASP?pageNo=2&amp;prodNo=3" shape="rect" coords="56, 14, 151, 24">'+
        '<area href="Dftl_ProductFrame.ASP?pageNo=2&amp;prodNo=4" shape="rect" coords="161, 15, 260, 25">'+
        '<area href="Dftl_ProductFrame.ASP?pageNo=2&amp;prodNo=5" shape="rect" coords="271, 14, 353, 25">'+
        '<area href="Dftl_ProductFrame.ASP?pageNo=2&amp;prodNo=6" shape="rect" coords="362, 14, 520, 26">'+
        '<area href="Dftl_ProductFrame.ASP?pageNo=2&amp;prodNo=1" shape="rect" coords="17, 31, 76, 41">'+
        '<area href="Dftl_ProductFrame.ASP?pageNo=2&amp;prodNo=7" shape="rect" coords="87, 30, 257, 41">'+
        '<area href="Dftl_ProductFrame.ASP?pageNo=2&amp;prodNo=8" shape="rect" coords="265, 30, 519, 41"></map><img border="0" src="images/Dftl_ProLink.gif" width="537" height="59" usemap="#FPMap0"></td>'+
                      "<td width=\"146\"><a href=\"Dftl_ProductFrame.ASP?pageNo=7&amp;prodNo=0\" target=\"_top\"><img id=\"image1\" name=\"image1\" border=\"0\" src=\"images/Dftl_SideLinkUp_01.gif\" width=\"146\" height=\"20\" onMouseOver=\"changeImage('1','Over')\" onMouseOut=\"changeImage('1','Out')\"></a><br><a href=\"Dftl_ProductFrame.ASP?pageNo=8&amp;prodNo=0\" target=\"_top\"><img id=\"image2\" name=\"image2\" border=\"0\" src=\"images/Dftl_SideLinkUp_02.gif\" width=\"146\" height=\"19\" onMouseOver=\"changeImage('2','Over')\" onMouseOut=\"changeImage('2','Out')\"></a><br><a href=\"Dftl_ProductFrame.ASP?pageNo=9&amp;prodNo=0\" target=\"_top\"><img id=\"image3\" name=\"image3\" border=\"0\" src=\"images/Dftl_SideLinkUp_03.gif\" width=\"146\" height=\"20\" onMouseOver=\"changeImage('3','Over')\" onMouseOut=\"changeImage('3','Out')\"></a></td>"+
                    '</tr>'+
                '</table>'+
                ///--
                "</TD>"+
                "<TD height=\"70\" style=\"background-image: url('cuts/box_mtl_r.gif'); background-repeat: repeat-y\" width=\"12\"></TD></TR>"+
                "<TR height=\"100%\"><TD width=\"12\" style=\"background-image: url('cuts/box_mtl_l.gif'); background-repeat: repeat-y\">&nbsp;</TD>"+
                "<TD width=\"756\">"+
                "<div align=\"left\"><table border=\"0\" cellspacing=\"0\" width=\"100%\" cellpadding=\"0\" class=\"inset\">"+
                "<tr><td align=\"left\" width=\"100%\" class=\"background\" height=\"25\">"+  //////****<img src=\"images/Dftl_logo.gif\" style=\"position: absolute; left: 0; top: 65\">"+
                /****In place of table we are putting only logo for that****/
                /*"<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>"+
                "<TR><TD><IMG SRC=\"top/SWD-3c_01.gif\" WIDTH=169 HEIGHT=62></TD>"+
                "<TD><IMG SRC=\"top/SWD-3c_02.gif\" WIDTH=169 HEIGHT=62></TD>"+
                "<TD><IMG SRC=\"top/SWD-3c_03.gif\" WIDTH=169 HEIGHT=62></TD>"+
                "<TD><IMG SRC=\"top/SWD-3c_04.gif\" WIDTH=169 HEIGHT=62></TD></TR>"+
                "<TR><TD><IMG SRC=\"top/SWD-3c_05.gif\" WIDTH=169 HEIGHT=62></TD>"+
                "<TD><IMG SRC=\"top/SWD-3c_06.gif\" WIDTH=169 HEIGHT=62></TD>"+
                "<TD><IMG SRC=\"top/SWD-3c_07.gif\" WIDTH=169 HEIGHT=62></TD>"+
                "<TD><IMG SRC=\"top/SWD-3c_08.gif\" WIDTH=169 HEIGHT=62></TD></TR></TABLE>"+*/
                /*"<IMG SRC=\"top/DFTL_logo.gif\" WIDTH=75 HEIGHT=76>"*/
                "&nbsp;</td></tr>";
                //alert(prodNo+"----jjj--"+enqNo+"=nnn=="+Product)
               if(prodNo==0){
                   if (enqNo > 0){
                       ///These Heights are for Enquiry form.....
                       if (Product=="Broach"){
                           var pageHeight = new Array(640,770,640,730,590,660,660,640);
                           //For broach minimu height should be 640 becaz we have to consider
                           //2nd page of broach also. Other wise minimum is 550
                       }else if(Product=="Hob"){
                           var pageHeight = new Array(1400,1280,1140,1110,550);
                       }else if(Product=="Shaper Cutter"){
                           var pageHeight = new Array(1340,1390,550);
                       }else if(Product=="Shaving Cutter"){
                           var pageHeight = new Array(1700,580);
                       }else if(Product=="Spline Gauge"){
                           var pageHeight = new Array(730,730,600,570,730,730,550);
                       }else if(Product=="Spline Mandrel"){
                           var pageHeight = new Array(720,690,580,550);
                       }else if(Product=="Master Gear"){
                           var pageHeight = new Array(640,700,550);
                       }
						var frameSrc   = "EnquiryFormBroachFirst.asp?enqNo="+ enqNo +"&Product="+Product+"&broachType="+broachType;   
                   }else{                       
					   ///These Heights are of pages like profile,customer etc......
                       var pageHeight = new Array(920,1220,560,600,460,725,5020,1480,1860);
					   var pageSrc    = new Array("profile.asp","Dftl_product.asp","CUSTOMERS.asp","EnquiryFormIndex.asp","GuestBook.asp","CONTACTS.asp","Nomen.asp","Trouble.asp","NewDevelop.asp","code_of_product.asp");
					   var frameSrc   = pageSrc[pageNo-1] + "?enqNo="+ enqNo +"&Product="+Product+"&broachType="+broachType;
                   }
               }else{
                   ///These Heights are for product's pages etc......
                   var pageHeight = new Array(1220,2150,710,1170,540,1560,1000,870);
				   var pageSrc    = new Array("profile.asp","Dftl_product.asp","CUSTOMERS.asp","EnquiryFormIndex.asp","GuestBook.asp","CONTACTS.asp","Nomen.asp","Trouble.asp","NewDevelop.asp","code_of_product.asp");
				   var frameSrc   = pageSrc[pageNo-1] + "?enqNo="+ enqNo +"&Product="+Product+"&broachType="+broachType;
               }             
//alert(frameSrc+"----"+frameHeight)
               //alert(prodNo+pageNo);
		if(pageNo==10){
		 var frameHeight= 2500;
		  
		}else{
               if(prodNo==0 && pageNo != 2){
                   if (enqNo > 0){
                       var frameHeight= pageHeight[enqNo-1]
                   }else{
                       var frameHeight= pageHeight[pageNo-1]
                   }
               }else{
                   if (prodNo==0){ 
		               prodNo=1 
		               var frameHeight= pageHeight[prodNo]
	               }else{
                       var frameHeight= pageHeight[prodNo-1]
                   }				   
               }}
		
			   frameHeight+=20;///This is for extra margin which is reqd.               
			   
var frameWidth = 720;
//alert(Product);
var BodyPart   ="<tr>"+
                '<td name="bodymain" id="bodymain" width="100%" ALIGN="CENTER" class="background" style="padding-bottom: 50">'+
                '<div name = "frame3" id = "frame3" style = "display: block" >'+
                '<IFRAME name = "fra1" id = "fra1" style = "overflow:auto" src="'+ frameSrc +'" width = "'+ frameWidth +'"  border =0 frameborder="0" marginWidth=0 marginHeight=0 height = '+ frameHeight +' allowTransparency  scrolling = no >'+
                "</IFRAME></div></td></tr>";
               ////-------     
var Footer     ="<tr><TD style=\"padding-right: 30; padding-bottom:20\" align=\"right\" valign=\"bottom\" class=\"background\">"+
                "<a href=\"mailto:marketing@daggerforst.com\"><img id=\"imageBot1\" name=\"imageBot1\" border=\"0\" src=\"LowerButt/Lower_Up_01.gif\" onMouseOver=\"changeBottomImage(1,'Over')\" onMouseOut=\"changeBottomImage(1,'Out')\"></a>"+
                "<a href=\"index.htm\"><img id=\"imageBot2\" name=\"imageBot2\" border=\"0\" src=\"LowerButt/Lower_Up_02.gif\" onMouseOver=\"changeBottomImage(2,'Over')\" onMouseOut=\"changeBottomImage(2,'Out')\">"+
                "<a href=\"#Top\"><img id=\"imageBot3\" name=\"imageBot3\" border=\"0\" src=\"LowerButt/Lower_Up_03.gif\" onMouseOver=\"changeBottomImage(3,'Over')\" onMouseOut=\"changeBottomImage(3,'Out')\">"+
                "<a href=\"DFTL_ProductFrame.asp?pageNo=4&prodNo=0\"><img id=\"imageBot4\" name=\"imageBot4\" border=\"0\" src=\"LowerButt/Lower_Up_04.gif\" onMouseOver=\"changeBottomImage(4,'Over')\" onMouseOut=\"changeBottomImage(4,'Out')\"></TD></tr>"+
                "</TD></tr>"+
                "</table></div></TD><TD width=\"12\" style=\"background-image: url('cuts/box_mtl_r.gif'); background-repeat: repeat-y\">&nbsp;</TD></TR><TR height=\"14\"><TD width=\"12\" height=\"13\" valign=\"top\"><IMG height=\"13\" width=\"12\" src=\"cuts/box_mtl_botl.gif\"></TD><TD height=\"13\" width=\"756\" style=\"background-image: url('cuts/box_mtl_bot.gif'); background-repeat: repeat-x\" valign=\"bottom\"></TD><TD width=\"12\" height=\"13\"><IMG height=\"13\" width=\"12\" src=\"cuts/box_mtl_botr.gif\"></TD></TR></TABLE>"
    Footer+="<br><table width=\"100%\"><tr><td align=\"right\"><a href=\"http://www.YashBirlaGroup.com\" style=\"text-decoration: none\" target=\"_top\"><img border=\"0\" src=\"Images/YB-logo.gif\"></a></td></tr><tr><td><hr color=\"#000066\" size=\"2\" width=\"100%\"><font size=\"1\" color=\"#08080\"><center>Copyright © 2002 DFTL pvt Ltd. All rights reserved.<br>Site is designed and maintained by <a href=\"mailto:ShlokaInfotech@vsnl.net\">Shloka Infotech Ltd.</a><br></center></font></td></tr></table></CENTER>";
                
function  changeBottomImage(no,event){
    if (event=="Over"){
        eval("imageBot"+no+".src=\"LowerButt/Lower_Over_0"+no+".gif\"")
    }else{
        eval("imageBot"+no+".src=\"LowerButt/Lower_Up_0"+no+".gif\"")
    }
}

function  changeImage(no,event){
    if (event=="Over"){
        eval("image"+no+".src=\"Images/Dftl_SideLinkOver_0"+no+".gif\"")        
    }else{
        eval("image"+no+".src=\"Images/Dftl_SideLinkUp_0"+no+".gif\"")
    }
}
function openProdPage(no){
    var prodPage = new Array("Broaches","Hobs","ShaperCutter","ShavingCutter","MasterGears","SplineGaugesAndMandrels","BroachSharpeningMachine","HSSMetCutCirSlit");
    parent.window.location="DFTL_"+prodPage[no-1]+".htm"
}
