// JavaScript Document
function conf_sub()
{
	if(document.getElementById('remarks_desc').value=='')
	{
		alert('Please Enter the Description');  
		document.getElementById('remarks_desc').focus();  
		return false;
	}
	else if(document.getElementById('remarks_desc').value!='')
	{
		document.getElementById("lod").innerHTML = '<img src="images/elements/loaders/loader.gif" />'
		var ids = document.getElementById("remarks_desc").value;
		if (window.XMLHttpRequest)
		{
			// code for IE7+, Firefox, Chrome, Opera, Safari
			xmlhttp=new XMLHttpRequest();
		}
		else
		{
			// code for IE6, IE5
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		xmlhttp.onreadystatechange=function()
		{
			if (xmlhttp.readyState==4 && xmlhttp.status==200)
			{
				var res = xmlhttp.responseText;
				if(res.trim()=="1")
				{
					document.getElementById("lod").innerHTML =' ';
					alert("This Description is already Exist");	
					document.getElementById("remarks_desc").focus();
					return false;					
				}
				else
				{	
					var where_to= confirm("Do you really want to Submit the Data?");
					if (where_to== true)
					{
						document.fm.submit();
					}
					else
					{
						return false;	
					}
				}					
			}
		}
		
		var qurl ="?remarks_desc="+ids+"&pg_id=1";
		xmlhttp.open("GET","ajax/cad_remarks_get_AJAX.php"+qurl,true);
		xmlhttp.send();	
	}
}

function foc(ids)
{
	document.getElementById(ids).style.border="2px solid #0099FF";	
}

function stnon(ids)
{
	document.getElementById(ids).style.border="thin solid #CCCCCC";
}
//DESIGN LIST PAGE, THIS IS FOR ACTIVE INACTIVE THE PAGES
function des_act_ina(design_id,statu_s,ids)
{
	
	document.getElementById("ajaxres_"+ids).innerHTML='<img src="images/elements/loaders/loader.gif" />';
	//alert(ids);
		
	if (window.XMLHttpRequest)
	{
		// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}
	else
	{
		// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			//alert(xmlhttp.responseText);		
			document.getElementById("ajaxres_"+ids).innerHTML=xmlhttp.responseText;
		}
	}
	
	var qurl ="?pg_id=2&ids="+ids+"&remarks_id="+design_id+"&statu_s="+statu_s;
	//alert(qurl);
	xmlhttp.open("GET","ajax/cad_remarks_get_AJAX.php"+qurl,true);
	xmlhttp.send();				
}