var exit = true;

function open_trial_window()
{
	corner_top = (screen.width / 2) - 320;
	corner_left = (screen.height / 2) - 240;

	trial_window = window.open('/join-p-2.phtml{sess_id}', 'trial_window', 'scrollbars=0,status=0,location=0,toolbar=0,titlebar=1,resizable=0,menubar=0,width=640,height=480,top=' + corner_top + ',left=' + corner_left);
}

function open_usc_statement()
{
	usc_statement_window = window.open('/usc_statement.html', 'usc_statement_window', 'scrollbars=0,status=0,location=0,toolbar=0,titlebar=1,resizable=0,menubar=0,width=670,height=430,top=10,left=10');
}

function header(id)
{
	document.t_header.src = '/i/images/header/tour_01_' + id + '-2.jpg';
	return false;
}
function footer(id)
{
	document.t_footer.src = '/i/images/footer/03_' + id + '_2.jpg';
	setTimeout('post_footer(\'' + id + '\')', 2000)
	return false;
}
function post_footer(id)
{
	document.t_footer.src = '/i/images/footer/03_' + id + '_3.jpg';
	return false;
}

function thisMovie(movieName) {
	if(navigator.appName.indexOf("Microsoft") != -1) {
 		return window[movieName];
 		} else {
 	return document[movieName];
 	}
};

function switchVideo(obj, vid, pid, iid)
{
	removeItem(obj);
	addItem(obj, {file:'/i/flv/tour_' + vid + '.flv', image:'/i/images/tour_block' + iid + '.jpg'},1);
	sendEvent(obj,'playitem', 1);
}

function sendEvent(player, typ, prm) { thisMovie(player).sendEvent(typ,prm); };
function addItem(player,obj,idx) { thisMovie(player).addItem(obj,idx); }
function removeItem(player, idx) { thisMovie(player).removeItem(idx); }

function echeck(str) 
{
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    return false
		 }

 		 return true					
}

function do_submit_ccjoin (result, errors) 
{ 
	document.ccjoin.submit();
}

function do_submit_wpjoin (result, errors) 
{ 
	document.wpjoin.submit();
}
