// JScript File
   var t;
   var isNeck = false;
   var mWidth=50;
   var mHeight=50;
   var radio = 7;
   
  function resetPreview()
  {
       if(t != null)
       {
	    //Event.unloadCache();
	      
            t.previewImg.src = document.getElementById("abigimg").href;

            t.reset();
        }
      // alert(document.getElementById("previewArea").outerHTML);
        //imgPreview.previewImg.src = "../Common/ProImgbyCode.aspx?ProductCode=" + document.getElementById("Ori_ProductCode").value + "&PicType="+ document.getElementById("Ori_showType").value;
       //document.getElementById("previewArea").innerHTML = "<img src=\"../Common/ProImgbyCode.aspx?ProductCode=" + document.getElementById("Ori_ProductCode").value + "&PicType="+ document.getElementById("Ori_showType").value + "\" id=\"imgCrop_testImage\"  style=\"width:775px;height:775px;left:-425px;top:0px\"\>";
    
  }
  
 function createPreview() {  
        if(t == null)
        {
            //document.getElementById("previewArea").className = "previewArea";
            //document.getElementById("previewArea").style.position = "absolute";
            var s_img=document.getElementById("abigimg").href;
            
            
            t = new Cropper.ImgWithPreview( 
                    'testImage', 
                    { 
                    	
	                    radio: radio,
	                    minWidth: mWidth, 
	                    minHeight: mHeight,
	                    maxWidth:mWidth,
	                    maxHeight: mHeight,
	                    previewWrap: 'previewArea',
	                    previewSrc: s_img
                    } 
                ); 
           
           if(!document.body.attachEvent)
           {
                setPreviewWrapPos();
                t.reset();   
           }
       }
	  
	} 
// example with a preview of crop results, must have minimumm dimensions
	function observe_pic()
	{
	  
	   Event.observe(
	        window,'load',createPreview
	   );
	  
	 
		Event.observe( 
			document.getElementById("testImage"), 
			'mouseover', createPreview
		);
		
		
	}
	
	
	
    function setPreviewWrapPos()
    {
    	 var previewArea=document.getElementById("previewArea")
       
       previewArea.style.width="350px";
       previewArea.style.height="350px";
       previewArea.style.top ="150px";// ptop + "px";
       //previewArea.style.left ="500px";// pleft + "px";
        
    }
    
   