function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}





/********Print***********/
function Submitbtnsearch()
		 {
        // process only the Enter key
        if (event.keyCode == 13)
        {
            // cancel the default submit
            event.returnValue=false;
            event.cancel = true;
            // submit the form by programmatically clicking the specified button
            document.getElementById("ControlHeader1_btnsearch").click();
        }
    }
    
    function Submitbtnmailinglist()
		 {
        // process only the Enter key
        if (event.keyCode == 13)
        {
            // cancel the default submit
            event.returnValue=false;
            event.cancel = true;
            // submit the form by programmatically clicking the specified button
            document.getElementById("ControlMailinglist1_btnsubmit").click();
        }
    }
    
    function Submitbtnmailinglisthomepage()
		 {
        // process only the Enter key
        if (event.keyCode == 13)
        {
            // cancel the default submit
            event.returnValue=false;
            event.cancel = true;
            // submit the form by programmatically clicking the specified button
            document.getElementById("btnsubmitnewsletter").click();
        }
    }
    
function print_function()
{ 
	var disp_setting="toolbar=no,location=no,directories=no,menubar=no,";
		disp_setting+="scrollbars=yes,width=600, height=700, left=100, top=100";
	var content_title = document.getElementById("printtitle").innerHTML;
	var content_value = document.getElementById("print").innerHTML;

	var docprint=window.open("","",disp_setting);

	docprint.document.open();
	docprint.document.write('<html><head><title>Mind Clinics</title></head><link rel="stylesheet" type="text/css" href="css/styles.css">');
	docprint.document.write('<body onLoad="self.print(); self.close();" style="margin:0px;padding:5px 20px 20px 20px; background:#FFFFFF;" >');
	docprint.document.write('<div style="padding-bottom:10px;"><a href="index.aspx?pageid=8930"><img border="0" src="images/logo.gif"/></a></div>');
	docprint.document.write('<div class="titles">'+content_title+'</div>');
	docprint.document.write('<div id="print2">'+content_value+'</div>');
	docprint.document.write('</body></html>');
	docprint.document.close(); 
 	docprint.focus();
}

/****Enlarge Font*****/

var fontVariation=2;
var minFontSize=11;
var maxFontSize=15;

function enlargeFont(bigger)
{
	var elements=document.getElementById("print");
	var tds=elements.getElementsByTagName("TD");
	var newFontSize="";
		newFontSize=elements.style.fontSize;
		if(newFontSize=="")
			newFontSize=minFontSize;
			newFontSize=parseInt(newFontSize);
		if(bigger){
			newFontSize=(newFontSize<maxFontSize)?(newFontSize+fontVariation):(maxFontSize);}
		else
			{newFontSize=(newFontSize>minFontSize)?(newFontSize-fontVariation):(newFontSize);}
		
	elements.style.fontSize=newFontSize+'px';
	
	for(var i=0;i<tds.length; i++){
		tds[i].style.fontSize=newFontSize+'px';
	}
}
/******Clear Fields*******/
function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}



function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function ShowLinks(x){
	if(MM_findObj("links"+x).style.display=="none")
	{
	for (var i=1;i<=3;i++){
		MM_findObj("links"+i).style.display="none";
				}
		MM_findObj("links"+x).style.display="";
	}
		else{
		MM_findObj("links"+x).style.display="none";
		}
		}
