function bookmark(title, url) {
 if (title == undefined)
  title = document.title;
 if (url == undefined)
  url = top.location.href;
 if (window.sidebar) {
  // Firefox
  window.sidebar.addPanel(title, url, '');
 } else if (window.opera && window.print) {
  // Opera
  var t = document.createElement('a');
  t.setAttribute('rel', 'sidebar');
  t.setAttribute('href', url);
  t.setAttribute('title', title);
  t.click();
 } else if(window.external ) {
  // IE
  window.external.AddFavorite(url, title);
 }
 else {
//сюда уже проверку сами вставите, хотя, по идее это условие никогда не выполнится
//но для надежности пусть будет
  alert('Что бы добавить страницу в избранное нажмите CTRL-D.');
 }
 return false;
}

function place_cursor()
{
	try {
		if (document.forms[1] && document.forms[1][0])	document.forms[1][0].focus();
	} catch(err) {}
}
//-----------------------------------------------------------------------------
function goto_ahref(id)
{
	window.location.href=document.getElementById(id).href;
}
//-----------------------------------------------------------------------------
function goto_blank_ahref(id)
{
	window.open(document.getElementById(id).href,'','');
}
//-----------------------------------------------------------------------------
function mOvr(sender) {
	oldBGColor=sender.style.background;
	sender.style.background="#0000CC";
}
function mOut(sender) {
	sender.style.background=oldBGColor;
}
function mClk(sender) {
	window.location.href=document.getElementById(sender).href;
}
//-----------------------------------------------------------------------------
function bookmark_uni(url,title) {
	if (!url) {
		url='http://'+spServerNameNice+'/';
	}
	if (!title) {
		title='РЎР•РљРЎ РџРћР РўРђР› - Р”РµРІСѓС€РєРё РљРёРµРІР° - '+spServerNameNice;
	}
	if (document.all) {
		window.external.addFavorite(url,title);
	} else if (window.sidebar && window.sidebar.addPanel) {
		window.sidebar.addPanel(title,url,'');
	}
}
//-----------------------------------------------------------------------------
function jmp(url) {
	window.location.href=url;
}
//-----------------------------------------------------------------------------
function popup_href(url,w,h){
	if (!w) w=720;
	if (!h) h=520;
	window.open(url, 'sexshop', 'scrollbars=1,fullscreen=0,toolbar=0,menubar=0,status=1,resizable=1,location=0,directories=0,width='+w+',height='+h);
}
//--------------------------------------------------------------
function payment_show(to_change) {
	for (i=1;i<4;i++) {
		if (i==to_change) {document.getElementById("tr_"+i).style.display="";}
		else {document.getElementById("tr_"+i).style.display="none";}
	}
}
//--------------------------------------------------------------
function popup_win_href(url) {
	window.open(url, 'sexshop', '');
}
//--------------------------------------------------------------
function sp_edit_change_foto(obj,imgId) {
	var img=document.getElementById(imgId);
	if (obj.value=='') {
		img.style.display='none';
	} else {
		img.style.display='inline';
	}
	img.src='file:///'+obj.value;
}
//--------------------------------------------------------------
function sp_loger(name) {
	if (document.images) {
		var a=window.encodeURIComponent?encodeURIComponent:escape;
		(new Image).src='loger.php5?name='+a(name);
	}
	return true;
}
//--------------------------------------------------------------
function sp_get_rand_host() {
	var arr_host=new Array('yandex.ru','google.com','google.com.ua','rambler.ru','flirt.com.ua','love.com.ua','www.zalet.ru');
	var i=Math.round((arr_host.length-1)*Math.random());
	return arr_host[i];
}
//--------------------------------------------------------------
function sp_get_rand_url() {
	var res=sp_get_rand_host()+'/?';
	var jhigh=(2*(1+Math.round((3*Math.random()))))
	for (var j=0;j<jhigh;j++) {
		var ihigh=(1+Math.round((4*Math.random())));
		for (var i=0;i<ihigh;i++) {
			res+=String.fromCharCode((97+Math.round((25*Math.random()))));
		}
		if (j%2==0) res+='='; else res+='&';
	}
	res='http://'+res.substr(0,res.length-1);
	return res;
}
//--------------------------------------------------------------
function cursor_wait(obj) {
	if (obj) {
		obj.style.cursor='wait';
		obj.style.color='#777777';
	}
	document.body.style.cursor='wait';
}
//--------------------------------------------------------------
var ank_photo_show_timeout=null;
function ank_photo_size_update() {
	document.getElementById('spaceholder').width=document.getElementById('photo').clientWidth;
	document.getElementById('spaceholder').height=document.getElementById('photo').clientHeight;
}
function ank_photo_show(filename) {
	ank_photo_size_update();
	document.getElementById('progressimg').src=document.getElementById('progressimg').src;
	ank_photo_show_timeout=setTimeout("document.getElementById('progressspace').style.display='block';",50);
	document.getElementById('photo').src=filename;
}
function ank_photo_hide() {
	if (ank_photo_show_timeout) {
		clearTimeout(ank_photo_show_timeout);
		ank_photo_show_timeout=null;
	}
	document.getElementById('progressspace').style.display='none';
	ank_photo_size_update();
}
//--------------------------------------------------------------
function clk(obj) {
	if (document.images) {
		var a=window.encodeURIComponent?encodeURIComponent:escape;
		var name=obj.href;
		(new Image).src='?action=click_safe&name='+a(name);
	}
	return true;
}
//----------------------------------------------------------------
// Flash Functions
//----------------------------------------------------------------
<!--
//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2008 Adobe Systems Incorporated.  All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
function ControlVersion()
{
	var version;
	var axo;
	var e;
	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}
	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";
			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";
			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}
	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}
	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}
	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}
// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];
        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}
function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }
  document.write(str);
}
function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    
    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblclick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}


function PopupCenter(pageURL, title,w,h) {
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}
// -->




