var browserName=navigator.appName; 
function Is_FF(el)
{
	if(browserName=='Netscape')
		return true;
	return false;
}
function GetChildNodes(el,index){
	if(Is_FF()){
		var j_c=0;
		for(i_c=0;i_c<el.childNodes.length;i_c++){ 
			var theNode = el.childNodes[i_c];
			if (theNode.nodeType == "1"){
				if(j_c==index)
					return theNode;
				j_c++;	
			}
		}
	}else{
		return el.childNodes[index];
	}
}
function WinOpen(U,w,h)
{
	var t = (window.screen.availHeight -h)/2
	var l = (window.screen.availWidth -w)/2
	window.open(U,"_blank","height="+h+",width="+w+",top="+t+",left="+l+",resizable=yes,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes",true);
}
function WinOpenres(U,w,h)
{
	var t = (window.screen.availHeight -h)/2
	var l = (window.screen.availWidth -w)/2
	window.open(U);
}
function WinOpenT(U,Title,w,h)
{
	var t = (window.screen.availHeight -h)/2
	var l = (window.screen.availWidth -w)/2
	window.open(U,Title,"height="+h+",width="+w+",top="+t+",left="+l+",resizable=yes,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes",true);
}
function OpenDialog(U,Dars,w,h)
{
	var t = (window.screen.availHeight -h)/2
	var l = (window.screen.availWidth -w)/2
	window.showModalDialog(U,Dars,"dialogHeight:"+h+"px,dialogWidth:"+w+"px");
	//window.open(U,"_blank","height="+h+",width="+w+",top="+t+",left="+l+",status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes",true);
}
//
if (Is_FF()){
		document.addEventListener('DOMAttrModified',function (e){
		if(e.target.nodeName=="INPUT"){
			if(e.target.id=="Grid_Code"){
				if(e.attrName=="value"){
					try{
					DocChanged(e.target);
					}catch(err){
					
					}
				}
			}
		}
		},true);
}
function SetImageSize_ById(el_id,w,h){
SetImageSize(document.getElementById(el_id),w,h);
}
var ImdId =1000;
function SetImageSize2(el,w,h){
			img = new Image();
			//alert();
			//return;
			img.onload = function test(img){
			alert(img);
			}
			//eval("SetImageSize2(el,img,w,h)");
			img.src = el.src;
}
function aaa()
{
alert("F");
}
//function SetImageSize(el2,el,w,h){
function SetImageSize(el,w,h){
var el2 = el;
			//alert(w);
		//	alert(el.complete)
			//alert(el.width);
			//SetImageSize2(el2,el,w,h);
			
			//alert(el.width)
			//alert(el.height)
			//alert(el.width);
			if (el.width<w && el.height<h){
			//If Width And Height Less Than  W And H
				if(el.width==0){
					if(el.id==""){
					el.id = "Img_" + String(ImdId);
					ImdId+=1;
					}
					setTimeout("SetImageSize_ById('"+el.id+"',"+w+","+h+")",10);
				}
			return null;
			}
		//alert("O");
			
			if (el.width>w && el.height>h){
			//If Width And Height Greater Than  W And H
				if (el.width>el.height)
				{//If Width And Height Greater Than  W And H And Width Greater Height
					//el.height = el.height/(el.width/w);
					el2.height = (el.height*w)/el.width;
					el2.width = w;
					return null;
				}
				else
				{//If Width And Height Greater Than  W And H And Width Less Height
					//el.width = el.width*(h/el.height) ;
					el2.width = (el.width*h)/el.height ;
					el2.height = h;
					return null;
				}
			}
			
			//If On Of The  Width Or Height Greater Than  W And H 
			if(el.width>=w){
			//If Width Greater Than W
					el2.height =(el.height*w)/el.width;
					el2.width = w;
					return null;
			}
			else
			{//If Height Greater Than H 
				    el2.width = (el.width*h)/el.height ;
					el2.height = h;
					return null;
			}
}