// JavaScript Document

function get_ID_value(DIV_ID)
{
	return document.getElementById(DIV_ID).value
}

function get_ID_name(DIV_ID)
{
	return document.getElementById(DIV_ID).name
}

function get_innerHTML_valur(DIV_ID)
{
	return document.getElementById(DIV_ID).innerHTML;
}

function get_check_cond(DIV_ID)
{
	return document.getElementById(DIV_ID).checked
}

function reset_div_data(DIV_ID)
{
	document.getElementById(DIV_ID).value ="";
}

function display_innerHTML_txt(DIV_ID,txt)
{
	document.getElementById(DIV_ID).innerHTML = txt;
}

function highlight(DIV_ID)
{

	document.getElementById(DIV_ID).select();
}

function clear_txt(DIV_ID,change_txt_color)
{
	document.getElementById(DIV_ID).value = "";
	document.getElementById(DIV_ID).style.color = change_txt_color
}

function change_but_img(DIV_ID,path)
{
	document.getElementById(DIV_ID).src = path;
}

function email_check(str) 
{
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
	   //alert("Invalid E-mail ID")
	   return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   //alert("Invalid E-mail ID")
	   return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		//alert("Invalid E-mail ID")
		return false
	}

	 if (str.indexOf(at,(lat+1))!=-1){
		//alert("Invalid E-mail ID")
		return false
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		//alert("Invalid E-mail ID")
		return false
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
		//alert("Invalid E-mail ID")
		return false
	 }
	
	 if (str.indexOf(" ")!=-1){
		//alert("Invalid E-mail ID")
		return false
	 }

	 return true					
}

var xmlHttp;

function xmlHttpObject()
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
    {
        alert ("Browser does not support HTTP Request");
        return;
    }
}


function GetXmlHttpObject(handler)
{
	var xmlHttp=null;
	try
	{
		 // Firefox, Opera 8.0+, Safari
		 xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	 	//Internet Explorer
	 	try
	  	{
	  		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	  	}
	 	catch (e)
	  	{
	  		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	  	}
	}
	
	return xmlHttp;
}

function display_msn_panel(type)
{
	xmlHttpObject();
	
	var url="PhpRespondAjax/msn_panel.php";
	
	var params = "request=msn_panel&type="+type
	xmlHttp.open("POST",url,true) ;
	
	//Send the proper header information along with the request
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.onreadystatechange=setDisplay_msn_panel;
	xmlHttp.send(params);
}

function setDisplay_msn_panel()
{	
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 			
		document.getElementById("MSN_div").innerHTML = xmlHttp.responseText ; 
	} 
}


function resize_browser()
{
	  var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) 
	{
		//alert(1)
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;		
		
	} 
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
	{
		//alert(2)
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;

	} 
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
	{
		//alert(3)
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	
	//alert(myHeight);
	//header_height  = parseInt(winH)*0.3;
	var half = parseInt(myHeight)*0.98-parseInt(200);
	document.getElementById("container_td").style.height = half+"px";	
}

var min=12;
var max=15;

var timeForClick = 1;
function changeFontSize(_chngValue) 
{
	

	if(timeForClick < 4)
	{		
		var p = document.getElementsByTagName('div');
   
	   for(i=0;i<p.length;i++) 
	   {
		  var s =p[i].style.fontSize?parseInt(p[i].style.fontSize.replace("px","")):min;
		  if(_chngValue=="higher")
		  {
			
			if(s!=max)s += 1;
		  }
		  else if(_chngValue=="lower")
		  {
			
			if(s!=min)s -= 1;
		  }
		  p[i].style.fontSize = s+"px";
	   }	   	  

	}
}


function enable_block(DIV_ID)
{
	document.getElementById(DIV_ID).style.display = "block";
}


function disable_block(DIV_ID)
{
	document.getElementById(DIV_ID).style.display = "none";
}


						
