/*Script Developed By Prantik Gautam. (ENGECORC)*/

function set_all(tot)
{
    var image1=new Image(0,0);
    var image2=new Image(0,0);
    var image3=new Image(0,0);
    var image4=new Image(0,0);
    var image5=new Image(0,0);
    var image6=new Image(0,0);
    var image7=new Image(0,0);
    var image8=new Image(0,0);
    var image9=new Image(0,0);
    var image10=new Image(0,0);
    var image11=new Image(0,0);
    var image12=new Image(0,0);
    var image13=new Image(0,0);
    var image14=new Image(0,0);
    var image15=new Image(0,0);
    var image16=new Image(0,0);
    var image17=new Image(0,0);
    var image18=new Image(0,0);
    var image19=new Image(0,0);
    var image20=new Image(0,0);
    var image21=new Image(0,0);
    var image22=new Image(0,0);
    var image23=new Image(0,0);
    var image24=new Image(0,0);
    var image25=new Image(0,0);
    var image26=new Image(0,0);
    var image27=new Image(0,0);
    var image28=new Image(0,0);
    var image29=new Image(0,0);
    var image30=new Image(0,0);
    var image31=new Image(0,0);
    var image32=new Image(0,0);
    var image33=new Image(0,0);
    var image34=new Image(0,0);
    var image35=new Image(0,0);
    var image36=new Image(0,0);
    var image37=new Image(0,0);
    var image38=new Image(0,0);
    var image39=new Image(0,0);
    var image40=new Image(0,0);
    var image41=new Image(0,0);
    image1.src="img/about_us_bottom.png";
    image2.src="img/about_us_middle.png";
    image3.src="img/about_us_upper.png";
    image4.src="img/aboutus.jpg";
    image5.src="img/ads_main_strip.jpg";
    image6.src="img/aim_obj.jpg";
    image7.src="img/ajax-loader.gif";
    image8.src="img/banner_low.png";
    image9.src="img/bar.jpg";
    image10.src="img/close.gif";
    image11.src="img/contact.jpg";
    image12.src="img/deptt.jpg";
    image13.src="img/goto.jpg";
    image14.src="img/goto.png";
    image15.src="img/home.jpg";
    image16.src="img/icn.ico";
    image17.src="img/img_holder.png";
    image18.src="img/left_strip.jpg";
    image19.src="img/loader.gif";
    image20.src="img/loader2.gif";
    image21.src="img/loader4.gif";
    image22.src="img/loading.gif";
    image23.src="img/menu_bottom.jpg";
    image24.src="img/menu_mid.jpg";
    image25.src="img/menu_top.jpg";
    image26.src="img/middle_strip.jpg";
    image27.src="img/overlay_bottom.png";
    image28.src="img/overlay_mid.png";
    image29.src="img/overlay_top.png";
    image30.src="img/post.png";
    image31.src="img/prod.jpg";
    image32.src="img/prods_bottom.png";
    image33.src="img/prods_mid.png";
    image34.src="img/prods_top.png";
    image35.src="img/product_bottom.png";
    image36.src="img/products_mid.png";
    image37.src="img/products_top.png";
    image38.src="img/right_strip.jpg";
    image39.src="img/search.jpg";
    image40.src="img/Shiv.jpg";
    image41.src="img/vertical_strip.jpg";    
    document.getElementById('two').style.display="none";
    document.getElementById('three').style.display="none";
    document.getElementById('four').style.display="none";
    document.getElementById('five').style.display="none";
    //document.getElementById('six').style.display="none";
    document.getElementById('seven').style.display="none";
    document.getElementById('srchh').focus();
    get_all_new_result(1,tot);
    if(document.all)
    {
        document.getElementById('prods').style.marginTop=-12+"px";
        document.getElementById('post_p').style.marginTop=10+"px";
    }
}
function set_all_about()
{
    document.getElementById('one').style.display="none";
    document.getElementById('three').style.display="none";
    document.getElementById('four').style.display="none";
    document.getElementById('five').style.display="none";
    //document.getElementById('six').style.display="none";
    document.getElementById('seven').style.display="none";
    document.getElementById('srchh').focus();
    document.getElementById('logo_comp').style.display="none";
    if(document.all)
    {
        document.getElementById('lgnd_abt').style.marginTop=10+"px";
        document.getElementById('about_us_desc').style.marginTop=30+"px";
       // document.getElementById('reseller').style.marginLeft=-6+"px";       
    }
    else
    {
        document.getElementById('about_us_desc').style.marginTop=0+"px";
    }
}
function set_all_aims()
{
    document.getElementById('one').style.display="none";
    document.getElementById('two').style.display="none";
    document.getElementById('four').style.display="none";
    document.getElementById('five').style.display="none";
    //document.getElementById('six').style.display="none";
    document.getElementById('seven').style.display="none";
    document.getElementById('srchh').focus();
    if(document.all)
    {
        document.getElementById('lgnd_abt').style.marginTop=10+"px";
        document.getElementById('about_us_desc').style.marginTop=30+"px";
    }
    else
    {
        document.getElementById('about_us_desc').style.marginTop=0+"px";
    }
}
function set_all_products()
{
    document.getElementById('one').style.display="none";
    document.getElementById('two').style.display="none";
    document.getElementById('four').style.display="none";
    document.getElementById('three').style.display="none";
    //document.getElementById('six').style.display="none";
    document.getElementById('seven').style.display="none";
    document.getElementById('srchh').focus();
    if(document.all)
    {
        document.getElementById('lgnd_abt').style.marginTop=10+"px";
        document.getElementById('about_us_desc').style.marginTop=30+"px";
    }
    else
    {
        document.getElementById('about_us_desc').style.marginTop=0+"px";
    }
}
function set_all_cont()
{
    document.getElementById('one').style.display="none";
    document.getElementById('two').style.display="none";
    document.getElementById('four').style.display="none";
    document.getElementById('three').style.display="none";
    //document.getElementById('six').style.display="none";
    document.getElementById('five').style.display="none";
    document.getElementById('srchh').focus();
    if(document.all)
    {
        document.getElementById('lgnd_abt').style.marginTop=10+"px";
        document.getElementById('about_us_desc').style.marginTop=30+"px";
    }
    else
    {
        document.getElementById('about_us_desc').style.marginTop=0+"px";
    }
}
function set_all_deptt()
{
    document.getElementById('one').style.display="none";
    document.getElementById('two').style.display="none";
    //document.getElementById('four').style.display="none";
    document.getElementById('three').style.display="none";
    //document.getElementById('six').style.display="none";
    document.getElementById('five').style.display="none";
    document.getElementById('seven').style.display="none";
    document.getElementById('srchh').focus();
    if(document.all)
    {
        document.getElementById('lgnd_abt').style.marginTop=10+"px";
        document.getElementById('about_us_desc').style.marginTop=30+"px";
    }
    else
    {
        document.getElementById('about_us_desc').style.marginTop=0+"px";
    }
}
function move_pointer(v)
{
    document.getElementById(v).style.display="block";
}
function reset_pointer(v)
{
    document.getElementById(v).style.display="none";
}
function get_results(e)
{
    if(e.keyCode==13)
    {
        async_result();
    }
}
function createXMLHttpRequest()
{       
    if(window.ActiveXObject)
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    if(window.XMLHttpRequest)
    xmlHttp=new XMLHttpRequest();
}
function get_all_new_result(v,tot)
{
    for(var i=1;i<=tot;i++)
    {
        if(v!=i)
        {
            document.getElementById(i).style.color="#ffffff";
        }
        else
        {
            document.getElementById(v).style.color="#990000";
        }
    }
    createXMLHttpRequest();
    xmlHttp.open("GET","new_products.php?val="+v,true);        
    xmlHttp.onreadystatechange=function()
    {
        if(xmlHttp.readyState == 1)
        {                
            document.getElementById('ads').innerHTML="<img src='img/ajax-loader.gif' border='0' style='float:left;margin-top:170px;margin-left:240px'/>";                    
        }
        if(xmlHttp.readyState == 4)
        {
            if(xmlHttp.status == 200)
            {                    
                reply=xmlHttp.responseText;
                document.getElementById('ads').innerHTML=reply;
            }
        }
    }
    xmlHttp.send(null);
}
function get_categories()
{
    var opt=document.getElementById('tnm').value;
    createXMLHttpRequest();
    xmlHttp.open("GET","categories.php?option_val="+opt,true);        
    xmlHttp.onreadystatechange=function()
    {
        if(xmlHttp.readyState == 1)
        {                
            document.getElementById('ctgry').innerHTML="<img src='img/ajax-loader.gif' width='16' height='16' border='0' style='float:left'/>&nbsp;&nbsp;Please wait. Loading.....";                    
        }
        if(xmlHttp.readyState == 4)
        {
            if(xmlHttp.status == 200)
            {                    
                reply=xmlHttp.responseText;
                document.getElementById('ctgry').innerHTML=reply;
            }
        }
    }
    xmlHttp.send(null);
}
function show_all_results()
{
    var b_tag=document.getElementById('tnm').value;
    var catgry=document.getElementById('category').value;
    createXMLHttpRequest();
    xmlHttp.open("GET","new_products.php?brand_name="+b_tag+"&category="+catgry+"&id=1",true);        
    xmlHttp.onreadystatechange=function()
    {
        if(xmlHttp.readyState == 1)
        {                
            document.getElementById('product_mid').innerHTML="<img src='img/loading.gif' width='32' height='32' border='0' style='float:left;margin-left:250px;margin-top:250px'/>";                    
        }
        if(xmlHttp.readyState == 4)
        {
            if(xmlHttp.status == 200)
            {                    
                reply=xmlHttp.responseText;
                document.getElementById('product_mid').innerHTML=reply;
                document.getElementById('1').style.color="#990000";
                if(document.all)
                {
                    document.getElementById('pgntn').style.marginTop=-27+"px";
                }
                else
                {
                    document.getElementById('pgntn').style.marginTop=0+"px";
                }
            }
        }
    }
    xmlHttp.send(null);
}
function get_products(v,tot)
{
    var b_tag=document.getElementById('tnm').value;
    var catgry=document.getElementById('category').value;        
    createXMLHttpRequest();
    xmlHttp.open("GET","new_products.php?brand_name="+b_tag+"&category="+catgry+"&id="+v,true);        
    xmlHttp.onreadystatechange=function()
    {
        if(xmlHttp.readyState == 1)
        {                
            document.getElementById('product_mid').innerHTML="<img src='img/loading.gif' width='32' height='32' border='0' style='float:left;margin-left:250px;margin-top:250px'/>";                    
        }
        if(xmlHttp.readyState == 4)
        {
            if(xmlHttp.status == 200)
            {                    
                reply=xmlHttp.responseText;
                document.getElementById('product_mid').innerHTML=reply;
                if(document.all)
                {
                    document.getElementById('pgntn').style.marginTop=-27+"px";
                }
                else
                {
                    document.getElementById('pgntn').style.marginTop=0+"px";
                }
                for(var i=1;i<=tot;i++)
                {
                    if(v!=i)
                    {
                        document.getElementById(i).style.color="#ffffff";
                    }
                    else
                    {
                        document.getElementById(v).style.color="#990000";
                    }
                }
            }
        }
    }
    xmlHttp.send(null);    
}
function result_desc(v)
{
    document.getElementById('ovr_show_hide').style.display="block";
    createXMLHttpRequest();
    xmlHttp.open("GET","new_products.php?item_id="+v,true);        
    xmlHttp.onreadystatechange=function()
    {
        if(xmlHttp.readyState == 1)
        {                
            document.getElementById('overlay_mid').innerHTML="<img src='img/loader2.gif' width='48' height='48' border='0' style='float:left;margin-left:240px;margin-top:50px'/>";                    
        }
        if(xmlHttp.readyState == 4)
        {
            if(xmlHttp.status == 200)
            {                    
                reply=xmlHttp.responseText;
                document.getElementById('overlay_mid').innerHTML=reply;                
            }
        }
    }
    xmlHttp.send(null);
}
function closeIt()
{
    Effect.Fade('ovr_show_hide');
    return false;
}
function open_up()
{
    document.getElementById('ovr_show_hide').style.display="block";
    createXMLHttpRequest();
    xmlHttp.open("GET","categories.php?cat=1",true);        
    xmlHttp.onreadystatechange=function()
    {
        if(xmlHttp.readyState == 1)
        {                
            document.getElementById('overlay_mid').innerHTML="<img src='img/loader2.gif' width='48' height='48' border='0' style='float:left;margin-left:240px;margin-top:50px'/>";                    
        }
        if(xmlHttp.readyState == 4)
        {
            if(xmlHttp.status == 200)
            {                    
                reply=xmlHttp.responseText;
                document.getElementById('overlay_mid').innerHTML=reply;                
            }
        }
    }
    xmlHttp.send(null);    
}
function go_search(v)
{
    document.brands.brnds.value=v;
    document.brands.action="search_products.php";
    document.brands.submit();
}
function search_all_products(b_tag,b_id,tot)
{
    document.srch.search.focus();
    document.getElementById('one').style.display="none";
    document.getElementById('two').style.display="none";
    document.getElementById('three').style.display="none";
    document.getElementById('four').style.display="none";
    //document.getElementById('six').style.display="none";
    document.getElementById('seven').style.display="none";    
    createXMLHttpRequest();
    xmlHttp.open("GET","new_products.php?brnd_name="+b_tag+"&b_id="+b_id,true);        
    xmlHttp.onreadystatechange=function()
    {
        if(xmlHttp.readyState == 1)
        {                
            document.getElementById('product_mid').innerHTML="<img src='img/loading.gif' width='32' height='32' border='0' style='float:left;margin-left:250px;margin-top:250px'/>";                    
        }
        if(xmlHttp.readyState == 4)
        {
            if(xmlHttp.status == 200)
            {                    
                reply=xmlHttp.responseText;
                document.getElementById('product_mid').innerHTML=reply;
                if(document.all)
                {
                    document.getElementById('pgntn').style.marginTop=-15+"px";
                }
                else
                {
                    document.getElementById('pgntn').style.marginTop=0+"px";
                }
                for(var i=1;i<=tot;i++)
                {
                    if(b_id!=i)
                    {
                        document.getElementById(i).style.color="#ffffff";
                    }
                    else
                    {
                        document.getElementById(b_id).style.color="#990000";
                    }
                }
            }
        }
    }
    xmlHttp.send(null);  
}
function search_async_products(b_tag,b_id,tot)
{
    document.srch.search.focus();
    document.getElementById('one').style.display="none";
    document.getElementById('two').style.display="none";
    document.getElementById('three').style.display="none";
    document.getElementById('four').style.display="none";
    //document.getElementById('six').style.display="none";
    document.getElementById('seven').style.display="none";    
    createXMLHttpRequest();
    xmlHttp.open("GET","new_products.php?async_brand_name="+b_tag+"&async_id="+b_id,true);        
    xmlHttp.onreadystatechange=function()
    {
        if(xmlHttp.readyState == 1)
        {                
            document.getElementById('product_mid').innerHTML="<img src='img/loading.gif' width='32' height='32' border='0' style='float:left;margin-left:250px;margin-top:250px'/>";                    
        }
        if(xmlHttp.readyState == 4)
        {
            if(xmlHttp.status == 200)
            {                    
                reply=xmlHttp.responseText;
                document.getElementById('product_mid').innerHTML=reply;
                if(document.all)
                {
                    document.getElementById('pgntn').style.marginTop=-15+"px";
                }
                else
                {
                    document.getElementById('pgntn').style.marginTop=0+"px";
                }
                for(var i=1;i<=tot;i++)
                {
                    if(b_id!=i)
                    {
                        document.getElementById(i).style.color="#ffffff";
                    }
                    else
                    {
                        document.getElementById(b_id).style.color="#990000";
                    }
                }
            }
        }
    }
    xmlHttp.send(null); 
}
function async_result()
{
    if(document.srch.search.value!="")
    {
        document.srch.action="search_products.php";
        document.srch.submit();
    }
    else
    {
        alert("Please enter key word in search field.");
    }
}
function go_to_web(v)
{
    if(v!="")
    {
        window.open("http://"+v);
    }
    else
    {
        alert("Web site not assigned here.");
    }
}
