<!--

function trim(str)
	{
		var len,loop,start=0,end;
		len=str.length;
		for(loop=0;loop<len;loop++)
		{
			if(str.charAt(loop)==" " || str.charAt(loop)==" ") 
				start=loop+1;
			else 
				break;
		}
		end=len;
		for(loop=len-1;loop>=0;loop--)
		{
			if(str.charAt(loop)==" " || str.charAt(loop)==" ") 
				end=loop;
			else 
				break;
		}
		if(start>len-1) 
			return "";
		else
		{
			if(end<0) 
				return "";
			else 
				return(str.substring(start,end));
		}
	}

function ignoreSpaces(string) 
	{
		var temp = "";
		string = '' + string;
		splitstring = string.split(" ");
		for(i = 0; i < splitstring.length; i++)
		temp += splitstring[i];
		return temp;
	}

function checkIllegalChar(string, Specials, strField)
	{
		
		// Specials SHOULD BE AN Array specified in the Main Page //
		// eg. var Specials = new Array(" ","=","\'",);			  //

		var strIllegalChar = '';
		var blnIllegalChar = false;
		
		for(var checkChar = 0; checkChar < Specials.length; checkChar++) {
			if (string.indexOf(Specials[checkChar], 0 ) != -1 ) {
				
				if (Specials[checkChar] == " ") {
					strIllegalChar +="(Blank Space)\n";
				} else {
					strIllegalChar +="              "+Specials[checkChar]+"\n";
				}
				
				blnIllegalChar = true;
			}
		}
		
		if (blnIllegalChar != false) {
			alert('DegreeC - CMS:\n         Sorry, '+strField+' contain the follwoing illegal character(s)\n\n              '+strIllegalChar+'\n         Please Remove them, Thank you\!');
			return false;
		}
		
		return true;
		
	}
	
function ValidateURL(string, strField) 
	{
		var v = new RegExp();
		v.compile("^[A-Za-z]+://[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$");
		if (!v.test(string)) {
			alert("DegreeC - CMS:\n         Please Enter a Valid "+strField+"\!\n         Thank you.");
			return false;
		}
		return true;
	} 

//function DoToAll(obj_input)
//	{ 
//		bol_is_checked = (obj_input.checked)?true:false
//	  	obj_input.form.WelcomeMessage.disabled = !(bol_is_checked);
//	    
//	}

var mIndex = 0;

function SSIndex(sDir) {
	
	var mPD	= document.getElementById('_PD');
	var mP	= document.getElementById('_P');
	
	var mN	= document.getElementById('_N');
	var mND	= document.getElementById('_ND');
	var mA	= document.getElementById('_A');
	
	mIndex	= (0 == sDir) ? --mIndex : ++mIndex;
	
	if (mIndex < 0) mIndex = 0;
	if (mIndex > 7) mIndex = 7;
	
	if (7 == mIndex && true == mL) {
			mN.style.display = 'none';
			mN.style.display = 'none';
			mND.style.display = '';
	} else if (7 == mIndex) {
			mN.style.display = 'none';
			mND.style.display = 'none';
			mA.style.display = '';
	} else {
			mA.style.display = 'none';
			mND.style.display = 'none';
			mN.style.display = '';
	}
	
	if (0 == mIndex) {
			mPD.style.display = '';
			mP.style.display = 'none';
	} else {
			mPD.style.display = 'none';
			mP.style.display = '';
	}
	
	$.get("ajax_slide_show.php", { '_t': mIndex },
   function(data){
     $('#_SS_M').html(data);
   });
	
}


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];}
}

/**************************************
* http://vertical-scroller.vbarsan.com/
*    This notice may not be removed 
**************************************/

//-- Begin Scroller's Parameters and messages -->
//scroller's width
var swidth=195;

//scroller's height
var sheight=140;


//scroller's speed 
var sspeed=2;
var restart=sspeed;
var rspeed=sspeed;

//scroller's pause
var spause=2000;

//scroller's background
var sbcolor="#FFFFFF";

//Messages: set your own; use as many as you'd like; set up Hyperlinks to
//URLs as you normally do: <a target=... href="... URL ...">..message..</a>;
//Preloading images is recommended:

//When no preloading, use below the actual image path instead of '+preload...+';
var singletext=new Array();
//singletext[0]='<table CELLSPACING="0" CELLPADDING="0" align="center" ><tr><td height="100px width:110px" valign="middle"><div class=login_bg_text><span style="color:#ff0000;">Application invited for batches commencing in:</span> <br><strong>March, 2010<br>May, 2010<br>July, 2010</strong><br /><span style="color:#ff0000;">Examination Centers for the Selection Test</span>:<br /><strong>Bangalore</strong><br /><strong>Chennai</strong><br /><strong>Cochin</strong><br /><strong>Coimbatore</strong><br /><strong>Mangalore</strong><br /><strong>Trichy</strong><br /><strong>Trivandrum</strong><br /><span style="color:#ff0000;">Last date of application for all batches 6th March 2010</span>.<br /><br /><span style="color:#ff0000;">Results for the July batch will be published on March 31, 2010.</div></td></tr></table>';

singletext[0]='<table CELLSPACING="0" CELLPADDING="0" align="center" ><tr><td height="100px width:110px" valign="middle"><div class=login_bg_text><span style="color:#ff0000;">Admission closed for all batches till July 2010.</span><br /><br /><span>Register as an User to receive intimation on batches commencing in August, September & October 2010</span>.</div></td></tr></table>';

//singletext[...]='...';
//-- end Parameters and message -->

//-- begin: Scroller's Algorithm -->
var ii=0;
function goup(){if(sspeed!=rspeed*16){sspeed=sspeed*2;restart=sspeed;}}

function start(){
if(document.getElementById){ns6div=document.getElementById('iens6div');ns6div.style.top=sheight+"px";ns6div.innerHTML=singletext[0];sizeup=ns6div.offsetHeight;ns6scroll();}
else 
if(document.layers){ns4layer=document.ns4div.document.ns4div1;ns4layer.top=sheight;ns4layer.document.write(singletext[0]);ns4layer.document.close();sizeup=ns4layer.document.height;ns4scroll();}
else 
if(document.all){iediv=iens6div;iediv.style.pixelTop=sheight+"px";iediv.innerHTML=singletext[0];sizeup=iediv.offsetHeight;iescroll();}}
function iescroll(){if(iediv.style.pixelTop>0&&iediv.style.pixelTop<=sspeed){iediv.style.pixelTop=0;setTimeout("iescroll()",spause);}else 
if(iediv.style.pixelTop>=sizeup*-1){iediv.style.pixelTop-=sspeed+"px";setTimeout("iescroll()",100);}else{if(ii==singletext.length-1)ii=0;else ii++;iediv.style.pixelTop=sheight+"px";iediv.innerHTML=singletext[ii];sizeup=iediv.offsetHeight;iescroll();}}
function ns4scroll(){if(ns4layer.top>0&&ns4layer.top<=sspeed){ns4layer.top=0;setTimeout("ns4scroll()",spause);}else 
if(ns4layer.top>=sizeup*-1){ns4layer.top-=sspeed;setTimeout("ns4scroll()",100);}else{if(ii==singletext.length-1)ii=0;else ii++;ns4layer.top=sheight;ns4layer.document.write(singletext[ii]);ns4layer.document.close();sizeup=ns4layer.document.height;ns4scroll();}}
function ns6scroll(){if(parseInt(ns6div.style.top)>0&&parseInt(ns6div.style.top)<=sspeed){ns6div.style.top=0;setTimeout("ns6scroll()",spause);}else 
if(parseInt(ns6div.style.top)>=sizeup*-1){ns6div.style.top=parseInt(ns6div.style.top)-sspeed+"px";setTimeout("ns6scroll()",100);}
else{if(ii==singletext.length-1)ii=0;else ii++;
ns6div.style.top=sheight+"px";ns6div.innerHTML=singletext[ii];sizeup=ns6div.offsetHeight;ns6scroll();}}




//-->