		var lastActiveTab = "NA";
		var lastActiveBox = "NA";
		var content=new Array();
		content[0]="XI"
		content[1]="XII";
		content[2]="IIT"; 
		content[3]="AIEEE"
		content[4]="CAT";
		content[5]="SAT";
		content[6]="CD"
		
		
	   
		var ctr = 0;
		var csmPath = "";
		 function goToBuyProduct(id)
		   {
			  document.GetAllProductForm.channelId.value =   id;
			  //alert("goToBuyProduct:"+id);
			  document.GetAllProductForm.submit();
		   }
		function changeContent(chId)
		{
			//alert("!!!!!!!!!"+document.getElementById("loading"));
			if(flag)
			{
				   //alert(document.getElementById("loading").style.display);
			document.getElementById("loading").style.display = "block";
			var boxId = chId + "BOX"; 
			chId = chId + "-content"
			if(chId =='XII-content')
			{
				 
				 document.getElementById("head1").innerHTML ='<html:link action="/showcbse">XII-BOARD PREP</html:link>';
				 document.getElementById("head2").innerHTML ='300+ hours of detailed course content';
				 document.getElementById("head3").innerHTML ="<span style='color:#3f8809'>Never miss a class again with topchalks</span>";
				 document.getElementById("head4").innerHTML ="Fully explained solutions to 4500 problems";
				 document.getElementById("head5").innerHTML ="<span style='color:#3f8809'>Max your performance beyond Distinction</span>";
				
				 //alert(document.getElementById("regbox").innerHTML);
				
				

				
				
			}
			else if(chId =='CD-content')
			{
				
				 document.getElementById("head1").innerHTML ='<html:link action="/educational-cds">CDs</html:link>';
				 document.getElementById("head2").innerHTML ="No Internet Connection Required";
				 document.getElementById("head3").innerHTML ="<span style='color:#3f8809'>Easy to Install & Use</span>";
				 document.getElementById("head4").innerHTML ="No Time Limit For Consumption Of Content";
				 document.getElementById("head5").innerHTML ="<span style='color:#3f8809'>Now: Study Anytime, Anywhere & Excel</span>";
				
				 
			
				
			}
			else if(chId =='AIEEE-content')
			{
				
				 document.getElementById("head1").innerHTML ='<html:link action="/educational-cds">AIEEE</html:link>';
				 document.getElementById("head2").innerHTML ="240+ hours of in-depth lectures";
				 document.getElementById("head3").innerHTML ="<span style='color:#3f8809'>2000+ solved problems</span>";
				 document.getElementById("head4").innerHTML ="Prepared by subject experts from across India";
				 document.getElementById("head5").innerHTML ="<span style='color:#3f8809'>Years of expertise, now at your doorstep</span>";
				
				 
			
				
			}
			else if(chId =='XI-content')
			{
				
				 document.getElementById("head1").innerHTML ='<html:link action="/cbsexi">CLASS XI PREP</html:link>';
				 document.getElementById("head2").innerHTML ="Bridging the Gap:<font size=3px>X->XI->XII</font>";
				 document.getElementById("head3").innerHTML ="<span style='color:#3f8809'>Detailed explanation of every concept</span>";
				 document.getElementById("head4").innerHTML ="Methodical solutions of all the problems";
				 document.getElementById("head5").innerHTML ="<span style='color:#3f8809'>Now: Study Anytime, Anywhere & Excel</span>";
				
				 
			
				
			}
			
			else if(chId =='IIT-content')
			{
				
				 document.getElementById("head1").innerHTML ='<html:link action="/showiit">IIT-JEE PREP</html:link>';
				 document.getElementById("head2").innerHTML ="Our 700+ hrs of coaching = Your success for lifetime";
				 document.getElementById("head3").innerHTML ="<span style='color:#3f8809'>Our Instructors = Revered by best in the industry</span>";
				 document.getElementById("head4").innerHTML ="Zero Travel Time = Better focus, retention & recall";
				 document.getElementById("head5").innerHTML ="<span style='color:#3f8809'>Our Course = Available 24x7, On-Demand</span>";
				
				 
			
				
			}
			else if(chId =='SAT-content')
			{

				 document.getElementById("head1").innerHTML ='<html:link action="/showsat">SAT/PSAT PREP</html:link>';
				 document.getElementById("head2").innerHTML ="Over 125 hrs of In-Depth Content";
				 document.getElementById("head3").innerHTML ="<span style='color:#3f8809'>Designed To Teach Students Of Every Level</span>";
				 document.getElementById("head4").innerHTML ="24x7 Classroom Learning @ Your Doorsteps";
				 document.getElementById("head5").innerHTML ="<span style='color:#3f8809'>2 Complete SAT Sample Test Papers</span>";
				 
				 
					 
				

				
			}
			else if(chId =='CAT-content')
			{
				  //alert(chId);
				 document.getElementById("head1").innerHTML ='<html:link action="/cat">CATScan</html:link>';
				 document.getElementById("head2").innerHTML ="Start Preparing for MBA";
				 document.getElementById("head3").innerHTML ="<span style='color:#3f8809'>Over 1000 CAT Questions from previous CAT papers</span>";
				 document.getElementById("head4").innerHTML ="Detailed solution in an audio video format";
				 document.getElementById("head5").innerHTML ="<span style='color:#3f8809'>Lots of tricks and short cuts</span>";
				

				 
				
			}
			
			//alert("lastActiveTab:::"+lastActiveTab)
			if(lastActiveTab != "NA")
			{
				document.getElementById(lastActiveTab).className = "";
			}
			document.getElementById(chId).className = "active";
			lastActiveTab = chId;
			
			if(lastActiveBox != "NA")
			{
				
				document.getElementById(lastActiveBox).style.display = "none";
			}
			document.getElementById(boxId).style.display  = "block";
			lastActiveBox = boxId;
			
			 document.getElementById("loading").style.display = "none";
			document.getElementById("content").style.display = "block";
			
			}
		}
		
		function show()
			{
				//alert("show");
				if(ctr == 7)
				{
					ctr = 0;
				}

				changeContent(content[ctr++]);
				setTimeout("show()",20000)
			}
	  var flag = true;
		function setFlag()
		{
			   
				flag = false;
		}
		function resetFlag()
		{
			   
			   flag = true;
		}
		function showInstructorDetails(path,data)
		{
			document.InstructorForm.xmlPath.value =   path;
			document.InstructorForm.input.value =   data;
			//alert("Rajesh:"+document.InstructorForm.xmlPath.value);
			document.InstructorForm.submit();
		}
		function setCSMPath()
		{
			csmPath = "http://" + window.location.hostname +"/CSM/";
			//csmPath = "http://" +'192.168.0.200'+"/CSM/";
			//alert("CSM PATH"+csmPath);
		}
	
		function showDemo(downloadPath,chId)
		{
				//alert("1");
				downloadPath = csmPath + downloadPath;
				//alert(downloadPath);
				var pos = downloadPath.lastIndexOf("/");
				var qname= downloadPath.substring(pos+1,downloadPath.length);
				downloadPath = downloadPath + "/" + qname + ".sdz"
				//alert("complete path:"+downloadPath);
				if(downloadPath!=null && downloadPath!="" && downloadPath!="NA" && downloadPath!="NODATA")
				{
					var sw = window.screen.width;
					var sh = window.screen.height;
					if(navigator.appName == "Microsoft Internet Explorer")
					{
						sw = window.screen.availWidth;
						sh = window.screen.availHeight;
					}
					//alert("width="+sw +" height="+sh +" availWidth="+aw +" availHeight="+ah);
					//alert("width="+sw +" height="+sh )
					var uri='pages/topchalks/flexreader/downloadreader.jsp?path='+downloadPath+'&demo=demo&chId='+chId;
					var newwindow = window.open(uri,'DownLoadSolution','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,left=0,top=0,screenX=0,screenY=0,width='+sw+',height='+sh)
					if (window.focus)
					{
						newwindow.focus();
					}
				}
		}

		
		
		

		

