// JavaScript Document

// declaring ajax variable

var ajax = new sack();

// function for displaying the information through ajax

function parseajax()
{
	//alert(ajax.response);
	eval(ajax.response);
}

function show()
{
	document.getElementById('camp').style.display='';
}
function hide()
{
	document.getElementById('camp').style.display='none';
}
function validateLogin()
{
	var frm = document.Form_Name;
	
	if((document.getElementById('user').value=='username') || (document.getElementById('user').value==''))
	{
		alert('Please enter the user name');
		frm.user.focus();
		return false;
	}
	if((document.getElementById('password').value=='password') || (document.getElementById('password').value==''))
	{
		alert('Please enter the password');
		frm.password.focus();
		return false;
	}
}

function campId(val,clink)
{
	document.getElementById('hide_camp_id2').value=val;
	document.getElementById('hid_Camp_Link2').value = clink;
	document.Form_Name.submit();
}



function goBackPack(site_url)
{
	window.location.href = site_url+'/backpack.html';
}

/////// function for validating forgot password form ///////

function sendPassword(site_url)
{
	var frm = document.Form_Name;
	
	if (GenValidation(frm.txt_fgtUserName,'your user name.','','') == '')
	{
		return false;
	}
	else
	{
		var emailId = frm.txt_fgtUserName.value;
		ajax.requestFile= site_url+'/controllers/ajax_controller/register-ajax.php?forgot_username='+emailId;
		ajax.onCompletion=parseajax;
		ajax.runAJAX();
	}
}


////////************ GOOGLE ANALYTICS ***************////////////////////////
/*var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

try {
var pageTracker = _gat._getTracker("UA-8915433-1");
pageTracker._trackPageview();
} catch(err) {}
*/