// JavaScript Document



function imgclick( obj, id , src )
{

	//var pop =  new PopBg( document.body );
	//	pop.setDisplay( true );
	
	
	var loading = new PopFrame( document.body, function()
	{
		return true;
	}  ,  "box_ro"  );

	
	loading.midcell.style.backgroundColor = "#FFF";
	loading.midcell.style.color = "#333";		
	loading.setSize(60	, 60);
	loading.popbg.setDisplay( false );
	loading.setDisplay( true );
	loading.frame.closeButton.thebody.style.display = "none";
	
	var loadingimg = document.createElement("img");
		loading.appendChild( loadingimg );
		loadingimg.src = IMG_DIR+"syc_or_gr.gif";
	
	loading.setDisplay( true );

	
	

	var pop = new PopFrame( document.body, function()
	{
		return true;
	}  ,  "box_ro"  );
	
	pop.midcell.style.backgroundColor = "#FFF";
	pop.midcell.style.color = "#333";		
	pop.setSize(800,600);
	pop.popbg.setDisplay(true);
	//pop.setDisplay( true );
	pop.frame.closeButton.thebody.style.display = "none";
	//alert( pop.frame.closeButton.thebody.tagName );
	
	var linkDiv = document.createElement("div");
	pop.appendChild( linkDiv );
		linkDiv.style.width = "100%";
		linkDiv.align = "left";
		linkDiv.style.paddingBottom = "10px";
	
	
	this.closeButton = new imgButton( linkDiv, linkDiv, IMG_DIR+"close.gif" , "Close", function( event, obj )
	{
		pop.hide();
	} );	
	

	
	var img = document.createElement("img");
		pop.appendChild( img );
		img.style.visibility = "hidden";
		
		img.onload = function()
		{
			pop.setSize( this.offsetWidth,this.offsetHeight );
			
			loading.hide();
			
			if( document.all )
			{
				img.style.visibility = "visible";
				pop.setDisplay( true );
			}
			else
			{
				setOpacity( pop.thebody , 0 );
				img.style.visibility = "visible";
							
				pop.setDisplay( true );
				
				var runner = new transform(
					function( intv ){
						setOpacity( pop.thebody , intv );								
					} , 
					function(){
						setOpacity( pop.thebody , 100 );
					} , 20,  100 );
				runner.run();
			}
		}
				
		img.src = "../img/photos/"+src;

	var link = document.createElement("div");
		pop.appendChild( link );
		link.style.padding = "5px";
		link.innerHTML = "<a class='cotext' href='http://www.jiaart.net/img/photos/"+src+"' >http://www.jiaart.net/img/photos/"+src+"</a>";





}