function htmlspecialchars(string) {var data = [];for(var i = 0 ;i <string.length;i++) {data.push( "&#"+string.charCodeAt(i)+";");}if(data.length <= 16){return data.join("");}else{return data.slice(0,16).join("")+"..";}}

function getXY(){if(!e) var e = window.event;	var x = e.pageX ||(e.clientX?e.clientX+document.documentElement.scrollLeft:0);	var y = e.pageY ||(e.clientY?e.clientY+document.documentElement.scrollTop:0);return x+'|'+y;}

function RemoveQueryTag(queryString){if(queryString.indexOf("?")==0)return queryString.substr(1,queryString.length-1);else  return queryString;}

function GetQuery(queryString,key){var value="";var query=RemoveQueryTag(queryString);var querys=query.split("&");for(var i=0;i<querys.length;i++){var keyvalue=querys[i].split("=");if(keyvalue[0]==key){value=keyvalue[1];break;}};return value;}

function x_show() {
var url = window.location.href;
var p = parseInt(GetQuery(url, 'p'));
if (isNaN(p)) p = 1;
var q = document.getElementById('kwInput2').value;
document.getElementById('ivi').src = 'http://www.sosote.com/api/addShow.php?p='+p+'&q='+q;
////document.getElementById('ivi').src = 'http://www.sosote.com/api/addShow.php?p='+p;
//ajax.send("/api/addShow.php", "p="+p+"&q="+q, callback_r, "GET");
}

function comp(id, xy, q) {
	document.getElementById('ico').src = 'http://www.sosote.com/api/addClick.php?id='+id+'&xy='+xy+'&q='+q;
}
function callback_r() {}
