var img_default=new Array('tsop3.jpg','TX.jpg','progrmmer.jpg','ATK200.jpg');
var header_default=new Array('TSOP','RF Tx','Programmer','ATK 200');
var text_default=new Array("The all new ATK 300 is a minimized version of ATK200 with addons for CC250 Board interfacing and eliminating much of the unused space.","The all new ATK 300 is a minimized version of ATK200 with addons for CC250 Board interfacing and eliminating much of the unused space.","The all new ATK 300 is a minimized version of ATK200 with addons for CC250 Board interfacing and eliminating much of the unused space.","The all new ATK 300 is a minimized version of ATK200 with addons for CC250 Board interfacing and eliminating much of the unused space.");
var testimonials=new Array("It was an overwhelming experience to attend this workshop as there was immediate and precise application of theory to practical in a very straight and elaborate way","Practical works were included in a very good way with precisely related option.","Students were made to try out and build programs. This facilitates better thinking process.","Excellent, it met my expectations.","A very good workshop, I enjoyed the practical method of approach very much that made it very exciting.","They gave us the idea and how to implement them in day to day life.","The workshop was the best I have ever witnessed. I am not so good at electronic circuits, but the manner in which everything was explained could be understood even by a beginner.","It was very knowledgeable and helpful in terms of microcontrollers and related technologies.","Yes, it was good to attend this workshop, was very nice experience and got very useful ideas.","This workshop made us learn many things for the 1st time which we didn’t do before.","I had a good experience; new innovative works in robotics made me excited and brought a great interest in the field of robotics.","It was really inspiring and it is a good start for me to go forward in robotics.","It was a good opportunity to learn a lot of new things.","Good, we enjoyed the session and at the end, added value to ourselves.","It was an awesome experience and the knowledge that you people have is good.","Today the two day robotic workshop was very interesting and I have got a lot of knowledge about robots and microcontrollers.","The teaching method was excellent. They started from very basic things and ended with high knowledge.","I was luck to choose professional robotics for summer course 2009.","I did learn things in a small time that I would have taken a long time to learn if I tried by reading.","Language, presentation, electronic skills all was excellent and perfectly delivered in the benefits of the students.","As you started from very basics of electronics, programming etc it was very helpful. It helped a lot as robotics was a totally unreachable field before this workshop. But now I feel very much comfortable with robotics and feel it very interesting.","Teaching was so good and there was no difficulty in understanding the concepts.","The pace was really good, two days and so much knowledge is remarkable. Keep up the good work.","The workshop was up to the mark and the style & techniques were totally new & came to know about new technology.","It was very good and the trainers were very co operative and enthusiastic in giving knowledge.","The teaching method was good and the materials provided were excellent, the course material was easy to find and browse.","It was awesome!!","The trainers know how to teach from the very fundamental to advanced levels.","The training was superb with excellent faculty members, very friendly environment.","Logics of program were excellent enabled me to know the actual meaning of robot & robotics.","It was an awesome experience one of its own kind, well planned and we would like to have you at our college again.","Actually here I got that kind of teaching which I wanted i.e. theory related to practical and basics.","It is nothing but a dream which was fulfilled by teachers.","It was nice and wonderful experience and I would like to attend this workshop again.","Excellent, I got what I needed from this workshop.","The teaching was awesome & mind blowing which were done manually by us using the codes and PCBs.","It was new and innovative to me and about teaching, it was nice and course delivery was very smooth going and informative.","I think I got some valuable knowledge at very cheap cost which gives a good platform to enter in the robotics world.","The teaching method was quite impressive and course delivery model was great.","Teaching was too good and same was the practical.","It was higher than my knowledge so I learnt many things from this training because teaching process was excellent.","It was one of the best experiences. I first time came across this technology and found it easy with nice trainers.","It was impressive and practical.","I was lucky to join such a good session; I hope the same in future.","It was a good one; we would be waiting to get more out of such workshops in future.","Nice program for robotics & embedded system first time in Orissa.","It’s an excellent place for gaining something, I really search for it.","It was good, thanks for giving new ideas about robotics.","It was really good; the trainers helped us with all doubts.","It was the best workshop ever attended");
var testi_writer=new Array("Akash Kumar, NIT Surathkal","Nithin Mallya, NIT Surathkal","Ankush Nayak, NIT Surathkal","Suhas Rohit Pal, NIT Surathkal","Pramod G.S., NIT Surathkal","Debesh kumar, NIT Rourkela","Akash Kumar, NIT Allahabad","Akhila Gollakota, BITS Pilani","Rahul Kumar, Cochin University of Science and Technology","Kumari Sunil Kumar, JBIET Hyderabad","M. Harish, JBIET Hyderabad","Priya, JBIET Hyderabad","A. Krishna Chaitanya, MVSR College of Engineering Hyderabad","Rahul Jain, Sir M Visvesuaraya Institute of Technology, Bangalore","Vinay G., SJCE Mysore","Mohammed Sameer, GEC Kozhikode","Subhranshu Kumar Sahoo, NIST Berhampur","Samarajeet Mohapatra, NIST Berhampur","Akshay S. Faduis, C. V. Raman College of Engineering","K Siba Shankar Patro, CET Bhubaneswar","Saranya T. S., GEC Calicut","Prejiz K, GEC Calicut","Hari Sahankar, GEC Calicut","Nilamadhab Pradhan, CEB Bhubaneswar","Isha Acharya, CEB Bhubaneswar","Hemant Agrawaal, NITTE Meenakshi Institue of Technology, Mumbai","Santosh Kumar, SDMCET Dharwad","Somnath Nanda, DRIEMS Cuttak","Preeti Mishra, KISD Bhubaneswar","Kasturi Acharya, KISD Bhubaneswar","K. Rahul Babu, VIIT Vizag","Adwait Prasada Nayak, Sanjay Memorial Institute of Technology, Chandipadar","Monali Panda, SMIT","Manshi Chandra Sahu, Sir M Visvesvaraya Institute of Technology, Bangalore","Rohit Sangtani, Sir MVIT, Bangalore","Lavanya D. N., Vidya Vikas Institute of Engineering & Technology, Mysore","Vijaykumar V. Koppad, Sir Jayachamarajendra College of Engineering","Arun Kumar Pradahan, MIET Bhubaneswar","Amlan Mohapatra, A.B.I.T. Cuttack","Nakul A. R, Adchunchunagiri institute of Technology","K. ravi Teja, Progressive Engineering College","Richa Gaur, Vivekananda institute of Engineering & Technology Hyderabad","Harshitha U.S, NMAMIT, NITTE","Umesh, Naval College of Engineering","N. V. Sai Chandra, MVSR Engineering College","Keshab Ch. Nayak, Padmashree DCE Banagarh","Biswaranjan Mohanty, Templecity Institute of Technology & Engineering","Bhagyashree S Patil, B. V. Bhoomarad College of engineering & Technology","Samrath A. Kumar, Srinivas Institute of Technology","Rakesh Dondagi, BVBCET Hubli");
var testi_counter=-1;
var img=img_default;
var header=header_default;
var text=text_default;
var prod_counter=0;
var flag_pad=0;
function init()
{
	var total=parseInt(window.innerWidth);
	var wdth=parseInt((total-987)/2);
	try
	{
		document.getElementById("left_panel").style.width=wdth+"px";
		document.getElementById("right_panel").style.width=(wdth-1)+"px";
	}
	catch(e){ }
	var settings = {
      tl: { radius: 10 },
      tr: { radius: 0 },
      bl: { radius: 10 },
      br: { radius: 0 },
      antiAlias: true
    }
	curvyCorners(settings, "#footer_text");
    $('div.sliderGallery').each(function () {
      var ul = $('ul', this);
      var productWidth = ul.innerWidth() - $(this).outerWidth();

      var slider = $('.slider', this).slider({ 
      handle: '.handle',
      minValue: 0, 
      maxValue: productWidth, 
      slide: function (ev, ui) {
        ul.css('left', '-' + (ui.value*100) + 'px');
      }, 
      stop: function (ev, ui) {
        ul.animate({ 'left' : '-' + (ui.value*60) + 'px' }, 500, 'linear');
       },
      change: function (ev, ui) {
        ul.animate({ 'left' : '-' + (ui.value*60) + 'px' }, 500, 'linear');
       }
     });
   });
	url_split();
	start_slide_show();
	start_testi_show();
	window.setTimeout("start_product_show()",1000);
}
function url_split()
{
	durl = document.URL;
	componentList = durl.split('#');
	doc = componentList[componentList.length-1];
	componentList1 = doc.split('.');
	doc = componentList1[0];
	if (componentList.length==1 || doc=="index" || doc=="")
		i=1;
	else
	{
		ajax(doc+".html");
	}
}

function start_slide_show()
{
	var value = parseInt($( ".slider" ).slider( "option", "value" ));
	if (value>=100)
		value=-1;
	$( ".slider" ).slider( "option", "value", (value+1) );
	window.setTimeout("start_slide_show()",1200);
}
function start_testi_show()
{
	$("#testi_writer").hide();
	$("#testi_text").hide();
	testi_counter++;
	if (testi_counter>=testimonials.length)
		testi_counter=0;
	document.getElementById('testi_writer').innerHTML=testi_writer[testi_counter];
	document.getElementById('testi_text').innerHTML=testimonials[testi_counter];
	$("#testi_writer").show('fold',{},1000);
	$("#testi_text").show('fold',{},1000);
	window.setTimeout("start_testi_show()",5000);
}

function start_product_show()
{
	$("#prod_text").hide('slide',{},500);
	prod_counter++;
	if (prod_counter>=img.length)
		prod_counter=0;
	document.getElementById("prod_img").innerHTML="<img src='images/products/"+img[prod_counter]+"'>";
	document.getElementById("prod_text").innerHTML="<b><font size='+2'>"+header[prod_counter]+"</font></b><br/><br/>"+text[prod_counter];
	$("#prod_text").show('slide',{},1000);
	window.setTimeout("start_product_show()",10000);
	
}
function show_sub_menu(x)
{
	reset_all();
	var src=document.getElementById("img"+x).src;
	src=src.split(".");
	temp="";
	for (j=0;j<src.length-1;j++)
	{
		if (temp=="")
			temp=src[j];
		else
			temp=temp+"."+src[j];
	}
	src=temp;
	document.getElementById("img"+x).src=src+"_hover.jpg";
	document.getElementById("link"+x).onmouseout= function() { };
	var left=getX(document.getElementById("img"+x));
	document.getElementById("up_arrow").style.left=(left+10)+"px";
	document.getElementById("up_arrow").style.display="block";
	document.getElementById("sub_menu").style.display="block";
		
	if (left<window.innerWidth/2)
		document.getElementById("sub_menu").style.left=left+"px";
	else
		document.getElementById("sub_menu").style.left=(left-(left-window.innerWidth/2))+"px";

	switch (x)
	{
		case 1:
			document.getElementById("sub_menu").innerHTML  = "<a href='index.html'>Home</a>";
			document.getElementById("sub_menu").innerHTML += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
			document.getElementById("sub_menu").innerHTML += "<a href='introduction.html' onclick=\"ajax('about_us.html'); return false;\">About Us</a>";
			document.getElementById("sub_menu").innerHTML += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
			document.getElementById("sub_menu").innerHTML += "<a href='gallery/gallery.html' target='_blank'>Gallery</a>";
			document.getElementById("sub_menu").innerHTML += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
			document.getElementById("sub_menu").innerHTML += "<a href='index.html' onclick=\"ajax('contact_us.html'); return false;\">Contact Info.</a> ";
			break;
		case 2:
			document.getElementById("sub_menu").style.left='';
			document.getElementById("sub_menu").innerHTML="<a href='#' onclick=\"ajax('workshop_bot_begin.html'); return false;\"><b>Bot Begin</b></a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='workshop_bot_tom.html' onclick=\"ajax('workshop_bot_tom.html'); return false;\"><b>Bot Tom</b></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='workshop_bot_beam.html' onclick=\"ajax('workshop_bot_beam.html'); return false;\"><b>Bot Beam</b></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='workshop_bot_eye.html' onclick=\"ajax('workshop_bot_eye.html'); return false;\"><b>Bot Eye</b></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='workshop_bot_mouse.html' onclick=\"ajax('workshop_bot_mouse.html'); return false;\"><b>Bot Mouse</b></a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='workshop_bot_sense.html' onclick=\"ajax('workshop_bot_sense.html'); return false;\"><b>Bot Sense</b></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='workshop_bot_sms.html' onclick=\"ajax('workshop_bot_sms.html'); return false;\"><b>Bot SMS</b></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='workshop_bot_sumo.html' onclick=\"ajax('workshop_bot_sumo.html'); return false;\"><b>Bot Sumo</b></a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='workshop_bot_swarm.html' onclick=\"ajax('workshop_bot_swarm.html'); return false;\"><b>Bot Swarm</b></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='workshop_bot_virtual.html' onclick=\"ajax('workshop_bot_virtual.html'); return false;\"><b>Bot Virtual</b></a>";
			break;
		case 3:
			document.getElementById("sub_menu").innerHTML="Embedded Systems and Robotics &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Professional Robotics ";
			break;
		case 4:
			document.getElementById("sub_menu").innerHTML="<a href='#' onclick=\"ajax('associated_colleges.html'); return false;\">Associated Colleges</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='#' onclick=\"ajax('rcsa.html'); return false;\">Training Partners&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='#' onclick=\"ajax('venues.html'); return false;\">Forthcoming Venues</a>";
			break;
		case 5:
			document.getElementById("sub_menu").innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href='internship.html' onclick=\"ajax('internship.html'); return false;\">Internship Opportunities</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <a href='job_oppertunities.html' onclick=\"ajax('job_oppertunities.html'); return false;\">Job Opportunities</a>";

	}
	return false;
}
function reset_all()
{
	for (i=1;i<=5;i++)
	{
		var src=document.getElementById("img"+i).src;
		src=src.split(".");
		temp="";
		for (j=0;j<src.length-1;j++)
		{
			if (temp=="")
				temp=src[j];
			else
				temp=temp+"."+src[j];
		}
		src=temp;
		src=src.split("_");
		src=src[0];
		document.getElementById("img"+i).src=src+".jpg";
		document.getElementById("link"+i).onmouseout=function() { MM_swapImgRestore(); }
	}
}
function getX( oElement )
{
	var iReturnValue = 0;
	while( oElement != null ) {
		iReturnValue += oElement.offsetLeft;
		oElement = oElement.offsetParent;
	}
	return iReturnValue;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function ajax(page)
{
	xhr=get_connection();
	document.getElementById("main_content").style.height='auto';
	document.getElementById("main_content").innerHTML="<center><img src='images/loading.gif' height='30px' widht='30px'><br><span style='font-size:15px; color:#666666;'>Loading...</span></center>";

	 if (xhr) 
	 {
        xhr.onreadystatechange = setContent;
        xhr.open("GET", ""+page, true);
        xhr.send(null);
     }
     else {
        alert("Sorry, but I couldn't create an XMLHttpRequest");
     }
		return false;
}
function get_connection()
{
	var xhr=false;	
	 if (window.XMLHttpRequest)
	 {
        xhr = new XMLHttpRequest();
     }
     else 
	 {
        if (window.ActiveXObject) 
		{
           try 
		   {
              xhr = new ActiveXObject ("Microsoft.XMLHTTP");
			}
              catch (e) { }
        }
     }
	 return (xhr);
}
function setContent() 
{
	 if (xhr.readyState == 4) 
	 {
		document.getElementById("main_content").innerHTML=xhr.responseText;
		document.getElementById("main_content").style.backgroundColor="#FFFFFF";
		if (flag_pad==0)
		{
			flag_pad=1;
			document.getElementById("main_content").style.paddingLeft="15px";
		}
		if (document.getElementById("wrk_img"))
		{
			var img_temp=trim(document.getElementById("wrk_img").innerHTML);
			img=img_temp.split(',');
			var header_temp=trim(document.getElementById("wrk_header").innerHTML);
			header=header_temp.split(',');
			var text_temp=trim(document.getElementById("wrk_text").innerHTML);
			text=text_temp.split(',');
			start_slide_show();
		}
		else
		{
			img=img_default;
			header=header_default;
			text=text_default;
		}
	}
}

function trim(str)
{
    if(!str || typeof str != 'string')
        return null;

    return str.replace(/^[\s]+/,'').replace(/[\s]+$/,'').replace(/[\s]{2,}/,' ');
}

function get_status(page,u1,u2,u3)
{
	xhr=get_connection();
	temp=u1.split('-');
	u1=temp[3];
	document.getElementById("track").innerHTML="<center><img src='images/loading.gif' height='30px' widht='30px'><br><span style='font-size:15px; color:#666666;'>Loading...</span></center>";

	 if (xhr) 
	 {
        xhr.onreadystatechange = setContent_track;
        xhr.open("GET", page+"?u1="+u1+"&u2="+u2+"&u3="+u3, true);
        xhr.send(null);
     }
     else {
        alert("Sorry, but I couldn't create an XMLHttpRequest");
     }
		return false;
}
function setContent_track() 
{
	 if (xhr.readyState == 4) 
	 {
		document.getElementById("track"). innerHTML = xhr.responseText;
	 }
}
function show_payment_code()
{
	if (document.getElementById('mode').value=="Not Paid Yet")
	{
		document.getElementById('code_row').style.display='none';
		document.getElementById('code').value='';
		document.getElementById('code_col').innerHTML='';
	}
	else if (document.getElementById('mode').value=="Demand Draft Sent")
	{
		document.getElementById('code_row').style.display='table-row';
		document.getElementById('code').value='';
		document.getElementById('code_col').innerHTML='D.D. Number';
	}
	else if (document.getElementById('mode').value=="Transfered through Online Banking")
	{
		document.getElementById('code_row').style.display='table-row';
		document.getElementById('code').value='';
		document.getElementById('code_col').innerHTML='Tranfering Acc. No.';
	}
		
}
function populate_track()
{
	document.getElementById('track').innerHTML="<h2 align='center'><u>Track your Status</u></h2>    <table border='0' cellspacing='0' cellpadding='10' width='100%'>  <tr>    <td>Registration Code</td>    <td><input type='text' id='email' name='email' style='border:1px solid #FFFF99' /></td>  </tr>  <tr>    <td>Password</td>    <td><input type='password' id='pass' name='pass' style='border:1px solid #FFFF99' /></td>  </tr>  <tr>     <td colspan='2' align='center'>       <input type='button' value='Track Status' style='border:1px solid #FFFF99; background-color:#FFFF99; width:100px; height:50px' onclick=\"get_status('get_status.php',document.getElementById('email').value,document.getElementById('pass').value,1)\" />     </td>  </tr></table>";
}