<!--
			window.defaultStatus="Welcome to MyTailor.com | Custom Tailors of Mens' Suits, Custom Shirts and more "
		
		// delay timer for itinery button : created by raghavan on 15-03-2006 //
		var timerID;
		function ShowDelayMap(m){
			
			if (m=='show') {
				timerID = window.setTimeout('showmap()', 500); 
			}	
			else if(m=='hide'){
				timerID = window.setTimeout('hidemap()', 500); 
			}
			else {
				window.clearInterval(timerID,100); 
				//alert("nothing");
			}	
		}
		
		function showmap() {	
			window.clearInterval(timerID,100);
			var obj = document.getElementById('mymap');
			obj.style.visibility="visible";
			obj.style.display="block";
		}
		
		function hidemap() {	
			window.clearInterval(timerID,100);
			var obj = document.getElementById('mymap');
			obj.style.visibility="hidden";
			obj.style.display="none";
		}
						
		//-->
		
		
		
		
		//second part
		var obj=false;
		var pValue;
		
		//var http_request = false;
		var _ms_XMLHttpRequest_ActiveX="";		
		
		function LoadData(pType)
		{
			pValue = pType;			
			obj = false;

			if (window.XMLHttpRequest) { // Mozilla, Safari,...
				obj = new XMLHttpRequest();
				if (obj.overrideMimeType) {
					obj.overrideMimeType('text/xml');
					// See note below about this line
	                
				}
			} else if (window.ActiveXObject) { // IE

				var versions = ["Msxml2.XMLHTTP.7.0", "Msxml2.XMLHTTP.6.0", "Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];

				for (var i = 0; i < versions.length ; i++) {
					try {
					// try to create the object
					// if it doesn't work, we'll try again
					// if it does work, we'll save a reference to the proper one to speed up future instantiations
						obj = new ActiveXObject(versions[i]);

						if (obj) {
							_ms_XMLHttpRequest_ActiveX = versions[i];
							break;
						}
					}
					catch (objException) {
					// trap; try next one
					} ;
				}
			}
			if (!obj) {
				alert('Giving up :( Cannot create an XMLHTTP instance');
				return false;
			}
			//alert(http_request);
			if(obj)
			{					
				var ItemValue
				if(pType=='s')
				{				
				var a = document.createElement("OPTION");// new Option('Loading...',0);
				a.text = 'Loading...';
				a.value = 0;
				document.forms[0].SearchModule_cmbType.options.add(a);				
				ItemValue = document.getElementById("SearchModule_cmbMaterial").value;
				}
				else if(pType=='t')
				{var a1 = document.createElement("OPTION");//new Option('Loading...',0);
				a1.text = 'Loading...';
				a1.value = 0;
				document.forms[0].SearchModule_cmbCategory.options.add(a1);
				ItemValue = document.getElementById("SearchModule_cmbType").value;
				}
				
				obj.onreadystatechange =ProcessResponse;
				obj.open("GET", "LoadUsingAJEX.aspx?Type="+ pType +"&itemid=" + ItemValue,  true);
				obj.send(null);         
			}
			return false;
		}
		
			function ProcessResponse()
			{				
				
				if(obj.readyState == 4)
				{
					if(obj.status == 200)
					{
						if(pValue == 's')
						{
							
							var dsRoot=obj.responseXML.documentElement;  					
							var select2 = document.getElementById("SearchModule_cmbType")
							
							for (var count = select2.options.length-1; count >-1; count--)
							{
								select2.options[count] = null;
							}
							var select3=document.getElementById("SearchModule_cmbCategory")														
							for(var cnt = select3.options.length-1; cnt >-1; cnt--)
							{select3.options[cnt] = null;}
							var CatID = dsRoot.getElementsByTagName('CategoryID');
							var CatName = dsRoot.getElementsByTagName('CategoryName');
							var CatIDtext;
							var CatNametext; 
							var listItem;
							
							//alert(CatID.length)
							select2.options[0]=new Option("--Select Category--","0");
							for (var count = 1; count < CatID.length+1; count++)
							{
   								CatIDtext = (CatID[count-1].textContent || CatID[count-1].innerText || CatID[count-1].text);
   								CatNametext = (CatName[count-1].textContent || CatName[count-1].innerText || CatName[count-1].text);
   								//document.write(CatID + ' ' +CatNametext)
   								//document.write(text+'<BR>');
								//listItem = new Option(text, text,  false, false);
								//ddlOrders.options[ddlOrders.length] = listItem;
								select2.options[count]=new Option(CatNametext,CatIDtext);
							}
						}
						else if(pValue == 't')
						{
							var dsRoot=obj.responseXML.documentElement;  					
							var select2 = document.getElementById("SearchModule_cmbCategory")
							for (var count = select2.options.length-1; count >-1; count--)
							{
								select2.options[count] = null;
							}
							var CatID = dsRoot.getElementsByTagName('subcategoryid');
							var CatName = dsRoot.getElementsByTagName('subcategoryName');
							var CatIDtext;
							var CatNametext; 
							var listItem;
							
							//alert(CatID.length)
							select2.options[0]=new Option("--Select Pattern--","0");
							for (var count = 1; count < CatID.length+1; count++)
							{
   								CatIDtext = (CatID[count-1].textContent || CatID[count-1].innerText || CatID[count-1].text);
   								CatNametext = (CatName[count-1].textContent || CatName[count-1].innerText || CatName[count-1].text);   								
								select2.options[count]=new Option(CatNametext,CatIDtext);
							}
							
						}
					}
					else
					{
						alert("Error retrieving data!" );
					}
				}window.event
			}
			function OpenSearch()
			{
			//SearchModule_cmbMaterial
				if (document.getElementById("SearchModule_cmbCategory").value != '' && document.getElementById("SearchModule_cmbCategory").value != '' && document.getElementById("SearchModule_cmbCategory").value != '')
				{
					document.forms[0].cid.value=document.getElementById("SearchModule_cmbType").value
					document.forms[0].iID.value=document.getElementById("SearchModule_cmbMaterial").value
					document.forms[0].sub.value=document.getElementById("SearchModule_cmbCategory").value
					//document.forms[0].__VIEWSTATE.name = 'NOVIEWSTATE';
					document.forms[0].action = 'showfabric.aspx?of=s,'+document.forms[0].iID.value +',' +document.forms[0].sub.value ;
					document.forms[0].submit();
				}
				else
				{
					document.forms[0].action = 'showfabric.aspx?of=b,2';
					document.forms[0].submit();
				}
				
			}
			
			function opendocument(item,url){
			
				document.forms[0].iID.value=item
			
			document.mytailorForm.action=url;
			document.mytailorForm.submit();
		}
		
		function showFabric(fabric)
			{
				if(fabric==1)
					{
					document.forms[0].cid.value=0;
					document.forms[0].iID.value=0;
					document.forms[0].sub.value=0;
					document.forms[0].action = 'showfabric.aspx?fabric=go';
					document.forms[0].submit();										
					}
				else if(fabric==2)
					{
					document.forms[0].cid.value=73;
					document.forms[0].iID.value=2;
					document.forms[0].sub.value=1094;
					document.forms[0].action = 'showfabric.aspx?fabric=go';
					document.forms[0].submit();	
					}
				else if(fabric==3)
				
					{
					document.forms[0].cid.value=0;
					document.forms[0].iID.value=0;
					document.forms[0].sub.value=0;
					document.forms[0].action = 'showfabric.aspx?fabric=go';
					document.forms[0].submit();	
					}
				else if(fabric==4)
					{
					document.forms[0].cid.value=69;
					document.forms[0].iID.value=2;
					document.forms[0].sub.value=896;
					document.forms[0].action = 'showfabric.aspx?fabric=go';
					document.forms[0].submit();	
					
					}
				else if(fabric==5)
				{
					document.forms[0].cid.value=75;
					document.forms[0].iID.value=2;
					document.forms[0].sub.value=1129;
					document.forms[0].action = 'showfabric.aspx?fabric=go';
					document.forms[0].submit();	
				}
				else if(fabric==6)
				{
					document.forms[0].cid.value=76;
					document.forms[0].iID.value=2;
					document.forms[0].sub.value=1120;
					document.forms[0].action = 'showfabric.aspx?fabric=go';
					document.forms[0].submit();	
				}
				
				else
				{
					document.forms[0].action = 'showfabric.aspx';
					document.forms[0].submit();
				}
				
			}
			
			
			
			
		
		
		
		
		