


// this for pop window & annoucements
function changeDivision(strID,flag)
			{
				//alert(document.getElementById(strID).className);
				
				if(document.getElementById(strID).style.visibility != 'visible')
				{
					document.getElementById('Layer1').className='welcome_onclick';
					document.getElementById(strID).style.visibility = 'visible';
					document.getElementById(strID).style.display = 'block';
				}
				else
				{
					document.getElementById('Layer1').className='welcome_header';
					document.getElementById(strID).style.visibility = 'hidden';
					document.getElementById(strID).style.display = 'none';
				}
				return;
			}
			
			function show_popup(str1,top,left)
			{
			//alert(top +"   " + left);
			var p=window.createPopup()
			var pbody=p.document.body
			
			pbody.style.fontFamily = 'Arial, Helvetica, sans-serif'
			pbody.style.fontSize = '10px'
			//pbody.style.border = '10'
			//pbody.style.style.borderColor = '#000000'
			pbody.style.color = '#000000'
			pbody.style.backgroundColor = '#78A676'
			pbody.innerHTML=str1
			p.show(left+100,top+110,200,50,document.body)
			}
			
			function NewWindow(url, windowname, width, height, scroll, options)
				{
				
					var win = null;
					LeftPosition = (screen.width) ? (screen.width-width)/2 : 0;
					TopPosition = (screen.height) ? (screen.height-height)/2 - 50 : 0;
					settings = 'height='+height+',width='+width+',top='+TopPosition+',left='+LeftPosition+',scrollbars=' + scroll + ' ' + options + ' ';

					//alert(settings);
					 //window.open(url,windowname,settings);
					win = window.open(url,windowname,settings);
					try
					{
						if(win.window.focus){win.window.focus();}
					}
					catch(err)
					{}
					
					return win;
				}
										
//change image aspectradio

function tmpSetAspectRatio(imageID,height,width)
		{					
		
		//var _obj1=document.getEleentById('CtlClientDetails1_CTLaccountDetails1_imagephoto');	
		alert(document.getElementById(imageID));	
		var _obj1=document.getElementById(imageID);
		
		var defaultHeight=height;
		var defaultWidth=width;
		var imagewidth=parseInt(_obj1.width);
		var imageheight=parseInt(_obj1.height);	
		//ert(imagewidth + '=' + _obj1.height);
		var imgRWidth;
		var imgRHeight;
		var newwidth;
		var newheight;
	

		
		if(defaultHeight==imageheight && defaultWidth==imagewidth)
		{
			newheight=imgRHeight;
			newwidth=imgRWidth;				
		}
		if (defaultHeight>imageheight && defaultWidth > imagewidth)
		{
			
				 newheight=imageheight;
				 newwidth=imagewidth;
				 //newheight = defaultWidth * imageheight /imagewidth;
				// newwidth = defaultHeight * imagewidth /imageheight;

			
		}		
		if (defaultHeight>imageheight && defaultWidth < imagewidth)
		{			
				newheight = defaultWidth * imageheight /imagewidth;
				if (newheight > defaultHeight) 
				 {
					  newheight = defaultHeight;
					  newwidth = defaultHeight * imagewidth /imageheight
				 }
				 else 
				  {
					   newwidth = defaultWidth
				  }
				  imagewidth = newwidth;
				  imageheight = newheight;     
		}	
		if (defaultHeight<imageheight && defaultWidth > imagewidth)
		{
			  newwidth = defaultHeight * imagewidth /imageheight;
			  if (newwidth > defaultWidth) 
			  {
				  newwidth = defaultWidth
				  newheight = defaultWidth * imageheight /imagewidth
			  }
			 else 
			  {
				  newheight = defaultHeight
			  }
		}
		
		if(defaultHeight<imageheight && defaultWidth < imagewidth)
		{
			 newwidth = defaultHeight * imagewidth /imageheight;
			  if (newwidth > defaultWidth) 
			  {
				  newwidth = defaultWidth
				  newheight = defaultWidth * imageheight /imagewidth

			  }
			  else 
			  {
				  newheight = defaultHeight
			  }	
		

		}
			
		 imageheight = newheight;
		 imagewidth = newwidth;	

		 _obj1.width=imagewidth;
		_obj1.height=imageheight;
			//window.location.reload();
}
			
			
//remove the session after click on someotherpage
function doonload()
	{
	
		if(window.screenLeft ==0)
		{
		//if(window.location.search=='')
		if(window.location.search.indexOf("page")== -1)
		{							//win.close();
				window.location.href = "../DashBoard/Temp.aspx?page="+window.location.href;
		}
		
	}				
						
	}
	
	
	//
	function checkSearchText()
{

	if(document.getElementById('CtlClientDetails1_txtsearch').value == '')
	{
		alert('Please enter search text');
		return false;
	}
	return true;
}		


function Chkingforsubjectandmessage(subject,messsage)
{
			var _msg = '';
			
	                   // if(trim(subject) == "" && messsage == 0)
	                   if(trim(subject) == "" )
	                    {
	                       // _msg = _msg +'Subject and Message are empty.';
	                       _msg = _msg +'Subject is empty.';
	                    }
	                    else
	                    {
	                       /* if(messsage == 0)
	                        {
	                             _msg = _msg +'Message is empty.';
	                        } */
	                         if(trim(subject) == "")
	                        {
	                             _msg = _msg +'Subject is empty.';
	                        }
	                    }
			 if(_msg!='')
                        {
                            _msg =_msg + "\nDo you want to continue?";
			}
		return _msg;
}


<!-- REST OF BODY CONTENT BELOW HERE -->

