

window.onresize= function resize()
	{   
	    if((typeof(IsLoad)=="undefined")||(IsLoad))
	    {
		    settopstyle();
		    IsLoad=false;
		}		
	}
//Set top Menu Style
function settopstyle()
{
	 var bodyheight=parseInt(document.documentElement.clientHeight); 
	 var divtop=parseInt(document.getElementById('divTop').offsetHeight);
	 var divcopy=parseInt(document.getElementById('divCopyRight').offsetHeight);
	 
	 if(bodyheight<parseInt(document.body.clientHeight))
	 {
	    bodyheight=parseInt(document.body.clientHeight);
	 }
	 
	 if((divtop!=null)&&(divcopy!=null))
	 {
	     var divSubBody=document.getElementById('divSubMiddleBottom');
	     var tbAdminContent=document.getElementById('tbAdminContent');
	     if(tbAdminContent!=null)
	     {
	        if(bodyheight-divtop-divcopy-120>0)
	        {
	            tbAdminContent.style.height=bodyheight-divtop-divcopy-25-90+'px';
	        }
	        
	     }
	     if(divSubBody!=null)
	     {  
	         if(bodyheight-divtop-divcopy-286-20>0)
	         {
	            if(bodyheight-divtop-divcopy-286-20<300)
	            {
	               
	                divSubBody.style.height=300+'px';
	            }
	            else
	            {
	                divSubBody.style.height=bodyheight-divtop-divcopy-286-20+'px';
	            }
		     }
	     }
	     if(typeof(IsPhotoPage)=="undefined")
	     {
	        IsPhotoPage=false
	     }
	     else
	     {
	        window.scrollTo(0,500);
	     }
	 }     
	 var div=document.getElementById('gotop');
	 var bodywidth=parseInt(document.documentElement.clientWidth);         
	 if(bodywidth<parseInt(document.body.clientWidth))
	 {
	    bodywidth=parseInt(document.body.clientWidth);
	 }
     if(div!=null)
     {
	    if ((bodywidth>=884)&&(div!=null)&&(div!="undefined"))
	    {
		    div.style.left=860+(bodywidth-884)/2-25 +'px';
	    }
	    else
	    {
		    div.style.left=bodywidth-25+'px';
	    }
	    div.style.bottom='68px';
	 }
}  


//set selected node style
function settreenode(objname)
{
	var node=document.getElementById(objname);
   
	if (node != 'undefined')
	{
		var selectnode=node.value;
		if (selectnode=="")
			return;
			
		var selectnode=document.getElementById(selectnode);
		
		if ((selectnode != 'undefined')&&(selectnode != null))
		{          
			selectnode.parentNode.className=selectnode.parentNode.className.replace("level2","leafhover");
		}        
	}   
}

//set selected top menu item style
function setmenuitem(objname,menuname)
{
	var menu=document.getElementById(objname);
	
	if ((menu != 'undefined')&&(menu.rows.length>0))
	{       
		var rows=menu.rows[0];
		for (var i=0;i<rows.cells.length;i++)
		{//debugger;
			var td=rows.cells[i];            
		  
			var result=false;
			
			if (lBrowser.isIE)
				result=(td.innerText==menuname);
			else
				result=(td.textContent.search(menuname)!=-1);
				
			if (result)
			{
				var tb=td.firstChild;
				var n=tb.tagName.toLowerCase();
				if (tb.tagName.toLowerCase()=="table")
				{
					tb.className = tb.className.replace("menu","menusel");
					var array=tb.getElementsByTagName("a");
					
					if (array.length>0)
					{
						var label=array[0];
						label.style.color="#ffffff";
					}
										
					break;
				}                
			}
		}
	}
}

//get value from hidden field 
function getvalue()
{
    //debugger;    
   
    if (telephone!='undefined')
    {
        for (var i=0;i<telephone.length;i++)
        {
           initphone(document.getElementById(telephone[i])); 
        }
    }
}

function initphone(obj)
{
    if ((obj!=null)&&(obj.value!=""))
    {
        var values=obj.value.split("-");
        if (values.length>0)
        {
            for (var i=0;i<values.length;i++)
            {
                var box=document.getElementById(obj.id+(i+1).toString());
                if (box!=null)
                {
                    box.value=values[i];
                }
            }
        }
    }
    else
        return;
}

//set value to hidden field
function setvalue()
{
    if (telephone!='undefined')
    {
        for (var i=0;i<telephone.length;i++)
        {
           setphone(document.getElementById(telephone[i])); 
        }
    }
}

function setphone(obj)
{
    if (obj!=null)
    {
        var values="";
        for (var i=0;i<4;i++)
        {
            var box=document.getElementById(obj.id+(i+1).toString());
            if (box!=null)
            {
                values+=(box.value+"-").toString();
            }
        }
        obj.value=values.substring(0,values.length-1);
        if (obj.value=="---")
        {
            obj.value="";
        }
    }
    else
        return;
}

//
function setkeypress(e)
{
    var key = window.event?e.keyCode:e.which;
     
    if (key==8)
        return;
        
    if ((key <48||key>57)) 
    {
        if (window.event)
            event.returnValue=false
        else
            e.preventDefault();
    }
}


 function FCKeditorValidate(source, arguments)  
{  
   var value = oEditer.GetXHTML(true);  
   if(value=="")  
   {  
      arguments.IsValid = false;       
   }  
   else   
   {   
      arguments.IsValid = true;   
   }   
}  

function FCKeditor_OnComplete( editorInstance )  
{   
   oEditer = editorInstance;  
}  
