var jcount ;
var jgrow=1 ;
var jtime ;
var jtime2 ;
var jtarget ;
var joldtarget ;
var jtoldtarget ;
var jopen=0 ;
var jtop ;
var jmtop ;
var jmtop2 ;
var jmheight ;
var jmheight2 ;
var joldtop ;
var jsw ;
var jyplus ;
var jyminus ;

function j_load()
	{
	if(navigator.appName.indexOf("Microsoft")!=-1)
		{
		ww=document.body.offsetWidth-20 ;
		wh=document.body.offsetHeight-20 ;
		}
	else
		{
		ww=window.innerWidth ;
		wh=window.innerHeight ;
		}
	sw=(ww-777)/2+100 ;
	document.getElementById('pic1').style.left=sw ;
	document.getElementById('pic2').style.left=sw ;
	document.getElementById('pic1_lg').style.left=sw ;
	document.getElementById('pic2_lg').style.left=sw ;
	jsw=sw ;
	}

function j_zoom()
	{
	//Some javascript
	}
	
function test()
	{
	jcount = 0;
	var cont = document.getElementById('j_cont') ;
	if(!cont.style.height) cont.style.height = 350 ;	
	jtime = window.setTimeout("loopone()", 10) ;
	}
	
function loopone()
	{
	var cont = document.getElementById('j_cont') ;
	if(jgrow==1) cont.style.height = parseInt(cont.style.height) + 1 ;
	else cont.style.height = parseInt(cont.style.height) - 1 ;	
	jcount +=1 ;
	jtime = window.setTimeout("loopone()", 10) ;
	if(jcount==50)
		{
		if(jgrow==1) jgrow=0 ;
		else jgrow=1 ;	
		clearTimeout(jtime) ;
		}
	}
	
	
function test2(lg_target, lg_top)
	{
	jtarget=lg_target ;
	jtop=lg_top ;
	if(jopen==1)
		{
		jtoldtarget=joldtarget ;
		var old = document.getElementById(jtoldtarget) ;
		old.style.zIndex=2 ;
		//Work out increments...
		jyminus=(joldtop-100)/(150/4) ;
		jmtop2=parseInt(old.style.top) ;
		jmheight2=parseInt(old.style.height) ;
		jtime2 = window.setTimeout("loopshrink()",10) ;
		}
	if(jopen==0||jtarget!=joldtarget)
		{
		var cont = document.getElementById(jtarget) ;
		cont.style.display = 'block' ;
		cont.style.zIndex=3 ;
		if(!cont.style.left) cont.style.left = 250 ;	
		if(!cont.style.top) cont.style.top = jtop ;	
		if(!cont.style.height) cont.style.height = 80 ;	
		if(!cont.style.width) cont.style.width = 100 ;	
		//Work out increments...
		jyplus=(parseInt(cont.style.top)-100)/(150/4) ;
		jmtop=parseInt(cont.style.top) ;
		jmheight=parseInt(cont.style.height) ;
		jtime = window.setTimeout("loopgrow()", 10) ;
		}
	else jopen=0 ;
	}
	
function loopgrow()
	{
	var cont = document.getElementById(jtarget) ;
	var jct = parseInt(cont.style.top) ;
	var jcl = parseInt(cont.style.left) ;
	if(jct>100||jcl<(jsw+150))
		{
		cont.style.left = parseInt(cont.style.left) + 4 ;
		jmtop-=jyplus ;
		jmheight+=5.58 ;
		cont.style.top = jmtop ;
		if(parseInt(cont.style.width)<430) cont.style.width = parseInt(cont.style.width) + 8 ;
		cont.style.height = jmheight ;
		jtime = window.setTimeout("loopgrow()", 10) ;
		}
	else
		{
		jopen=1 ;
		joldtarget=jtarget ;
		joldtop=jtop ;
		clearTimeout(jtime) ;
		//alert(jct+"-"+jcl+"-"+jsw+"-"+jyplus+"-"+jcount) ;
		}			
	}

function loopshrink()
	{
	var old = document.getElementById(jtoldtarget) ;
	var jct = parseInt(old.style.top) ;
	var jcl = parseInt(old.style.left) ;
	if(jct<joldtop||jcl>jsw)
		{
		old.style.left = parseInt(old.style.left) - 4 ;
		jmtop2+=jyminus ;
		jmheight2-=5.58 ;
		old.style.top = jmtop2 ;
		if(parseInt(old.style.width)>100) old.style.width = parseInt(old.style.width) - 8 ;
		if(parseInt(old.style.height)>80) old.style.height = jmheight2 ;
		jtime2 = window.setTimeout("loopshrink()", 10) ;
		}
	else
		{
		old.style.display='none' ;
		old.style.left=jsw ;
		clearTimeout(jtime2) ;
		}			
	}
