// Basic function
function getRef(name)
{
	return document.getElementById(name);
}
function showDiv(divname)
{
	getRef(divname).style.visibility = "visible";
	getRef(divname).style.display = "";
}
function hideDiv(divname)
{
	getRef(divname).style.visibility = "hidden";
	getRef(divname).style.display = "none";									
}

// end pop up
var IsolLang =
{
	// Language direction : "ltr" (left to right) or "rtl" (right to left).
	Dir					: "ltr",
	Preview				: "Preview",
	BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.",
	DialogBlocked		: "It was not possible to open the dialog window. Make sure all popup blockers are disabled."
	
}
function OpenPopUpBrowser( url, width, height )
{
	// oEditor must be defined.
	var iLeft = ( screen.width  - width ) / 2 ;
	var iTop  = ( screen.width - height ) / 2 ;

	var sOptions = "toolbar=no,status=yes,resizable=yes,dependent=yes,scrollbars=yes" ;
	sOptions += ",width=" + width ;
	sOptions += ",height=" + height ;
	sOptions += ",left=" + iLeft ;
	sOptions += ",top=" + iTop ;
		var oWindow = window.open( url, 'IsolPopUpWindow', sOptions ) ;
		
		if ( oWindow )
		{
			try
			{
				
				var sTest = oWindow.name ; 
				oWindow.opener = window ;
				oWindow.focus();
			}
			catch(e)
			{
				alert(IsolLang.DialogBlocked) ;
			}
		}
		else
			alert(IsolLang.DialogBlocked) ;
}
// end pop up


function isSelectCheckBox(chkboxname)
{
    var frm = document.forms['aspnetForm'];
    if (!frm) 
    {
        frm = document.aspnetForm;
    }
	var isChecked=false;
	for (var i=0;i < frm.elements.length;i++)
	{
		var e = frm.elements[i];
		if (e.type == "checkbox"  && e.name==chkboxname && e.checked==true )
		{
			isChecked=true;
		}
	} 
	return isChecked;
}



// Created by Shankho

function selectAllChildCheckBox(objMstr,chkChildCheckBox)
{
    var frm = document.forms['aspnetForm'];
    if (!frm) 
    {
        frm = document.aspnetForm;
    }
	
	for (var i=0;i < frm.elements.length;i++)
	{
		var e = frm.elements[i];
		if (e.type == "checkbox"  && e.name==chkChildCheckBox)
		{
			e.checked = objMstr.checked;
		}
	}
}

// End



//Master page
///Donot remove below function
function mpRef(objName)
{
   var preFixStr="ctl00_cpHolder_";
   
   return document.all ? document.all[preFixStr + objName ] : document.getElementById(preFixStr + objName);
}


function ImageChange(name, direction,roll,unroll)
{

    switch(direction)
    {
        case 'in':
        name.src = roll;
        break;
        case 'out':
        name.src = unroll;
        break;
    }
}


function preloader() 
{
 

} 

/*
 INPUT : Tag Object
 OUTPUT: If Success Position of the tag in a array Otherwise return null( If Tag Object is invalid)
 	Array(left Position ,Top Position);
 example :-
 var clt=getRef("signin");
 var pos=getTagPostion(clt);
 if(pos!=null)
 {
	 left=pos[0];
	 top=pos[1];
 }
*/
function getTagPostion(ctl)
{
	if(!isValidObject(ctl))
	{
		return null;
	}
	var	leftpos=0;
	var	toppos=0;
	aTag =ctl;
	do {
		aTag = aTag.offsetParent;
		leftpos	+= aTag.offsetLeft;
		toppos += aTag.offsetTop;
	} while(aTag.tagName!="BODY");
	leftpos +=ctl.offsetLeft;
	toppos += ctl.offsetTop;
	return new Array(leftpos,toppos);
}

function isValidObject(obj) 
{
		if (obj==null) {
			return false;
		}
		if (typeof(objToTest)== "undefined" )
		 {
			return false;
		}
		return true;

}















