

function popUPwin(url,width,height,scrollbars)
{
//alert(width)
if (scrollbars==1)
	popupwin = window.open(url,'popupwin','top=0,left=0,width=' + width + ',height=' + height + ',scrollbars=1, resizable=yes');
else
	popupwin = window.open(url,'popupwin','top=0,left=0,width=' + width + ',height=' + height + ',scrollbars=0, resizable=yes');
	
	popupwin.focus();
}


		function popUpMsg(pageID,Height) {
			//alert("D")
			window.open("popUpMsg.aspx?pageID="+pageID,"","height=" + Height + " , width=450, left=200, top=100, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, titlebar=no, toolbar=no");
		}


function setBigPicPos()
{
	if(document.body.clientWidth < 990)
	{
		document.getElementById("bigAdd").style.display = 'none';
		//document.getElementById("tdAdd").width = 180;
	}
	else
	{
		document.getElementById("bigAdd").style.display = "";
		//document.getElementById("tdAdd").width = 0;
	}
}



	
		
/* paging function ************************************************/
		function getSelectedItems(msg_id,hiddenName)
		{			
			var checkBoxId = msg_id;
			var tmp = document.getElementById(hiddenName).value;	
			//-----------------------------------------------
			 if (document.getElementById(checkBoxId).checked)
			{
				if (document.getElementById(hiddenName).value == "")
				{
					document.getElementById(hiddenName).value += msg_id;
				}
				else
				{	
					if (tmp.indexOf(msg_id) == -1)				
						document.getElementById(hiddenName).value += ","+msg_id;
				}
				
				//alert(document.getElementById(hiddenName).value);								
			}
			else   //erase this msg_id from the string
			{
				var arr = new Array();
				
				if (tmp.indexOf(msg_id+",") != -1)				
					arr = tmp.split(msg_id+",");
				else				
					if (tmp.indexOf(","+msg_id) != -1)					
						arr = tmp.split(","+msg_id);	
					else				
						if (tmp.indexOf(msg_id) != -1)						
							arr = tmp.split(msg_id);					
												
				
				//document.getElementById(hiddenName).value	= arr.toString();
				str = "";	
				for (i=0; i<arr.length; i++)
				{
					str += arr[i];										
				}
				document.getElementById(hiddenName).value = str;
				
				//alert(document.getElementById("selectedItemsInpt").value);
			}
			
		}
/******************************************************************/


/* restore checked items in datagrid (paging)*/
function restoreCheckedItems(form_name,msgs_id)
{
	var arr = new Array();
	arr = msgs_id.split(",");	
	
	for(i=0; i<arr.length; i++)
	{
		if (document.getElementById(arr[i])!=null)
		if (document.getElementById(arr[i]).checked == false)
		{
			document.getElementById(arr[i]).checked = true;	
			//alert(arr[i].toString());		
		}
	}
}

