
function switchimg(callingelement,divname,url)
{
    var element = document.getElementById(divname);
		var newurl = url+'displayimg.php?img='+callingelement.value;
		element.innerHTML = '<object id="moreinfoimages" name="moreinfoimages" type="text/html" data="'+newurl+'"><\/object>';
}

function togglebg(callingelement) {
	var obj = callingelement.parentNode;
	for(var i = 0; i < obj.childNodes.length; i++) {
		if(obj.childNodes[i].className == "radiolabel" || obj.childNodes[i].className == "radiolabelinit") {
			if(obj.childNodes[i] == callingelement) {
				callingelement.style.color="white";
				callingelement.style.background="#20558A";
			}
			else {
				obj.childNodes[i].style.background="white";
				obj.childNodes[i].style.color="#20558A";
			}
		}
	}
}

function readyfun() {
	 $(document).ready(function() {
		 $("#featimg").load("featimg.php");
		 $("#feattext").load("feattext.php");
	   var refreshId = setInterval(function() {
	      $("#featimg").load('featimg.php');
	      $("#feattext").load('feattext.php');
	   }, 9000);
	   $.ajaxSetup({ cache: false });
	});
}

function readyfun2() {
	 $(document).ready(function(partno) {
		 $("#feattext").load("feattext.php?partno="+partno);
	   var refreshId = setInterval(function() {
	      $("#feattext").load('feattext.php?partno='+partno);
	   }, 9000);
	   $.ajaxSetup({ cache: false });
	});
}

/*function popwin(theURL, Name, popW, popH) { // V 1.0
	var winleft = (screen.width - popW) / 2;
	var winUp = (screen.height - popH) / 2;
	winProp = 'width='+popW+',height='+popH+',left='+winleft+',t op='+winUp+',scrollbars=yes'
		Win = window.open(theURL, Name, winProp)
		if (parseInt(navigator.appVersion) >= 4){
			Win.window.focus();
		}
}*/


$(document).ready(function(){
	//Examples of how to assign the ColorBox event to elements
	$(".colldesc").colorbox({width:"85%", height:"80%", iframe:true, transistion:"fade"});
	$(".moreinfo").colorbox({width:"90%", height:"80%", iframe:true, transistion:"fade"});
	$("a[rel='cb-pics']").colorbox({transition:"fade"});  
	//Example of preserving a JavaScript event for inline calls.
	$("#click").click(function(){ 
		$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
		return false;
	});
});


