function CreateForm(DivId,ActionName,HiddenFieldName,HiddenFieldValue)
{

	var frmString='<body><form name="FrmCreate" action="'+ActionName+'" method="post"><input type="hidden" name="'+HiddenFieldName+'" value="'+HiddenFieldValue+'"></form></body>';
	document.getElementById(DivId).innerHTML=frmString;
	document.FrmCreate.submit();
}

//********** Add _ajx suffix in url

function CreateAjaxURL(link){
	var arrPath = link.split('?');

	if(typeof(arrPath[1])!="undefined")
	{
		//if(!regex.exec(arrPath[1]))
		if(arrPath[1].indexOf('_ajx')==-1)
		link += "&_ajx=1" ;
	}
	else
	link += "?_ajx=1" ;

	return link;

}

function ShowUploadingProgrees()
{
	document.getElementById("Media_Uploading").style.display="";
}
/* validate date form user input*/

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
	// EXCEPT for centurial years which are not also divisible by 400.
	return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		if(i>=1 && i<=9)
		{
			i="0"+i;
		}
		this[i] = 31
		if (i=="04" || i=="06" || i == "09" || i=="11")
		{this[i] = 30}
		if (i=="02")
		{this[i] = 29}
	}
	return this ;
}

/* this function use to validate user date
to use this validation call 	ValidateDate($Year(YYYY format),$Month(mm format),$Day(dd format))
*/
function ValidateDate(strYear,strMonth,strDay)
{
	var daysInMonth= DaysArray(12);
	if((strMonth=="02" && strDay > daysInFebruary(strYear)) || strDay > daysInMonth[strMonth])
	{
		return true;
	}
	return false;
}

// Removes leading whitespaces
function Ltrim( value ) {
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
}

// Removes ending whitespaces
function Rtrim( value ) {
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");

}

// Removes leading and ending whitespaces
function trim( value ) {
	return Ltrim(Rtrim(value));
}


function getbrowser(){
	if(navigator.appName.indexOf("Netscape")>-1){
		return("Netscape");
	}
	else if((navigator.appName.indexOf("Microsoft")>-1) || (navigator.appName.indexOf("MSIE")>-1)){
		return("IE");
	}
	else if(navigator.appName.indexOf("Opera")>-1){
		return("Opera");
	}
	else{
		return(navigator.appName);
	}
	<!--+"-"+version;// -->
	return 1;
}


var ns6=document.getElementById&&!document.all

function restrictinput(maxlength,e,placeholder){
	if (window.event&&event.srcElement.value.length>=maxlength)
	return false
	else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength){
		var pressedkey=/[a-zA-Z0-9\.\,\/]/ //detect alphanumeric keys
		if (pressedkey.test(String.fromCharCode(e.which)))
		e.stopPropagation()
	}
}

function countlimit(maxlength,e,placeholder){
	var theform=eval(placeholder)
	var lengthleft=maxlength-theform.value.length
	var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)
	if (window.event||e.target&&e.target==eval(placeholder)){
		if (lengthleft<0)
		theform.value=theform.value.substring(0,maxlength)
		placeholderobj.innerHTML=lengthleft
	}
}


function displaylimit(thename, theid, thelimit){
	var theform=theid!=""? document.getElementById(theid) : thename
	var limit_text='<b><span id="'+theform.toString()+'">'+thelimit+'</span></b> characters remaining on your input limit'
	if (document.all||ns6)
	document.write(limit_text)
	if (document.all){
		eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
		eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}
	}
	else if (ns6){
		document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true);
		document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true);
	}
}


function setActiveNavMenu(containerId,aRef)
{
	var NV3 = document.getElementById(containerId);
	var NVAs = NV3.getElementsByTagName('a');
	var nAs = NVAs.length;
	for(var i=0;i<nAs;i++)
	{
		if(NVAs[i]!=aRef)
		{
			if(!NVAs[i].setAttribute('class',''))
			NVAs[i].className = '';
		}
		else
		{
			if(!NVAs[i].setAttribute('class','active'))
			NVAs[i].className = 'active';
		}
	}
}


// added by : Anurag
function matchString(strMatch, strString)
{
	var objRegExp = eval("/"+strMatch+"/i");
	return objRegExp.test(strString);

}


function GetFocusOnField( strFormName ,strFieldName)//form Name,and field Name
{

	//alert('comonnnnnnnnnnn')
	setTimeout("AShortDelayInFocus('"+strFormName+"','"+strFieldName+"')", 1000);
}

function ShowSearchDiv(divid)
{
	objQuick=document.getElementById('QuickSearch');
	objAdv=document.getElementById('AdvSearch');
	if(divid==1)
	{	objQuick.style.display='';
	objAdv.style.display='none';
	}
	else if(divid==2)
	{   objQuick.style.display='none';
	objAdv.style.display='';
	}



}


function StartAction(varname, strFrm)
{
	if(strFrm == undefined){
		strFrm = 'frmGridData';
	}

	if(varname==true)
	CheckAllData(strFrm);
	else
	RevertCheckAllData(strFrm);
}


function CheckAllData(strFrm)
{
	for(var i=0;i<document.forms[strFrm].elements.length;i++)
	{
		if(document.forms[strFrm].elements[i].name.indexOf("chk")!="-1")
		{

			if(document.forms[strFrm].elements[i].disabled==false)
			{
				document.forms[strFrm].elements[i].checked=true;
			}
		}
	}
}

function RevertCheckAllData(strFrm)
{
	for(var i=0;i<document.forms[strFrm].elements.length;i++)
	{
		if(document.forms[strFrm].elements[i].name.indexOf("chk")!="-1" && document.forms[strFrm].elements[i].checked==true)
		{
			if(document.forms[strFrm].elements[i].disabled==false)
			{
				document.forms[strFrm].elements[i].checked=false;
			}
		}
		else if(document.forms[strFrm].elements[i].name.indexOf("chk")!="-1" && document.forms[strFrm].elements[i].checked==false)
		{
			if(document.forms[strFrm].elements[i].disabled==false)
			{
				document.forms[strFrm].elements[i].checked=true;
			}
		}
	}
}




function UncheckMain(strFrm)
{
	var boolCheck = true;
	if(strFrm == undefined){
		strFrm = 'frmGridData';
	}

	if(document.forms[strFrm].MainCheck.checked==false)
	{
		for(var i=0;i<document.forms[strFrm].elements.length;i++)
		{
			if(document.forms[strFrm].elements[i].name.indexOf("chk")!="-1" && document.forms[strFrm].elements[i].checked==false)
			{
				boolCheck = false;
				break;
			}
		}
		if(boolCheck==true)
		document.forms[strFrm].MainCheck.checked=true;
	}
	else
	{
		document.forms[strFrm].MainCheck.checked=false;
	}
}


function CheckIsSelected(formName,checkBoxName,hiddenName,msg)
{
	var obj=eval("document."+formName);
	var chkobj=eval("document."+formName+"."+checkBoxName);
	var hidobj=eval("document."+formName+"."+hiddenName);
	var blSelected = false;

	if(!chkobj.length)
	{
		if(chkobj.checked)
		blSelected = true;
	}
	else
	{
		for(i=0;i<chkobj.length;i++)
		{
			if(chkobj[i].checked)
			{
				blSelected = true;
				break;
			}

		}
	}

	if(!blSelected)
	{
		if(msg)
		alert(msg);
		else
		alert('Please select at least one record.');
		return false;
	}
	else
	{
		var values="";
		if(!chkobj.length)
		{
			hidobj.value=chkobj.value;
		}
		else
		{
			for(i=0;i<chkobj.length;i++)
			{
				if(chkobj[i].checked)
				values = values+chkobj[i].value+",";
			}
			hidobj.value=values.substring(0,values.length -1);
		}
		//alert(hidobj);

		//alert(document.frmGridData.delids.value);

		return true;
	}
}


function CheckIsSelectedLightBox(formName,checkBoxName,hiddenName,msg,path)
{
	var obj=eval("document."+formName);
	var chkobj=eval("document."+formName+"."+checkBoxName);
	var hidobj=eval("document."+formName+"."+hiddenName);
	var blSelected = false;

	if(!chkobj.length)
	{
		if(chkobj.checked)
		blSelected = true;
	}
	else
	{
		for(i=0;i<chkobj.length;i++)
		{
			if(chkobj[i].checked)
			{
				blSelected = true;
				break;
			}

		}
	}

	if(!blSelected)
	{
		if(msg)
			tb_show("", path+"?msg="+msg);
		else
			tb_show("", path+"?msg=Please_select_at_least_one_record.");
		return false;
	}
	else
	{
		var values="";
		if(!chkobj.length)
		{
			hidobj.value=chkobj.value;
		}
		else
		{
			for(i=0;i<chkobj.length;i++)
			{
				if(chkobj[i].checked)
				values = values+chkobj[i].value+",";
			}
			hidobj.value=values.substring(0,values.length -1);
		}

		return true;
	}
}

function MultiDelete(link,msg)
{

	if(CheckIsSelected('frmGridData','chk','dataids'))
	{
		link=link+"&id="+document.frmGridData.dataids.value;
		if(confirm(msg))
		{
			link =CreateAjaxURL(link);
			return AjaxRequestGet(link,'GridData');

		}

		else
		return false;
	}
}

function DeleteData(link)
{
	if(confirm('Are you sure to delete record?'))
	{
		link =CreateAjaxURL(link);
		AjaxRequestGet(link,'GridData');
		return true;
	}else{
		return false;
	}

}


//Word Filter Function

function WordFilter(value)
{
	var FILTER_TEXT = new Array("Fuck","Fuk","Dick","Pussy","Ass","Cock","Sperm","XXX","penis","vegina","Porn");
	var _CFG_FILTER = FILTER_TEXT.join("|") ;
	var _CFG_FILTER_TEXT=eval("/"+_CFG_FILTER+"/i");
	if(eval(_CFG_FILTER_TEXT.test(trim(value))))
	return true;
	else
	return false;
}



/*----------------------------------------------*/
function RemoveActiveNavMenu(containerId,heading,arrHeading)
{
	var blnHeading = false;
	for(i=0;i<arrHeading.length;i++)
	{
		if(arrHeading[i]==heading)
		{
			blnHeading = true;
			break;
		}
	}
	if(blnHeading)
	return true;

	var NV3 = document.getElementById(containerId);
	var NVAs = NV3.getElementsByTagName('a');
	var nAs = NVAs.length;
	for(var i=0;i<nAs;i++)
	{
		if(!NVAs[i].setAttribute('class',''))
		NVAs[i].className = '';
	}
}

function in_array(key,arrIds)
{
	for(var i=0; i<arrIds.length;i++)
	{
		if(key==arrIds[i])
		return true;
	}
	return false;
}

function getRadioValue(form_name,radio_name)
{
	radio = eval("document."+form_name+"."+radio_name);
	for(i=0;i<radio.length;i++)
	{
		if(radio[i].checked)
		{
			return radio[i].value;
		}
	}
	return '';
}

function setRadioValue(form_name,radio_name,value)
{
	radio = eval("document."+form_name+"."+radio_name);
	for(i=0;i<radio.length;i++)
	{
		if(radio[i].value == value)
		{
			radio[i].checked=true;
			return;
		}
		else
		{
			radio[i].checked=false;
		}
	}
}

function setComboValue(form_name,combo_name,value)
{
	combo = eval("document."+form_name+"."+combo_name);
	opt = combo.options;
	for(i=0;i<opt.length;i++)
	{
		if(opt[i].value==value)
		{
			combo.selectedIndex=i;
			return;
		}
	}
}

function showById(id)
{
	document.getElementById(id).style.display="";
}

function hideById(id)
{
	document.getElementById(id).style.display="none";
}


function array2json(arr) {
	var parts = [];
	var is_list = (Object.prototype.toString.apply(arr) === '[object Array]');

	for(var key in arr) {
		var value = arr[key];
		if(typeof value == "object") { //Custom handling for arrays
			if(is_list) parts.push(array2json(value)); /* :RECURSION: */
			else parts[key] = array2json(value); /* :RECURSION: */
		} else {
			var str = "";
			if(!is_list) str = '"' + key + '":';

			//Custom handling for multiple data types
			if(typeof value == "number") str += value; //Numbers
			else if(value === false) str += 'false'; //The booleans
			else if(value === true) str += 'true';
			else str += '"' + value + '"'; //All other things
			// :TODO: Is there any more datatype we should be in the lookout for? (Functions?)

			parts.push(str);
		}
	}
	var json = parts.join(",");

	if(is_list) return '[' + json + ']';//Return numerical JSON
	return '{' + json + '}';//Return associative JSON
}



// return the x and y position of scroll bar
function getScrollXY() {
	var scrOfX = 0, scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		//DOM compliant
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	}
	return [ scrOfX, scrOfY ];
}

// return the witdh and height of window content
function getWindowSize()
{
	var windowWidth = document.documentElement.scrollWidth || document.body.scrollWidth ;
	var windowHeight = document.documentElement.scrollHeight || document.body.scrollHeight ;
	return [ windowWidth , windowHeight ];
}

// return the witdh and height of screen
function getScreenSize()
{
	var winW = 1024, winH = 460;

	if (parseInt(navigator.appVersion)>3) {
		if (navigator.appName=="Netscape") {
			winW = window.innerWidth;
			winH = window.innerHeight;
		}
		if (navigator.appName.indexOf("Microsoft")!=-1) {
			winW = document.body.offsetWidth;
			winH = document.body.offsetHeight;
		}
	}
	return [winW, winH];
}

// return the witdh and height of element
function getElementSize(id)
{
	var dv = document.getElementById(id);
	if(dv==null)
	{
		return [0,0];
	}
	if(dv.style.display!='none')
	{
		var y = dv.clientHeight || dv.offsetHeight;
		var x = dv.clientWidth	|| dv.offsetWidth;
	}
	else
	{
		var y=500, x=980;
	}
	return [ x, y ];
}


// return the  element's x and y positions from the window content top
function getElementXY(id)
{
	var el = document.getElementById(id);
	XY= getScrollXY();

	var _x = XY[0];
	var _y = XY[1];

	while( el && !isNaN( el.offsetLeft ) && !isNaN( el.offsetTop ) ) {
		_x += el.offsetLeft - el.scrollLeft;
		_y += el.offsetTop - el.scrollTop;
		el = el.parentNode;
	}

	return [ _x, _y ];
}


function confirmDelete(id)
{
	if(confirm("Are you sure you want to delete this reply?")==true)
	{
		return true;
	}
	hideFront(id);
	return false;
}

function confirmEventDelete(id)
{
	if(confirm("Are you sure you want to delete this event?")==true)
	{
		return true;
	}
	hideFront(id);
	return false;
}

function confirmEventPublish(id,type)
{
	if(confirm("Are you sure you want to publish this event?")==true)
	{
		return true;
	}
	hideFront(id);
	return false;
}

function confirmEventUnPublish(id,type)
{
	if(confirm("Are you sure you want to Unpublish this event?")==true)
	{
		return true;
	}
	hideFront(id);
	return false;
}

function confirmAction(id,action)
{

	if(confirm("Are you sure you want to "+ action +" this post?")==true)
	{
		return true;
	}
	hideFront(id);
	return false;
}

function confirmAcceptAbuseForum(id,action)
{

	if(confirm("Are you sure you want to accept this post as a report abuse? If you choose OK, this post will be accepted as a report abuse and will no more appear in core application.")==true)
	{
		return true;
	}
	hideFront(id);
	return false;
}

function confirmRejectAbuseForum(id,action)
{
	if(confirm("Are you sure you want to reject this post as a report abuse? If you choose OK, this post will be rejected as a report abuse and will continue appear in core application.")==true)
	{
		return true;
	}
	hideFront(id);
	return false;
}

function confirmAcceptAbuseDebate(id,action)
{

	if(confirm("Are you sure you want to accept this debate as a report abuse? If you choose OK, this debate will be accepted as a report abuse and will no more appear in core application.")==true)
	{
		return true;
	}
	hideFront(id);
	return false;
}
function confirmRejectAbuseDebate(id,action)
{
	var val = confirm("Do you want to reject this debate as a report abuse? If you choose OK, reports for all categories for this debate will be rejected as a report abuse and will continue appear in core application. If you choose Cancel then only selected category report will be rejected and rest will remain in pending state.");
	if(val == true)
	{
		action = action+'&t=yes';
		document.location.href = action;
	}
	else
	{
		action = action+'&t=no';
		document.location.href = action;
	}

/*	if(confirm("Are you sure you want to reject this debate as a report abuse? If you choose OK, this debate will be rejected as a report abuse and will continue appear in core application.")==true)
	{
		return true;
	}*/
	hideFront(id);
	return false;
}

function confirmRejectSession(id,action)
{
	var val = confirm("Do you want to reject this session as a report abuse? If you choose OK, reports for all categories for this session will be rejected as a report abuse and will continue appear in core application. If you choose Cancel then only selected category report will be rejected and rest will remain in pending state.");
	if(val == true)
	{
		action = action+'&t=yes';
		document.location.href = action;
	}
	else
	{
		action = action+'&t=no';
		document.location.href = action;
	}

/*	if(confirm("Are you sure you want to reject this debate as a report abuse? If you choose OK, this debate will be rejected as a report abuse and will continue appear in core application.")==true)
	{
		return true;
	}*/
	hideFront(id);
	return false;
}

function confirmAcceptAbuseSession(id,action)
{

	if(confirm("Are you sure you want to accept this session as a report abuse? If you choose OK, this session will be accepted as a report abuse and will no more appear in core application.")==true)
	{
		return true;
	}
	hideFront(id);
	return false;
}
function confirmRejectAbuseSession(id,action)
{
	if(confirm("Are you sure you want to reject this session as a report abuse? If you choose OK, this session will be rejected as a report abuse and will continue appear in core application.")==true)
	{
		return true;
	}
	hideFront(id);
	return false;
}

function confirmAcceptReview(id,action)
{

	if(confirm("Are you sure you want to accept this Session Review as a report abuse? If you choose OK, this Session Review will be accepted as a report abuse and will no more appear in core application.")==true)
	{
		return true;
	}
	hideFront(id);
	return false;
}
function confirmRejectReview(id,action)
{
	var val = confirm("Do you want to reject this Session Review as a report abuse? If you choose OK, reports for all categories for this Session Review will be rejected as a report abuse and will continue appear in core application. If you choose Cancel then only selected category report will be rejected and rest will remain in pending state.");
	if(val == true)
	{
		action = action+'&t=yes';
		document.location.href = action;
	}
	else
	{
		action = action+'&t=no';
		document.location.href = action;
	}

	hideFront(id);
	return false;
}

function confirmAcceptAbuseFeature(id,action)
{

	if(confirm("Are you sure you want to accept this feature event as a report abuse? If you choose OK, this feature event will be accepted as a report abuse and will no more appear in core application.")==true)
	{
		return true;
	}
	hideFront(id);
	return false;
}

function confirmRejectAbuseFeature(id,action)
{
	var val = confirm("Do you want to reject this featured event as a report abuse? If you choose OK, reports for all categories for this featured event will be rejected as a report abuse and will continue appear in core application. If you choose Cancel then only selected category report will be rejected and rest will remain in pending state.");
	if(val == true)
	{
		action = action+'&t=yes';
		document.location.href = action;
	}
	else
	{
		action = action+'&t=no';
		document.location.href = action;
	}

/*	if(confirm("Are you sure you want to reject this feature event as a report abuse? If you choose OK, this feature event will be rejected as a report abuse and will continue appear in core application.")==true)
	{
		return true;
	}*/
	hideFront(id);
	return false;
}

function confirmAcceptAbuseAdvertise(id,action)
{

	if(confirm("Are you sure you want to accept this banner advertisement as a report abuse? If you choose OK, this banner advertisement will be accepted as a report abuse and will no more appear in core application.")==true)
	{
		return true;
	}
	hideFront(id);
	return false;
}

function confirmRejectAbuseAdvertise(id,action)
{
	var val = confirm("Do you want to reject this banner advertisement as a report abuse? If you choose OK, reports for all categories for this banner advertisement will be rejected as a report abuse and will continue appear in core application. If you choose Cancel then only selected category report will be rejected and rest will remain in pending state.");
	if(val == true)
	{
		action = action+'&t=yes';
		document.location.href = action;
	}
	else
	{
		action = action+'&t=no';
		document.location.href = action;
	}
	/*if(confirm("Are you sure you want to reject this banner advertisement as a report abuse? If you choose OK, this banner advertisement will be rejected as a report abuse and will continue appear in core application.")==true)
	{
		return true;
	}*/
	hideFront(id);
	return false;
}

/***
*		Functions from DrawButton.js
***/

function getversion(){

if(navigator.appName.indexOf("Netscape")>-1){

make="Netscape";

}

else if((navigator.appName.indexOf("Microsoft")>-1) || (navigator.appName.indexOf("MSIE")>-1)){

make="IE";

}

else if(navigator.appName.indexOf("Opera")>-1){

make="Opera";

}

else{

make=navigator.appName;

}

version=parseInt(navigator.appVersion);

details=make;

<!--+"-"+version;// -->

return details;

}

// -->


function getposition(ImageId,divId)
{
         
        var imageid = document.getElementById(ImageId);
        objMenuDiv =  document.getElementById(divId);
        x = moveXbySlicePos (0, imageid, divId);
        y = moveYbySlicePos (18, imageid);
        document.getElementById(divId).style.top = y;
        document.getElementById(divId).style.left = x;
		alert(x);
		alert(y);

 }

function moveXbySlicePos (x, img, divId)
{
        var leftside = 65;
        if (!document.layers)
        {
                var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
                var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
                var par = img;
                var lastOffset = 0;
                while(par)
                {
                        if( par.leftMargin && ! onWindows ) x += parseInt(par.leftMargin);
                        if( (par.offsetLeft != lastOffset) && par.offsetLeft ) x += parseInt(par.offsetLeft);
                        if( par.offsetLeft != 0 ) lastOffset = par.offsetLeft;
                        par = macIE45 ? par.parentElement : par.offsetParent;
                }
     }

         else if (img.x) x += img.x;
         return x;
}
function moveYbySlicePos (y, img)
{
        if(!document.layers) {
                var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
                var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
                var par = img;
                var lastOffset = 0;
                while(par){
                        if( par.topMargin && !onWindows ) y += parseInt(par.topMargin);
                        if( (par.offsetTop != lastOffset) && par.offsetTop ) y += parseInt(par.offsetTop);
                        if( par.offsetTop != 0 ) lastOffset = par.offsetTop;
                        par = macIE45 ? par.parentElement : par.offsetParent;
                }
        } else if (img.y >= 0) y += img.y;
        return y;
}




function  show(id)
{
	if(document.getElementById('RecCount') && document.getElementById('RecCount').value!="")
		{
		   var count = document.getElementById('RecCount').value;

		   arrCount = count.split(",");
			   for(i=0;i<arrCount.length;i++)
				{
				  if(document.getElementById('divbutton'+arrCount[i]))
					{
					 document.getElementById('divbutton'+arrCount[i]).style.visibility = "hidden";
					}
				}
		}


	if(getversion()=='IE')
		{
			document.getElementById('divbutton'+id).style.visibility = "visible";
		}
		else
		{
			var obj=eval("document.getElementById('divbutton"+id+"')");
			obj.style.visibility = "visible";
		}
}

function  hide(id)
{		if(getversion()=='IE')
		{
			document.getElementById('divbutton'+id).style.visibility = "hidden";
		}
		else
		{
			var obj=eval("document.getElementById('divbutton"+id+"')");
			obj.style.visibility = "hidden";
		}
}
	
function  hideFront(id)
{
	if(getversion()=='IE')
	{
		document.getElementById('divbutton'+id).style.display = "none";
	}
	else
	{
		var obj=eval("document.getElementById('divbutton"+id+"')");
		obj.style.display = "none";
	}
}


function  showFront(id)
{
	if(document.getElementById('RecCount') && document.getElementById('RecCount').value!="")
	{
	   var count = document.getElementById('RecCount').value;
	   arrCount = count.split(",");
		   for(i=0;i<arrCount.length;i++)
			{
			  if(document.getElementById('divbutton'+arrCount[i]))
				{
				 document.getElementById('divbutton'+arrCount[i]).style.display = "none";
				}
			}
	}


	if(getversion()=='IE')
	{
		document.getElementById('divbutton'+id).style.display = "block";
	}
	else
	{
		var obj=eval("document.getElementById('divbutton"+id+"')");
		obj.style.display = "block";
	}
}

function OpenPopupWindow(url)
{ 
	objSubWin=window.open(url,'Calendar','left=100,top=100,width=800 ,height=500,resizable=1,scrollbars=1');
	if(!objSubWin)  alert("Please disable Popup Blocker.");
	else objSubWin.focus();  	  
}

/***
*   Function of Lightbox-form.js
***/

function gradient(id, level)
{
	var box = document.getElementById(id);
	box.style.opacity = level;
	box.style.MozOpacity = level;
	box.style.KhtmlOpacity = level;
	box.style.filter = "alpha(opacity=" + level * 100 + ")";
	box.style.display="block";
	return;
}


function fadein(id) 
{
	var level = 0;
	while(level <= 1)
	{
		setTimeout( "gradient('" + id + "'," + level + ")", (level* 1000) + 10);
		level += 0.01;
	}
}


function openbox(MemId, MemEmail, fadin)
{
  var box = document.getElementById('box');
  
  document.getElementById('filter').style.display='block';

  document.getElementById('error').style.display='none';

  document.getElementById('MemId').value = MemId;
  document.getElementById('MemEmail').value = MemEmail;

  if(fadin)
  {
	 gradient("box", 0);
	 fadein("box");
  }
  else
  { 	
    box.style.display='block';
  }
  
  document.getElementById('txtPersonalNote').value="Hi, add me to your network.";
}


function openEmailBox(fadin)
{
  var box = document.getElementById('boxEmail');
  
  document.getElementById('filter').style.display='block';

  document.getElementById('error').style.display='none';

  if(fadin)
  {
	 gradient("boxEmail", 0);
	 fadein("boxEmail");
  }
  else
  { 	
    box.style.display='block';
  } 
}

// Close the lightbox

function closebox()
{
   document.getElementById('box').style.display='none';
   document.getElementById('filter').style.display='none';
   document.getElementById('box').style.height='160px';
   document.getElementById('cmbGroups').value="";
   
   document.getElementById('boxEmail').style.display='none';
}

// Close the lightbox

function closestatusbox()
{
   document.getElementById('box').style.display='none';
   document.getElementById('filter').style.display='none';
   document.getElementById('box').style.height='160px';
}

function DisplayMessage(fadin)
{
    closebox(); 
	var box1 = document.getElementById('box1'); 
	document.getElementById('filter').style.display='block';
    document.getElementById('result').value=msg;
   
	if(fadin)
	{
		gradient("box1", 0);
		fadein("box1");
	}
	else
	{ 	
		box1.style.display='block';
	}  	
}

function DisplayMessage1(fadin,msg)
{
    closebox(); 
	var box1 = document.getElementById('box1'); 
	document.getElementById('filter').style.display='block';
    document.getElementById('result').innerHTML=msg;
   
	if(fadin)
	{
		gradient("box1", 0);
		fadein("box1");
	}
	else
	{ 	
		box1.style.display='block';
	}  	
}
/* helptooltip.js */
function findPosX(obj){var curleft=0;if(obj.offsetParent)while(1){curleft+=obj.offsetLeft;if(!obj.offsetParent)break;obj=obj.offsetParent}else if(obj.x)curleft+=obj.x;return curleft}function findPosY(obj){var curtop=0;if(obj.offsetParent)while(1){curtop+=obj.offsetTop;if(!obj.offsetParent)break;obj=obj.offsetParent}else if(obj.y)curtop+=obj.y;return curtop}function toggleHelpIcon(flagit,obj,hdText,bdyText){id="dvHelpToolTip";if(flagit=="1"){y=findPosY(obj);x=findPosX(obj);var top=parseInt(y)-60;var left=parseInt(x)+12;if(document.layers){document.layers[''+id+''].style.display="";document.layers[''+id+''].style.top=top+"px";document.layers[''+id+''].style.left=left+"px";document.layers[''+id+''].style.position="absolute";document.layers['hdText'].innerHTML=hdText;document.layers['bdyTxt'].innerHTML=bdyText;if(trim(hdText)==''){document.layers['hdText'].style.display="none"}else{document.layers['hdText'].style.display=""}}else if(document.all){document.all[''+id+''].style.display="";document.all[''+id+''].style.top=top+"px";document.all[''+id+''].style.left=left+"px";document.all[''+id+''].style.position="absolute";document.all['hdText'].innerHTML=hdText;document.all['bdyTxt'].innerHTML=bdyText;if(trim(hdText)==''){document.all['hdText'].style.display="none"}else{document.all['hdText'].style.display=""}}else if(document.getElementById){document.getElementById(id).style.display="";document.getElementById(''+id+'').style.top=top+"px";document.getElementById(''+id+'').style.left=left+"px";document.getElementById(''+id+'').style.position="absolute";document.getElementById('hdText').innerHTML=hdText;document.getElementById('bdyTxt').innerHTML=bdyText;if(trim(hdText)==''){document.getElementById('hdText').style.display="none"}else{document.getElementById('hdText').style.display=""}}}else if(flagit=="0"){if(document.layers)document.layers[''+id+''].style.display="none";else if(document.all)document.all[''+id+''].style.display="none";else if(document.getElementById)document.getElementById(''+id+'').style.display="none"}}function toggleHelpIconNon(flagit,obj,hdText,bdyText){id="dvHelpToolTipNonTransparent";if(flagit=="1"){y=findPosY(obj);x=findPosX(obj);var top=parseInt(y)-60;var left=parseInt(x)+12;if(document.layers){document.layers[''+id+''].style.display="";document.layers[''+id+''].style.top=top+"px";document.layers[''+id+''].style.left=left+"px";document.layers[''+id+''].style.position="absolute";document.layers['hdText1'].innerHTML=hdText;document.layers['bdyTxt1'].innerHTML=bdyText;if(trim(hdText)==''){document.layers['hdText1'].style.display="none"}else{document.layers['hdText1'].style.display=""}}else if(document.all){document.all[''+id+''].style.display="";document.all[''+id+''].style.top=top+"px";document.all[''+id+''].style.left=left+"px";document.all[''+id+''].style.position="absolute";document.all['hdText1'].innerHTML=hdText;document.all['bdyTxt1'].innerHTML=bdyText;if(trim(hdText)==''){document.all['hdText1'].style.display="none"}else{document.all['hdText1'].style.display=""}}else if(document.getElementById){document.getElementById(id).style.display="";document.getElementById(''+id+'').style.top=top+"px";document.getElementById(''+id+'').style.left=left+"px";document.getElementById(''+id+'').style.position="absolute";document.getElementById('hdText1').innerHTML=hdText;document.getElementById('bdyTxt1').innerHTML=bdyText;if(trim(hdText)==''){document.getElementById('hdText1').style.display="none"}else{document.getElementById('hdText1').style.display=""}}}else if(flagit=="0"){if(document.layers)document.layers[''+id+''].style.display="none";else if(document.all)document.all[''+id+''].style.display="none";else if(document.getElementById)document.getElementById(''+id+'').style.display="none"}}function toggleHelpIconLeft(flagit,obj,hdText,bdyText){id="dvHelpToolTip_left";if(flagit=="1"){y=findPosY(obj);x=findPosX(obj);var top=parseInt(y)-60;var left=parseInt(x)-242;if(document.layers){document.layers[''+id+''].style.display="";document.layers[''+id+''].style.top=top+"px";document.layers[''+id+''].style.left=left+"px";document.layers[''+id+''].style.position="absolute";document.layers['hdText_left'].innerHTML=hdText;document.layers['bdyTxt_left'].innerHTML=bdyText;if(trim(hdText)==''){document.layers['hdText_left'].style.display="none"}else{document.layers['hdText_left'].style.display=""}}else if(document.all){document.all[''+id+''].style.display="";document.all[''+id+''].style.top=top+"px";document.all[''+id+''].style.left=left+"px";document.all[''+id+''].style.position="absolute";document.all['hdText_left'].innerHTML=hdText;document.all['bdyTxt_left'].innerHTML=bdyText;if(trim(hdText)==''){document.all['hdText'].style.display="none"}else{document.all['hdText_left'].style.display=""}}else if(document.getElementById){document.getElementById(id).style.display="";document.getElementById(''+id+'').style.top=top+"px";document.getElementById(''+id+'').style.left=left+"px";document.getElementById(''+id+'').style.position="absolute";document.getElementById('hdText_left').innerHTML=hdText;document.getElementById('bdyTxt_left').innerHTML=bdyText;if(trim(hdText)==''){document.getElementById('hdText_left').style.display="none"}else{document.getElementById('hdText_left').style.display=""}}}else if(flagit=="0"){if(document.layers)document.layers[''+id+''].style.display="none";else if(document.all)document.all[''+id+''].style.display="none";else if(document.getElementById)document.getElementById(''+id+'').style.display="none"}}function toggleHelpIconLarge(flagit,obj,hdText,bdyText){id="dvHelpToolTipLarge";if(flagit=="1"){y=findPosY(obj);x=findPosX(obj);var top=parseInt(y)-60;var left=parseInt(x)+12;if(document.layers){document.layers[''+id+''].style.display="";document.layers[''+id+''].style.top=top+"px";document.layers[''+id+''].style.left=left+"px";document.layers[''+id+''].style.position="absolute";document.layers['hdText2'].innerHTML=hdText;document.layers['bdyTxt2'].innerHTML=bdyText;if(trim(hdText)==''){document.layers['hdText2'].style.display="none"}else{document.layers['hdText2'].style.display=""}}else if(document.all){document.all[''+id+''].style.display="";document.all[''+id+''].style.top=top+"px";document.all[''+id+''].style.left=left+"px";document.all[''+id+''].style.position="absolute";document.all['hdText2'].innerHTML=hdText;document.all['bdyTxt2'].innerHTML=bdyText;if(trim(hdText)==''){document.all['hdText2'].style.display="none"}else{document.all['hdText2'].style.display=""}}else if(document.getElementById){document.getElementById(id).style.display="";document.getElementById(''+id+'').style.top=top+"px";document.getElementById(''+id+'').style.left=left+"px";document.getElementById(''+id+'').style.position="absolute";document.getElementById('hdText2').innerHTML=hdText;document.getElementById('bdyTxt2').innerHTML=bdyText;if(trim(hdText)==''){document.getElementById('hdText2').style.display="none"}else{document.getElementById('hdText2').style.display=""}}}else if(flagit=="0"){if(document.layers)document.layers[''+id+''].style.display="none";else if(document.all)document.all[''+id+''].style.display="none";else if(document.getElementById)document.getElementById(''+id+'').style.display="none"}}
function offToolTip(objToolTip){ setTimeout(function(){toggleHelpIcon(0,objToolTip)},2000);}

