// JavaScript Document
function clear_txtBox(me)
{
	me.value='';	
}
function change_color(me)
{
	me.style.color='#000000';
}
function change_class(id_str,classname)
{

	var o=get_obj(id_str);
	o.className=classname;
}
function go_url(url)
{
	//alert(url);

	location.href=url;
}
function formSabmit_dont_unsubmit(frm)
{

	/*if(frm.onsubmit==undefined)frm.submit();
	else if(frm.onsubmit())*/ frm.submit();
}
function frm_submit(id_str)
{
	
	formSabmit_dont_unsubmit(get_obj(id_str));
}
function get_obj(obj_id)
{
    var obj;
    if( document.all )
    {
        obj = document.all[obj_id];
    }
    else if( document.getElementById )
    {
        obj = document.getElementById(obj_id);
    }
    else if( document.getElementsByName )
    {
        obj = document.getElementsByName(obj_id);
    }
	//alert(obj)
    return obj;
}
function getWindow()
{
	var winW=-1,winH=-1;
	if (parseInt(navigator.appVersion)>3) 
	{		
	 	if (navigator.appName=="Netscape") 
		{
			winW = window.innerWidth;
			winH = window.innerHeight;
		}
		if (navigator.appName.indexOf("Microsoft")!=-1) 
		{
			winW = document.body.offsetWidth;
			winH = document.body.offsetHeight;
		}
	}
	return {w:winW,h:winH};
}

function print_r(theObj)
{
	//alert(theObj.constructor);
  if(theObj.constructor == Array ||   theObj.constructor == Object || theObj.constructor==MouseEvent)
  {
    document.write("<ul>")
    for(var p in theObj)
	{
      if(theObj[p].constructor == Array||theObj[p].constructor == Object)
	  {
		  document.write("<li>["+p+"] => "+typeof(theObj)+"</li>");
		  document.write("<ul>")
		  print_r(theObj[p]);
		  document.write("</ul>")
      } 
	  else 
	  {
		document.write("<li>["+p+"] => "+theObj[p]+"</li>");
      }
    }
    document.write("</ul>")
  }
}

var popUpWin=0;

function popUpWindow(URLStr, left, top, width, height)

{

  if(popUpWin)

  {

    if(!popUpWin.closed) popUpWin.close();

  }

  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');

}
function getPage_Con(url,pra)
{
	//return "SDfgdfgd";
  	 var  req = new XMLHttpRequest(); 
	 req.open("POST", url, false); 
	 req.setRequestHeader("Content-type", "application/x-www-form-urlencoded;charset=UTF-8;"); 
	 req.send(pra); 
	 if(req.status == 200) 
	  return req.responseText;
	 return false;

}
function ajaxpageload(url, containerid,type)
{
	if(type==1)
	{
		document.getElementById(containerid).innerHTML='<div><img src="../load.gif" border="0"/> Loading ...</div>';
	}
	ajaxpage(url,containerid);
}
function ajaxpage(url, containerid)
{	
	
	var page_request = false
	if (window.XMLHttpRequest) // if Mozilla, Safari etc
	{
			page_request = new XMLHttpRequest()		
			
	}
	else if (window.ActiveXObject)
	{ // if IE
		
		try {page_request = new ActiveXObject("Msxml2.XMLHTTP")		} 
		catch (e){
					try{page_request = new ActiveXObject("Microsoft.XMLHTTP")}
					catch (e){}
				 }
	}
	else return false
	
	page_request.onreadystatechange=function()
	{
		loadpage(page_request, containerid)
	}
	
	page_request.open('GET', url ,true)
	page_request.send(null)
	return true;
}

function loadpage(page_request, containerid)
{
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
	document.getElementById(containerid).innerHTML=page_request.responseText
}

function MSG_Box(text)
{
	var k=confirm(text);
	
	return k;
}
function get_obj_swf(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName]
    }
    else 
	{
        return document[movieName]
    }
}

function activObj()
{
 var activeXObjTypes = new Array( "applet", "embed", "object" ); 
  for ( var i = 0; i < activeXObjTypes.length; i++ ) 
  { 
    var xObj = document.getElementsByTagName( activeXObjTypes[i] ); 
    for( var j = 0; j < xObj.length; j++ ) 
    { 
      xObj[j].outerHTML = xObj[j].outerHTML; 
    } 
  } 
}