// JavaScript Document

function showItem(obj){ 
    if(document.getElementById){
    var el = document.getElementById(obj);
    el.style.display = "block";
    }
}

function hideItem(obj){ 
    if(document.getElementById){
    var el = document.getElementById(obj);
    el.style.display = "none";
    }
}
function simplePreload(){ 
    var args = simplePreload.arguments;
    document.imageArray = new Array(args.length);
    for(var i=0; i<args.length; i++){
        document.imageArray[i] = new Image;
        document.imageArray[i].src = args[i];
    }
}
function switchImage(imgName, imgSrc){
    if (document.images){
        if (imgSrc != "none"){
            document.images[imgName].src = imgSrc;
        }
    }
}

//pop window for conferences
function PopoffWindow(URL, orient) {
	var ItsTheWindow;
	if (orient == "Horizontal") {
		ItsTheWindow = window.open(URL,"kitty","status=no,height=300,width=560,scrollbars=yes,resizable=no,toolbar=0");
	} else if (orient == "Vertical") {
		ItsTheWindow = window.open(URL,"kitty","status=no,height=300,width=560,scrollbars=yes,resizable=no,toolbar=0");
	}
}

/*
addPrintLink function by Roger Johansson, www.456bereastreet.com
*/
var addPrintLink = {
	init:function(sTargetEl,sLinkText) {
		if (!document.getElementById || !document.createTextNode) {return;} // Check for DOM support
		if (!document.getElementById(sTargetEl)) {return;} // Check that the target element actually exists
		if (!window.print) {return;} // Check that the browser supports window.print
		var oTarget = document.getElementById(sTargetEl);
		var oLink = document.createElement('a');
		oLink.id = 'print-link'; // Give the link an id to allow styling
		oLink.href = '#'; // Make the link focusable for keyboard users
		oLink.appendChild(document.createTextNode(sLinkText));
		oLink.onclick = function() {window.print(); return false;} // Return false prevents the browser from following the link and jumping to the top of the page after printing
		oTarget.appendChild(oLink);
	},
/*
addEvent function included here for portability. Replace with your own addEvent function if you use one.
*/
/* addEvent function from http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html */
	addEvent:function(obj, type, fn) {
		if (obj.addEventListener)
			obj.addEventListener(type, fn, false);
		else if (obj.attachEvent) {
			obj["e"+type+fn] = fn;
			obj[type+fn] = function() {obj["e"+type+fn](window.event);}
			obj.attachEvent("on"+type, obj[type+fn]);
		}
	}
};
addPrintLink.addEvent(window, 'load', function(){addPrintLink.init('uts-print','Print');});


//jumpmenu function
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


function chkcontrol(j){
	var total=0;
	var podcastStr = "**";
	for(var i=0; i < document.submittingform.podcast.length; i++){
		if(document.submittingform.podcast[i].checked){
			total = total +1;
			podcastStr += document.submittingform.podcast[i].value + "**";
			}
			if(total > 2){
				alert("Please Select only 2");
				document.submittingform.podcast[j].checked = false ;
				return false;
			}else{	
					document.submittingform.podcastStr.value = podcastStr;
					}
		
			
	}
} 		


