// JScript File
function showMsg(x){
	alert(x);
}

function ajaxFunction(){

 var xmlHttp;
  try
    {    // Firefox, Opera 8.0+, Safari 
 	xmlHttp=new XMLHttpRequest();  
  }
  catch (e)
    {    // Internet Explorer 
  try
      {   
 	 xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); 
      }
    catch (e)
      {   
  	try
        	{   
     		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); 
      	}
     	 catch (e)
        	{     
 		alert("Your browser does not support AJAX!");    
    		return false;
	}

      }  
 }	

	return xmlHttp;
	
}
function ajaxwork()
{
   
    if(document.getElementById("DropDownList1").value!=0)
    {
         xmlHttp=ajaxFunction();
        xmlHttp.onreadystatechange=function(){
        if(xmlHttp.readyState==1)
					{
					
					 document.getElementById("spn1").innerHTML="<img src='images/a1.gif'/><img src='images/loading.gif'/>";
					 document.getElementById("spn1_id").innerHTML="<p style='margin-top:-10px'></p>";
					 document.getElementById("spn2_id").innerHTML="<p style='margin-top:-10px'></p>";
					 document.getElementById("spn2").innerHTML="<p style='margin-top:-10px'></p>";
					 document.getElementById("spn3_id").innerHTML="<p style='margin-top:-10px'></p>";
					 document.getElementById("spn3").innerHTML="<p style='margin-top:-10px'></p>";
					 document.getElementById("Span1").innerHTML="<p style='margin-top:-10px'></p>";
//		             document.getElementById("Span1_id").innerHTML="<p style='margin-top:-10px'></p>";
                     					 
					// alert("s");
					}
					if(xmlHttp.readyState==4)
					{
					    var r=xmlHttp.responseText
					    //alert(r);
					   document.getElementById("spn1").innerHTML=r.split("eee",1);
					}
        }
        var url="system.aspx?mid="+document.getElementById("DropDownList1").value+"&type=manu";
  		xmlHttp.open("GET",url,true);
        xmlHttp.send(null);	
    }
    else
    {   
         document.getElementById("spn1").innerHTML="<p style='margin-top:-10px'></p>";
		 document.getElementById("spn1_id").innerHTML="<p style='margin-top:-10px'></p>";
		 document.getElementById("spn2_id").innerHTML="<p style='margin-top:-10px'></p>";
		 document.getElementById("spn2").innerHTML="<p style='margin-top:-10px'></p>";
		 document.getElementById("spn3_id").innerHTML="<p style='margin-top:-10px'></p>";
		 document.getElementById("spn3").innerHTML="<p style='margin-top:-10px'></p>";
		 document.getElementById("Span1").innerHTML="<p style='margin-top:-10px'></p>";
//		 document.getElementById("Span1_id").innerHTML="<p style='margin-top:-10px'></p>";
//		 document.getElementById("Span2_id").innerHTML="<p style='margin-top:-10px'></p>";
//		 document.getElementById("Span2").innerHTML="<p style='margin-top:-10px'></p>";
    }
}
function showbrand()
{
     if(document.getElementById("DropDownList2").value!=0)
    {
         xmlHttp=ajaxFunction();
        xmlHttp.onreadystatechange=function(){
         if(xmlHttp.readyState==1)
					{
					 document.getElementById("spn2").innerHTML="<img src='images/a1.gif'/><img src='images/loading.gif'/>";
					 document.getElementById("spn2_id").innerHTML="<p style='margin-top:-10px'></p>";
					 document.getElementById("spn3_id").innerHTML="<p style='margin-top:-10px'></p>";
		             document.getElementById("spn3").innerHTML="<p style='margin-top:-10px'></p>";
		              document.getElementById("Span1").innerHTML="<p style='margin-top:-10px'></p>";
					 
					// alert("s");
					}
					if(xmlHttp.readyState==4)
					{
					
					    var r=xmlHttp.responseText
					    //alert(r);
					    document.getElementById("spn2").innerHTML=r.split("eee",1);
					}
        }
        var url="system.aspx?mid="+document.getElementById("DropDownList1").value+"&bid="+document.getElementById("DropDownList2").value+"&type=brand";
  		xmlHttp.open("GET",url,true);
        xmlHttp.send(null);	
     }
     else
     {
        //document.getElementById("spn1").innerHTML="<p style='margin-top:-10px'></p>";
        document.getElementById("spn2").innerHTML="<p style='margin-top:-10px'></p>";
        document.getElementById("spn2_id").innerHTML="<p style='margin-top:-10px'></p>";
	    document.getElementById("spn3_id").innerHTML="<p style='margin-top:-10px'></p>";
		document.getElementById("spn3").innerHTML="<p style='margin-top:-10px'></p>";
		document.getElementById("Span1").innerHTML="<p style='margin-top:-10px'></p>";
     }
}
function showmodel()
{
     if(document.getElementById("brandid").value!=0)
    {
         xmlHttp=ajaxFunction();
        xmlHttp.onreadystatechange=function(){
         if(xmlHttp.readyState==1)
					{
					 document.getElementById("spn3").innerHTML="<img src='images/a1.gif'/><img src='images/loading.gif'/>";
					  document.getElementById("Span1").innerHTML="<p style='margin-top:-10px'></p>";
					// alert("s");
					}
					if(xmlHttp.readyState==4)
					{
					    var r=xmlHttp.responseText
					    //alert(r);
					    document.getElementById("spn3").innerHTML=r.split("eee",1);
					}
        }
        var url="system.aspx?mid="+document.getElementById("DropDownList1").value+"&mode="+document.getElementById("brandid").value+"&bid="+document.getElementById("DropDownList2").value+"&type=model";
  		xmlHttp.open("GET",url,true);
        xmlHttp.send(null);	
     }
     else
     {
        //document.getElementById("spn1").innerHTML="<p style='margin-top:-10px'></p>";
        //document.getElementById("spn2").innerHTML="<p style='margin-top:-10px'></p>";
        document.getElementById("spn3").innerHTML="<p style='margin-top:-10px'></p>";
        document.getElementById("Span1").innerHTML="<p style='margin-top:-10px'></p>";
     }
 }
 function show()
 {
     if(document.getElementById("modelid").value==0)
     {
        alert('please select model');
        return false;
     }   
     var t = document.getElementById("DropDownList2");
           var strUser1 = t.options[t.selectedIndex].text;      
          var e = document.getElementById("modelid"); 
     var strUser = e.options[e.selectedIndex].text;
     window.location.href ="http://computerlaptopmemory.com/computer-memory/"+trimName(strUser1)+trimName(strUser)+".html";
     //window.location.href ="memoryspecification.aspx?id="+document.getElementById("modelid").value;
     //document.location.href="Default.aspx?id="+document.getElementById("modelid").value;
    
   
 }
 
 function trimName(v){
        var temp="";
        var s;
        for(i=0;i<v.length;i++){
                s=v.substring(i,i+1);
                if(s.charCodeAt(0)>47 && s.charCodeAt(0) <58){
                        temp+=s;
                }
 
                if(s.charCodeAt(0)>64 && s.charCodeAt(0) <91){
                                        temp+=s;
                }
 
                if(s.charCodeAt(0)>96 && s.charCodeAt(0) <123){
                                        temp+=s;
                }
 
        }
        //alert(v+ " = "+ temp);
        return temp;
}

function models()
{
    if(document.getElementById("modelid").value!=0)
    {
        xmlHttp=ajaxFunction();
        xmlHttp.onreadystatechange=function(){
         if(xmlHttp.readyState==1)
					{
					 document.getElementById("Span1").innerHTML="<img src='images/a1.gif'/><img src='images/loading.gif'/>";
					// alert("s");
					}
					if(xmlHttp.readyState==4)
					{
					    var r=xmlHttp.responseText
					    //alert(r);
					    document.getElementById("Span1").innerHTML=r.split("eee",1);
					}
		}
		var url="system.aspx?type=go";
  		xmlHttp.open("GET",url,true);
        xmlHttp.send(null);				
    }
     else
    {
         /*document.getElementById("spn1").innerHTML="<p style='margin-top:-10px'></p>";
		 document.getElementById("spn1_id").innerHTML="<p style='margin-top:-10px'></p>";
		 document.getElementById("spn2_id").innerHTML="<p style='margin-top:-10px'></p>";
		 document.getElementById("spn2").innerHTML="<p style='margin-top:-10px'></p>";
		 document.getElementById("spn3_id").innerHTML="<p style='margin-top:-10px'></p>";
		 document.getElementById("spn3").innerHTML="<p style='margin-top:-10px'></p>";*/
		 document.getElementById("Span1").innerHTML="<p style='margin-top:-10px'></p>";
    }
}
