function setRadioValue(theObj,theObjValue) {
	for (var i=0; i<theObj.length; i++) {
		if (theObj[i].value==theObjValue) { 
		theObj[i].checked = true;
		}
	}
	checkOrder(document.order_info);
}

$(document).ready(function(){
					//Initalize
					numShots=parseInt(2);
					currentShot=1;
					ext="{screenshot_ext}";
					var arr_screenshots=new Array();
					arr_screenshots[0]="{screenshot1}";
					arr_screenshots[1]="{screenshot2}";
					
					var arr_screenshotsTB=new Array();
					arr_screenshotsTB[0]="{screenshotTB1}";
					arr_screenshotsTB[1]="{screenshotTB2}";
					
					$('#system_requirements').hide();
					
					function updateCount() {
						$("#prevnext").find("span").empty();
						$("#prevnext").find("span").append(currentShot + " / " + numShots);
					}
					updateCount();

					function setImgPath() {
						smallPath=arr_screenshotsTB[currentShot-1];
						largePath=arr_screenshots[currentShot-1];
					}
			
					preSmall = new Array();
					for(i=1;i<numShots+1;i++) {
						this["smallLoad"+i] = new Image();
						this["smallLoad"+i].src = arr_screenshotsTB[currentShot-1];
						this["largeLoad"+i] = new Image();
						this["largeLoad"+i].src = arr_screenshots[currentShot-1];
					}
				
					function changeShot(num){
						currentShot+=num;
						if(currentShot>numShots) {
							currentShot=currentShot-numShots;
						} else if(currentShot<1) {
							currentShot=numShots+currentShot;
						}
						setImgPath();
						$("#screen_shot").attr("src",smallPath);
						$("#screen_shot_large").attr("src",largePath);
						updateCount();
					}

					$("#prev").click( function() { 
						changeShot(-1);
					} );
					$("#next").click( function() { 
						changeShot(1);
					} );
					$("#prevlrg").click( function() { 
						changeShot(-1);
					} );
					$("#nextlrg").click( function() { 
						changeShot(1);
					} );
	
					$("#screenshotLG").click(function(){
						content_height = $('#content').height();
						$('#screenshots_overlay').height(content_height); 
						$('#screenshots_overlay').show();
						$('#outer_container').show(); 
						$('#outer_container').children().show();
						$('#outer_container').children().children().show();
						$('#outer_container').children().children().children('a').show();
					})
					$("#screenshotMG").click(function(){
						content_height = $('#content').height();
						$('#screenshots_overlay').height(content_height); 
						$('#screenshots_overlay').show();
						$('#outer_container').show(); 
						$('#outer_container').children().show();
						$('#outer_container').children().children().show();
						$('#outer_container').children().children().children('a').show();
					})
					function closeLarge() {
						$('#outer_container').hide();
						$('#screenshots_overlay').hide();
					}
					$("#close_screenshots_lg").click(function(){
						closeLarge();
					});
					jQuery(document).keypress(function(ev) {
						if (ev.which == 27) {
							closeLarge();
						};
					});

					system_req_link_click = true;
					$("#system_req_link").click(function(){
						if (system_req_link_click == true) {
							$('#system_requirements').show();
							system_req_link_click = false;
						} else {
							$('#system_requirements').hide();
							system_req_link_click = true;
						}
					})

				});