		$(document).ready(function(){
		var content = $("#result");	
		
		PreloadImg();
		populateNews();	
		//promptAdv();		
		setInterval(StartAds,3000);
		$("#TabMenu a").hover(function(e){
			$("#ImgObject").ImageStop(true,true);			
			$("#banner").html('<img src="images/load.gif" id="ImgObject"/>');
			
			$("#ImgObject").ImageSwitch({	Type:"FadeIn", 
											NewImage:$(this).attr("rel"),
											EffectOriginal: false,
											Speed: 200});
			
			e.preventDefault();
		});
		$("#TabMenu a").click(function(e){
			$("#ImgObject").ImageStop(true,true);
			$("#banner").html('<img src="images/load.gif" id="ImgObject"/>');
			$("#ImgObject").ImageSwitch({	Type:"FadeIn", 
											NewImage:$(this).attr("rel"),
											EffectOriginal: false,
											Speed: 200});
			e.preventDefault();
		});
	    $("#menu a").click(function(e){
			$("#ImgObject").ImageStop(true,true);
			$("#banner").html('<img src="images/load.gif" id="ImgObject"/>');
			$("#ImgObject").ImageSwitch({	Type:"FadeIn", 
											NewImage:$(this).attr("rel"),
											EffectOriginal: false,
											Speed: 200});
			e.preventDefault();
		});
			
					
		 $("#home").click(function(){
			 DeselectLinks();
			 $("#home").addClass("current");
			 
		   	content.slideUp();
		   	content.load('pages/main.html');
		   	content.slideDown();
		     
		   });  
		   $("#aboutus").click(function(){
		    DeselectLinks();
		    $("#aboutus").addClass("current");
		  	content.slideUp();
		   	content.load('pages/about-us.html');		   	
			content.slideDown();
		     
		   });		   
		  
		   $("#contactus").click(function(){
		    DeselectLinks();
		   $("#contactus").addClass("current");
		  	content.slideUp();
		   	content.load('pages/contact-us.html');
		   	content.slideDown();
			refreshCaptcha();
		     
		   });		   
		   
		   $("#programs").click(function(){		  
		   	content.slideUp();
		   	content.load('pages/programs.html');
		   	content.slideDown();
		     
		   });
		   $("#calendar").click(function(){		  
		   	content.slideUp();
		   	content.load('pages/calendar.html');
		   	content.slideDown();
		     
		   });
		   $("#studentinfo").click(function(){		  
		   	content.slideUp();
		   	content.load('pages/studentinfo.html');
		   	content.slideDown();
		     
		   });
		   $("#franchise").click(function(){		  
		   	content.slideUp();
		   	content.load('pages/franchise.html');
		   	content.slideDown();
		     
		   });
		   $("#photos").click(function(){ 
		    content.slideUp();			
		   	content.load('pages/photogallery.html');			
		   	content.slideDown();
		   });
		   $("#faq").click(function(){ 
		    DeselectLinks();
		   $("#faq").addClass("current");
		    content.slideUp();			
		   	content.load('pages/faq.html');
				
		   	content.slideDown();
		   });
		   $("#Stlogin").click(function(){ 
		    content.slideUp();			
		   	content.load('pages/maintenance.html');			
		   	content.slideDown();
		   });
		   $("#articles").click(function(){
            DeselectLinks();		   
			
		   $("#articles").addClass("current");
		    content.slideUp();			
		   	content.load('pages/article.html');			
		   	content.slideDown();
		   });
		   
		   
		   $("#contacts-form").submit(function(){
		   sendLink();
		   return false;
		   });
		   
		   $('dt').live('click',function(){
			var dd = $(this).next();
			
			// If the title is clicked and the dd is not currently animated,
			// start an animation with the slideToggle() method.
			
			if(!dd.is(':animated')){
				dd.slideToggle();
				$(this).toggleClass('opened');
			}
			
		});
		
		$('a.button').click(function(){
			
			// To expand/collapse all of the FAQs simultaneously,
			// just trigger the click event on the DTs
			
			if($(this).hasClass('collapse')){
				$('dt.opened').click();
			}
			else $('dt:not(.opened)').click();
			
			$(this).toggleClass('expand collapse');
			
			return false;
		});
		   
	
		//if mask is clicked
		$('#mask').click(function () {
			$(this).hide();
			$('.window').hide();
		});			
		$('.window #close').click(function (e) {
		//Cancel the link behavior
		e.preventDefault();
		
		$('#mask').hide();
		$('.window').hide();
		});
		 });
		 


/*
http://www.hieu.co.uk/blog/index.php/imageswitch/imageswitch-example/

*/
var ImgIdx = 1;//To mark which image will be select next
var ListEffect = [	["GCET @<strong>Navigator</strong>", "IHM/CLAT @<strong>Navigator</strong>", "CAT @<strong>Navigator</strong>","Bank PO @<strong>Navigator</strong>"],
						["ScrollIn", "ScrollOut", "ScrollIn","ScrollOut"],
						["TopDown", "LeftRight","DownTop", "RightLeft"]];
	function PreloadImg(){
		$.ImagePreload("images/Graphic1.jpg");
		$.ImagePreload("images/Graphic2.jpg");
		$.ImagePreload("images/Graphic3.jpg");
		$.ImagePreload("images/Graphic4.jpg");
	}
	
	var StartAds = function(){
		$("#Description").animate({"top": "-20px"},500,function(){
			if(!$("#Ads").ImageAnimating()){
				$("#Ads").ImageSwitch({	Type:ListEffect[1][ImgIdx], 
										NewImage:"images/Graphic"+(ImgIdx+1)+".jpg",
										Direction: ListEffect[2][ImgIdx],
										StartOpacity: 1,
										EndOpacity: 1,
										Speed: 500
										},function(){
											$("#Description").html(ListEffect[0][ImgIdx]);
											$("#Description").animate({"top": "0px"},500);
											ImgIdx++;
											if(ImgIdx>3) ImgIdx = 0;												
										});												
			}
		});
	}
	
/*   Add news here in following format
[ Date, link , Title, Description  ]
it will follow the order as it is
*/	
var NewsList = [	
["Kinara D","#","Bank Exams","BOB"],	
["Rita Joshi","#","Bank Exams","BOB"],	
["Sabiya Sujeet","#","Bank Exams","SBI"],
["Manan Sheth","#" , "IHM","Goa"],			
["Nupur Rawat","#" , "CLAT","Jodhpur"],			
["Bhumi Patel","#" , "CLAT","Ahmedabad"],			
["Anuj Shah","#" , "IHM","Mumbai"],			
["Priti Patel","#" , "Bank Exams","AXIS BANK"],			
["Vipul Patel","#" , "IHM","Auragabad"],			
["Draksha","#" , "Bank Exams","Indian Overseas BANK"],			
["Vikas Karal","#" , "Competitive Exams","UPSC"],			
["Manoj Meena","#" , "Bank Exams","Alahabad BANK"],			
["Hiral Vadsara","#" , "Bank Exams","SBI"],			
["Mangal Patel","#" , "MBA","K J Somaiya"],			
["Purva Soral","#" , "Bank Exams","Indian Overseas BANK"],			
["Namarta Shah","#" , "Bank Exams","Corporation BANK"],			
["Renu Rathod","#" , "Bank Exams","SBI"],			
["Mihir Chavda","#" , "Bank Exams","AXIS BANK"],			
["Umang Adesara", "#","IHM", "AurangaBad"],
["Richa Sharma", "#","Bank Clerical Exam", "DENA BANK"],			
["Kenul Shah", "#","IHM", "Aurangabad"],
["Jaydeep", "#","Law", "Vadodara"],
["Vikram S.", "#","NLU", "Jodhpur"],
["Falak Vashi", "#","IHM", "Shimla"],
["Rajo Raphel", "#","IHM", "Mumbai"],
["Shilpi Singh","#","Bank Exams","Corporation bank"],
["Mangal Patel","#","MBA","K J Somaiya Inst"],
["Rohit Dodia","#","MBA","B K school of Management"],
["Ramakant","#","MBA","CPI Management"],
["Khushbu","#","MBA","Som-Lalit Institute of Management Studies"],
["Kamal Virani","#","Bank Exams","State Bank Of India"],
["Sona Nair","#","Bank Exams","Bank Of Baroda"],
["Nisha K.","#","MBA","Narsee Monjee Institute"],
["Pratik Maniar","#","MBA","Sardar Patel University, Vidya nagar"],
["Sejal Patel","#","Bank Exams","Gujarat Gramin Bank"],
["Jignyasa Parmar","#","Bank Exams","Allahabad bank"]	,
["And goes on and on....","#"," "," "]		
		];

function populateNews(){
	
	var newsli = document.getElementById('listnews');
	var allNews="";
	var i=0;
	for(i=0;i<NewsList.length;i++){
		/*allNews+= "<li><strong>" + NewsList[i][0] +"</strong><h4><a href='"+NewsList[i][1]+"'>"+NewsList[i][2]+"</a></h4>"+NewsList[i][3]+"</li>";*/
		allNews+= "<li><h4>" + NewsList[i][0] +"</h4>";
		if(NewsList[i][2]!=" ")
		{
			allNews+=NewsList[i][2]+" - ";
		}
		allNews+=NewsList[i][3]+"</li>";
	}
	newsli.innerHTML = allNews;
}


/*Contact Us section starts*/
function validateEmailForm() 
{
 var okSoFar=true;
// alert(1);
 var c_username=document.getElementById("username");
  var c_email=document.getElementById("email");
  var c_tel=document.getElementById("telephone");
  var c_comments=document.getElementById("comments");
  var c_captch=document.getElementById("6_letters_code");
  
  
 {
 
 
 
 var reg1 = /^[A-Za-z .'-]+$/;
  
  if ((c_username.value=="" || !reg1.test(c_username.value)) && okSoFar)
  {
    okSoFar=false;
    alert("The Name you entered does not appear to be valid..");
    c_username.focus();
	return okSoFar;
  }
  if((c_email.value=="" || !validateEmail(c_email.value)) && okSoFar)
  {
    okSoFar = false;
    alert ("Please enter a valid email address.");
    c_email.focus();
	return okSoFar;
  }
  
  
 
  var reg3 = /\d/;
  
   if ((c_tel.value==""  || !reg3.test(c_tel.value)) && okSoFar)
  {
    okSoFar=false;
    alert("Please enter Valid Contact number.");
    c_tel.focus();
	return okSoFar;
  }
  reg=/[\W\w]*/;
  if ((c_comments.value=="" || !reg.test(c_comments.value)) && okSoFar)
  {
    okSoFar=false;
    alert("Please enter the details for your enquiry.");   
	c_comments.focus();	
	return okSoFar;
  }
 }return okSoFar;
}


function validateEmail(email)
{
    var splitted = email.match("^(.+)@(.+)$");
    if(splitted == null) return false;
    if(splitted[1] != null )
    {
      var regexp_user=/^\"?[\w-_\.]*\"?$/;
      if(splitted[1].match(regexp_user) == null) return false;
    }
    if(splitted[2] != null)
    {
      var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
      if(splitted[2].match(regexp_domain) == null) 
      {
	    var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
	    if(splitted[2].match(regexp_ip) == null) return false;
      }// if
      return true;
    }
return false;
}

function refreshCaptcha()
{
	var img = document.images['captchaimg'];	
	img.src = img.src.substring(0,img.src.lastIndexOf("?"))+"?rand="+Math.random()*1000;
	document.getElementById("6_letters_code").focus();
}

function sendLink(){

		    var c_username=$("#username").val();
			  var c_email=$("#email").val();
			  var c_tel=$("#telephone").val();
			  var c_comments=$("#comments").val();
			  var c_captch=$("#6_letters_code").val();
			  var dataString = 'email='+ c_email + '&username=' + c_username + '&telephone=' + c_tel + '&comments=' + c_comments+'&6_letters_code='+c_captch;
		   
		   if(!validateEmailForm())
			{
			/*$('#success').fadeOut(200).hide();
			$('#error').fadeOut(200).show();*/
			}
			else
			{
			
			 var http = false;

			if(navigator.appName == "Microsoft Internet Explorer") {
			  http = new ActiveXObject("Microsoft.XMLHTTP");
			} else {
			  http = new XMLHttpRequest();
			}

			
			  http.abort();
			  http.open("GET", "php/send_form_email.php?" + dataString, true);
			  http.onreadystatechange=function() {
				if(http.readyState == 4) {
				var returnedMsg = http.responseText;
				if(returnedMsg.indexOf("Error") != -1){
					returnedMsg="<font color='red'><b>"+returnedMsg+"</b></font>";
				}else{
					returnedMsg="<font color='green'><b>"+returnedMsg+"</b></font>";
					document.getElementById('contactname').style.display="none";
					document.getElementById('contactemail').style.display='none';
					document.getElementById('contactno').style.display='none';
					document.getElementById('contactmsg').style.display='none';
					document.getElementById('contactimg').style.display='none';
					document.getElementById('contactbtn').style.display='none';					
				}
				document.getElementById('message').innerHTML = returnedMsg;
				}
			  }
			  http.send(null);		
			}
			
			
}
/*Contact Us section ends*/

/*Photo Section starts*/
var PhotosList = ["1","2","3","4","5","6","7","8"];


function populatePhotos(){
	
	var photoli = document.getElementById('Photogallery');
	var allPhotos="<marquee behavior='alternate' direction='left' scrollamount='2' scrolldelay='10' onMouseOver='this.stop()' onMouseOut='this.start()' bgcolor='#F4F4F4'>";
	var i=0;
	for(i=0;i<PhotosList.length;i++){
		allPhotos+= "<a class='thumbnail' href='#thumb'><img src='images/gallery/"+PhotosList[i]+"_thumb.jpg' width='100px' height='66px' border='0' /><span><img height='370' width='500' src='images/gallery/"+PhotosList[i]+".jpg' /><br />1</span></a>";	
	}
	allPhotos+="</marquee>";
	photoli.innerHTML = allPhotos;
}
/*Photo section ends*/

function DeselectLinks() {
   var linkList = document.getElementById("menu").getElementsByTagName("a"); 
   for (i = 0; i < linkList.length; i++) {
      linkList[i].className = linkList[i].className.replace( /(?:^|\s)current(?!\S)/ , '' );
	
   }
   /*var subMenuList = document.getElementById("TabMenu").getElementsByTagName("a"); 
   for (i = 0; i < subMenuList.length; i++) {
      subMenuList[i].className = subMenuList[i].className.replace( /(?:^|\s)current(?!\S)/ , '' );
	
   }*/

}


/*FAQ section starts*/

	

var QuestionList =[

[
/*This questions are for first header*/
["Can I apply to any number of banks after the exam?" , "Yes, you can apply to all the 19 banks specified by the IBPS." ],
["To which 19 banks can I apply?" ,"You can apply to all 19 banks who come up with the vacancies. Find the list of banks as below.. "+
			"<ul>"+
				"<li>Allahabad Bank</li>"+
				"<li>Andhra Bank</li>"+
				"<li>Bank of Baroda</li>"+
				"<li>Bank of India</li>"+
				"<li>Bank of Maharashtra</li>"+
				"<li>Canara Bank</li>"+
				"<li>Central Bank of India</li>"+
				"<li>Corporation Bank</li>"+
				"<li>Dena Bank</li>"+
				"<li>Indian Bank</li>"+
				"<li>Indian Overseas Bank</li>"+
				"<li>Oriental Bank of Commerce</li>"+
				"<li>Punjab National Bank</li>"+
				"<li>Punjab & Sind Bank</li>"+
				"<li>Syndicate Bank</li>"+
				"<li>Union Bank of India</li>"+
				"<li>United Bank of India</li>"+
				"<li>UCO Bank</li>"+
				"<li>Vijaya Bank</li>"+
			"</ul>"],
["What is the validity period of the score card?","Score Cards issued by IBPS will be valid for one year from the date of issue of the Score Card."],
["The test result shows Pass. Will I surely get a bank job?","Not Necessarily. Clearing the test alone does not guarantee any job. It is necessary to apply for the recruiting bank with the test score and appear for Interview/GD to complete the final selection."],
["My result status shows Fail. Will I receive scorecard?","No. Scorecards are sent only to candidates who have passed the exam."],
["I have failed/ I did not write the test. When to apply again?","The exact date is not known but IBPS may start registrations for the next PO common exam in the months of January 2012 or February 2012. "],
["Will individual banks have any cutoffs?","Each bank will specify a minimum IBPS CWE score for each section or overall score in the notification and only those who have secured that shall apply for vacancies. "]
],
/*First Header question list is completed*/
/*Second header question list starts*/
[
["What is CMAT?",
"Common Management Admissions Test (CMAT 2012) will be conducted within a 9 day test window starting from 20th February 2012 to 28th February 2012 in 61 cities. The candidates will have option of selecting date and city for appearing in the test."],
["Which are the imortant dates for CMAT 2012?",
"The CMAT 2012 Online Registration will begin from 9th December 2011. The last date of registration is 9th January 2012 on website www.aicte-cmat.in./ "+
"The candidates will have option of selecting date for appearing in the test"],
["In which cities CMAT can be given?", 
"CMAT will be taken in total 61 cities. The candidates will have option of selecting city for appearing in the test. Candidate have to select up-to three " + "cities giving order of preference. Since it is a first come first served basis, candidates are requested to book slot as soon as possible."],
["How I can apply online for CMAT?",
"Before understanding the online registration process of CMAT 2012, let's have a look at what all is needed for the registration process."+
"Pre-requisites before starting the CMAT Registration:"+
"Candidate should have the following ready before starting the CMAT registration process:"+
"<ul>"+
"<li>A Computer with good Internet connectivity so that there is no disconnection of Internet during registration</li>"+
"<li>All candidater qualification details as candidate need to enter them while registering for CMAT exam</li>"+
"<li>A Valid e-mail id which candidate will be using at least for the next 6 months. All communication will be done on this e-mail id which candidate will "+ "enter while registering for CMAT exam</li>"+
"<li>A Valid mobile number as all information via SMS will be sent to this number</li>"+
"<li>A valid Credit / Debit card in case candidate want to pay Online</li>"+
"<li>A Printer connected to candidater system as candidate will have to Print three copies of Challan in case candidate are planning to pay by cash at the "+ "bank.</li>"+
"</ul>"+
"<br/>"+
"Registering for CMAT is a 4 Step process as mentioned below:"+

"<h2><span>Step 1:</span></h2> Log on to http://www.aicte-cmat.in/. First time candidate will enter as NEW USER. Here candidate will read the instructions"+ "carefully, accept the declaration and proceed."+
"<h2><span>Step 2:</span></h2> Here candidate need to enter few basic details. Submitting this page will generate a unique 8 digit password. This password "+ "will be shown on candidater screen and will be sent to candidate via e-mail and sms. From now onwards, whenever candidate wish to login to the registration "+ "portal, candidate will come as an 'existing user' and login with candidater e-mail id and this unique 8 digit password. This completes candidater self registration "+
"<h2><span>Step 3:</span></h2> Payment Process: Candidate can do the payment in either of the two modes mentioned below-:"+
"<ul>"+
"<li><b>Online Payment:</b> Candidate can select online payment mode and then do the payment using Credit card / Debit card / Net Banking. Once candidater "+ " payment is successfully done, candidate will receive a confirmation e-mail and sms. Once candidate have received the successful payment confirmation, "+ "  candidate can proceed with the remaining part of registration process</li>"+
"<li><b>Cash Payment in SBI bank:</b> Candidate can select this option to pay by cash at any of the designated SBI bank branch. Once candidate select this "+ "option and proceed, candidate will see a challan on candidater screen with candidater details already filled in it. Candidate need to take 3 printouts of "+ " this challan, fill in the details wherever required in all the copies, and walk in to candidater nearest SBI bank branch with cash on the next day of "+ "generation of Challan. Cash Deposit will be accepted only from the next day of candidater Challan generation</li>"+
"</ul>"+
"<h2><span>Step 4:</span></h2> Now that candidate have made the payment, candidate need to fill the remaining part of the form. Once candidate have filled "+ " the complete form, we suggest candidate once again check the complete data entered. Candidate can still modify the data entered by clicking on "+ "View / Modify."+ 
"Once candidate are sure that all the data entered is accurate, candidate will have to accept a declaration and click on Submit. The system will re-confirm "+ " to candidate for submit. Once candidate confirm, candidater form will get finally submitted. Candidate will see a message on candidater screen stating "+ " 'Thank candidate for successfully registering for the AICTE CMAT 2012 exam. Please login from 30th Jan 2012 onwards to download candidater exam ADMIT "+ "CARD'. For latest updates, please visit www.aicte-cmat.in/"]

]
/*Second header question list is completes*/
];


var MainHeaderFAQ = [
[ "What Next after IBPS Exams results are Out?",QuestionList[0]],
[ "Know about CMAT Registration Process",QuestionList[1]]
];

function populatefaq(){
//alert(1)

	var qnali = document.getElementById('faqsample');
	var dl = "";
	for(m=0;m<MainHeaderFAQ.length;m++){
	dl+='<h1>'+MainHeaderFAQ[m][0]+'</h1>';
	var questionlist = MainHeaderFAQ[m][1];
	for(i=0;i<questionlist.length;i++){
		dl+='<dt><span class="icon"></span>'+questionlist[i][0]+'</dt><dd>'+questionlist[i][1]+'</dd>';
	}
	}
	//alert(dl);
	
	qnali.innerHTML = dl;

}
/*FAQ section ends*/

/*Sticky note starts*/
function promptAdv(){
var id = '#announce';
		
		//Get the screen height and width
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();
	
		//Set heigth and width to mask to fill up the whole screen
		$('#mask').css({'width':maskWidth,'height':maskHeight});
		
		//transition effect		
		$('#mask').fadeIn(1000);	
		$('#mask').fadeTo("slow",0.8);	
	
		//Get the window height and width
		var winH = $(window).height();
		var winW = $(window).width();
              
		//Set the popup window to center
		$(id).css('top',  winH/2-$(id).height()/2);
		$(id).css('left', winW/2-$(id).width()/2);
	
		//transition effect
		$(id).fadeIn(2000); 

}


/*Sticky notes ends*/
