
	function toggle(id) {	 
		if(document.getElementById(id).style.display=='block')
			{
			document.getElementById(id).style.display='none';
			document.getElementById(id).style.visibility='hidden';
			
			
			}
		else 
			{
			document.getElementById(id).style.display='block';
			document.getElementById(id).style.visibility='visible';
			
			
			}
	}
	
function changeFolder(id) {

if (document.getElementById(id).src == 'http://www.smithoptics.com/imagery/images/foldClosed.gif'){
	document.getElementById(id).src = 'http://www.smithoptics.com/imagery/images/foldOpen.gif';
	}else{
	document.getElementById(id).src = 'http://www.smithoptics.com/imagery/images/foldClosed.gif';
	}
}	
	
	
	function changeimg(id) {

if (document.getElementById(id).src == 'http://www.smithoptics.com/imagery/images/show.jpg'){
	document.getElementById(id).src = 'http://www.smithoptics.com/imagery/images/hide.jpg';
	}else{
	document.getElementById(id).src = 'http://www.smithoptics.com/imagery/images/show.jpg';
	}
}
function fileDownload(file,w,h,p){
	window.open(file,'Download');  
}
	
	
	
// ONload realod page
function reloadPage()
{
window.location.reload();
} 

function showQueue() { 
var queueInfo = "<a href='results.php'>Download Queue</a>"
document.getElementById('queue').innerHTML = queueInfo;
}

//ADD PRODUCT TO DOWNLOAD QUEUE

// get return data
function handleHttpResponse() { 
if (http.readyState) { 
var postinfo = http.responseText
document.getElementById('returnpostinfo').innerHTML = postinfo;
} 
}

function handleHttpResponseRemove() { 
if (http.readyState) { 
var removeditem = http.responseText
document.getElementById('listupdate').innerHTML = removeditem;
} 
}

//var getpage = "inc/process_add.php?param="; // The server-side script 
function removeproductqueue(value) {
var getpage = "inc/process.php?param=";
var productid = value
http.open("GET", getpage + productid, true); 
http.onreadystatechange = handleHttpResponseRemove; http.send(null);
}


// add products to addqu session array
function updateproductqueue(value,checkstat) {

if (checkstat==true) {
var getpage = "inc/process_add.php?param=";
}else{
var getpage = "inc/process_delete.php?param=";
}
var addqu = value
http.open("GET", getpage + addqu, true); 
http.onreadystatechange = handleHttpResponse; http.send(null);
}




function getHTTPObject() { 
var xmlhttp; 
/*@cc_on @if (@_jscript_version >= 5) try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } 
catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } 
catch (E) { xmlhttp = false; } } @else xmlhttp = false; @end @*/  
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { 
try { xmlhttp = new XMLHttpRequest(); 
} catch (e) { 
xmlhttp = false; 
} 
} 
return xmlhttp; 
} 
var http = getHTTPObject(); // We create the HTTP Object 