//alert('dsf');
function settings()
{
	check_session();
		//alert(document.getElementById('PrifxId').value);
	var	PrifxId=document.getElementById('PrifxId').value;
	var	DpiId=document.getElementById('DpiId').value;
	var	QualityId=document.getElementById('QualityId').value;
	var	PLimitId=document.getElementById('PLimitId').value;
	var	RLimitId=document.getElementById('RLimitId').value;
	var	MFileLimit=document.getElementById('MFileLimit').value;
/*		var dirname="";	
		var tab= document.getElementsByTagName('A');
		for(i=0;i<tab.length;i++)
			if(tab[i].className=='current')
				dir_Id=tab[i].name
				arr = new Array();
				arr=dir_Id.split("_");
				iPdfFolderId=arr[1];
				tabid=arr[0];
		var id_str='';
		id_str=getSelectedImage();
	*/					
		var url = "ajaxfiles/settings.php?PrifxId="+PrifxId+"&DpiId="+DpiId+"&QualityId="+QualityId+"&PLimitId="+PLimitId+"&RLimitId="+RLimitId+"&MFileLimit="+MFileLimit;
		//alert(url);
		//window.location = url;
		//return true;
		var isWorking = false;
		if (!isWorking)
		{
				isWorking = true;
				if (window.XMLHttpRequest)
			  	{
					http_setting_status=new XMLHttpRequest();
			  		http_setting_status.open("GET",url, true);
				  	http_setting_status.onreadystatechange=handleHttpResponseSettingImage;
				  	http_setting_status.send(null);
			  	}
				// code for IE
				else if (window.ActiveXObject)
			  	{
			  		http_setting_status=new ActiveXObject("Microsoft.XMLHTTP");
			    	if (http_setting_status)
			    	{
			    		http_setting_status.open("GET",url, true);
			    		http_setting_status.onreadystatechange=handleHttpResponseSettingImage;
			    		http_setting_status.send();
			    	}
			  	}
		   return false;
	  	}
}
function handleHttpResponseSettingImage()
{
	
	if (http_setting_status.readyState == 4)
	{
		//alert(http_setting_status.responseText);
		var xmlDocument = http_setting_status.responseXML;
		var msg = xmlDocument.getElementsByTagName('msg').item(0).firstChild.data;
		var PrifxId = xmlDocument.getElementsByTagName('PrifxId').item(0).firstChild.data;
		var DpiId = xmlDocument.getElementsByTagName('DpiId').item(0).firstChild.data;
		var QualityId = xmlDocument.getElementsByTagName('QualityId').item(0).firstChild.data;
		var PLimitId = xmlDocument.getElementsByTagName('PLimitId').item(0).firstChild.data;
		var RLimitId = xmlDocument.getElementsByTagName('RLimitId').item(0).firstChild.data;
		var MFileLimit = xmlDocument.getElementsByTagName('MFileLimit').item(0).firstChild.data;
		call_errmsg(msg);
		var temp=''
		temp+='<div style="border:solid 0px;">';

			temp+='<div class="input_box" style="border:solid 0px; width:100%">';
				temp+='<div width="10%" style="border:solid 0px; width:100px; float:left;">&nbsp;</div>';
				temp+='<div style=" width:150px; float:left;" align="right">Dots Per Inches </div>';
				temp+='<div style=" width:10px;float:left;" align="center" >:</div>';
				temp+='<div style=" width:30px;float:left;"><input type="Text" id="DpiId" value="'+DpiId+'" class="plainInput"></div>';
			temp+='</div>';
			temp+='<div style="clear:both;"></div>';
			temp+='<div class="input_box" style="border:solid 0px; width:100%">';
				temp+='<div width="10%" style="border:solid 0px; width:100px; float:left;">&nbsp;</div>';
				temp+='<div style=" width:150px; float:left;" align="right">Quality</div>';
				temp+='<div style=" width:10px;float:left;" align="center" >:</div>';
				temp+='<div style=" width:30px;float:left;"><input class="plainInput" id="QualityId" value="'+QualityId+'" type="Text" ></div>';
			temp+='</div>';
			temp+='<div  style="clear:both;"></div>';
			temp+='<div class="input_box" style="border:solid 0px; width:100%">';
				temp+='<div width="10%" style="border:solid 0px; width:100px; float:left;">&nbsp;</div>';
				temp+='<div style=" width:150px; float:left;" align="right">Prefix</div>';
				temp+='<div style=" width:10px;float:left;" align="center" >:</div>';
				temp+='<div style=" width:30px;float:left;"><input class="plainInput" type="Text" value="'+PrifxId+'" id="PrifxId" ></div>';
			temp+='</div>';
			temp+='<div style="clear:both;"></div>';
			temp+='<div class="input_box" style="border:solid 0px; width:100%">';
				temp+='<div width="10%" style="border:solid 0px; width:100px; float:left;">&nbsp;</div>';
				temp+='<div style=" width:150px; float:left;" align="right">Page Limit</div>';
				temp+='<div style=" width:10px;float:left;" align="center" >:</div>';
				temp+='<div style=" width:30px;float:left;"><input class="plainInput" type="Text" value="'+PLimitId+'" id="PLimitId" ></div>';
			temp+='</div>';
			temp+='<div style="clear:both;"></div>';
			temp+='<div class="input_box" style="border:solid 0px; width:100%">';
				temp+='<div width="10%" style="border:solid 0px; width:100px; float:left;">&nbsp;</div>';
				temp+='<div style=" width:150px; float:left;" align="right">Thumbnails Per Page</div>';
				temp+='<div style=" width:10px;float:left;" align="center" >:</div>';
				temp+='<div style=" width:30px;float:left;"><input type="Text" class="plainInput" value="'+RLimitId+'" id="RLimitId" ></div>';
			temp+='</div>';
			temp+='<div style="clear:both;"></div>';
			temp+='<div class="input_box" style="border:solid 0px; width:100%">';
				temp+='<div width="10%" style="border:solid 0px; width:100px; float:left;">&nbsp;</div>';
				//temp+='<div style=" width:150px; float:left;" align="right">Maximum Size of File for upload</div>';
				//temp+='<div style=" width:10px;float:left;" align="center" >:</div>';
				temp+='<div style=" width:180px; float:left; text-align:left;"><input type="hidden" readonly="true" class="plainInput"  id="MFileLimit" > </div>';// value="'+MFileLimit+'"
			temp+='</div>';
			temp+='<div style="clear:both;"></div>';
			temp+='<div style="border:solid 0px; width:100%">';
				temp+='<div width="10%" style="border:solid 0px; width:100px; float:left;">&nbsp;</div>';
				temp+='<div style=" width:150px; float:left;" align="right">&nbsp;</div>';
				temp+='<div style=" width:10px;float:left;" align="center" >&nbsp;</div>';

				temp+='<div style=" width:200px;float:left;border:solid 0px;" align="left"><img src="'+js_site_images+'btn-submit.gif" style="cursor:pointer;" onclick="settings();" name="btnsubmit"/>&nbsp;';
				temp+='<img src="'+js_site_images+'btn-cancel.gif" style="cursor:pointer;" onclick="back_to_home();" name="btncancel" id="btncancel"/></div>';

//				temp+='<div style=" width:200px;float:left;border:solid 0px;" align="left"><input type="button" value="Submit" class="button" onclick="settings();">&nbsp;<input type="button" value="Cancel" class="button" onclick="back_to_home();"></div>';
			temp+='</div>';
		temp+='</div>';
		//alert(temp);
		document.getElementById('test').innerHTML = temp;		
		activeImage = new Array();		
	}
	else
	{
		temp='<table class=listing-border" width="100%" height="250" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td align="center"><img src="'+js_site_images+'loading-Animation.gif"/></td></tr></table>';		
		document.getElementById('test').innerHTML=temp;
	}

}

