﻿// 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 apple()
{
   
    if(document.getElementById("ddapple").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>";                     					 
					
					}
					if(xmlHttp.readyState==4)
					{
					    var r=xmlHttp.responseText
					    //alert(r);
					    document.getElementById("spn1").innerHTML=r.split("eee",1);
					}
        }
        var url="script.aspx?mid="+document.getElementById("ddapple").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>";
    }
}
function compaq()
{
   
    if(document.getElementById("ddCompaq").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>";                     					 
					
					}
					if(xmlHttp.readyState==4)
					{
					    var r=xmlHttp.responseText
					    //alert(r);
					    document.getElementById("spn1").innerHTML=r.split("eee",1);
					}
        }
        var url="script.aspx?mid="+document.getElementById("ddCompaq").value+"&brd=compaq"+"&type=compaq";
  		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>";
    }
}
function comModel()
{
     if(document.getElementById("ddBrand").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'/>";
					// alert("s");
					}
					if(xmlHttp.readyState==4)
					{
					    var r=xmlHttp.responseText
					    //alert(r);
					    document.getElementById("spn3").innerHTML=r.split("eee",1);
					}
        }
        var url="script.aspx?mid="+document.getElementById("ddCompaq").value+"&manu=compaq"+"&bid="+document.getElementById("ddBrand").value+"&type=comModel";
  		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 dell()
{
   
    if(document.getElementById("dddell").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>";                     					 
					
					}
					if(xmlHttp.readyState==4)
					{
					    var r=xmlHttp.responseText
					    //alert(r);
					    document.getElementById("spn1").innerHTML=r.split("eee",1);
					}
        }
        var url="script.aspx?mid="+document.getElementById("dddell").value+"&brd=dell"+"&type=dell";
  		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>";
    }
}
function dellModel()
{
     if(document.getElementById("dellBrand").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'/>";
					// alert("s");
					}
					if(xmlHttp.readyState==4)
					{
					    var r=xmlHttp.responseText
					    //alert(r);
					    document.getElementById("spn3").innerHTML=r.split("eee",1);
					}
        }
        var url="script.aspx?mid="+document.getElementById("dddell").value+"&manu=dell"+"&bid="+document.getElementById("dellBrand").value+"&type=dellModel";       
  		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 gateway()
{
   
    if(document.getElementById("ddgate").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>";                     					 
					
					}
					if(xmlHttp.readyState==4)
					{
					    var r=xmlHttp.responseText
					    //alert(r);
					    document.getElementById("spn1").innerHTML=r.split("eee",1);
					}
        }
        var url="script.aspx?mid="+document.getElementById("ddgate").value+"&brd=gateway"+"&type=gateway";
  		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>";
    }
}
function gateModel()
{
     if(document.getElementById("gateBrand").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'/>";
					// alert("s");
					}
					if(xmlHttp.readyState==4)
					{
					    var r=xmlHttp.responseText
					    //alert(r);
					    document.getElementById("spn3").innerHTML=r.split("eee",1);
					}
        }
        var url="script.aspx?mid="+document.getElementById("ddgate").value+"&manu=gateway"+"&bid="+document.getElementById("gateBrand").value+"&type=gateModel";
  		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 hp()
{
   
    if(document.getElementById("ddhp").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>";                     					 
					
					}
					if(xmlHttp.readyState==4)
					{
					    var r=xmlHttp.responseText
					    //alert(r);
					    document.getElementById("spn1").innerHTML=r.split("eee",1);
					    //alert(document.getElementById("spn1_id").innerHTML=);
					}
        }
        var url="script.aspx?mid="+document.getElementById("ddhp").value+"&brd=Hewlett-Packard"+"&type=hp";
  		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>";
    }
}
function hpModel()
{
     if(document.getElementById("hpBrand").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'/>";
					// alert("s");
					}
					if(xmlHttp.readyState==4)
					{
					    var r=xmlHttp.responseText
					    //alert(r);
					    document.getElementById("spn3").innerHTML=r.split("eee",1);
					    //alert(document.getElementById("Span1").innerHTML=);
					}
        }
        var url="script.aspx?mid="+document.getElementById("ddhp").value+"&manu=Hewlett-Packard"+"&bid="+document.getElementById("hpBrand").value+"&type=hpModel";
  		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 ibm()
{
   
    if(document.getElementById("ddibm").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>";                     					 
					
					}
					if(xmlHttp.readyState==4)
					{
					    var r=xmlHttp.responseText
					    //alert(r);
					    document.getElementById("spn1").innerHTML=r.split("eee",1);
					}
        }
        var url="script.aspx?mid="+document.getElementById("ddibm").value+"&brd=ibm"+"&type=ibm";
  		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>";
    }
}
function ibmModel()
{
     if(document.getElementById("ibmBrand").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'/>";
					// alert("s");
					}
					if(xmlHttp.readyState==4)
					{
					    var r=xmlHttp.responseText
					    //alert(r);
					    document.getElementById("spn3").innerHTML=r.split("eee",1);
					}
        }
        var url="script.aspx?mid="+document.getElementById("ddibm").value+"&manu=ibm"+"&bid="+document.getElementById("ibmBrand").value+"&type=ibmModel";
  		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 e = document.getElementById("modelid"); 
     var strUser = e.options[e.selectedIndex].text;
     //window.location.href ="../memoryspecification.aspx?id="+document.getElementById("modelid").value;
     //document.location.href="Default.aspx?id="+document.getElementById("modelid").value;
    window.location.href ="http://computerlaptopmemory.com/computer-memory/Compaq"+trimName(strUser)+".html";
   
 }
 function show1()
 {
     if(document.getElementById("modelid").value==0)
     {
        alert('please select model');
        return false;
     }           
     var e = document.getElementById("modelid"); 
     var strUser = e.options[e.selectedIndex].text;
     //window.location.href ="../memoryspecification.aspx?id="+document.getElementById("modelid").value;
     //document.location.href="Default.aspx?id="+document.getElementById("modelid").value;
    window.location.href ="http://computerlaptopmemory.com/computer-memory/Dell"+trimName(strUser)+".html";
   
 }
 function show2()
 {
     if(document.getElementById("modelid").value==0)
     {
        alert('please select model');
        return false;
     }           
     var e = document.getElementById("modelid"); 
     var strUser = e.options[e.selectedIndex].text;
     //window.location.href ="../memoryspecification.aspx?id="+document.getElementById("modelid").value;
     //document.location.href="Default.aspx?id="+document.getElementById("modelid").value;
    window.location.href ="http://computerlaptopmemory.com/computer-memory/Gateway"+trimName(strUser)+".html";
   
 }
 function show3()
 {
     if(document.getElementById("modelid").value==0)
     {
        alert('please select model');
        return false;
     }           
     var e = document.getElementById("modelid"); 
     var strUser = e.options[e.selectedIndex].text;
     //window.location.href ="../memoryspecification.aspx?id="+document.getElementById("modelid").value;
     //document.location.href="Default.aspx?id="+document.getElementById("modelid").value;
    window.location.href ="http://computerlaptopmemory.com/computer-memory/HewlettPackard"+trimName(strUser)+".html";
   
 }
 function show4()
 {
     if(document.getElementById("modelid").value==0)
     {
        alert('please select model');
        return false;
     }           
     var e = document.getElementById("modelid"); 
     var strUser = e.options[e.selectedIndex].text;
     //window.location.href ="../memoryspecification.aspx?id="+document.getElementById("modelid").value;
     //document.location.href="Default.aspx?id="+document.getElementById("modelid").value;
    window.location.href ="http://computerlaptopmemory.com/computer-memory/IBM"+trimName(strUser)+".html";
   
 }

function showgo()
 {
     if(document.getElementById("ddBrand").value==0)
     {
        alert('please select model');
        return false;
     }    
        
     var e = document.getElementById("ddBrand"); 
     var strUser = e.options[e.selectedIndex].text;
     //window.location.href ="../memoryspecification.aspx?id="+document.getElementById("ddBrand").value;
     //document.location.href="Default.aspx?id="+document.getElementById("modelid").value;
    window.location.href ="http://computerlaptopmemory.com/computer-memory/Apple"+trimName(strUser)+".html";
   
}

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;
}
