function loadjscssfile(filename, filetype) {
    if (filetype == "js") { //if filename is a external JavaScript file
        var fileref = document.createElement('script')
        fileref.setAttribute("type", "text/javascript")
        fileref.setAttribute("src", filename)
    }
    else if (filetype == "css") { //if filename is an external CSS file
        var fileref = document.createElement("link")
        fileref.setAttribute("rel", "stylesheet")
        fileref.setAttribute("type", "text/css")
        fileref.setAttribute("href", filename)
    }
    if (typeof fileref != "undefined")
        document.getElementsByTagName("head")[0].appendChild(fileref)
        
        
}





function seelarge() {
    showWindow();
}

function showWindow() {

        var firstpos = 0
        var winPanel = Ext.getCmp('panelWindowId');
        if (!winPanel) {
            winPanel = new Ext.Window({
                title: document.getElementById("sp_zoomimagetitle").innerHTML, //Title of the Window
                id: 'panelWindowId', //ID of the Window Panel
                autoHeight: true, //Height of the Window will be auto
                width: 620, //Width of the Window
                resizable: false, //Resize of the Window, if false - it cannot be resized
                closable: false, //Hide close button of the Window
                modal: true, //When modal:true it make the window modal and mask everything behind it when displayed
                contentEl: 'divWindowId' //ID of the respective 'div'

            });
            firstpos = 1
            
        }





        winPanel.show();
        if (firstpos == 1)
        {
            var pos = winPanel.getPosition();
            winPanel.setPosition(pos[0], pos[1] + 100)
        }

    //alert(pos[0]);
    //winPanel.setPosition(
    //show method has got three optional parameters like animateTarget, callback, Object scope
}
function hideWindow() {
    Ext.getCmp('panelWindowId').hide();
    //Even this hide methof has got same three optional parameters like animateTarget, callback, Object scope
    //getCmp method is to retrieve the reference to the component
}






function loadzoom() {

                var zoomswf = "http://www1.pall.com/swf/zoom.swf"
                //var zoomimageurl = document.getElementById("sp_zoomimageurl").innerHTML
                var sozoom = new SWFObject(zoomswf, "zoomFlash", "600", "300", "9", "#FFFFFF");
                //var prod_image = new String(zoomimageurl);
                //prod_image = prod_image.replace("/images/", "/images_lg/");
				sozoom.addVariable("image", prod_image); //To change the image dynamically, uncomment this line and alter the image path. 
                sozoom.addParam("menu", "false");
                sozoom.write("zoomFlash");
				

            }


			
function loadElearning() {

                var zoomswf = "http://www1.pall.com/ELearning/AeroSpace/Centrisep/Metastructure.swf"
				//zoomswf = "http://www1.pall.com/Flash/AcroSep/AcroSep_player.swf"
				//zoomswf = "http://www1.pall.com/ELearning/AeroSpace/Centrisep/player.swf"
				
				
				
                //var zoomimageurl = document.getElementById("sp_zoomimageurl").innerHTML
                var sozoom = new SWFObject(zoomswf, "zoomFlash", "800", "600", "8", "#FFFFFF");
				
                //var prod_image = new String(zoomimageurl);
                //prod_image = prod_image.replace("/images/", "/images_lg/");
				//sozoom.addVariable("image", prod_image); //To change the image dynamically, uncomment this line and alter the image path. 
                //sozoom.addParam("menu", "false");
                sozoom.write("zoomFlash");
				

            }
			


loadjscssfile("http://www1.pall.com/jscripts/extjs/resources/css/ext-all.css", "css");
loadjscssfile("http://www1.pall.com/swf/swfobject.js", "js");
loadjscssfile("http://www1.pall.com/jscripts/extjs/examples/shared/examples.css", "css");
loadjscssfile("http://www1.pall.com/blendtrans.js", "js");




    function Removeimage(object) {

        object.src = "http://www1.pall.com/images/gray_pixel.gif";
        document.getElementById("divimagezoom").style.display="none";

    }
	
	

if (document.getElementById("divimagezoom")) {

    
    var zoomimageurl = document.getElementById("sp_zoomimageurl").innerHTML
	var prod_image = new String(zoomimageurl);
    prod_image = prod_image.replace("/images/", "/images_lg/");
    prod_image = prod_image.replace(".gif", ".jpg");
    //var pageurl = location.href.toLowerCase();
    //if (pageurl.indexOf('laboratory') != -1) {
//        //   show magnify icon
       
	   
	       var tempdiv
    tempdiv = ""

    tempdiv = tempdiv +" <div style=\"display: block;\" id=\"image_magnifier\">";
    tempdiv = tempdiv +"  <a style=\"color: rgb(127, 126, 126); font-size: 11px;\" href=\"javascript:seelarge()\">";
    tempdiv = tempdiv +"     <img border=\"0\" src=\"http:\/\/www1.pall.com\/swf\/magnifier_grey.jpg\"\/> See larger image<\/a>";
    tempdiv = tempdiv +" <\/div>";


    tempdiv = tempdiv + "<div id=\"divWindowId\" class=\"x-hidden\" style=\"padding:10px\">";
    tempdiv = tempdiv + "<div class=\"x-tool x-tool-close \" id=\"ext-gen10\" style=\"background-position:0px 0;\" onclick=\"hideWindow()\"> <\/div>";
    tempdiv = tempdiv + "  ";
    tempdiv = tempdiv + "  <div id=\"zoomFlash\"><br><br><br>";
    tempdiv = tempdiv + "        <strong>You need to upgrade your Flash Player<\/strong><br><a href=\"http:\/\/www.adobe.com\/shockwave\/download\/download.cgi?P1_Prod_Version=shockwaveFlash\"> Click here to intall latest Flash Player<\/a>";
    tempdiv = tempdiv + "  <\/div>";
    tempdiv = tempdiv + "";
    tempdiv = tempdiv + "<br\/>";
    tempdiv = tempdiv + "<\/div>";
	tempdiv = tempdiv + "<img src=\"" + prod_image + "\"  onerror=\"Removeimage(this)\" id=\"img1\" height=\"1\" width=\"1\">";
    document.getElementById("divimagezoom").innerHTML = tempdiv;

    

    var t = setTimeout("loadzoom()", 1000);
	   
    //}  
    

}



if (document.getElementById("divElearning")) {

    alert("bvbvbv");
    var zoomimageurl = document.getElementById("sp_zoomimageurl").innerHTML
	var prod_image = new String(zoomimageurl);
    prod_image = prod_image.replace("/images/", "/images_lg/");
    prod_image = prod_image.replace(".gif", ".jpg");
    //var pageurl = location.href.toLowerCase();
    //if (pageurl.indexOf('laboratory') != -1) {
//        //   show magnify icon
       
	   
	       var tempdiv
    tempdiv = ""

    tempdiv = tempdiv +" <div style=\"display: block;\" id=\"image_magnifier\">";
    tempdiv = tempdiv +"  <a style=\"color: rgb(127, 126, 126); font-size: 11px;\" href=\"javascript:seelarge()\">";
    tempdiv = tempdiv +"     <img border=\"0\" src=\"http:\/\/www1.pall.com\/swf\/magnifier_grey.jpg\"\/> See larger image<\/a>";
	
	tempdiv = tempdiv +" <a href='http://www1.pall.com/E_Learning/AeroSpace/Centrisep/Metastructure.swf' > click </a>";
    tempdiv = tempdiv +" <\/div>";


    tempdiv = tempdiv + "<div id=\"divWindowId\" class=\"x-hidden\" style=\"padding:10px\">";
    tempdiv = tempdiv + "<div class=\"x-tool x-tool-close \" id=\"ext-gen10\" style=\"background-position:0px 0;\" onclick=\"hideWindow()\"> <\/div>";
    tempdiv = tempdiv + "  ";
    tempdiv = tempdiv + "  <div id=\"zoomFlash\"><br><br><br>";
    tempdiv = tempdiv + "        <strong>You need to upgrade your Flash Player<\/strong><br><a href=\"http:\/\/www.adobe.com\/shockwave\/download\/download.cgi?P1_Prod_Version=shockwaveFlash\"> Click here to intall latest Flash Player<\/a>";
    tempdiv = tempdiv + "  <\/div>";
    tempdiv = tempdiv + "";
    tempdiv = tempdiv + "<br\/>";
    tempdiv = tempdiv + "<\/div>";
	//tempdiv = tempdiv + "<img src=\"" + prod_image + "\"  onerror=\"Removeimage(this)\" id=\"img1\" height=\"1\" width=\"1\">";
    document.getElementById("divElearning").innerHTML = tempdiv;

    alert(tempdiv);

    var t = setTimeout("loadElearning()", 10000);
	   
    //}  
    

}




  