﻿// JScript File

function test(){
  alert('hi');
}

/*
 *  url: Image url
 */
function showProductImage(url){
  window.open('ProductImage.aspx?url='+url,'Product','width=580,height=600,resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no,left=30,top=30')
}


/*** AJAX ***/
/*
 * Switching languages
 */
function testAJAX(newLang){
  AJAXHelper.test(newLang, testAJAX_CallBack)
}

function testAJAX_CallBack(response){
  //if the server-side code threw an exception
  if (response.error != null)
  {
    //should probably do better than this
    alert("Error. "+response.error); 
    return;
  }

  //Checking if the response wasn't what we expected  
  var result = response.value; 
  //if (result == null || (typeof(result) != "object")) 
  if (result == null)
  {
    //should probably do better than this
    alert("Got unexpected return from server");
    return;
  }

  //if we got here - everything is ok. Proceed.
  alert(result);
}
