// JavaScript Document



function popitup(url) {
	newwindow=window.open(url,'name','height=370,width=550,scrollbars=1,top=200,left=200');
	if (window.focus) {newwindow.focus()}

}
function hide_content(getid)
{
	document.getElementById(getid).style.display = "none"
}
function changeclass(aon,aoff1,aoff2,aoff3,aoff4,aoff5,aoff6,aoff7,aoff8,aoff9,aoff10,show_content_tab,hide_content_tab1,hide_content_tab2,hide_content_tab3,hide_content_tab4,hide_content_tab5,hide_content_tab6,hide_content_tab7,hide_content_tab8,hide_content_tab9,hide_content_tab10)
{
	document.getElementById(aon).className = "ajaxtabon"
	
	document.getElementById(aoff1).className = "ajaxtaboff"
	document.getElementById(aoff2).className = "ajaxtaboff"
	document.getElementById(aoff3).className = "ajaxtaboff"
	document.getElementById(aoff4).className = "ajaxtaboff"
	document.getElementById(aoff5).className = "ajaxtaboff"
	document.getElementById(aoff6).className = "ajaxtaboff"
	document.getElementById(aoff7).className = "ajaxtaboff"	
	document.getElementById(aoff8).className = "ajaxtaboff"
	document.getElementById(aoff9).className = "ajaxtaboff"
	document.getElementById(aoff10).className = "ajaxtaboff"
	document.getElementById(show_content_tab).className = "show"
	document.getElementById(hide_content_tab1).className = "hide"
	document.getElementById(hide_content_tab2).className = "hide"
	document.getElementById(hide_content_tab3).className = "hide"
	document.getElementById(hide_content_tab4).className = "hide"
	document.getElementById(hide_content_tab5).className = "hide"
	document.getElementById(hide_content_tab6).className = "hide"
	document.getElementById(hide_content_tab7).className = "hide"
	document.getElementById(hide_content_tab8).className = "hide"
	document.getElementById(hide_content_tab9).className = "hide"
	document.getElementById(hide_content_tab10).className = "hide"
	
/*	document.getElementById(aoff6).className = "ajaxtaboff"
	document.getElementById(aoff7).className = "ajaxtaboff"
	document.getElementById(aoff8).className = "ajaxtaboff"
*/}


function change_solution_sub_tabs_class(tabon,taboff1,taboff2,taboff3,taboff4,taboff5)
{
	document.getElementById(tabon).className = "solution_sub_tabs_on"
	document.getElementById(taboff1).className = "solution_sub_tabs_off"
	document.getElementById(taboff2).className = "solution_sub_tabs_off"
	document.getElementById(taboff3).className = "solution_sub_tabs_off"
	document.getElementById(taboff4).className = "solution_sub_tabs_off"
	document.getElementById(taboff5).className = "solution_sub_tabs_off"
}
function change_solution_sub_tabs_show_content(contenttabon,contenttaboff1,contenttaboff2,contenttaboff3,contenttaboff4,contenttaboff5)
{
	document.getElementById(contenttabon).className = "show"
	document.getElementById(contenttaboff1).className = "hide"
	document.getElementById(contenttaboff2).className = "hide"
	document.getElementById(contenttaboff3).className = "hide"
	document.getElementById(contenttaboff4).className = "hide"
	document.getElementById(contenttaboff5).className = "hide"
}
function show_solution_content(page,containerid)
{
	new NA_evilpage(page,containerid)
	document.getElementById(containerid).style.display = "block"
}
function swap_tabs_left_panel_3(headon,headoff1,headoff2,contenton,contentoff1,contentoff2)
{
	headon_left = headon + "_left"
	headon_center = headon + "_center"
	headon_right = headon + "_right"	
	
	headoff1_left = headoff1 + "_left"
	headoff1_center = headoff1 + "_center"
	headoff1_right = headoff1 + "_right"	
	
	headoff2_left = headoff2 + "_left"
	headoff2_center = headoff2 + "_center"
	headoff2_right = headoff2 + "_right"	
	
	document.getElementById(headon_left).className = "frag_news_sub_head_left_curve"
	document.getElementById(headon_center).className = "frag_news_sub_head_center"
	document.getElementById(headon_right).className = "frag_news_sub_head_right_curve"
	
	document.getElementById(headoff1_left).className = ""
	document.getElementById(headoff1_center).className = "content_12_darkgray"
	document.getElementById(headoff1_right).className = ""

	document.getElementById(headoff2_left).className = ""
	document.getElementById(headoff2_center).className = "content_12_darkgray"
	document.getElementById(headoff2_right).className = ""
	
	document.getElementById(contenton).className = "show"
	document.getElementById(contentoff1).className = "hide"
	document.getElementById(contentoff2).className = "hide"
	
}


function showLogin()
{
	
	document.getElementById('videologin').className = "show"
	//document.getElementById("error_msg_center").className = "video_login"
//	document.getElementById("geterrormsg").innerHTML = "msg"
}
function hideLogin()
{
	document.getElementById('videologin').className = "hide"
}

function submitVideoLogin()
{
	    document.getElementById('error').innerHTML=""
	     //alert(document.getElementById('error').innerHtml)
		 var xhr = GetXmlHttpObject()
		 var username=document.getElementById('user').value
		 var password=document.getElementById('pwd').value
		 document.getElementById('user').value=""
		 document.getElementById('pwd').value=""
		 //alert(username!=''&&password!='')
		if(username!=''&&password!='')
		{
		
		var url='video_login.asp?username='+username+'&password='+password;
		xhr.open("POST",url, false);
		
		xhr.onreadystatechange= function()
		{
			if(xhr.readyState==4) 
			{    
				//alert(xhr.status == 200)
				if (xhr.status == 200)
				{
					//alert(xhr.responseText=='Invalid Username & Password')
					if(xhr.responseText=='Invalid Username & Password')
					{
				 	document.getElementById('error').innerHTML=xhr.responseText
					}else
					{
						newwindow=window.open('starting_video.asp','video','height=650,width=900,scrollbars=1,top=100,left=100');
						if (window.focus) {newwindow.focus()}
					}
				
				} 
				else
				{
					
				}
			}
		};
		xhr.send(null);
		}
}

 function GetXmlHttpObject()
	{
	var xmlHttp=false;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	  }
	return xmlHttp;
	}
	
	
	
	
	
	
function ajaxRequest(){
	
		 var username=document.getElementById('user').value
		 var password=document.getElementById('pwd').value
		 document.getElementById('user').value=""
		 document.getElementById('pwd').value=""
		// alert(username!=''&&password!='')
		if(username!=''&&password!='')
		{
		var url='video_login.asp?username='+username+'&password='+password;
		var request = false;
		if (window.xmlhttpRequest) {
		request = new xmlhttpRequest();
		}
		else if (window.ActiveXObject) {
		try {
		request = new ActiveXObject("Msxml2.xmlhttp");
		}
		catch (e){
		try{
		request = new ActiveXObject("Microsoft.xmlhttp");
		}
		catch (e){}
		}
		}
		//alert('123')
	request.open("POST", url, false);
	//alert('123')
	request.onreadystatechange = function() {
	if (request.readyState == 4) { // readyState, see below
	//alert('')
	//container.innerHTML = request.responseText;
	}
	}
	request.send(null);
		}
}