function flip(id)
{
	console.log(id);
	
	var ans = new Array("one","two","thr","for");
	
	for ( i = 0; i < ans.length; i++)
	{
		if(document.getElementById(ans[i]).style.visibility == "visible")
		{
			
			document.getElementById(ans[i]).style.visibility = "hidden";
			document.getElementById(ans[i]).style.height = 0;
		}
		
	}
	
	changeHeight(id);
}

function changeHeight(id){
	var elm = document.getElementById(id);
	elm.style.visibility = "visible";
	var height  =  parseInt(elm.style.height);
	 var change = 100-height;
	 var total=height+Math.ceil((change/12));
	 elm.style.height=total+'px';
	 function c() {
		   changeHeight(id);
		   console.log(total);
	 }
	 if(change==0) {
	  clearTimeout(timer);
	  return;
	 }
	 timer=setTimeout(c,10);
	}

function setClass(id,n,s){
	var ans;
	switch(n)
	{
		case 1:
			ans = new Array("a1","a2","a3","a4","a5","a6");
			break;
		
		case 2:
			ans = new Array("s1","s2","s3","s4","s5");
			break;
			
		case 3:
			ans = new Array("i1","i2","i3","i4");
			break;
			
		case 4:
			ans = new Array("r1","r2","r3","r4","r5","r6");
			break;
		
		case 5:
			ans = new Array("u1","u2","u3");
			break;
		
		case 6:
			ans = new Array("c1","c2","c3");
			break;
		
	}
		for ( i = 0; i < ans.length; i++)
		{
			document.getElementById(ans[i]).className = "not";
		}
		
	var it = document.getElementById(id);
	it.className = "cur";
	console.log(id);
	
	if(s>0){
		
		var ld = "<div style='height:20px;margin:220px 0 0 0;' align='center'>" +
				"<img src=\"/images/loading.gif\">" +
				"<br/><br/>Loading: A moment please.." +
				"</div>";
		var add;
		
		var add = '/store/content/wh/' + id;
		dojo.byId("sub").innerHTML= ld;
		dojo.xhrGet(
		{
			url: add,
			timeout: 5000,
			load: function(response) 
			{
				console.log(response);
				dojo.byId('sub').innerHTML = response;
			},
			error: function()
			{
				dojo.byId('sub').innerHTML = "<font color='red'>There was an error</font>";
			}
		});
	}
}

function locat(url)
{
	switch(url)
	{
		case 'q':
			window.location="/index/quote";
			break;
			
		case 'c':
			window.location="/index/contact";
			break;
	}
}



