<?php
function mainHeader($ptitle="", $kwords="", $desc="", $pageName="") {
	global $baseurl;
	if ($ptitle=="") {
		$ptitle="Welcome to ".WEBSITE_NAME;
	}
	?>
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title><?=$ptitle;?></title>
	<meta name="keywords" content="<?=$kwords;?>" />
	<meta name="description" content="<?=$desc;?>" />
	<script src="<?=SITE_URL_PATH;?>/js/common.js" type="text/javascript"></script>
	<script src="<?=SITE_URL_PATH;?>/js/validation.js" type="text/javascript"></script>
	<script src="<?=SITE_URL_PATH;?>/js/lang.js" type="text/javascript"></script>
	<script type="text/javascript" src="<?=SITE_URL_PATH;?>/Scripts/bookmark.js"></script>
	<script type="text/javascript" src="<?=SITE_URL_PATH;?>/js/showHint.js"></script>
	<script type="text/javascript" src="<?=SITE_URL_PATH;?>/images/ae.js" charset="iso-8859-1"></script>
	<link href="<?=SITE_URL_PATH;?>/images/home.css" rel="stylesheet" type="text/css" />
	
	<?php
	if (strstr($_SERVER['PHP_SELF'],"help.")) {
		?>
		<script language="javascript" type="text/javascript">
		function toggleQuestion(question) {
			if (document.getElementById('q' + question).style.visibility == 'visible') {
				document.getElementById('q' + question).style.visibility = 'hidden';
				document.getElementById('q' + question).style.position = 'absolute';
			}
			else {
				document.getElementById('q' + question).style.visibility = 'visible';
				document.getElementById('q' + question).style.position = 'static';
			}
		}
		</script>
		<?php
	}
	
	if (strstr($_SERVER['PHP_SELF'],"catalog_details")) {
		?>
		<link href="<?=SITE_URL_PATH;?>/tabber/tabber.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="<?=SITE_URL_PATH;?>/tabber/tabber.js"></script>
		<?php
	}	
	
	if (strstr($_SERVER['PHP_SELF'],"product_details") or strstr($_SERVER['PHP_SELF'],"tradelead_details")) {
		?>
		<script src="<?=SITE_URL_PATH;?>/facefiles/jquery-1.2.2.pack.js" type="text/javascript"></script>
		<link href="<?=SITE_URL_PATH;?>/facefiles/facebox.css" media="screen" rel="stylesheet" type="text/css" />
		<script src="<?=SITE_URL_PATH;?>/facefiles/facebox.js" type="text/javascript"></script>
		<script type="text/javascript">
		jQuery(document).ready(function($) {
			$('a[rel*=facebox]').facebox() 
		})
		</script>
		<link href="<?=SITE_URL_PATH;?>/tabber/tabber.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="<?=SITE_URL_PATH;?>/tabber/tabber.js"></script>
		<?php
	}
	
	if (strstr($_SERVER['PHP_SELF'],"join_free")) {
		?>
		<script language="JavaScript" type="text/javascript">
		var xmlHttp
		function check_user(username) {
			var username = document.join_free_form.email.value;
			if (username != "") {
				xmlHttp=GetXmlHttpObject();
				if (xmlHttp==null) {
					alert ("Browser does not support HTTP Request");
					return;
				}
				var url="ajax_check_user.php";
				url=url+"?c="+username;
				url=url+"&sid="+Math.random();
				
				xmlHttp.onreadystatechange=stateChanged 
				xmlHttp.open("GET",url,true);
				xmlHttp.send(null);
			}
		}
		function stateChanged() { 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
				document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
			}
		}
		
		function GetXmlHttpObject() {
			var xmlHttp=null;
			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;
		}
		</script>
		<?php
	}
	?>
	
<?php
}



?>