
var itsonview=false;
var httpObject = null;
var globalEditField='';
var inline_edit_allowed=true;

String.prototype.trim = function()
{
	return this.replace(/^\s+|\s+$/g,"");
}
String.prototype.ltrim = function()
{
	return this.replace(/^\s+/,"");
}
String.prototype.rtrim = function()
{
	return this.replace(/\s+$/,"");
}
function checkField(src,label)
{
	if (src.value.trim()=='')
	{
		alert('Please enter '+label);
		src.focus();
		return false;
	}
	else
		return true;
}
function openWindow(_url, _width, _height)
{
	_name = Math.round(Math.random()*10000);
	var myWindow = window.open (_url, _name, "resizable=yes,scrollbars=yes,status=1,location=0,width="+_width+",height="+_height);
	if (navigator.appName=='Netscape') 
		myWindow.focus(); 
}
function catchKey(e, form_name, skip_fields)
{
    var isIE = (navigator.userAgent.indexOf("MSIE") != -1);
    key = (isIE) ? key = event.keyCode : e.which;
    if (key == 13)
    {
		if (skip_fields)
			document.forms[form_name].submit();
		else if (document.forms[form_name].elements['login'].value!='' && document.forms[form_name].elements['password'].value!='')
			document.forms[form_name].submit();
    }
}
//
function show(divId)
{
	var id = document.getElementById(divId);
	id.style.display = 'inline';
}
//
function fnhide(divId)
{
	var id = document.getElementById(divId);
	id.style.display = 'none';
}
//
function getObj(n)
{
	return document.getElementById(n);
}

$(function() {
    $('#slideshow1').cycle();
	
	function mainmenu(){
		$(" #thenav ul ").css({display: "none"}); // Opera Fix
		$(" #thenav li").hover(function(){
			$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(400);
			},function(){
				$(this).find('ul:first').css({visibility: "hidden"});
			});
		}

		$(document).ready(function(){
		mainmenu();
	});
	
	$('#clicksupport').click(function() {
		if($('#supportbox').css("display") == "none"){
			$('#supportbox').show();
			$("#livechat_sub").show();
			$("#livechat_add").hide();
			$('#supportbox').fadeIn('900', function() {
   				//Animation complete.
			});
		}else{
			$('#supportbox').hide();
			$("#livechat_sub").hide();
			$("#livechat_add").show();
			$('#supportbox').fadeOut('900', function() {
   				//Animation complete.
			});
		}
	});
	$('#clickexams').click(function() {
		if($('#topexamsbox').css("display") == "none"){
			$('#topexamsbox').show();
			$("#topexams_sub").show();
			$("#topexams_add").hide();
			$('#topexamsbox').fadeIn('900', function() {
   				//Animation complete.
			});
		}else{
			$('#topexamsbox').hide();
			$("#topexams_sub").hide();
			$("#topexams_add").show();
			$('#topexamsbox').fadeOut('900', function() {
   				//Animation complete.
			});
		}
	});
});
