﻿// JScript File
function search_roll(useID, useID2){
    document.getElementById(useID).src='/images/icon_search_h.png';
    document.getElementById(useID2).style.background='url(/images/search_back_h.png) relative no-repeat right top';
    document.getElementById(useID2).style.color="#cccccc";}
function search_rollo(useID, useID2){
    document.getElementById(useID).src='/images/icon_search.png';
    document.getElementById(useID2).style.background='url(/images/search_back.png) relative no-repeat right top';
    document.getElementById(useID2).style.color="#666666";}
function search_rollt(useID2){document.getElementById(useID2).style.color="#cccccc";}   
function search_rollto(useID2){document.getElementById(useID2).style.color="#666666";}  
function bskremove(product)
{
    //$(product).checked == true;
    document.getElementById(product).checked=true
    document.basket.submit();
}

function clearDefault(el) 
{
  if (el.defaultValue==el.value) el.value = "";
}

function showOther(str)
{
    c = document.getElementById("title_other");
    if(str =="Other")
    {
        c.style.display="block";
    }
    else
    {
        c.style.display="none";
    }
}


function popimage(spc,colour)
{
    var newwindow;
    newwindow=window.open(spc+"/"+colour+"/imagezoom.html",'name123123awdawdawd123123','height=625,width=700,scrollbars=0,menubar=0,resizable=0,status=0');
	if (window.focus) {newwindow.focus()}
}

function showImage(pcode,pcol,img)
{
document.getElementById("zoom_over").style.display="none";
document.getElementById("mouseWindow").style.display="none";
document.getElementById("side_form").style.display="none";
document.getElementById("fullscreen_container").style.display="block";

var xmlHttp=null;

if (pcode.length==0)
  { 
  document.getElementById("fullscreen_container").innerHTML="";
  return;
  }
try
  {
  xmlHttp=new XMLHttpRequest();
  }
catch(e)
  {
  try
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  catch(e)
    {
    alert ("Your browser does not support XMLHTTP!");
    return;  
    }
  }
var url="fullscreen.asp";
url=url+"?pcode=" + pcode;
url=url+"&pcol=" + pcol;
url=url+"&img=" + img;
url=url+"&sid="+Math.random();
xmlHttp.open("GET",url,false);
xmlHttp.send(null);
document.getElementById("fullscreen_container").innerHTML=xmlHttp.responseText;
}

function hideImage()
{
document.getElementById("side_form").style.display="block";
document.getElementById("fullscreen_container").style.display="none";
document.getElementById("fullscreen_container").innerHTML="";
}

function showImage(pcode,pcol,img,status)
{
    var container = $("fullscreen_container")
    var xmlHttp=null;

    if (pcode.length==0)
      { 
      container.innerHTML="";
      return;
      }
    try
      {
      xmlHttp=new XMLHttpRequest();
      }
    catch(e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch(e)
        {
        alert ("Your browser does not support XMLHTTP!");
        return;  
        }
      }
 
    var url= "/fullscreen.asp";
    url=url+"?pcode=" + pcode;
    url=url+"&pcol=" + pcol;
    url=url+"&img=" + img;
    url=url+"&status=" + status;
    
    //url=url+"&sid="+Math.random();
    //try set to true for async
    xmlHttp.open("GET",url,false);
    xmlHttp.send(null);
    container.innerHTML=xmlHttp.responseText;
    container.style.display="block";

    if (!status)
    {
        new Effect.toggle( 'fullscreen_box', 'appear', { from: 0.0, to: 0.6, duration: 0.4, fps:10 } );
        new Effect.toggle( 'fullscreen_content', 'blind', { duration: 0.8, delay: 0.2, fps:15 } );
    } else {
        new Effect.Appear( 'fullscreen_image_div', { duration: 0.4 } );
    }
}

function hideImage()
{
    new Effect.toggle( 'fullscreen_box', 'appear', { to: 0.0, from: 0.6, duration: 0.4 , fps:10} );
    new Effect.toggle( 'fullscreen_content', 'blind', { duration: 0.4 , fps:15} );
    setTimeout("$('fullscreen_container').style.display='none';",600)
}

function Highlight(id)
{
    var storediv = document.getElementById('st-'+id)
	if(storediv) {
	    storediv.style.backgroundColor = '#e2d4ee';
	}
	var marker = document.getElementById('mark-'+id)
	if(marker) {
	    marker.src = '/storelocator/marker_on.png';
	}
}

function UnHighlight(id,num)
{
    var storediv = document.getElementById('st-'+id)
	if(storediv) {
	    storediv.style.backgroundColor = '#FFF';
	}
    var marker = document.getElementById('mark-'+id)
	if(marker) {
	    marker.src = '/storelocator/marker'+num+'.png';
	}
}