﻿function langSelect(sel){

	if( sel.selectedIndex > 0 ){

		var lang = sel.options[sel.selectedIndex].value;

		sel.selectedIndex = 0;

		document.location = '/International/Default_' + lang + '.aspx';

	}

}

function navOver(li){

	if( li.navOutTimeout ) clearTimeout( li.navOutTimeout );

	if( li.className.indexOf('over') == -1 ){

		li.className += " over";

	}

}

function navOut(li){

	li.navOutTimeout = setTimeout( "checkNavOut('" + li.id + "')", 100 );

}

function checkNavOut( id ){

	var li = document.getElementById(id);

  	li.className = li.className.replace( " over", "" );

}



function selectAll( a ){

	var id = a.id;

	var newValue = ( a.innerHTML == 'Select All' );

	a.innerHTML = (newValue) ? 'Clear All' : 'Select All';

	

	for( var i=0; i<document.forms[0].elements.length; i++ ){

		var el = document.forms[0].elements[i];

		if( el.id.indexOf(id) == 0 ){

			el.checked = newValue;

		}

	}

}

function initSelect( id ){

	var a = document.getElementById(id);

	var gotOne = false;

	for( var i=0; i<document.forms[0].elements.length; i++ ){

		var el = document.forms[0].elements[i];

		if( el.id.indexOf(id) == 0 && el.checked ){

			gotOne = true;

			break;

		}

	}

	a.innerHTML = (gotOne) ? 'Clear All' : 'Select All';

}

function openPopupDisplay(strDocName, strWinName, intHeight, intWidth, strScroll){

	if(strWinName == ""){strWinName = "popwin";}

	return window.open(strDocName,strWinName,"height=" + intHeight + ",width=" + intWidth + ",toolbars=no,status=no, scrollbars=" + strScroll) == null;

}



$(document).ready(function () {
	$('[rel=flashPopup]').click(function (e) {
		e.preventDefault();
		$('<div id="flashPopup"><div id="flashPopupMovie"></div></div>').modal({
			closeHTML: ('<a class="modalCloseImg" title="Close" href="#"></a>'),
			onClose: function (dialog){
				$('#flashPopup')[0].innerHTML = '';
				$.modal.close();
			}
		});
		swfobject.embedSWF(

			e.currentTarget.href,

			"flashPopupMovie", 

			950, 

			500, 

			"9.0.0", 

			false, /* no express install */

			{/*flashvars*/}, 

			{/*params*/}, 

			{/*attributes*/}

		);
		$('#simplemodal-overlay').click( function(e){
			$.modal.close();	
		});
	});
});

//Buyers Page Rollover//
Rollimage = new Array()
   
Rollimage[0] = new Image(180,21) 
Rollimage[0].src = "../Images/Layout/webinarRegBTN_off.gif" 

Rollimage[1] = new Image(180,21)
Rollimage[1].src = "../Images/Layout/webinarRegBTN_on.gif"

function SwapOut() {
  document.webinar_button.src = Rollimage[1].src;
  return true;
}
function SwapBack() {
  document.webinar_button.src = Rollimage[0].src;
  return true;
} 

function isEmail(fld, customerr) {
	var err = document.getElementById("errmsg");
	err.style.display = "none";
	if (fld.value != "") {
		temp = fld.value + " ";
		found = temp.search(/[\w\+\.\'-]+@([\w-]+\.){1,3}[a-zA-Z]{2,}\s{1}/);
		if (found == 0)
			return true;
	}
	// after here, blank or not formatted correctly
	err.innerHTML = (customerr ? customerr : "Email must be in the form abc@xyz.com");
	err.style.display = "block";
	return false;
}
