﻿//////////////////////////////////////////////////////////////////////////////////
// 
// Start Vnvn_wma_Image_26
// 
//////////////////////////////////////////////////////////////////////////////////
  
var Vnvn_wma_Image_26 = {
    
  //=========================================================================
    // Xu ly button Next Back  cua Image small
  //=========================================================================
    
    Next: function  (path,fdr,dv)
    {
            var sQry = "cmd=100&sData="+Vnvn_wma_Image_26.findTheDivByID(path).src+"&ProductID="+fdr+"&idimg="+path;//+Vnvn_wma_Image_26.GetProductID(fdr);
            Vnvn_wma_Image_26.SendDataToServer(dv,s_Path+"VNVN_Web/VNVN_19_Server.aspx","Post",sQry);          
    } ,
    Back: function (path,fdr,dv)
    {
            var sQry = "cmd=101&sData="+Vnvn_wma_Image_26.findTheDivByID(path).src+"&ProductID="+fdr+"&idimg="+path;//+Vnvn_wma_Image_26.GetProductID(fdr);
            Vnvn_wma_Image_26.SendDataToServer(dv,s_Path+"VNVN_Web/VNVN_19_Server.aspx","Post",sQry);
    },
    
////////////////////////////////////////////////
	// start           Print News 
	////////////////////////////////////////////////
	
	
	PrintNews: function(div2,div3,div4) //phan nay de Print page tren trang product  detail
    {  
        if(navigator.appName == "Microsoft Internet Explorer")
        {
            fileCss='IE.css';
        }
        else fileCss='FF.css';
	    w=open();
	    w.document.writeln('<html>');
	    w.document.writeln('<head>');
	    w.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">');
	    w.document.writeln('<link rel="stylesheet" href="App_Themes/Skin1/'+ fileCss+'" type="text/css" />');
	    w.document.writeln('</head>');
	    w.document.writeln('<body topmargin=3 leftmargin=0 marginheight=3 marginwidth=0  >');
         w.document.writeln('<center>')
        w.document.writeln('<table width="500"  cellspacing="0" cellpadding="0">');
        w.document.writeln('<tr>');
              w.document.writeln('<th colspan="2">');                      
                        w.document.writeln('<img src="App_Themes/Skin1/images/logo.png" id="logo" />');                        
              w.document.writeln('</th>');        
        w.document.writeln('</tr>');
        w.document.writeln('<tr>');
                        w.document.writeln('<td style="padding-left:10px;padding-top:10px;">');
                             w.document.writeln(document.getElementById(div2).innerHTML);// lay title product    
                        w.document.writeln('</td>'); 
                    w.document.writeln('</tr>'); 
        w.document.writeln('<tr>');
             w.document.writeln('<td style="font-size:11px;" >');
                     w.document.writeln(document.getElementById(div3).innerHTML); //lay tat ca thong tin lien quan den product    
             w.document.writeln('</td>'); 
        w.document.writeln('</tr>'); 
        
        w.document.writeln('<tr>'); 
                 w.document.writeln('<th colspan="2" align="center" style="font-size:11px;padding:10px 0px;">'); 
                       w.document.writeln('<img  src="App_Themes/Skin1/images/Img_Print.jpg" id="imgPrint"/>')  ;          
                       w.document.writeln('<a onclick="javascript:location.reload(true);window.print();" style=" cursor:pointer" >');
                       w.document.writeln('Print this page');
                       w.document.writeln('</a>');           
                  w.document.writeln('</th >'); 
        w.document.writeln('</tr>'); 
        w.document.writeln('<tr>');
              w.document.writeln('<th colspan="2">');                           
                        w.document.writeln(document.getElementById(div4).innerHTML); //lay dong chu copyright 
              w.document.writeln('</th>');
        w.document.writeln('</tr>');
        
        w.document.writeln('</table >');
        w.document.writeln('</center>');
	    w.document.writeln('</body>');
	    w.document.writeln('</html>');
	    w.document.title = document.title;
	    return false;
	},  
	
	////////////////////////////////////////////////
	// end          Print page  
	////////////////////////////////////////////////

    ////////////////////////////////////////////////
	// start           Print page 
	////////////////////////////////////////////////
	
	
	PrintPage: function() //phan nay de Print page tren trang product  detail
    {  
        if(navigator.appName == "Microsoft Internet Explorer")
        {
            fileCss='IE.css';
        }
        else fileCss='FF.css';
     w=open();
     w.document.writeln('<html>');
     w.document.writeln('<head>');
     w.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">');
     w.document.writeln('<link rel="stylesheet" href="../App_Themes/Skin1/'+ fileCss+'" type="text/css" />');
     w.document.writeln('<style>');
     w.document.writeln('body{line-height:1.5em;font-family:Tahoma;font-size:13px;}.MVF_Footer_Copyright_WhiteText{color:#000;}');
     w.document.writeln('.ASIA_Footer_Copyright_WhiteText{color:#000000;font-weight:bold;font-family:Tahoma;font-size:13px;padding-left:4px;text-decoration:none;}');
     w.document.writeln('.Css_Bg_Dics{background-image:url(../App_themes/Skin1/images/bg_songlist.jpg);background-repeat:no-repeat;float:left;clear:both;font-family:tahoma;font-size:12px;font-weight:bold;margin-bottom:5px;padding-left:8px;text-transform:uppercase;width:523px;}');
     w.document.writeln('.TBF_Footer_Background{background:none;padding-top:0px;height:auto;width:auto;margin:0px;}');
     w.document.writeln('.TBF_Tbx_Quantity{height:18px}');
     w.document.writeln('</style>');
     w.document.writeln('<script type="text/javascript" src="../VNVN_JS/VNVN_24_JScript.js"></script>');         
     w.document.writeln('</head>');     
     w.document.writeln('<body topmargin=3 leftmargin=0 marginheight=3 marginwidth=0  >');
         w.document.writeln('<center>')
        w.document.writeln('<table  cellspacing="0" cellpadding="2" width="600">');
        w.document.writeln('<tr>');
              w.document.writeln('<td colspan="2">');                      
                        w.document.writeln('<img src="../App_Themes/Skin1/images/logo.png" id="logo" />');                        
              w.document.writeln('</td>');        
        w.document.writeln('</tr>');
        w.document.writeln('<tr>');
             w.document.writeln('<td style="font-size:12px;vertical-align:top;">');
                w.document.writeln('<table>');
                    w.document.writeln('<tr>');
                        w.document.writeln('<td style="font-size:12px;" valign="top">');
                           w.document.writeln(document.getElementById('pnl_A5_L7_X2_Y1_055').innerHTML); /*//lay tam hinh       */
                        w.document.writeln('</td>');
                         w.document.writeln('<td style="font-size:12px;vertical-align:top;line-height: 1.5em;padding-left:20px;">');
       w.document.writeln(document.getElementById('pnl_A5_L5_X4_Y1_005').innerHTML); 
                         w.document.writeln('</td>');               
                    w.document.writeln('</tr>'); 
                w.document.writeln('</table>'); 
             w.document.writeln('</td>'); 
        w.document.writeln('</tr>'); 
        
        w.document.writeln('<tr>'); 
                 w.document.writeln('<th colspan="2" align="left" style="font-size:11px;">'); 
                       w.document.writeln('<img  src="../App_Themes/Skin1/images/Img_Print.jpg" id="imgPrint"/>')  ;          
                       w.document.writeln('<a onclick="javascript:location.reload(true);window.print();" style=" cursor:pointer" >');
                       w.document.writeln('Print this page');
                       w.document.writeln('</a>');           
                  w.document.writeln('</th >'); 
        w.document.writeln('</tr>'); 
  
        w.document.writeln('<tr>'); 
                 w.document.writeln('<th colspan="2" align="left" style="font-size:11px;">'); 
                 w.document.writeln(document.getElementById('A2_L0_X0_Y0').innerHTML);
                 w.document.writeln('</th >'); 
        w.document.writeln('</tr>'); 
        
        w.document.writeln('</table >');
        w.document.writeln('</center>');
     w.document.writeln('</body>');
     w.document.writeln('</html>');
     w.document.title = document.title;
     return false;
 },
	
	////////////////////////////////////////////////
	// end          Print page  
	////////////////////////////////////////////////
	
	
	////////////////////////////////////////////////
	// start           Print page song list
	////////////////////////////////////////////////
	PrintPageSonglist: function(div1,div2,div3,div4,div5) //phan nay de Print page tren trang product  detail
    {  
        if(navigator.appName == "Microsoft Internet Explorer")
        {
            fileCss='IE.css';
        }
        else fileCss='FF.css';
	    w=open();
	    w.document.writeln('<html>');
	    w.document.writeln('<head>');
	    w.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">');
	    w.document.writeln('<link rel="stylesheet" href="App_Themes/Skin1/'+fileCss+'" type="text/css" />');
	    w.document.writeln('</head>');
	    w.document.writeln('<body topmargin=3 leftmargin=0 marginheight=3 marginwidth=0 >');
         w.document.writeln('<center>')
        w.document.writeln('<table style="font-size:10"  cellspacing="0" cellpadding="0" >');
        w.document.writeln('<tr>');
              w.document.writeln('<th colspan="2">');                      
                        w.document.writeln('<img src="App_Themes/Skin1/images/logo.png" id="logo" />');                        
              w.document.writeln('</th>');        
        w.document.writeln('</tr>');
        w.document.writeln('<tr>');
              w.document.writeln('<th>');           
                        w.document.writeln(document.getElementById(div2).innerHTML);// lay tam hinh   
              w.document.writeln('</th>');       
              w.document.writeln('<th align="right" style="width:300px;">');  
                        w.document.writeln('<div class="Css_Div_A5_MiddleCenter">');
                            w.document.writeln(document.getElementById(div4).innerHTML);// lay title product          
                            w.document.writeln(document.getElementById(div1).innerHTML); //lay tat ca thong tin lien quan den product    
                        w.document.writeln('</div>');
              w.document.writeln('</th>');    
        w.document.writeln('</tr>'); 
        w.document.writeln('<tr>'); 
                 w.document.writeln('<th colspan="2" align="left">'); 
                       w.document.writeln('<img  src="App_Themes/Skin1/images/Img_Print.jpg" id="imgPrint"/>')  ;          
                       w.document.writeln('<a onclick="javascript:location.reload(true);window.print();" style=" cursor:hand" >');
                       w.document.writeln('Print this page');
                       w.document.writeln('</a>');           
                  w.document.writeln('</th >'); 
        w.document.writeln('</tr>'); 
        w.document.writeln('<tr>');
              w.document.writeln('<th colspan="2">');                           
                        div=document.getElementById(div5).innerHTML;
                        w.document.writeln(div); //lay song list 
              w.document.writeln('</th>');
        w.document.writeln('</tr>');
        w.document.writeln('<tr>');
              w.document.writeln('<th colspan="2">');                           
                        w.document.writeln(document.getElementById(div3).innerHTML); //lay dong chu copyright 
              w.document.writeln('</th>');
        w.document.writeln('</tr>');
        w.document.writeln('</table >');
        w.document.writeln('</center>');
	    w.document.writeln('</body>');
	    w.document.writeln('</html>');
	    w.document.title = document.title;
	    return false;
	},  
	
	////////////////////////////////////////////////
	// end           Print page song list
	////////////////////////////////////////////////
 
   //=========================================================================
    // Print Order
    //=========================================================================
     PrintOrder: function(div1,div3) //phan nay de Print page tren trang Order
    {  
     w=open();
     if(navigator.appName == "Microsoft Internet Explorer"){
         FileCss = 'IE.css';}
     else
         {FileCss = 'FF.css';}
         
     w.document.writeln('<html>');
     w.document.writeln('<head>');
     w.document.writeln('<title> PrintOrderPage </title>');
     w.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">');
     w.document.writeln('<link rel="stylesheet" href=../App_Themes/Skin1/'+ FileCss +' type="text/css" />');
     w.document.writeln('</head>');
     w.document.writeln('<body topmargin="3" leftmargin="0" marginheight="3" marginwidth="0">');
  
     w.document.writeln('<center>');
            w.document.writeln('<div style="width:600px;font-size:12px;">');
                      w.document.writeln('<div style="text-align:center;">');
                            w.document.writeln('<img src="../App_Themes/Skin1/images/logo.png" id="logo" />');
                      w.document.writeln('</div>');
        
                        w.document.writeln('<div width="625px" style="margin-top:20px;bgcolor:#fff6e4;">');                 
                              w.document.writeln(document.getElementById(div1).innerHTML); //lay tat ca thong tin lien quan den product
                        w.document.writeln('</div>'); 
                   
                        w.document.writeln('<div  style="float:left; text-align:center; width:625px;">');    
                           w.document.writeln('<a onclick="javascript:location.reload(true);window.print();" style="cursor:pointer" >');
		    w.document.writeln('<img  src="../App_Themes/Skin1/images/Img_Print.jpg" id="imgPrint"/>');
	             w.document.writeln('</a>');
                           w.document.writeln('<a onclick="javascript:location.reload(true);window.print();" style="cursor:pointer" >');
                                w.document.writeln('Print this page');
                           w.document.writeln('</a>');

		 w.document.writeln('<a onclick="javascript:window.close();" style=" cursor:pointer" >');
                                w.document.writeln(' |  Close');
                           w.document.writeln('</a>');

                        w.document.writeln('</div>');
	
	          w.document.writeln('<br />');
	          w.document.writeln('<br />');

                        w.document.writeln('<div style="float:left;clear:both;text-align:center;width:625px;">');    
                            w.document.writeln(document.getElementById(div3).innerHTML); //lay dong chu copyright 
                        w.document.writeln('</div>'); 
                
            w.document.writeln('</div>');  
     w.document.writeln('</center>');
     w.document.writeln('</body>');
     w.document.writeln('</html>');
     return false;
 },
    //=========================================================================
    // embedPlayer  play file windown media
    //=========================================================================
   embedPlayer: function (MP3URL,div2,i) 
   { 
    // Get Operating System sQry
    var isWin = navigator.userAgent.toLowerCase().indexOf("windows") != -1;
    if (isWin) { // Use MIME type application/x-mplayer2
      visitorOS="Windows";
    } else { // Use MIME type audio/mpeg, audio/x-wav, etc.
      visitorOS="Other";
    }
    var audioURL =Vnvn_wma_Image_26.CutString(MP3URL)+i;//MP3URL;
    var objTypeTag = "application/x-mplayer2"; // The MIME type to load the WMP plugin in non-IE browsers on Windows
    if (visitorOS != "Windows") { objTypeTag = "audio/mpeg"}; // The MIME type for Macs and Linux 
    
   var ctr2=document.getElementById("dd");
   ctr2.value=audioURL;
   var ctr3=document.getElementById("kk");
   ctr3.value=objTypeTag;
   var ctr1 = Vnvn_wma_Image_26.findTheDivByID(div2);
    ctr1.innerHTML ="<object  id=\"OD\" name=\"OD\" classid=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6\" width=\"160\" height=\"150\" >"+
                    "<param id=\"kk\" name='type' value='" + objTypeTag + "'>"+ 
                    "<param id=\"dd\" name=\"URL\" value=\"" + audioURL + "\" />"+
                    "<param name=\"Volume\" value=\"20\" />"+
                     "<param name=\"Loop\" value=\"20\" />"+
                    "<param name=\"EnableContextMenu\" value=\"false\"/>"+
                    "<embed id=EID  src ='" + audioURL + "' type='" + objTypeTag + 
                    "' autoplay='true' loop='20' enablecontextmenu='0' showcontrol='0'  volume='20' autostart='1' width=\"160\" height=\"150\"  controller='1' showstatusbar='1' ></embed>"+
                    "</object>";
    },
    CutString: function(str) // cat chuoi duong dan de loai bo  ki tu " ~ " vd: ~/image/anh.jpg  ---> image/anh.jpg
    {
        var path="";
        var ar=new Array();
        ar=str.split('/');
        for(var i=1;i<ar.length;i++)
       {
            if(i==ar.length-1)
            {
            path+=ar[i];
            }
            else
            {
            path+=ar[i]+="/";   
            }
        }     
        return path;
    },
    
    GetProductID: function(Pro)
    {
        var path="";
        var ar=new Array();
        ar=Pro.split('?Pid=');
        for(var i=1;i<ar.length;i++)
        {
          path+=ar[i];
        }     
        return path;
    },
    //=========================================================================
    // Ajax
    //=========================================================================
    Ajax : function(){
            if(window.XMLHttpRequest){
                xmlhttp = new XMLHttpRequest();        
            }else{
                try{
                    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
                }catch(e){
                    try{
                        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                    }catch(e){
                        xmlhttp = false;
                    }
                }
            }
            return xmlhttp;
          },
    //=========================================================================
    // Ajax :: Method 1, Send Data to Server
    //=========================================================================    
    SendDataToServer : function (sCtrID,sUrl,sMethod,sQry){
                clientCtr = sCtrID;
                xmlhttp = Vnvn_wma_Image_26.Ajax();
                if(xmlhttp){
                    xmlhttp.open(sMethod,sUrl,true);
                    xmlhttp.onreadystatechange = Vnvn_wma_Image_26.ProcessAjax;
                    xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
                    xmlhttp.send(sQry);            
                }else{
                    alert('Browser do not support Ajax!');
                }
            },
          
            
    //=========================================================================
    // Ajax :: Process
    //=========================================================================
    ProcessAjax : function ()
            {   
               Vnvn_wma_Image_26.OnPleaseWait(clientCtr);
                if(xmlhttp.readyState == 4 && xmlhttp.status == 200)
                {
                                
                    var sReply = xmlhttp.responseText;
                    var theDvContent = Vnvn_wma_Image_26.findTheDivByID(clientCtr);
                    try{
                        theDvContent.innerHTML = sReply;            
                    }catch(ex){}
                }        
            },  
           
    //=========================================================================
    // Ajax :: Method 2, Send Data to Server
    //=========================================================================    
    SendToServer : function (sFun,sUrl,sMethod,sQry){                
                xmlhttp = Vnvn_wma_Image_26.Ajax();
                if(xmlhttp){
                    xmlhttp.open(sMethod,sUrl,true);
                    xmlhttp.onreadystatechange = sFun;
                    xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
                    xmlhttp.send(sQry);            
                }else{
                    alert('Browser do not support Ajax!');
                }
            },
    //=========================================================================
    // Ajax :: On Please wait 
    //=========================================================================
       OnPleaseWait : function(clientCtr)
       {    
                var ctr =Vnvn_wma_Image_26.findTheDivByID(clientCtr);               
                ctr.innerHTML = "Loading...";
       },            

    
    //================================================================
    // Find Div
    //================================================================
    findTheDivByID: function(sID)
                {
                    
                    if(window.document.all)
                    {
                        theDv = window.document.all[sID];
                    }
                    else if(document.layers)
                        {
                          theDv = document.layers[sID];
                        }
                        else if(document.getElementById)
                              {
                                 theDv = document.getElementById(sID);        
                              }
                              else
                              {
                                 alert('Browser do not support Div');
                              }
                    return theDv;
                },



    //================================================================
    // LargeImage
    //================================================================
 
     NextLargeImage: function() // su dung de cho button "Next"  o trang view LargeImg ( file hinh  co property Eextra Largeimage) 
     {      
           var divactive;
           var divnext;
           var count=Vnvn_wma_Image_26.findTheDivByID('arrayImg').attributes['count'].value;
           if(count>28){count=28; }
           var ar=Array(count);  
           for(var i=1;i<=count;i++)
           {
            ar[i-1]="Image"+i;
           }
           for(var j=0;j<count;j++) 
           {
               divactive=Vnvn_wma_Image_26.findTheDivByID(ar[j]);
               if(divactive.className=="Css_LargImage")
               {
                     if(j==ar.length-1)   
                    {
                        divactive.className="Css_LargImageInvisible";
                        divnext=Vnvn_wma_Image_26.findTheDivByID(ar[0]); 
                        divnext.className="Css_LargImage";  
                        Vnvn_wma_Image_26.findTheDivByID("ImageCenter").src=divnext.attributes['lbl_Variable'].value;
                        break;
                    }
                    else
                    {
                        divactive.className="Css_LargImageInvisible";
                        divnext=Vnvn_wma_Image_26.findTheDivByID(ar[j+1]); 
                        divnext.className="Css_LargImage";
                        Vnvn_wma_Image_26.findTheDivByID("ImageCenter").src=divnext.attributes['lbl_Variable'].value;                                 
                        break;
                    }
               } 
           }
     },
     BackLargeImage: function() // su dung de cho button  "Back" o trang view LargeImg ( file hinh  co property Eextra Largeimage) 
     {      
           var divactive;
           var divnext;
           var count=Vnvn_wma_Image_26.findTheDivByID('arrayImg').attributes['count'].value;
           if(count>28){count=28; }
           var ar=Array(count);  
           for(var i=1;i<=count;i++)
           {
             ar[i-1]="Image"+i;
           }
           for(var j=0;j<count;j++) 
           {
               divactive=Vnvn_wma_Image_26.findTheDivByID(ar[j]);
               if(divactive.className=="Css_LargImage")
               {
                    if(j==0)   
                     {
                        divactive.className="Css_LargImageInvisible";
                        divnext=Vnvn_wma_Image_26.findTheDivByID(ar[ar.length-1]);
                        divnext.className="Css_LargImage";
                        Vnvn_wma_Image_26.findTheDivByID("ImageCenter").src=divnext.attributes['lbl_Variable'].value;                
                        break;
                    }
                    else
                    {
                        divactive.className="Css_LargImageInvisible";
                        divnext=Vnvn_wma_Image_26.findTheDivByID(ar[j-1]);
                        divnext.className="Css_LargImage";
                        Vnvn_wma_Image_26.findTheDivByID("ImageCenter").src=divnext.attributes['lbl_Variable'].value;                              
                        break;
                    }
               } 
           }
     },
     ClickViewImg: function(img_id) // su dung cho su kien onmouse len cac samll image de thay doi mau va view  Extralargeimage len
     {  
        var count=Vnvn_wma_Image_26.findTheDivByID('arrayImg').attributes['count'].value;
        var divactive;
        if(count>28){count=28; }
        var ar=Array(count);  
               for(var i=1;i<=count;i++)
               {
                ar[i-1]="Image"+i;
               }
            for(var j=0;j<count;j++) 
               {
                   divactive=Vnvn_wma_Image_26.findTheDivByID(ar[j]);
                   s=Vnvn_wma_Image_26.findTheDivByID(img_id).attributes['lbl_Variable'].value
                   
                   if(divactive.className=="Css_LargImage"&&divactive.id!=img_id)
                   {
                        Vnvn_wma_Image_26.findTheDivByID("ImageCenter").src=s; 
                        Vnvn_wma_Image_26.findTheDivByID(img_id).className="Css_LargImage";
                        divactive.className="Css_LargImageInvisible";
                        break;
                   }
                }   
     },

         NextImages: function()//su dung cho nut Next o tab Gallery (cung la Large Image nhung o page khac) moi lan thuc thi se thay doi 7 image
         {
           var count=Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_arrayImg').attributes['count'].value;
           var arr=Array(count);
           var Exar=Array(count);    
           for(var i=0;i<count;i++)
           { 
             arr[i]=Vnvn_wma_Image_26.CutString(Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_arrayImg').attributes["Simg"+i].value);
             Exar[i]=Vnvn_wma_Image_26.CutString(Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_arrayImg').attributes["Eximg"+i].value);
           }
           
            var temp=Vnvn_wma_Image_26.ArImgNext(Vnvn_wma_Image_26.GetIndexEndImg());
            var arind=new Array();
            arind=temp.split('/'); 
            for(var i=0;i<7;i++)          
            {    
                Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_Image'+i).src=arr[arind[i]];  
                Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_Image'+i).attributes['lbl_Variable'].value=Exar[arind[i]]; 
            }
            Vnvn_wma_Image_26.OnmouseImg('usc_ViewLargeImage_26_A4_004_Image0');
            Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_ImageCenter').src=Exar[arind[0]]; 
         },
         BackImages: function()//su dung cho nut Back o tab Gallery (cung la Large Image nhung o page khac) moi lan thuc thi se thay doi 7 image
         {
           var count=Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_arrayImg').attributes['count'].value;
           var arr=Array(count);
           var Exar=Array(count);    
           for(var i=0;i<count;i++)
           { 
             arr[i]=Vnvn_wma_Image_26.CutString(Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_arrayImg').attributes["Simg"+i].value);
             Exar[i]=Vnvn_wma_Image_26.CutString(Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_arrayImg').attributes["Eximg"+i].value);
           }
           
            var temp=Vnvn_wma_Image_26.ArImgBack(Vnvn_wma_Image_26.GetIndexStartImg());
            var arind=new Array();
            arind=temp.split('/'); 
            dem=6;
            for(var i=0;i<7;i++)          
            {
               Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_Image'+i).src=arr[arind[dem]];  
               Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_Image'+i).attributes['lbl_Variable'].value=Exar[arind[dem]]; 
               dem--;
            }
            Vnvn_wma_Image_26.OnmouseImg('usc_ViewLargeImage_26_A4_004_Image6');
            Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_ImageCenter').src=Exar[arind[0]]; 
         
         },
         ArImgNext : function(ind)// phat sinh mot day so chua cac vi tri moi cho tam anh khi nhan nut Next 
         {
            var count=Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_arrayImg').attributes['count'].value;
            var str="";
            var t=0;
            var dem=ind+1;
            for(var i=0;i<7;i++)
            {   
                if(dem<count)
                {
                  str+=dem+"/";
                  dem++
                }
                else 
                {  if(i==6)
                   {
                      str+=t;
                      t++;
                        
                   }
                   else 
                   {
                      str+=t+"/";
                      t++;
                   }
                }   
            }
            return str;
         },
         ArImgBack : function(ind) // phat sinh mot day so chua cac vi tri moi cho tam anh khi nhan nut Next 
         {
            var count=Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_arrayImg').attributes['count'].value;
            var str="";
            var t=count-1;
            var dem=ind-1;
            for(var i=0;i<7;i++)
            {   
                if(dem>=0)
                {
                  str+=dem+"/";
                  dem--
                }
                else 
                {  if(i==6)
                   {
                      str+=t;
                      t--;
                        
                   }
                   else 
                   {
                      str+=t+"/";
                      t--;
                   }
                }   
            }
            return str;
         },
         GetIndexEndImg :function()// lay vi tri cuoi cung trong mot day 7 tam anh
         {
           var count=Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_arrayImg').attributes['count'].value;
           for(var i=0;i<count;i++)
           {  
             t1=Vnvn_wma_Image_26.CutStringend(Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_arrayImg').attributes["Simg"+i].value);
             t2=Vnvn_wma_Image_26.CutStringend(Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_Image6').src);
             if(t1==t2)
             {
                   return i;
             }
           }
         },
         GetIndexStartImg :function() // lay vi tri dau tien trong mot day 7 tam anh
         {
           var count=Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_arrayImg').attributes['count'].value;
           for(var i=0;i<count;i++)
           {  
             t1=Vnvn_wma_Image_26.CutStringend(Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_arrayImg').attributes["Simg"+i].value);
             t2=Vnvn_wma_Image_26.CutStringend(Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_Image0').src);
             if(t1==t2)
             {
                   return i;
             }
           }
         },
         
        CutStringend: function(str) //lay phan tu cuoi cung trong array (tuc la Phan tu chi chua ten file khong bao gom cac thu muc khac)
         {
                var path="";
                var ar=new Array();
                ar=str.split('/');
                path=ar[ar.length-1];
                return path;
        },
        OnmouseImg: function(img) //su kien on mouse tren tranf Gallery (view Large Image)
        {
            var count=Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_arrayImg').attributes['count'].value;
            var leght=7;
            if(count<=7)
            {
                leght= count;
            }
            for(var j=0;j<leght;j++) 
           {
               divactive=Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_Image'+j);
               s=Vnvn_wma_Image_26.findTheDivByID(img).attributes['lbl_Variable'].value
               
               if(divactive.className=="Css_LargImage"&&divactive.id!=img)
               {
                    Vnvn_wma_Image_26.findTheDivByID('usc_ViewLargeImage_26_A4_004_ImageCenter').src=s; 
                    Vnvn_wma_Image_26.findTheDivByID(img).className="Css_LargImage";
                    divactive.className="Css_LargImageInvisible";
                    break;
               }
            }   
        },
        
        
    _KeepImg : null,
    ClickViewImgLarge: function(img_id,arrImg) // su dung cho su kien onmouse len cac samll image de thay doi mau va view  Extralargeimage len
     {  
        if (this._KeepImg)
             this._KeepImg.style.border = "solid 1px #000";
        this._KeepImg = Vnvn_wma_Image_26.findTheDivByID(img_id);
        this._KeepImg.style.border = "solid 3px red";
        
        var s;
        var obj = Vnvn_wma_Image_26.findTheDivByID(img_id);
        s =  (obj.lbl_Variable || obj.attributes.getNamedItem('lbl_Variable').value);
        Vnvn_wma_Image_26.findTheDivByID("ibt_MediumImage_A5_005").src=s; 
     },
     _Position : 0,   
     GetImageFromArr: function(arrSmall,arrLarge,DefaultCount,Dvid)
     {
        var pnl = Vnvn_wma_Image_26.findTheDivByID(Dvid);
        pnl.innerHTML = "";
        var arrSimg = arrSmall.split(',');
        var arrLimg = arrLarge.split(',');
        var div = document.createElement("div");
        div.style.marginTop = "25px";
        for(var i = this._Position ;i< this._Position + DefaultCount ; i++)
        {
            var img = document.createElement("img");
            img.style.marginRight = "8px";
            img.style.border = "solid 1px #000" ;
            img.id = "Image" + i;
            img.lbl_Variable = arrLimg[i].replace('~/','../');
            img.src = arrSimg[i].replace('~/','');
            img.onclick = this.ClickViewImgLarge.bind(null,img.id,arrSimg.length);
            div.appendChild(img);
            
        }
        pnl.appendChild(div);
       
       
     },
    
     ClickNextImgSmall: function(arrSmall,arrLarge,DefaultCount,Dvid)
     {
        var arrSimg = arrSmall.split(',');
        if(this._Position >= arrSimg.length - DefaultCount - 1) return false;
        this._Position = this._Position + 1;
        this.GetImageFromArr(arrSmall,arrLarge,DefaultCount,Dvid);
        return false;
     },
      ClickBackImgSmall: function (arrSmall,arrLarge,DefaultCount,Dvid)
     {
        if(this._Position <= 0) return false;
        this._Position = this._Position -1;
        this.GetImageFromArr(arrSmall,arrLarge,DefaultCount,Dvid,false);
        return false;
     },   
     embedPlayer2: function (MP3URL,div2,i) 
    { 
        // Get Operating System sQry
        var isWin = navigator.userAgent.toLowerCase().indexOf("windows") != -1;
        if (isWin) { // Use MIME type application/x-mplayer2
          visitorOS="Windows";
        } else { // Use MIME type audio/mpeg, audio/x-wav, etc.
          visitorOS="Other";
        } 
           var ctr1 = Vnvn_wma_Image_26.findTheDivByID(div2);
           var sUrl = Vnvn_wma_Image_26.CutString(MP3URL) + i ;
           sUrl = "/" + sUrl;
           ctr1.innerHTML ="<embed width=\"157px\" height='160px' bgcolor='#FF0' flashvars=\"AudioUrl=" + sUrl +"&page=PlayFlash.aspx\" scale='noscale' quality='high'  name=\"MP\" id=\"MP\" src=\"VNVN_Swf/SendData.swf\" type=\"application/x-shockwave-flash\"></embed>";
       
    }

       
}
Function.prototype.bind = function(){    
    
    var method = this;//this la function truyen vao
    
    if(arguments.length < 2 && arguments[0] === undefined)
        return this;
    //arguments nay chi read ,ko co cac phuong thuc nhu 1 mang binh thuong ma ta khai bao de su dung 
        
    var args = [];
    for(i=0;i<arguments.length; i++)
    {
        args.push(arguments[i]);
    }
    var object = args.shift();//shift lay ra fan tu dau tien cua mang.  
    return function(){
        return method.apply(object,args);//truyen args cho method
    };   

}

//////////////////////////////////////////////////////////////////////////////////
// 
// End Vnvn_wma_Image_26
// 
//////////////////////////////////////////////////////////////////////////////////
