var c_baseSite = '';var g_currentUser = 0;var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;var g_unloadFunction = function(){};function showStars( p_num){	for (i = 0 ; i < p_num ; i ++)	{		$( "star" + (i)).src = "/i/staron.jpg";	}	for (; i < 5 ; i ++)	{		$( "star" + (i)).src = "/i/staroff.jpg";	}//	$('stars_note').value = parseInt(p_num);}function popitup( url, p_width, p_height){	newwindow = window.open( url, '', 'scrollbars=1,location=0, status=0, height=' + p_height + ',width=' + p_width);	if (window.focus) {newwindow.focus()}	return false;}function CloseAllSubMenus(){	if ($('CadreContents')){$('CadreContents').hide();}	if ($('CadreMapKazucity')){$('CadreMapKazucity').hide();}	if ($('Main_EndQ')){$('Main_EndQ').hide();}	if ($('Disc_Main')){$('Disc_Main').hide();g_diM.CloseDiscussion(true);}	if ($('Disc_Main2')){$('Disc_Main2').hide();}	if ($('MenuPhone')){$('MenuPhone').hide();}	}function urlencode(str) {return escape(str).replace(/\+/g,'%2B').replace(/%20/g, '+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40');}function _submitStars(){	document.note_avatar.submit();}function ismaxlength(obj){	var mlength = obj.getAttribute ? parseInt( obj.getAttribute( "maxlength")) : "";	if (obj.getAttribute && obj.value.length > mlength)	{		obj.value = obj.value.substring( 0, mlength);	}}function hideDiv( p_div){	if ($(p_div))	{		$(p_div).hide();	}}function showDiv( p_div){	if ($(p_div))	{		$(p_div).show();	}}function showIDiv( p_div){	if ($(p_div))	{		$(p_div).show();	}}function toggleDiv( p_div){	if ($(p_div))	{		$(p_div).toggle();	}}function deleteNode( p_id){	var l_temp = $(p_id);	if (l_temp)	{		l_temp.parentNode.removeChild( l_temp);	}}function clearDefault( a){	if (a.defaultValue == a.value)	{		a.value = "";	}}function ConsumeEnter( p_event){	if (p_event.keyCode == 13)	{		p_event.returnValue = false;		p_event.cancel = true;		return true;	}	return false;}function SetCookie( p_name, p_value, p_expiredays){	var l_date = new Date();	l_date.setDate( l_date.getDate() + p_expiredays);	document.cookie = p_name+ "=" + escape( p_value) + ((p_expiredays==null) ? "" : ";expires=" + l_date.toUTCString());}function GetCookie(p_name){	if (document.cookie.length > 0)	{		l_cStart = document.cookie.indexOf( p_name + "=");		if (l_cStart != -1)		{			l_cStart = l_cStart + p_name.length + 1;			l_cEnd = document.cookie.indexOf( ";", l_cStart);			if (l_cEnd == -1)			{				l_cEnd = document.cookie.length;			}			return unescape( document.cookie.substring( l_cStart, l_cEnd));		}	}	return "";}function getQueryVariable( p_origin, variable){	var vars = p_origin.split("&");	for (var i = 0; i < vars.length; i++) {		var pair = vars[i].split("=");		if (pair[0] == variable) {			return pair[1];		}	}}function TableFilter( p_search, p_id, p_index){	var l_search = p_search.toLowerCase();	var l_table = $(p_id);	for (var i = 0 ; i < l_table.rows.length ; ++ i)	{		l_table.rows[i].style.display = l_table.rows[i].cells[p_index].innerHTML.toLowerCase().indexOf( l_search) >= 0 ? '' : 'none';	}}function addslashes( p_string){	return p_string.replace(/\\/g,'\\\\').replace(/\'/g,'\\\'').replace(/\"/g,'\\"').replace(/\0/g,'\\0');}function stripslashes( p_string){	return p_string.replace(/\\'/g,'\'').replace(/\\"/g,'"').replace(/\\0/g,'\0').replace(/\\\\/g,'\\');}RegExp.quote = function( str) {     return str.replace(/([.?*+^$[\]\\(){}-])/g, "\\$1");}function trim( str){	var	str = str.replace(/^\s\s*/, '');	var ws = /\s/;	var i = str.length;	while (ws.test(str.charAt(--i)));	return str.slice(0, i + 1);}function getActualMouseCoords( e, p_offset){	p_offset = p_offset || [0,0];	var posx = 0;	var posy = 0;	if (!e) var e = window.event;	if (e.pageX || e.pageY) 	{		posx = e.pageX;		posy = e.pageY;	}	else if (e.clientX || e.clientY) 	{		posx = e.clientX + document.body.scrollLeft			+ document.documentElement.scrollLeft;		posy = e.clientY + document.body.scrollTop			+ document.documentElement.scrollTop;	}	return {x:posx-p_offset[0],y:posy-p_offset[1]};}Array.prototype.shuffle = function(){ 	var len = this.length;	var i = len;	while (i--)	{		var p = parseInt(Math.random()*len);		var t = this[i];		this[i] = this[p];		this[p] = t; 	}};function AddTagIf( p_tag, p_text, p_cond, p_antiTag){	if (p_cond)	{		return p_tag + p_text + p_antiTag;	}	return p_text;}function _printJaxReq(p_ans){	_echo( 'Jax req : ' + p_ans.responseText);}function IsDev(){	return g_mainChar.id == 19;}function fireEvent( element, event){	//thanks to : http://jehiah.cz/a/firing-javascript-events-properly	if (document.createEventObject)	{		return element.fireEvent( 'on' + event, document.createEventObject())	}	var evt = document.createEvent( "HTMLEvents");	evt.initEvent( event, true, true);	return ! element.dispatchEvent( evt);}function supports_html5_storage(){	try	{		return 'localStorage' in window && window['localStorage'] !== null;	}	catch( e)	{		return false;	}}function del_cookie(name){    document.cookie = name + '=; expires=Thu, 01-Jan-70 00:00:01 GMT;';}function numberFormat(nStr){	nStr += '';	x = nStr.split('.');	x1 = x[0];	x2 = x.length > 1 ? '.' + x[1] : '';	var rgx = /(\d+)(\d{3})/;	while (rgx.test(x1)) {		x1 = x1.replace(rgx, '$1' + ' ' + '$2');	}	return x1 + x2;}
