
function submit_search1()
{ 
    var parSearch
    parSearch = document.formsearch.elements.txtSearch.value
    if (parSearch != ""){
        document.formsearch.submit();
    }
    else
    {
        alert("Aranacak ifade en az 2 karakter olmalıdır");	
    }
}
//317
function submit_search()
{ 
    var Goon = true;
    if (document.formsearch.txtSearch.value == "" || document.formsearch.txtSearch.value == null || document.formsearch.txtSearch.value.length<2){
        Goon = false;
        }
    if (Goon) {
        document.formsearch.submit();
    }
    else {
        alert("Aranacak ifade en az 2 karakter olmalıdır");
        return false;	
    }  
}

var lastUp = ""
var last   = ""

//var isDOM = (document.getElementById ? true : false); 
//var isIE4 = ((document.all && !isDOM) ? true : false);
//var isNS4 = (document.layers ? true : false);

function prd_list(parName, parUpName){
    var listname
    var list 
    listname = "prd_"+parName;
    if (document.getElementById(listname)!=null)
    {
        list     = document.getElementById(listname).style;
        //alert(list.display)
        if (list.display==null)list.display = "none";
        if (list.display == "none") 
        {
        //alert(listname)
        if (parUpName!="")
        {

            document.getElementById("prd_"+parUpName).style.display     = "inline"; 
        }
	        list.display      = "inline"; 
        }
        else 
        {
	        list.display      = "none"; 
	        //alert()
	        if (parUpName!="")
	        if (lastUp!="")
	        {
                document.getElementById("prd_"+lastUp).style.display     = "inline"; 
	        }
        }
        if (document.getElementById("prd_"+last)!=null)
        {
        if (last!="" && last!=parName && last!=parUpName)
        {
            //alert("Son :" + last)
            document.getElementById("prd_"+last).style.display     = "none"; 
        }
        last = parName
        }
        if (document.getElementById("prd_"+lastUp)!=null)
        {
        if (lastUp!="" && lastUp!=parName && lastUp!=parUpName)
        {
            //alert("Double Son :" + lastUp)
            document.getElementById("prd_"+lastUp).style.display     = "none"; 
        }
        if (parUpName!="") lastUp = parUpName
        }			    
    }
}
              
function goBrand(pBrandID){
    window.location.href='/asp/brands.asp?brand=' + pBrandID;
}
            	
function basket_go() { 
    window.location.href='/asp/show_basket.asp';
}
            	
function fnDetailPrd(sUrl) {
    
        window.location.href=sUrl
    	
}	

function fnDetailPrdUrl(pProduct) {
    var sUrl = 'http://www.netcarsi.com/asp/show_stock.asp?product=' + pProduct;
    return sUrl;
}	   
             
//document.onkeyup = equalkey; 
function equalkey(e) { 
    if( !e ) { 
        if( window.event ) { 
            //DOM 
            e = window.event; 
        } else { 
            //TOTAL FAILURE, WE HAVE NO WAY OF REFERENCING THE EVENT 
            return; 
        } 
    } 
    
    if( typeof( e.which ) == 'number' ) { 
        //NS 4, NS 6+, Mozilla 0.9+, Opera 
        e = e.which; 
        //if (e=='8') alert("bakspace1"); 
    } else if( typeof( e.keyCode ) == 'number' ) { 
        //IE, NS 6+, Mozilla 0.9+ 
        e = e.keyCode; 
        //if (e=='8') alert("bakspace2"); 
    } else if( typeof( e.charCode ) == 'number' ) { 
        //also NS 6+, Mozilla 0.9+ 
        e = e.charCode; 
        //if (e=='8') alert("bakspace3"); 
    } else { 
        //TOTAL FAILURE, WE HAVE NO WAY OF OBTAINING THE KEY CODE 
        return;
    } 

    //window.alert('The key pressed has keycode ' + e + 
    //' and is key ' + String.fromCharCode( e ) ); 
    return e;
} 

function isEnter(evnt) {
    var enterKey = false;
    if (Number(equalkey(evnt))==13)
    {
        //alert("Enter!");
        enterKey = true; 
    }
    return enterKey
}

function SubmitCheckB(evnt) {	
    if (isEnter(evnt))
	    frm_b2b();
}				
function SubmitCheck(evnt) {	
    if (isEnter(evnt))
	    frm_b2c();
}
            	
            	
function frm_b2b()
{
    var Goon = true;
    var strMess = "Eksik bilgi\n";
    var BirthDate
                
    if (document.getElementById("txtCompany_Code").value == "" || document.getElementById("txtCompany_Code").value == null){
        strMess = strMess+"\nFirma kodunuzu giriniz";
        Goon = false;
    }
                
    if (document.getElementById("txtPasswordB2B").value == "" || document.getElementById("txtPasswordB2B").value == null){
        strMess = strMess+"\nŞifreyi giriniz";
        Goon = false;
    }
                
    if (Goon) {
        //alert();
        document.getElementById("form_b2b").submit();
        //document.form_b2b.submit();
                    
    }
    else {
        alert(strMess);
    }  
} 
               
            	
function frm_b2c()
{
    var Goon = true;
    var strMess = 'Eksik bilgi\n';
    var BirthDate
    if (document.getElementById("txtEmail").value == "" || document.getElementById("txtEmail").value == null){
        strMess = strMess+'\nE-postanızı giriniz';
        Goon = false;
    }
                
    if (document.getElementById("txtPassword").value == "" || document.getElementById("txtPassword").value == null){
        strMess = strMess+'\nŞifreyi giriniz';
        Goon = false;
    }
    if (Goon) {
        document.getElementById("form_b2c").submit();
    }
    else {
        alert(strMess);
    }  
}	

function newsdetail(pNewsID)
{
    winprops = 'height=500,width=500,top=0,left=0,scrollbars=yes,resizable';
    lookupwin = window.open('/asp/newsdetail.asp?NewsID='+pNewsID, "lookup", winprops);
}
function Send(parIDQ)
{
    var Goon = false
    var radiogroup
    var j=0;
    radiogroup = document.getElementsByName("rd"+parIDQ); //document.all('rd'+parIDQ);
    //alert('rd'+parIDQ)
    for(j=0;j<radiogroup.length;j++) {
        //alert(radiogroup[j].name + ' - ' +radiogroup[j].checked)
        if(radiogroup[j].checked) {
	        IDR = radiogroup[j].value
	        Goon = true			      
	        break;
        }
    }
    if (Goon==true)
    {
        winprops = 'height=415,width=500,top=0,left=0,scrollbars=yes,resizable';
        lookupwin = window.open('/asp/addresponse.asp?parIDQ='+parIDQ+'&parIDR='+IDR, "lookup", winprops);        
    }
    else 
    {
        alert("Cevap seçimi yapılmadı! Lütfen seçeneklerden birisini seçiniz")
    }
}	


