try the following:
if($x < 0) $x = 0;
if (($x%2==0 AND $y%2!=0) OR ($x%2!=0 AND $y%2==0)) $y++;
If that does not give the desired results, please explain what the outcome is and how it differs from what you are trying to accomplish.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.