// SEARCH
function checkEnter(e){ //e is event object passed from function invocation 
	var characterCode //literal character code will be stored in this variable 
	
	if(e && e.which){ //if which property of event object is supported (NN4) 
		e = e; 
		characterCode = e.which; //character code is contained in NN4's which property 
	} 
	else{ 
		e = event; 
		characterCode = e.keyCode; //character code is contained in IE's keyCode property 
	} 
	
	if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key) 
	//Action Goes Here 
	(document.getElementById('searchtext').value=='Search' || document.getElementById('searchtext').value=='')?alert('Please Enter the Search Word'):location.href='/SearchResults.aspx?xsq='+document.getElementById('searchtext').value;
	return false; 
	} 
	else{ 
		return true; 
	} 
}
// NAVIGATION SCRIPT
$(document).ready(function() {	
	$('ul.m').mouseenter(
		function(){
			var str = $(this).attr('id');
			var tabID = str.substring(23,str.length);
			$('#dnn_dnnNav_ctldnnNavctr' + tabID + ' a').addClass('active');
		}).mouseleave(function(){
			var str = $(this).attr('id');
			var tabID = str.substring(23,str.length);
			$('#dnn_dnnNav_ctldnnNavctr' + tabID + ' a').removeClass('active');
	});
});
// Reference $ for jQuery

/* ROTATOR RANDOM */
function tabBlock(name,startTab,count,timercount,pausecount,autoplay) {
	this.name=name;
	this.playing=false;
	this.tabs=new Array();
	this.pages=new Array();
	this.currentIndex=startTab;
	this.running=false;this.timer=false;
	if (typeof timercount=='undefined'||timercount==null)
		this.timercount=5000;
	else
		this.timercount=timercount;
	if (typeof pausecount=='undefined'||pausecount==null)
		this.pausecount=15000;
	else
		this.pausecount=pausecount;
	if (typeof autoplay=='undefined'||autoplay==null)
		this.autoplay=false;
	else
		this.autoplay=autoplay;
	if (typeof this.currentIndex!='undefined') {
		if (this.currentIndex<0&&typeof count!='undefined'&&count!=null&&count>0) {
			this.currentIndex=(Math.floor(Math.random()*count)+1);
		}
	}
	else
		this.currentIndex=1;this.count=function() {return this.pages.length;}
	this.add=function(id,tabobjectid) {
		this.pages.push($('#'+id));
		this.tabs['T'+this.pages.length]=$('#'+tabobjectid);
		if(this.pages.length==this.currentIndex)
			this.show(this.currentIndex);
		else
			this.hide(this.pages.length-1);
		}
	this.hide=function(index) {
		this.pages[index].css('display','none');
	}
	this.play=function(duration) {
		this.running=true;
		this.playing=true;
		this.pause();
		this.timer=setTimeout(this.name+'.rotate();',duration);
	}
	this.toggle=function() {
		if(this.playing==true) {
			this.playing=false;this.pause();
		}
		else
			this.play(0);
	}
	this.pause=function() {
		if(this.timer)
			clearTimeout(this.timer);
	}
	this.delay=function() {
		this.play(this.pausecount);
	}
	this.rotate=function() {
		if(this.currentIndex+1<=this.count())
			this.detail(this.currentIndex+1);
		else
			this.detail(1);this.start();
	}
	this.start=function() {
		this.play(this.timercount);
	}
	this.detail=function(index) {
		this.currentIndex=index;for(var i=0;i<this.pages.length;i++) {
			if(i==index-1) {
				this.pages[i].css('display','block');
				if (typeof this.tabs['T'+(i+1)]!='undefined'&&this.tabs['T'+(i+1)]!=null)
					this.tabs['T'+(i+1)].addClass('current');}
				else {
					this.hide(i);
				if(typeof this.tabs['T'+(i+1)]!='undefined'&&this.tabs['T'+(i+1)]!=null)
					this.tabs['T'+(i+1)].removeClass('current');
				}
			}
		}
		this.show=function(index) {
			if(this.running)
				this.delay();this.detail(index);
		}
		if(this.autoplay==true)
			this.play(this.timercount);
	}
var srcvalue='';
var counter=0;
var timer;
