Auto Resizing Help
I am looking for a simple way to automatically size according to customers screen resolution. I have pieced together several snipets of javascript code that looks like it should work to me but generates a runtime error Expected: ')'
For the life of me I can't find what is causing this error and I have tried everything I can think of. Any help would be much appreciated.
This is the part that is throwing the error (v 3.51)
skin1/customer/home.tpl
{literal}
<SCRIPT LANGUAGE="JavaScript">
if ((isset($HTTP_GET_VARS["ScrnSize"])) and (!x_session_is_registered("ScrnSize"))) {
var ScrnSize = "UnCommon"
if (navigator.appVersion.indexOf("4.") != -1 &&
navigator.appName.indexOf("Explorer") != -1) {
ScrnSize = screen.width + "x" + screen.height;
}
if (navigator.appVersion.indexOf("4.") != -1 &&
navigator.appName.indexOf("Netscape") != -1) {
ScrnSize = screen.width + "x" + (screen.height + 19);
}
switch(ScrnSize) {
case "800x600" : $ScrnSize = "800"; break;
case "1024x768" : $ScrnSize = "1024"; break;
default : $ScrnSize = "800";
x_session_register("ScrnSize");
$smarty->assign("ScrnSize",$ScrnSize);
}
}
</script>
{/literal}
__________________
----------------------------------------------------
X-Cart 3.5.1
\"Heavily Modified\"
Win2000 Advanced Server/Apache 2.0.54 w/OpenSSL 0.9.7g
PHP 4.4.0/MySQL 4.1.14-nt
|