// Function that support the site

// Tab Control
function tc(str){
	//Create Array
	var string = str;
	var pattern = /,/;
	thearray = string.split(pattern);
	//Show Div
	document.getElementById(thearray[0]).style.display = "";
	document.getElementById("tab"+thearray[0]).style.background = "#ebebeb";
	//Close Divs
	for(i=1; i<thearray.length;i++){
	document.getElementById(thearray[i]).style.display = "none";
	document.getElementById("tab"+thearray[i]).style.background = "";
	}
}

//Page Start
function page_start(sect,howmany){	
		if ((sect == "t01")||(sect == "t02")||(sect == "t03")||(sect == "t04")||(sect == "t05")||(sect == "t06")){
			for(i=1; i < howmany; i++){
			document.getElementById("t0" + i).style.display = "none";
			document.getElementById("t0" + i).style.background = "#fff";				
			}
			document.getElementById(sect).style.display = "";
			document.getElementById("tab" + sect).style.background = "#ebebeb";
		}else{
			document.getElementById("t01").style.display = "";
			document.getElementById("tabt01").style.background = "#ebebeb";
		}
		
}

// Expand Collapse Div
function ec(divid) {
	if (document.getElementById(divid).style.display == ""){
	document.getElementById(divid).style.display = "none";
	document.getElementById(divid + "EC").src = "/images/plus.gif";
	}else{
	document.getElementById(divid).style.display = "";
	document.getElementById(divid + "EC").src = "/images/minus.gif";
	}
}

function ew(divid) {
	if (document.getElementById(divid).style.display == ""){
	document.getElementById(divid).style.display = "none";
	}else{
	document.getElementById(divid).style.display = "";
	}
}

// S-Series Landing Page
function swap_over(tab) {
	switch(tab){
		case "swap_sseries":
		document.getElementById("swap_sseries").style.display = "";
		document.getElementById("swap_2410").style.display = "none";
		document.getElementById("swap_60").style.display = "none";
		document.getElementById("swap_50").style.display = "none";
		document.getElementById("swap_50v").style.display = "none";
		document.getElementById("swap_25p").style.display = "none";
		break;
		case "swap_2410":
		document.getElementById("swap_sseries").style.display = "none";
		document.getElementById("swap_2410").style.display = "";
		document.getElementById("swap_60").style.display = "none";
		document.getElementById("swap_50").style.display = "none";
		document.getElementById("swap_50v").style.display = "none";
		document.getElementById("swap_25p").style.display = "none";
		break;
		case "swap_60":
		document.getElementById("swap_sseries").style.display = "none";
		document.getElementById("swap_2410").style.display = "none";
		document.getElementById("swap_60").style.display = "";
		document.getElementById("swap_50").style.display = "none";
		document.getElementById("swap_50v").style.display = "none";
		document.getElementById("swap_25p").style.display = "none";
		break;
		case "swap_50":
		document.getElementById("swap_sseries").style.display = "none";
		document.getElementById("swap_2410").style.display = "none";
		document.getElementById("swap_60").style.display = "none";
		document.getElementById("swap_50").style.display = "";
		document.getElementById("swap_50v").style.display = "none";
		document.getElementById("swap_25p").style.display = "none";
		break;
		case "swap_50v":
		document.getElementById("swap_sseries").style.display = "none";
		document.getElementById("swap_2410").style.display = "none";
		document.getElementById("swap_60").style.display = "none";
		document.getElementById("swap_50").style.display = "none";
		document.getElementById("swap_50v").style.display = "";
		document.getElementById("swap_25p").style.display = "none";
		break;
		case "swap_25p":
		document.getElementById("swap_sseries").style.display = "none";
		document.getElementById("swap_2410").style.display = "none";
		document.getElementById("swap_60").style.display = "none";
		document.getElementById("swap_50").style.display = "none";
		document.getElementById("swap_50v").style.display = "none";
		document.getElementById("swap_25p").style.display = "";
		break;		
		default:;
	}
}

//View Images
function viewImg (imgFile, imgName) {
	var imgFile;
	imgFile = "/templates/asp/viewimg.asp?img=" + imgFile + "&n=" + imgName;
	window.open(imgFile,'screen_shot','width=750,height=600');
}

function ViewVideo (location){
viewwebinar = window.open(location,"","status=1,resizable=yes,scrollbars=yes");
}

//button
function button(thisid, source){
document.getElementById(thisid).src = source ;
}

//Videos
function ViewVideo (location){
viewwebinar = window.open(location,"","status=1,resizable=yes,scrollbars=yes");
}


function tellmeaStory(psWebinar2Show,piWebinarWidth,piWebinarHeight) {
		if(parseInt(screen.width) < piWebinarWidth || parseInt(screen.height) < piWebinarHeight) {
//		if(parseInt(screen.width) < 1300 || parseInt(screen.height) < 337) {
			vRet = confirm("The optimal screen setting for this webinar is greater than 1016 pixels wide and more than 736 pixels in height. Your settings do not meet this criteria. To view anyway, click 'OK'. If you would like to adjust your settings, click 'Cancel'.");
			if(vRet == false) {
				return;
			} else {
				iLeft = (screen.width) ? (screen.width-piWebinarWidth)/2 : 0;
				iTop = (screen.height) ? (screen.height-piWebinarHeight)/2 : 0;
				win = window.open("webinar_popupwin.asp?archive="+psWebinar2Show,"WebinarArchive"+psWebinar2Show,"width="+piWebinarWidth+",height="+piWebinarHeight+",top="+iTop+",left="+iLeft+",directories=no,status=no,scrollbars=no,location=no,resizable=no,menubar=no");
			}
		} else {
			iLeft = (screen.width) ? (screen.width-piWebinarWidth)/2 : 0;
			iTop = (screen.height) ? (screen.height-piWebinarHeight)/2 : 0;
			win = window.open("webinar_popupwin.asp?archive="+psWebinar2Show,"WebinarArchive"+psWebinar2Show,"width="+piWebinarWidth+",height="+piWebinarHeight+",top="+iTop+",left="+iLeft+",directories=no,status=no,scrollbars=no,location=no,resizable=no,menubar=no");
		}
	}
	
function viewPlayer (url) {
	var url;
	newWindow = window.open(url,'Force10VideoPlayer','width=825,height=485');
	newWindow.focus();
}

//Products Landing Page
function swt(tab){
	switch(tab){
		case "sect0":
				document.getElementById('display_href').href = "#";
				document.getElementById('display').alt = "Force10 Networks";
				document.getElementById('display').src = "/products/images/F10.010_Product_Home1.jpg";
		break;
		case "sect1":
				document.getElementById('display_href').href = "/products/ethernetsr.asp";
				document.getElementById('display').alt = "Ethernet Switching/Routing";
				document.getElementById('display').src = "/products/images/F10.010_Product_Home2_ES_R.jpg";
		break;
		case "sect2":
				document.getElementById('display_href').href = "/products/traverse_family.asp";
				document.getElementById('display').alt = "Multiservice Transport Switch";
				document.getElementById('display').src = "/products/images/F10.010_Product_Home3_MTS.jpg";
		break;
		case "sect3":
				document.getElementById('display_href').href = "/products/masterseries_family.asp";
				document.getElementById('display').alt = "Cell Site Access Aggregators";
				document.getElementById('display').src = "/products/images/F10.010_Product_Home4_CSAA.jpg";
		break;
		case "sect4":
				document.getElementById('display_href').href = "/products/adit_600.asp";
				document.getElementById('display').alt = "Converged Access Devices";
				document.getElementById('display').src = "/products/images/F10.010_Product_Home5_CAD.jpg";
		break;
		case "sect5":
				document.getElementById('display_href').href = "/products/MetroAccessTraverseEdgeMultiserviceMultiplexers.asp ";
				document.getElementById('display').alt = "Metro Access Platforms";
				document.getElementById('display').src = "/products/images/F10.010_Product_Home6_MAP.jpg";
		break;
		case "sect6":
				document.getElementById('display_href').href = "/products/pseries.asp";
				document.getElementById('display').alt = "10 GbE Security Appliance";
				document.getElementById('display').src = "/products/images/F10.010_Product_Home7_10GbESA.jpg";
		break;
		default:;
	}
}

//Buttons
function button(thisid, source){
document.getElementById(thisid).src = source ;
}