/*
Created By		: Anish R
Date of Creation	: 19/10/2007	
Purpose		: Javascript functions	
Company		: TeamBees
*/

var mnu1 = 0;
var mnu2 = 0;

window.onscroll = function()
{
var scrollpos = getScrollingPosition();
if(parent.window.scrollY < 620)
//alert(document.getElementById('mask'));
	if(document.getElementById('mask')!=null)
		document.getElementById('mask').style.top = scrollpos[1]+'px';
 //document.title = document.getElementById('mask').style.top;
};

function getScrollingPosition()
{
var position = [0, 0];
if (typeof window.pageYOffset != 'undefined')
{
position = [
window.pageXOffset,
window.pageYOffset
];
}
else if (typeof document.documentElement.scrollTop
!= 'undefined' && document.documentElement.scrollTop > 0)
{
position = [
document.documentElement.scrollLeft,
document.documentElement.scrollTop
];
}
else if (typeof document.body.scrollTop != 'undefined')
{
position = [
document.body.scrollLeft,
document.body.scrollTop
];
}
return position;
}


/**
 * @return Void
 * @param String divID
 * @desc Show or hide a html element
*/
function showHideDiv(divID){
	//alert(divID);
	var HTMLelement	= document.getElementById(divID);
	var imgId = document.getElementById('imgmines_'+divID);
	//checking element exists or notimgmines
	if(HTMLelement==null){
		alert('HTML element with id '+divID+' does not exists.');
		return false;
	}
	//checking the current style and show or hide the element
	if(HTMLelement.style.display!='none'){
		imgId.src = '../images/dash_plus.gif';
		HTMLelement.style.display	= 'none';
	}else{
		imgId.src = '../images/dash_mines.gif';
		HTMLelement.style.display	= 'block';
	}
}

//hide and show div in adminteam
function showHideDivs(divID){
	//alert(divID);
	var HTMLelement	= document.getElementById(divID);
	var imgId = document.getElementById('imgmines_'+divID);
	//alert(imgId);
	//checking element exists or notimgmines
	if(HTMLelement==null){
		alert('HTML element with id '+divID+' does not exists.');
		return false;
	}
	//checking the current style and show or hide the element
	if(HTMLelement.style.display!='none'){
		imgId.src = '../images/ar_plus.gif';
		HTMLelement.style.display	= 'none';
	}else{
		imgId.src = '../images/p1.gif';
		HTMLelement.style.display	= 'block';
	}
}
//end of this function
/**
 * @return String
 * @param String sString
 * @Trim the leading spaces from a javascript variable
*/
function leftTrim(sString)
{
while (sString.substring(0,1) == ' ')
{
sString = sString.substring(1, sString.length);
}
return sString;
}

/**
 * @return void
 * @param fileName
 * @param Int id
 * @Shows The LightBox
*/
function showLightBox (fileName, id)
{
	//Set the size of mask with respect to window
		//var Mask 		= document.getElementById('mask');
		//Mask.style.width	= document.body.offsetWidth+'px';
		//Mask.style.height	= document.body.offsetHeight+'px';
		//Set mask size ends
		var parHidSport	= window.parent.document.getElementById('cursportsid');
		var sportID	= 0;
		var fName = '';
		if(parHidSport!=null){
			sportsID = parHidSport.value;
			fName		= fileName+'.php?id='+id+'&sportsID='+sportsID;
		}else{
			fName		= fileName+'.php?id='+id;
		}
		
		//var ifrme 		= document.getElementById('diagiframe');
		showPage 		= fName;
		//alert(showPage);
		//ifrme.style.height	= '720px';
		//ifrme.style.width	= '630px';
		window.scroll(0,0);
		$('diagiframe').src 	=  showPage;

			Effect.Appear($('mask'), {to:0.6, duration:0.0});
			$('mask').style.zIndex =10;

		$('diagiframe').style.display = "block";
		//alert($('diagiframe').offsetTop);
}

function showLightBox_chImg (fileName, id, chId)
{
		var fName = '';

			fName		= fileName+'.php?id='+id+'&chId='+chId;
		
		//var ifrme 		= document.getElementById('diagiframe');
		showPage 		= fName;

		//ifrme.style.height	= '720px';
		//ifrme.style.width	= '630px';
		window.scroll(0,0);
		$('diagiframe').src 	=  showPage;

			Effect.Appear($('mask'), {to:0.6, duration:0.0});
			$('mask').style.zIndex =10;

		$('diagiframe').style.display = "block";
		//alert($('diagiframe').offsetTop);
}

/**
 * @return void
 * @param fileName
 * @param Int id
 * @Shows The LightBox
*/
function showLightBoxMove (fileName, sclId,orderid)
{
	//Set the size of mask with respect to window
		//var Mask 		= document.getElementById('mask');
		//Mask.style.width	= document.body.offsetWidth+'px';
		//Mask.style.height	= document.body.offsetHeight+'px';
		//Set mask size ends
		
			fName		= fileName+'.php?sclId='+sclId+'&orderId='+orderid;
		
		
		//var ifrme 		= document.getElementById('diagiframe');
		showPage 		= fName;
		//ifrme.style.height	= '720px';
		//ifrme.style.width	= '630px';
		window.scroll(0,0);
		$('diagiframe').src 	=  showPage;

			Effect.Appear($('mask'), {to:0.6, duration:0.0});
			$('mask').style.zIndex =10;

		$('diagiframe').style.display = "block";
		//alert($('diagiframe').offsetTop);
}

function showLightBoxAdmin (fileName, id)
{
	//Set the size of mask with respect to window
		//var Mask 		= document.getElementById('mask');
		//Mask.style.width	= document.body.offsetWidth+'px';
		//Mask.style.height	= document.body.offsetHeight+'px';
		//Set mask size ends
		var fName = '';
		
			fName		= '../'+fileName+'.php?id='+id;
		
		
		//var ifrme 		= document.getElementById('diagiframe');
		showPage 		= fName;
		//ifrme.style.height	= '720px';
		//ifrme.style.width	= '630px';
		window.scroll(0,0);
		$('diagiframe').src 	=  showPage;

			Effect.Appear($('mask'), {to:0.6, duration:0.0});
			$('mask').style.zIndex =10;

		$('diagiframe').style.display = "block";
		//alert($('diagiframe').offsetTop);
}
/**
 * @return void
 * @Clears the error div
*/
function clearError(){
	var errDiv	= document.getElementById('div_error');
	if(errDiv != null){
		errDiv.innerHTML = '&nbsp;';
	}
}
function clearError1(){
	var errDiv	= document.getElementById('div_error1');
	if(errDiv != null){
		errDiv.innerHTML = '&nbsp;';
	}
}

function clearError2(){
	var errDiv	= document.getElementById('pass_error');
	if(errDiv != null){
		errDiv.innerHTML = '&nbsp;';
	}
}

/**
 * @return void 
 * @param divId
  *@show or hide the sub params
*/
function showHideDetails(divId){
	var divEle 	= document.getElementById(divId);
	var img	=document.getElementById('pm'+divId);
	if(divEle.style.display=='none'){
		img.src = '../images/p1.gif';
		divEle.style.display	= 'block';
	}else{
        		img.src = '../images/plus.gif';
		divEle.style.display	= 'none';
	}
}

/**
 * @return void
 * @param int id
 * @param string showHTML
 * @Assign the stat to params
*/
function showStat(id, showHTML){
	var parDiv	= window.parent.document.getElementById('paramStat_'+id);
	parDiv.innerHTML	= showHTML+parDiv.innerHTML;
}

/**
 * @return void
 * @Closes The LightBox
*/
function closeiframe(){
	parent.document.getElementById('diagiframe').style.height= 100+'px'; //for removing the scroll bar b4 closing
	parent.document.getElementById('diagiframe').style.display='none';
	parent.document.getElementById('mask').style.display='none';
}

/**
 * @return void
 * @Alert while editing stats
*/
function showEditStat(statId){
	var yn	= confirm('This editing will affect where ever you are using this stat. Do you want to edit this stat?');
	if(yn){
		var prevSel	= document.getElementById('prevEdit').value;
		xajax_showEdit(prevSel, statId);
	}
}

/**
 * @return void
 * @Alert while editing stats
*/
function showEditStatFrmMain(statId){
	var yn	= confirm('This editing will affect where ever you are using this stat. Do you want to edit this stat?');
	if(yn){
		showLightBox('editStat',statId);
	}
}

/**
 * @return void
 * @Alert while editing stats
*/
function clearStatAdd(){
	document.getElementById('newStattxt').value = '';
	document.getElementById('newStattxt').focus();
}

/**
 * @return void
 * @Alert while Deleting stats
*/
function deleteStats(statId){
	var yn	= confirm('This deleting will affect where ever you are using this stat. Do you want to delete this stat?');
	if(yn){
		var prevSel	= document.getElementById('prevEdit').value;
		xajax_deleteStats(statId);
	}
}

/**
 * @return void
 * @changes the colour of div while mouse over
*/

function moverDiv(id){
	var clsname	= document.getElementById('outer_'+id).className;
	if('ouffgg' == clsname)
		document.getElementById('outer_'+id).className = 'ouffgg_mover';
}

/**
 * @return void
 * @changes the colour of div while mouse over
*/

function moutDiv(id){
	var clsname	= document.getElementById('outer_'+id).className;
	if('ouffgg_mover' == clsname)
		document.getElementById('outer_'+id).className = 'ouffgg';
}
/**
 * @return void
 * @changes the colour of div while mouse over
*/

function moverDivSports(id){
	var clsname	= document.getElementById('changeColor_'+id).className;
	if('changediv1' == clsname)
		document.getElementById('changeColor_'+id).className = 'changediv';
}

/**
 * @return void
 * @changes the colour of div while mouse over
*/

function moutDivSports(id){
	var clsname	= document.getElementById('changeColor_'+id).className;
	if('changediv' == clsname)
		document.getElementById('changeColor_'+id).className = 'changediv1';
}

/**
 * @return void
 * @Alert while Emailing schools
*/
function mailSchool(sclid){	
    var pos2 = sclid.indexOf('selctdschools');
    if(pos2 == -1)
    {	
        alert('Please select the schools to send mail');
    }
    else
    {
	var yn  =  confirm('Are you sure you want to send mail to these schools?');
	if(yn){
	        xajax_mailSchools(sclid);	
    	}
    }
}

/**
 * @return void
 * @Alert while freeze schools 
*/
function freezeSchool(sclid){
	var pos1 = sclid.indexOf('selctdschools');
	if(pos1 == -1)
	{
		alert('Please select the schools to freeze');
	}
	else
	{
	var yn  =  confirm('Are you sure you want to change the school status?');
	if(yn){ 	
		     xajax_freezeSchools(sclid);
	      }
	}
}

/**
 * @return void
 * @Alert while Deleting schools
*/
function delSchools(sclid){
   var pos = sclid.indexOf('selctdschools');
   if(pos == -1)	
	{	
		alert('Please select the schools to delete');
	}
	else
	{	 
	var yn  =  confirm('Are you sure you want to delete these schools?');
	if(yn){
	        xajax_delSchools(sclid);	
    	}
	 }
}

/**
 * @return void
 * @Alert while Deleting school
*/
function deleteSchool(sclid){
	var yn	= confirm('Are you sure you want to delete this school?');
	if(yn){
	    	xajax_deleteSchool(sclid);
	}
}

/**
 * @return void
 * @Alert while Confirming school
*/
function confirmSchool(sclid){
	var yn  =  confirm('Are you sure you want to confirm this school?');
	if(yn){
	        xajax_confirmSchool(sclid);	
	}
}

/**
 * @return void
 * @Alert while Deleting sports
*/
function deleteSport(sportid){
	var yn	= confirm('Are you sure you want to delete this sport?');
	if(yn){
	    	xajax_deleteSport(sportid);
	}
}

/**
 * @return void
 * @Alert while Deleting user
*/
function deleteUser(userid){
	var yn	= confirm('Are you sure you want to delete this user?');
	if(yn){
	    	xajax_deleteUser(userid);
	}
}
function deletePhoto(photoid){
	var yn	= confirm('Are you sure you want to delete this photo?');
	if(yn){
	    	xajax_deletePhoto(photoid);
	}
}
/**
 * @return void
 * @Alert while Deleting content
*/
function deleteContent(userid){
	var yn	= confirm('Are you sure you want to delete this content?');
	if(yn){
	    	xajax_deletecontent(userid);
	}
}
function editContent(userid){	
	    	xajax_editcontent(userid);
	}
	
/**
 * @return void
 * @Alert while Deleting users
*/
function delUsers(userid){
	var yn  =  confirm('Are you sure you want to delete these users?');
	if(yn){
	        xajax_delteUsers(userid);	
	}
}
function deleteContacts(userid){
	
	var yn  =  confirm('Are you sure you want to delete these Contacts?');
	if(yn){
	        xajax_deletecontacts(userid);	
	}
}
function delPhoto(photoid){
	var yn  =  confirm('Are you sure you want to delete these photo?');
	if(yn){
	        xajax_deltePhoto(photoid);	
	}
}
/**
 * @return void
 * @desc Show or hide the Coach title
*/
function showCoachTitle(id){
	var ele	= document.getElementById('group1_'+id);
	if(ele.checked){
		xajax_showCoachTitle(id, 1);
	}else{
		xajax_showCoachTitle(id, 0);
	}
}

/**
 * @return void
 * @Alert while Emailing users
*/
function emailUsers(userid){	
	var yn  =  confirm('Are you sure you want to send mail to these users?');
	if(yn){
	        xajax_mailUsers(userid);	
	}
}

/**
 * @return void
 * @Alert while Freezing user account
*/
function freezUser(userid){
	var yn  =  confirm('Are you sure you want to change the user status?');
	if(yn){
	        xajax_freezUsers(userid);	
	}
}

/**
 * @return void
 * @Alert while Freezing users list
*/
function freezUserslist(userid){
	var yn  =  confirm('Are you sure you want to change the user status?');
	if(yn){
	        xajax_freezUserslist(userid);	
	}
}

/**
 * @return void
 * @Alert while Deleting College
*/
function DelCollege(clgId){	
	var yn  =  confirm('Are you sure you want to delete this college?');
	if(yn){
	        xajax_DeleteCollege(clgId);	
	}
}
/**
 * @return void
 * @Alert while Deleting Coach
*/
function delCoach(coachId,tab){	
	var yn  =  confirm('Are you sure you want to delete this coach?');
	if(yn){
	        xajax_DeleteCoach(coachId,tab);	
	}
}
/**
 * @return void
 * @Alert while Deleting one or more Coaches
*/
function deleteCoaches(coachId,tab){	
	var yn  =  confirm('Are you sure you want to delete these coaches?');
	if(yn){
	        xajax_delSeleCoaches(coachId,tab);	
	}
}
/**
 * @return void
 * @Alert while Deleting college Division
*/
function delDivision(diviId){	
	var yn  =  confirm('Are you sure you want to delete this college division?');
	if(yn){
	        xajax_deleteDivision(diviId);	
	}
}
/**
 * @return void
 * @Alert while Deleting college Type
*/
function delClgType(typeId){	
	var yn  =  confirm('Are you sure you want to delete this college type?');
	if(yn){
	        xajax_deleteClgType(typeId);	
	}
}
/**
 * @return void
 * @Alert while Deleting Grade
*/
function Deletegrade(gradeId){	
	var yn  =  confirm('Are you sure you want to delete this grade?');
	if(yn){
	        xajax_DeleteGrade(gradeId);	
	}
}




/**
 * @return void
 * @Alert while Deleting promotional code
*/
function delPromocode(promo_id){
	var yn  =  confirm('Are you sure you want to delete the promotional code?');
	if(yn){
	        xajax_delPromocode(promo_id);	
	}
}

/**
 * @return void
 * @Alert while Deleting promotional code
*/
function freezePromoCode(promo_id,freeze){
	if(freeze == 0)
	{ var yn  =  confirm('Are you sure you want to freeze the promotional code?');
	  }
	else
	{  
      var yn  =  confirm('Are you sure you want to unfreeze the promotional code?');		
	  }
	if(yn){
	        xajax_freezePromoCode(promo_id);	
	}
}

/**
 * @return void
 * @Alert while Deleting faq
*/
function deleteFaq(faqid){
	var yn	= confirm('Are you sure you want to delete this faq?');
	if(yn){
	    	xajax_deleteFaq(faqid);
	}
}

//check all
function checkAll(field)
{
	//alert(field);
for (i = 0; i < field.length; i++)
	field[i].checked = true ;
}

function uncheckAll(field)
{
for (i = 0; i < field.length; i++)
	field[i].checked = false ;
}

/**
* @return void
* @param int year
* @param int month
* @param int day
* @desc displays the currently selectd 
*/
function dispDob(year, month, day){
	var yearObj = document.dash_form.dob_Year;
	var monObj	= document.dash_form.dob_Month;
	var dayObj	= document.dash_form.dob_Day;
	var startYear = yearObj.options[0].value;
	var yearToSel	= year-startYear;
	
	yearObj.options[yearToSel].selected = true;
	monObj.options[month-1].selected = true;
	dayObj.options[day-1].selected = true;
}//function dispDob ends here

/**
* @return void
* @param int feet
* @param int inches
* @desc displays the currently selectd 
*/
function dispHeight(feet, inches){
	var feetObj	= document.getElementById('height_feet');
	var inchObj	= document.getElementById('height_inchs');
	feetObj.options[feet-1].selected = true;
	inchObj.options[inches-1].selected = true;
}//function dispHeight ends here

/**
* @return void
* @param int stateId
* @desc displays the currently selectd 
*/
function dispState(stateId){
	var stateObj	= document.dash_form.state_id;
	stateObj.options[stateId-1].selected = true;
}//function dispState ends here

function setCursorFocus(fieldName){
	document.getElementById(fieldName).focus();
}

function showContact_LightBox (fileName, id,spid, profComplete)
{
	if(0==profComplete){
		alert('Please enter your stats, upload a video, upload a picture and complete your personal information, before contacting the coaches');
		return;
	}
		var fName = '';
		fName		= fileName+'.php?id='+id+'&sportid='+spid;
		var ifrme 		= document.getElementById('diagiframe');
		showPage 		= fName;
		if(fileName=='memcontact_popup'){
			ifrme.style.height	= '400px';
		}else{
		ifrme.style.height	= '400px';
		}
		ifrme.style.width	= '550px';
		window.scroll(0,0);
		 $('diagiframe').src =  showPage;
      	 	
      	 	document.getElementById('mask').style.height = 800 + 'px';
			document.getElementById('mask').style.width = 1003 + 'px';
      	 	// ifrme.style.top = (t)+'px';
      	 	
	//if ((navigator.userAgent.indexOf("Safari") == -1) && (navigator.userAgent.indexOf("MSIE") == -1))
		//{
		Effect.Appear($('mask'), {to:0.6, duration:0.0});
		$('mask').style.zIndex =10;
		//}
	$('diagiframe').style.display = "";
}
function showMemberContact_LightBox (fileName, id)
{
		var fName = '';
		fName		= fileName+'.php?id='+id;
		var ifrme 		= document.getElementById('diagiframe');
		showPage 		= fName;
		ifrme.style.height	= '600px';
		ifrme.style.width	= '550px';
		window.scroll(0,0);
		 $('diagiframe').src =  showPage;
      	 	
      	 	document.getElementById('mask').style.height = (200 + 1000) + 'px';
      	 	// ifrme.style.top = (t)+'px';
      	 	
	//if ((navigator.userAgent.indexOf("Safari") == -1) && (navigator.userAgent.indexOf("MSIE") == -1))
		//{
		Effect.Appear($('mask'), {to:0.6, duration:0.0});
		$('mask').style.zIndex =10;
		//}
	$('diagiframe').style.display = "";
}


function showAdvSearchSel(){
	var objId	= document.getElementById('advSrch');
	clsName		= objId.className;
		objId.className = 'puaddghgh_selected';
}

function showAdvSearchDeSel(){
	var objId	= document.getElementById('advSrch');
	clsName		= objId.className;
		objId.className = 'puaddghgh';
}
function changediv(id)
{
	ID = document.getElementById(id);
	if(ID.style.display == "")
	{
		ID.style.display = "none";
	}
	else
	{
		ID.style.display = "";
	}
	return true;
}
function delContact(msgId,divid,spanid){
	var yn = confirm('Do you want to delete this Mail');
	if(yn==true)
	{
	xajax_delContact(msgId,divid,spanid);
	}
}
function del_inboxContact(msgId,divid){
	var yn = confirm('Do you want to delete this Mail');
	if(yn==true)
	{
	xajax_del_inboxContact(msgId,divid);
	}
}
function del_newboxContact(msgId,divid){
	var yn = confirm('Do you want to delete this Mail');
	if(yn==true)
	{
	xajax_del_newboxContact(msgId,divid);
	}
}
function submitDelete(frm_outbox,divcon){
	xajax_submitDelete(xajax.getFormValues(frm_outbox),divcon);
	}
	
function outbox_Delete(frm,divcon,spanid){
	var yn = confirm('Do you want to delete this Mail');
	if(yn==true)
	{
	xajax_outbox_Delete(frm,divcon,spanid);
	}
}
function inbox_Delete(frm,divcon){
	var yn = confirm('Do you want to delete this Mail');
	if(yn==true)
	{
	xajax_inbox_Delete(frm,divcon);
	}
}
function submit_inboxDelete(frm_inbox){
	
	xajax_submit_inboxDelete(xajax.getFormValues(frm_inbox));
	
}

function submit_newboxDelete(frm_inbox){
	
	xajax_submit_newboxDelete(xajax.getFormValues(frm_inbox));
	
}
function newbox_Delete(frm,divcon){
	var yn = confirm('Do you want to delete this Mail');
	if(yn==true)
	{
	xajax_newbox_Delete(frm,divcon);
	}
}
function refresh_parent()
{
	window.opener.location.reload();
}

function showTextF(obj, fcs){
	if(1 == fcs){
		if('From' == obj.value)
			obj.value	= '';
	}else{
		if('' == leftTrim(obj.value))
			obj.value = 'From';
	}
}

function showTextT(obj, fcs){
	if(1 == fcs){
		if('To' == obj.value)
			obj.value	= '';
	}else{
		if('' == leftTrim(obj.value))
			obj.value = 'To';
	}
}

function changeStyle(id1,id2)
{

	ID = document.getElementById(id1);
	ID1 = document.getElementById(id2);
	if(ID.style.display == "")
	{
		ID.style.display = "none";
	}
	else
	{
		ID.style.display = "";
	}
	
	if(ID1.style.display == "")
	{
		ID1.style.display = "none";
	}
	else
	{
		ID1.style.display = "";
	}
	return true;
}
function clear_maillist(id1,id2)
{
	ID1 = document.getElementById(id1);
	ID2 = document.getElementById(id2);
	ID1.value = "";
	ID2.innerHTML = "";
	
}
function closeiframe_mailinglist(){
	parent.document.getElementById('diagiframe').style.height= 100+'px'; //for removing the scroll bar b4 closing
	parent.document.getElementById('diagiframe').style.display='none';
	parent.document.getElementById('mask').style.display='none';
	 //var cname ='div_mem_mlist' +id;
	//parent.document.getElementById(cname).value += param;
	}

function showAddtoMail_LightBox (fileName, id,spid, profComplete)
{
	if(0==profComplete){
		alert('Please enter your stats, upload a video, upload a picture and complete your personal information, before adding coaches to mailinglist');
		return;
	}
		var fName = '';
		fName		= fileName+'.php?id='+id+'&sportid='+spid;
		var ifrme 		= document.getElementById('diagiframe');
		showPage 		= fName;
		ifrme.style.height	= '530px';
		ifrme.style.width	= '550px';
		window.scroll(0,0);
		 $('diagiframe').src =  showPage;
      	 	
      	 	document.getElementById('mask').style.height = (200 + 1000) + 'px';
			document.getElementById('mask').style.width = (1004) + 'px';
      	 	// ifrme.style.top = (t)+'px';
      	 	
	//if ((navigator.userAgent.indexOf("Safari") == -1) && (navigator.userAgent.indexOf("MSIE") == -1))
		//{
		Effect.Appear($('mask'), {to:0.6, duration:0.0});
		$('mask').style.zIndex =10;
		//}
	$('diagiframe').style.display = "";
}

function selMnuAddSports(id){
	var id1 = document.getElementById('mnu1_addsp');
	var id2	= document.getElementById('mnu2_addsp');
	
	var page1	= document.getElementById('page1_addSports');
	var page2	= document.getElementById('page2_addSports');
	
	if(1 == id){
		if('headerkcurr' != id1.className){
			page1.style.display	= 'block';
			page2.style.display	= 'none';
			id1.className		= 'headerkcurr';
			id2.className		= '';
		}
	}else{
		if('' == document.getElementById('cursportsid').value){
			document.getElementById('div_error').innerHTML = 'You must add sports to add accolades';
			return false;
		}
		if('headerkcurr' != id2.className){
			page1.style.display	= 'none';
			page2.style.display	= 'block';
			id1.className		= '';
			id2.className		= 'headerkcurr';
		}
	}
}

function chekAccolades(acoSpId){
	var yn=confirm('This accolades is already used by some user(s). Do you want to delete this?');
	if(yn)
		xajax_deleteAco(acoSpId, 1); 
}

function del_mailing_group(divid,id)

{
	res=confirm("Do you want to delete this mailing list");
	if(res==true)
	
	{
		xajax_del_mailinglist(divid,id);
	}
	return false;
}

function del_mailing_users(aFormvalues,chk_key,mlist_id)

{
	res=confirm("Do you want to remove selected members from this group");
	if(res==true)
	
	{
		xajax_del_all_mailing_users(aFormvalues,chk_key,mlist_id,'div_mem_mlist','div_tot_coaches');
	}
	return false;
}
function delmember_mailgroup(divid,id,tot_div,mlist_id)
{
	res=confirm("Do you want to delete this member from list");
	if(res==true)
	
	{
		xajax_delmember_mlist(divid,id,tot_div,mlist_id);
	}
	return false;
}
function showAdd_Mailgroup_LightBox(fileName)
{
		var fName = '';
		//fName		= fileName+'.php?id='+id+'&sportid='+spid;
		fName		= fileName+'.php';
		var ifrme 		= document.getElementById('diagiframe');
		showPage 		= fName;
		ifrme.style.height	= '250px';
		ifrme.style.width	= '550px';
		window.scroll(0,0);
		 $('diagiframe').src =  showPage;
      	 	
      	 	document.getElementById('mask').style.height = (200 + 1000) + 'px';
      	 	// ifrme.style.top = (t)+'px';
      	 	
	//if ((navigator.userAgent.indexOf("Safari") == -1) && (navigator.userAgent.indexOf("MSIE") == -1))
		//{
		Effect.Appear($('mask'), {to:0.6, duration:0.0});
		$('mask').style.zIndex =10;
		//}
	$('diagiframe').style.display = "";
}

function changedivstatus(id) {
	ID = document.getElementById(id);
	if(ID.style.display == "")
	{
		ID.style.display = "none";
	}
	return true;
}
/*function submit_Sentmail_outbox(frm_outbox)
{
	xajax_sentmail_outbox(xajax.getFormValues(frm_outbox));
		return false;
}*/
function show_Sentmailgroup_LightBox (fileName,id,arruserIds,mail_sentby)
{
		var fName = '';
		if(mail_sentby ==0)
		{
		fName		= fileName+'.php?id='+id;
		}
		else
		{
			fName		= fileName+'.php?id='+id+'&mgtype='+mail_sentby+'&mguids='+arruserIds;	
		}
		var ifrme 		= document.getElementById('diagiframe');
		showPage 		= fName;
		ifrme.style.height	= '450px';
		ifrme.style.width	= '550px';
		window.scroll(0,0);
		 $('diagiframe').src =  showPage;
      	 	
      	 	document.getElementById('mask').style.height = (200 + 1000) + 'px';
      	 	// ifrme.style.top = (t)+'px';
      	 	
	//if ((navigator.userAgent.indexOf("Safari") == -1) && (navigator.userAgent.indexOf("MSIE") == -1))
		//{
		Effect.Appear($('mask'), {to:0.6, duration:0.0});
		$('mask').style.zIndex =10;
		//}
	$('diagiframe').style.display = "";
}

function sent_mailto_group(id,arruserIds,mail_sentby)
{
	if(mail_sentby ==1)
		res=confirm("Do you want to sent mail to selected users in this group");
	else
	res=confirm("Do you want to sent mail to selected group");
	
	if(res==true)
		{
		 show_Sentmailgroup_LightBox('sentmail_popup',id,arruserIds,mail_sentby);
	}
	return false;
	
}


function sent_mailto_outboxgroup(arrMsgIds)
{
	res=confirm("Do you want to sent mail to selected users");
	if(res==true)
		{
		 show_Sentmail_outbox_LightBox('sentmail_outbox_popup',arrMsgIds);
	}
	return false;
	
}
function changeimg(id,url)
{
	ID = document.getElementById(id);
	if(ID.src == url +"images/ar_plus.gif")
	{
		ID.src ="images/p1.gif";
	}
	else
	{
		ID.src ="images/ar_plus.gif"
	}
}

/**
 * @return void
 * @Alert while Deleting sports
*/
function delprimSport(sportid){
	var yn	= confirm('Are you sure you want to delete primary sport?');
	if(yn){
	    	xajax_delprimSport(sportid);
	}
}

/**
 * @return void
 * @Alert while Activating account without payment
*/
function activateAccount(sports_id,sport){	
  if(sport == 1)
  {
      var pos3 = sports_id.indexOf('selctdsports');
      if(pos3 == -1)
      {	
        alert('Please select sports');
      }
      else
      {
	   var yn  =  confirm('Are you sure you want to activate account without payment?');
	   if(yn)
	        {
	          xajax_activateAccount(sports_id);	
             }
      }      
  }
  else
  { 
  	var yn  =  confirm('Are you sure you want to activate account without payment?');
	if(yn)
	  {
	    xajax_activateAccount(sports_id);	
      }	
  }
}

/**
 * @return void
 * @Alert while Deleting college Type
*/
function delSclType(typeId){	
	var yn  =  confirm('Are you sure you want to delete this school type?');
	if(yn){
	        xajax_delSclType(typeId);	
	}
}

function myinit(){
if(document.getElementById('arrow_left')!=null)
	initSlideShow();
}

function showTxt(obj, frm){
	var x = leftTrim(obj.value);
	if(frm==1){
		if(x=="Enter prospect's name")
			obj.value	= '';
	}else{
		if(x=='')
			obj.value	= "Enter prospect's name";
	}
}

function selNormalSearch(selIndex, frm){
	if(1==frm)
		document.getElementById('state_id').options[selIndex].selected = true;
	else if(2 == frm)
		document.getElementById('divi_id').options[selIndex].selected = true;
	else
		document.getElementById('coachName').value = selIndex;
}

function selNormalSearchAd(selIndex, frm){
	if(1==frm)
		document.getElementById('state_idAd').options[selIndex].selected = true;
	else if(2 == frm)
		document.getElementById('divsion_idAd').options[selIndex].selected = true;
	else
		document.getElementById('coachNameAd').value = selIndex;
}

function showDropMnu1(){
	mnu2 = 0;
	if(mnu1 == 0){
		mnu1 = 1;
		TagToTip('dropMnu1',BORDERWIDTH, 0, PADDING, 0,STICKY ,true, BGCOLOR, '',FIX, [119, 155], FADEIN, 50, FADEOUT, 50, COPYCONTENT, false);
	}
	else{
		mnu1 = 0;
		tt_HideInit();
	}
}

function showDropMnu2(){
	mnu1 = 0;
	if(mnu2 == 0){
		mnu2 = 1;
		TagToTip('dropMnu2',BORDERWIDTH, 0, PADDING, 0,STICKY ,true, BGCOLOR, '',FIX, [232, 155], FADEIN, 50, FADEOUT, 50, COPYCONTENT, false);
	}
	else{
		mnu2 = 0;
		tt_HideInit();
	}
}

function backOne(id, opt){
	//id	= id.replace('%3A',':');
	//alert(document.getElementById('o_'+id));
	if(opt==1)
		document.getElementById('o_'+id).className = 'drop_border_cls';
	else
		document.getElementById('o_'+id).className = 'drop_border';
}

function backTwo(id, opt){
	//id	= id.replace('%3A',':');
	//alert(document.getElementById('o_'+id));
	if(opt==1)
		document.getElementById('t_'+id).className = 'drop_border_cls';
	else
		document.getElementById('t_'+id).className = 'drop_border';
}

function memSearchSelection(id, frm){
	if(frm==1){
		document.getElementById('sports_id').options[id].selected=true;
	}else if(frm==2){
		document.getElementById('state_id').options[id].selected=true;
	}
}

function searchSelectionAd(id, frm){
	if(frm==1){
		document.getElementById('state_idAd').options[id].selected=true;
	}else if(frm==2){
		document.getElementById('sports_idAd').options[id].selected=true;
		xajax_checkSports(document.getElementById('sports_idAd').value);
	}
}

function js_showPositions(paramsVal, paramsName){
	var objSelPos	= document.getElementById('pos_id');
	objSelPos.options.length	= 0;
	for(i=0;i<paramsVal.length;i++){
		objSelPos.options[i]	= new Option(paramsName[i], paramsVal[i]);
	}
}