﻿// JScript File
function changeContent(val)
    {
       
        if(val==1)
        {
            document.getElementById("imgVisible1").style.visibility = "visible";
            document.getElementById("imgVisible1").style.display = "inline";  
            
            document.getElementById("imgVisible2").style.visibility = "hidden";
            document.getElementById("imgVisible2").style.display = "none";
            
            document.getElementById("imgVisible3").style.visibility = "hidden";
            document.getElementById("imgVisible3").style.display = "none";
            
            document.getElementById("lstByProduct").style.visibility ="visible";
            document.getElementById("lstByProduct").style.display ="inline";
            
            document.getElementById("lstByAlpha").style.visibility ="hidden";
            document.getElementById("lstByAlpha").style.display ="none";
            
            document.getElementById("viewInteractive").style.visibility ="hidden";
            document.getElementById("viewInteractive").style.display ="none";
            
            //Added on 15th September By Raghu
            document.getElementById("searchByCategory").style.visibility ="visible";
            document.getElementById("searchByCategory").style.display ="inline";
            
        }
        else if(val==2)
        {
                  
            document.getElementById("imgVisible1").style.visibility = "hidden";
            document.getElementById("imgVisible1").style.display = "none";
            
            document.getElementById("imgVisible2").style.visibility = "visible";
            document.getElementById("imgVisible2").style.display = "inline";
            
            document.getElementById("imgVisible3").style.visibility = "hidden";
            document.getElementById("imgVisible3").style.display = "none";
            
            
            document.getElementById("lstByProduct").style.visibility ="hidden";
            document.getElementById("lstByProduct").style.display ="none";
            
            document.getElementById("lstByAlpha").style.visibility ="visible";
            document.getElementById("lstByAlpha").style.display ="inline";
            
            document.getElementById("viewInteractive").style.visibility ="hidden";
            document.getElementById("viewInteractive").style.display ="none";
            //Added on 15th September By Raghu
            document.getElementById("searchByCategory").style.visibility ="hidden";
            document.getElementById("searchByCategory").style.display ="none";
        }
        else if(val==3)
        {
            document.getElementById("imgVisible1").style.visibility = "hidden";
            document.getElementById("imgVisible1").style.display = "none";
            
            document.getElementById("imgVisible2").style.visibility = "hidden";
            document.getElementById("imgVisible2").style.display = "none";
            
            document.getElementById("imgVisible3").style.visibility = "visible";
            document.getElementById("imgVisible3").style.display = "inline";
            
            document.getElementById("lstByProduct").style.visibility ="hidden";
            document.getElementById("lstByProduct").style.display ="none";
             
            document.getElementById("lstByAlpha").style.visibility ="hidden";
            document.getElementById("lstByAlpha").style.display ="none"; 
             
            document.getElementById("viewInteractive").style.visibility ="visible";
            document.getElementById("viewInteractive").style.display ="inline";
            //Added on 15th September By Raghu
            document.getElementById("searchByCategory").style.visibility ="hidden";
            document.getElementById("searchByCategory").style.display ="none";
        }
    }
function SetAltOfAllImgTags()
     {
         var ArrImgTags =document.getElementsByTagName('img');
         
         for(var i=0; i<ArrImgTags.length;i++)
         {
            var str= ArrImgTags[i].src;
             var lastIndex=str.lastIndexOf('.');
             if(lastIndex<0) 
                { 
                lastIndex=str.length;
                }
                
             str= str.substring(str.lastIndexOf('/')+1,lastIndex);
             str = str.replace('_thumb',' ');
             str = str.replace('thumb',' ');
             
             str= str.replace(/_/g,' ');
             str = str.replace(/-/g,' ');
             str = str.replace(/%20/g," ");
             if(str == 'primalpictures com 01')
                str = '3D human anatomy model';
             if(str == 'Head_Cross_Section')
                str = 'Primal Pictures Acupuncture Anatomy Head Cross Section';
             if(str == 'Systemic')
                str = 'Human Anatomy Systemic';               
             ArrImgTags[i].alt=str;
             ArrImgTags[i].title=str;         
         }          
    }
    function showMenu(id, pName, onlineVal)
    {   
        if(onlineVal != null)
        {
            onlineVal = onlineVal.toLowerCase();
            if(onlineVal.indexOf("online")>-1)
            {
                window.location  = "OnLineSubscriptions.aspx";
                return;
            }
        }        
        str = "dv";
        newid = str+id;
        obj = document.getElementById(newid);
        imgid = "img"+id;
        varImg = document.getElementById(imgid);             
        if (obj.style.display == "inline")
        {
            DisplayStyle = "inline";
            varImg.src = "images/red-bullet.gif";             
        }
        else
        {
            DisplayStyle = "none"; 
            varImg.src = "images/blue-bullet.gif";           
        }       
      
        if(DisplayStyle == "inline")
        {
            obj.style.display = "none";
            varImg.src = "images/blue-bullet.gif"; 
        }
        else
        {
            obj.style.display = "inline";
            varImg.src = "images/red-bullet.gif";
        }
             
        if(pName != '')
        {
            var varDiv = parent.document.getElementById(pName);
            if(varDiv != null)
                varDiv.className = "divHover";
                
        }
    }
    function getLastPage()
    {
        if(document.referrer.indexOf("thepiratebay")>0)
        {
            location.href="block.aspx";           
        }
        if(document.referrer.indexOf("www.area51warez")>0)
        {
            location.href="block.aspx";           
        }
        if(document.referrer.indexOf("www.koolpa.com")>0)
        {
            location.href="block.aspx";           
        }
        if (document.referrer.indexOf("www.doctor.vg") > 0) {
            location.href = "block.aspx";
		} 
        if (document.referrer.indexOf("warez.black-final.com") > 0) {
            location.href = "block.aspx";
		}
    }


            function showDemo(mediaURL)
            {
                $(document).ready(function ()
                {
//                    
                    $('#aClose').click(function ()
                    {
                        disablePopup();
                    });

                    {
                       
                        var strPath = window.location.href;
                        var mURL = "";
                        var ct = strPath.lastIndexOf("/");
                        strPath = strPath.substring(0, ct + 1);
                        parent.document.getElementById("hdPath").value = mediaURL; //.substring(mediaURL.lastIndexOf("/") + 1).replace(".jpg", ".xml");
                        //alert(mediaURL);
                        centerPopup(); // Centering with Css
                        loadPopup(); // Load PopUp
                        mURL='AnimationViewer.aspx?a=' + mediaURL.replace(".swf", "").replace(/_/g,'');
                        //mURL='AnimationViewer.aspx?a=';
                        //alert(mURL);
                        $('#animationDiv').load(mURL, function ()
                        //$('#animationDiv').load('AnimationViewer.aspx?a=' + mediaURL, function ()
                        {
                            //alert('Load was performed.');
                        });

                    }

                   

                    var popupStatus = 0;
                    function loadPopup()
                    {

                        $("#backgroundPopup").css({ "opacity": "0.7" });
                        $("#backgroundPopup").fadeIn("slow");
                        $("#dvAnimationViewer").fadeIn("slow");

                    }
                    function disablePopup()
                    {

                        $("#backgroundPopup").fadeOut("slow");
                        $("#dvAnimationViewer").fadeOut("slow");
                    }

                    function centerPopup()
                    {
                        var windowWidth = document.documentElement.clientWidth;
                        var windowHeight = document.documentElement.clientHeight;
                        var popupHeight = "580"; // $("#customerPopUpForm").height();
                        var popupWidth = "1000"; // $("#customerPopUpForm").width();
                        //centering               
                        $("#dvAnimationViewer").css({
                            "position": "absolute",
                            "top": 20,
                            "left": (screen.width / 2) - (popupWidth / 2) - 100
                        });
                        //only need force for IE6

                        $("#backgroundPopup").css({
                            "height": windowHeight
                        });
                    }
                });
            }

            function clearMsg()
            {
                //alert("I got called");
                document.getElementById("dvloading").style.display = "none";
                document.getElementById("dvloading").style.visibility = "hidden";
            }

