/* output */
tos=new Object();
tos["id"]=api_key;
if (api_key=='1781Es6RSbSK-28') {window.location = "http://logofest.promotionalstore.co.uk/";}

tos["url"]="http://www.tradeonlysearch.com/_api/";
//tos["url"]="http://localhost/tradeonly_mk1/_api/";
tos["urlapi"]=tos["url"]+'api.php?api_key='+tos["id"]+'&sess='+randomText(8)+'&ref='+(window.location.hostname);

if (typeof(jQuery)=="undefined") // Do not load JS if already there 
{
	tos_loadAnother(tos["url"]+'js/jquery.js');
}



tos_loadAnother(tos["url"]+'js/jquery.form.js');
tos_loadAnother(tos["url"]+'js/tos_api_ext.js');
document.write(unescape('%3Clink rel="stylesheet" href="')+tos["url"]+'tos_api_ext.css'+unescape('" /%3E'));
document.write(unescape('%3Clink rel="stylesheet" href="')+tos["url"]+'tos_api-2.css'+unescape('" /%3E'));
document.write(unescape('%3Cdiv id="tos_api"%3ELoading Panel...%3C/div%3E'));

function tos_loadAnother(filename) 
{
	document.write(unescape("%3Cscript src='")+filename+unescape("' type='text/javascript'%3E%3C/script%3E"));
/*	var thescript = document.createElement('script');
	thescript.setAttribute('type','text/javascript');
	thescript.setAttribute('src',filename);
	document.getElementsByTagName('head')[0].appendChild(thescript);
*/

}

function randomText(length)
{
  chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
  pass = "";
  for(x=0;x<length;x++)
  {
    i = Math.floor(Math.random() * 62);
    pass += chars.charAt(i);
  }
  return pass;
}

/* * */
