Ok, I think I have got it!
For anyone as far down the php learning curve as me, this is what I did.
Firstly I had trouble finding which variables were available in the products_info_display.php file. So if you add the following
Code:
<?php
echo '<pre>';
print_r($_GET);
echo '</pre>';
?>
at the top of the file it will output the available variables, in my case:
Code:
Array
(
[main_page] => product_info
[cPath] => 22_23
[products_id] => 381
)
[FONT=Verdana]Once I had the variable $cPath I inserted the following code
[/FONT]
Code:
<?php
if (!isset($cPath))
echo"not set";
if ($cPath=="22_23"){
?>
<script type="text/javascript">
function openpopup(popurl){
var winpops=window.open(popurl,"","width=700,height=400,resizable=yes, scrollbars=yes")
}
</script>
<script type="text/javascript">
function openpopup(popurl){
var winpops=window.open(popurl,"","width=700,height=400,resizable=yes, scrollbars=yes")
}
</script>
<a href="javascript:openpopup('http://www.rgdistribution.co.uk/extra_pages/swatch.php')">For available colours click HERE</a>
<?php
}
elseif ($cPath=="22_25"){
?>
<script type="text/javascript">
function openpopup(popurl){
var winpops=window.open(popurl,"","width=700,height=400,resizable=yes, scrollbars=yes")
}
</script>
<script type="text/javascript">
function openpopup(popurl){
var winpops=window.open(popurl,"","width=700,height=400,resizable=yes, scrollbars=yes")
}
</script>
<a href="javascript:openpopup('http://www.rgdistribution.co.uk/extra_pages/swatch.php')">For available colours click HERE</a>
<?php
}
?>
And all seems to work ok.
Maybe this is simple stuff to most of the people here on the forum, and maybe its not the most elegant way to do it - but hey, I DID IT 
Many thanks to Kobra for pointing me in the right direction, there is a pint on the bar for you!