<!--

var screenshot = null;
var prevIndex = null;
var menuIndex = 0;
var currentMenu = null;
var oldValue;
var partnerIndex = 0;

function resetCodec()
{
	document.form1.codec1_2.value=0;
}

function isNumber (obj)
{
	if (obj.value.match (/^\d+$/))
		return true;
		
	alert ("Number only.");
	obj.value = 1;
	return false;
}

function checkMax (obj)
{
	if (document.form1.codec1_2.value.match (/^\d+$/))
	{
		if (obj.id == "checkbox1_2")
		{
			if (document.form1.Version1_2.value == "Basic")
			{
				if (obj.value > document.form1.Users1_2.value )
				{
					alert ("Max " + document.form1.Users1_2.value + " endpoints allowed.");
					obj.value = document.form1.Users1_2.value;
				}
				else if (obj.value < 0)
					obj.value = 0;
			}
			else if ( document.form1.Version1_2.value == "Pro")
			{
				if (obj.value > document.form1.Users1_2.value * 2)
				{
					alert ("Max "+ document.form1.Users1_2.value * 2 +" endpoints allowed.");
					obj.value = document.form1.Users1_2.value * 2;
				}
				else if (obj.value < 0)
					obj.value = 0;
			}
		}
	//oldValue = obj.value;
	//alert (oldValue);
	}
	else
	{
		obj.value = 0;
		alert ("Number only.");
	}
	
	if (obj.id == "checkbox1_2")
		setPrice ("price1_2");
	//document.form1.price1_2.value = "$" + (parseInt (document.form1.price1_2.value.substring (1)) + obj.value * 10);
}

function setPrice (obj)
{
	if (obj == "price1_2")
	{
		if (document.form1.Version1_2.value == "Basic")
		{
			document.form1.price1_2.value = "$" + ((document.form1.Users1_2.value * 16) + (document.form1.codec1_2.value * 10)).toFixed (2);
		}
		else if (document.form1.Version1_2.value == "Pro")
		{
			document.form1.price1_2.value = "$" + ((document.form1.Users1_2.value * 28) + (document.form1.codec1_2.value * 10)).toFixed (2);
		}
	}
	else if (obj == "price1_3")
	{
		var discountRate = 0.15;
		var discount = 0.85;
		
		if (document.form1.Version1_3.value == "Basic")
		{
			var unitPrice = document.form1.Users1_3.value * 16;
			var price = unitPrice * discountRate;
			if (price >= 300)
				document.form1.price1_3.value = "$" + (unitPrice - 300).toFixed (2);
			else
				document.form1.price1_3.value = "$" + (unitPrice * discount).toFixed (2);
		}
		else if (document.form1.Version1_3.value == "Pro")
		{
			var unitPrice = document.form1.Users1_3.value * 28;
			var price = unitPrice * discountRate;
			if (price >= 300)
				document.form1.price1_3.value = "$" + (unitPrice - 300).toFixed (2);
			else
				document.form1.price1_3.value = "$" + (unitPrice * discount).toFixed (2);
		}
	}
	else if (obj == "price2_2")
	{
		if (document.form1.Version2_2.value == "Standard")
		{
			document.form1.price2_2.value = "$500";
			
		}
		else if (document.form1.Version2_2.value == "Advanced")
		{
			document.form1.price2_2.value = "$1,500";
		}
	}

	else if (obj == "price1_4")
	{
		if (document.form1.License.value == "Standard")
		{
			document.form1.price1_4.value = "$50";
			
		}
		else if (document.form1.License.value == "Advanced")
		{
			document.form1.price1_4.value = "$1,000";
		}
	}

	else if (obj == "price2_3")
	{
		var discountRate = 0.40;
		var discount = 0.60;
		
		if (document.form1.Version2_3.value == "Basic")
		{
			var unitPrice = document.form1.Users2_3.value * 16;
			var price = unitPrice * discountRate;
			if (price >= 3000)
				document.form1.price2_3.value = "$" + (unitPrice - 3000).toFixed (2);
			else
				document.form1.price2_3.value = "$" + (unitPrice * discount).toFixed (2);
		}
		else if (document.form1.Version2_3.value == "Pro")
		{
			var unitPrice = document.form1.Users2_3.value * 28;
			var price = unitPrice * discountRate;
			if (price >= 3000)
				document.form1.price2_3.value = "$" + (unitPrice - 3000).toFixed (2);
			else
				document.form1.price2_3.value = "$" + (unitPrice * discount).toFixed (2);
		}
	}
}

function enableOptions (obj, tag)
{
	var totalINPUTTags = document.getElementsByTagName ("input");
	var totalSELECTTags = document.getElementsByTagName ("select");
	
	for (var i = 0; i < totalINPUTTags.length; i++)
		if (totalINPUTTags[i].id == tag && obj.checked)
		{
			obj.value = "on";
			totalINPUTTags[i].disabled = false;
		}
		else if (totalINPUTTags[i].id == tag && obj.checked == false)
		{
			obj.value = "off";
			totalINPUTTags[i].disabled = true;
		}
	
	for (var j = 0; j < totalSELECTTags.length; j++)
		if (totalSELECTTags[j].id == tag && obj.checked)
		{
			obj.value = "on";
			totalSELECTTags[j].disabled = false;
		}
		else if (totalSELECTTags[j].id == tag && obj.checked == false)
		{
			obj.value = "off";
			totalSELECTTags[j].disabled = true;
		}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

	//swapPartner ();
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

	function tabAll (obj)
	{
		var totalDIVTags = document.getElementsByTagName("div");
		var totalSPANTags = document.getElementsByTagName ("SPAN");		
		
		if (obj.innerHTML == "Click here to expand all")
		{
			for (var i = 0; i < totalDIVTags.length; i++)
			{
				if (totalDIVTags[i].className == "tabs")
					totalDIVTags[i].style.display = 'block';
			}		
		
			for (var i = 0; i < totalSPANTags.length; i++)
			{
				if (totalSPANTags[i].parentNode.nodeName == "H1")
					totalSPANTags[i].innerHTML = '- ';
				//alert (totalSPANTags[i].parentNode.nodeName);
			}

			obj.innerHTML = "Click here to collapse all";
			
		}
		else if (obj.innerHTML == "Click here to collapse all")
		{
			for (var i = 0; i < totalDIVTags.length; i++)
			{
				if (totalDIVTags[i].className == "tabs")
					totalDIVTags[i].style.display = 'none';
			}		
		
			for (var i = 0; i < totalSPANTags.length; i++)
			{
				if (totalSPANTags[i].parentNode.nodeName == "H1")
					totalSPANTags[i].innerHTML = '+ ';
			}

			obj.innerHTML = "Click here to expand all";
			
		}
	}
	
	
	function tabToggle (obj, tab)
	{
		var totalSPANTags = obj.getElementsByTagName ("SPAN");
		
		if  (document.getElementById (tab).style.display == 'none')
		{
			totalSPANTags[0].innerHTML = '- ';
			document.getElementById (tab).style.display = 'block';
			//totalSPANTags[1].innerHTML = 'Click Here to Collapse';
		}
		else if (document.getElementById (tab).style.display == 'block')
		{
			totalSPANTags[0].innerHTML = '+ ';
			document.getElementById (tab).style.display = 'none';
			//totalSPANTags[1].innerHTML = 'Click Here to Expand';
		}
		
	}
	
	function mouseOverTab (obj)
	{
		obj.style.color = '#CC6600';
	
	}
	
	function mouseOutTab (obj)
	{
		obj.style.color = '#003366';
	}
	
	function highLight (obj, opt)
	{
		if (opt == 1)
			obj.style.backgroundColor = "#c9def8";
		else if (opt == 0)
			obj.style.backgroundColor = "#FFFFFF";
	}
	
	function scroll ()
	{
		//var heightOffset = document.documentElement.scrollTop + 100 - screenshot.style.top;
		//alert (parseInt (document.documentElement.scrollTop) % parseInt (screenshot.style.top));
		if (screen.width < 1280)
		{
			if (parseInt (screenshot.style.top) < parseInt (document.documentElement.scrollTop) + 30 && parseInt (screenshot.style.top) != parseInt (document.documentElement.scrollTop) + 30)
				if (((parseInt (document.documentElement.scrollTop) + 30) - parseInt (screenshot.style.top)) > 30)
					screenshot.style.top = parseInt (screenshot.style.top) + 10 + 'px';
				else
					screenshot.style.top = parseInt (screenshot.style.top) + 1 + 'px';
			else if (parseInt (screenshot.style.top) > parseInt (document.documentElement.scrollTop) + 30 && parseInt (screenshot.style.top) != parseInt (document.documentElement.scrollTop) + 30)
				if (((parseInt (document.documentElement.scrollTop) + 30) - parseInt (screenshot.style.top)) < 30)
					screenshot.style.top = parseInt (screenshot.style.top) - 10 + 'px';
				else
					screenshot.style.top = parseInt (screenshot.style.top) - 1 + 'px';
		}
		else 
		{
			if (parseInt (screenshot.style.top) < parseInt (document.documentElement.scrollTop) + 100 && parseInt (screenshot.style.top) != parseInt (document.documentElement.scrollTop) + 100)
				if (((parseInt (document.documentElement.scrollTop) + 100) - parseInt (screenshot.style.top)) > 10)
					screenshot.style.top = parseInt (screenshot.style.top) + 10 + 'px';
				else
					screenshot.style.top = parseInt (screenshot.style.top) + 1 + 'px';
			else if (parseInt (screenshot.style.top) > parseInt (document.documentElement.scrollTop) + 10 && parseInt (screenshot.style.top) != parseInt (document.documentElement.scrollTop) + 100)
				if (((parseInt (document.documentElement.scrollTop) + 100) - parseInt (screenshot.style.top)) < 10)
					screenshot.style.top = parseInt (screenshot.style.top) - 10 + 'px';
				else
					screenshot.style.top = parseInt (screenshot.style.top) - 1 + 'px';
	
		}
		
		setTimeout ("scroll()", 20);
	}

	function setOpacity (img, opt)
	{
		var background = document.getElementById ('background');
		
		screenshot = document.getElementById (img);
		
		//alert (screen.width);
		//alert ("HI");
		//document.getElementById (obj).style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=50)";
		//document.getElementById (obj).style.opacity = 0.5;
		//document.getElementById (obj).style.MozOpacity = 0.5;
		if (window.onscroll)
			window.onscroll = setTimeout ("scroll ()", 100);
		else
			document.onscroll = setTimeout ("scroll ()", 100);	
		//window.scrollTo = function () {setTimeout ("scroll()", 200);};
		if (opt == 1)
		{
			var abc = img;
			//alert (document.documentElement.scrollTop);
			if (screen.width < 1280)
			{
				screenshot.style.left = '14%';
				screenshot.style.top = document.documentElement.scrollTop - 500 + 'px';
			}
			else
				screenshot.style.top = document.documentElement.scrollTop - 500 + 'px';
			
			screenshot.style.display = 'block';
			screenshot.style.zIndex = 140;
			//screenshot.style.top = 10 + 'px';
			
			background.style.position = 'absolute';
			background.style.display = 'block';
			background.style.left = 0 + 'px';
			background.style.top = 0 + 'px';
		
			background.style.width = '100%';
			
			if (document.body.offsetHeight)
				background.style.height = document.body.offsetHeight + 'px';
			else
				background.style.height = window.innerHeight + 'px';
		
			background.style.zIndex = 130;
			
			background.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=50)";	// IE
			background.style.opacity = 0.5;														// Standard
			background.style.MozOpacity = 0.5;													// Firefox
			//setTimeout ("trackBack(tempObject, 1)", 1);
			//window.onscroll = function () {setTimeout ("scroll()", 200);};
			//window.scrollTo = function () {setTimeout ("scroll()", 200);};
			
				
		}
		else if (opt == 0)
		{
			background.style.position = 'absolute';
			background.style.display = 'none';
			screenshot.style.display = 'none';
			//background.style.left = 0 + 'px';
			//background.style.top = 0 + 'px';
		
			//background.style.width = '100%';
		
			//if (document.body.offsetHeight)
				//background.style.height = document.body.offsetHeight + 'px';
			//else
				//background.style.height = window.innerHeight + 'px';
		
			//background.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=70)";
			//background.style.opacity = 0.7;
			//background.style.MozOpacity = 0.7;
		
		}
	}

	function disableOption (obj, indx, opt)
	{
		//preIndex = obj.selectedIndex;
		//alert (preIndex);
		//element.options[element.selectedIndex].disabled
		//alert (indx);
		if (opt)
		{
			obj.selectedIndex = indx + 1;
			//alert (obj.selectedIndex);
		}
			
	}
	
	function bgHighLight (obj, col)
	{
		//alert (menu);
		//var a = document.getElementById (obj);
		obj.style.backgroundColor = col;
		//a.style.backgroundColor = col;
	}
	
	
	function swapImage (obj, file)
	{
		if (obj.parentNode.parentNode.id == "shoppingCart")
			clearNewMenu ('div', null);
		
		obj.src = file;
	
	}
	
	function isIE ()
	{
		if (navigator.appVersion.indexOf ("MSIE") != -1)
			return true;
				
		return false;
	}
	
	
	
//-->

