//Function defined for dropdowns of subject_add.php 
function AjaxFunction(id){
	//alert(id);
	var httpxml;
	try {
  		// Firefox, Opera 8.0+, Safari
  		httpxml=new XMLHttpRequest();
  	}catch (e) 
	{
  		// Internet Explorer
		try
		{
   			httpxml=new ActiveXObject("Msxml2.XMLHTTP");
    	}catch (e)
		{
    		try
			{
      			httpxml=new ActiveXObject("Microsoft.XMLHTTP");
     		 }catch (e)
			 {
		   		alert("Your browser does not support AJAX!");
      			return false;
      		 }
    	}
   }
	var url="sample1.asp";
	url=url+"?cid="+id;
	httpxml.onreadystatechange=stateck;
	httpxml.open("GET",url,true);
	httpxml.send(null);
	
	function stateck() 
	{
    	if(httpxml.readyState==4)
		{	
		    
			//alert(httpxml.responseText);
			var json=httpxml.responseText
			len=json.length;
			var temp=(json.indexOf('g')+1);
			json1=json.substring(0, temp);
			var temp1=(json.lastIndexOf(".")+1);
			json2=json.substring(temp, len);
			var image = json1;
			
			//alert(json1); 
			var imageText = json2;
			// Before adding new we must remove previously loaded elements
			document.getElementById("txt1").innerHTML=json2;
			document.images.photoslider.src=json1;
			
			
			
			
     	}
 	 }
	
  }

