function getClientWidth(){return document.documentElement.clientWidth}
function getClientHeight(){return document.documentElement.clientHeight}
function addLoadEvent (func) {
	 var oldonload = window.onload;
	 if (typeof window.onload != 'function') {window.onload = func;}
	else {window.onload = function() {if (oldonload) oldonload();func();}}}
function by_id (id) {
	var res = document.getElementById(id);
	return res;
}
function by_tag (tag,where) {
	var res=0;
	var where_=where ? where:document;
	var out_ = where_.getElementsByTagName(tag);
	if (out_.length == 1) {res=out_[0]} else {res=out_}
	return res;
}
function by_class(clname,obj,tag_name){
  var tn=tag_name ? tag_name:'*';
  var elmts=by_tag(tn,obj);
  var _out=new Array();
  var i=0, j=0;
  while(elmts[i]){
	if(elmts[i].className==clname){
	  _out[j]=elmts[i];
	  j++;
	}
	i++;
  }
  var res=0;
  if (_out.length == 1) {res=_out[0]} else {res=_out}
  return res;
}

var girls_tab = new Array();
girls_tab['01']=new Array();
girls_tab['01']['loc']='Japan';
girls_tab['01']['story']='That was a business trip to Japan, I thought I\'d die from boredom there, instead I met this hot Japanese chick, so wild in bed, I was too busy fucking her to get bored ';
girls_tab['01']['link']='Watch asian gfs homeporn';

girls_tab['02']=new Array();
girls_tab['02']['loc']='China';
girls_tab['02']['story']='I\'ve been dating this sexy Chinese babe for about a year and there\' no way I\'m gonna dump her, sexy girl rides my cock so rough I can\'t help crying her name over & over';
girls_tab['02']['link']='Watch asian gfs homeporn';

girls_tab['03']=new Array();
girls_tab['03']['loc']='Miami';
girls_tab['03']['story']='Miami beaches are crowded with hot babes in bikini, who new I\'d find there the hottest asian chick I\'ve ever seen and that she\'d let me fuck her in our first date?';
girls_tab['03']['link']='Watch asian gfs homeporn';

girls_tab['04']=new Array();
girls_tab['04']['loc']='New-York';
girls_tab['04']['story']='My new teen girlfriend is half Chinese, I\'m not madly in love with her, but what an idiot you must be to break up with a chick who\'s a professional cock sucker? ';
girls_tab['04']['link']='Watch asian gfs homeporn';

girls_tab['05']=new Array();
girls_tab['05']['loc']='Canada';
girls_tab['05']['story']='This home made porn was filmed in Canada, lucky dude met his sexy asian girlfriend in the subway, who would guess! Watch these two fuck in front of the camera';
girls_tab['05']['link']='Watch asian gfs homeporn';

girls_tab['06']=new Array();
girls_tab['06']['loc']='Brooklyn';
girls_tab['06']['story']='Hot asian girl was supposed to be my employee. I didn\'t give her a job but I asked her on a date. Sexy doll turned out to be wild, watch scenes from our crazy sex life';
girls_tab['06']['link']='Watch asian gfs homeporn';

girls_tab['07']=new Array();
girls_tab['07']['loc']='Italy';
girls_tab['07']['story']='Home made porn video made on vacation in Italy. Dude and his horny asian girlfriend spent the night fucking in all positions that their minds could come up with';
girls_tab['07']['link']='Watch asian gfs homeporn';

girls_tab['08']=new Array();
girls_tab['08']['loc']='Korea';
girls_tab['08']['story']='Lustful Korean babe is not only a skillful hairdresser, but also a great fuck, she shamelessly exposes her tasty pussy and lets me thrust hard into the soaking hole!';
girls_tab['08']['link']='Watch asian gfs homeporn';




function getStyle(e,s){
  var v=null;
  if(document.defaultView && document.defaultView.getComputedStyle){
    var cs=document.defaultView.getComputedStyle(e,null);
    if(cs && cs.getPropertyValue) v=cs.getPropertyValue(s);
  }
  if(!v && e.currentStyle) v=e.currentStyle[s];
  return v;
}

function tabs(obj) {
	var inners = by_id('inners_00');
	var lis = new Array();
	var i = 0;
	var tab = by_tag('li',by_id('tab_nav'));
	var imgs = by_tag('img',inners);
	inners.className = 'inners '+obj.className+'_inner';
  var lis=by_tag('li',by_id('tabs01'));
	for (i=0;i<7;i++) {
		if (by_tag('a',lis[i]).lang != obj.lang) {lis[i].className='';}
		else{lis[i].className = 'act'}
	}
	
	var name=obj.lang;
	imgs[0].src='#';
	imgs[1].src='#';
	imgs[2].src='#';
	imgs[3].src='#';
	imgs[4].src='#';
	imgs[5].src='#';  
	
	this.setTimeout(function() {
	imgs[0].src='images/set_block/'+name+'/01.jpg';
	imgs[1].src='images/set_block/'+name+'/02.jpg';
	imgs[2].src='images/set_block/'+name+'/03.jpg';
	imgs[3].src='images/set_block/'+name+'/04.jpg';
	imgs[4].src='images/set_block/'+name+'/06.jpg';
	imgs[5].src='images/set_block/'+name+'/05.jpg';},800)
	by_id('girl_loc').innerHTML=girls_tab[name]['loc'];
	by_id('girl_story').innerHTML=girls_tab[name]['story'];	
	by_id('girl_link').innerHTML=girls_tab[name]['link'];
}

function submit_h() {
	var cont = by_id('mem_submit');
	var b_height = document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
	cont.style.height = b_height - 342 + 'px';
}

function mem_submit_h() {
	var cont = by_id('mem_submit');
	var b_height = document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
	cont.style.height = b_height - 328 + 'px';
}

/* Bookmark */
var urlAddress = document.location;
var pageName = document.title;

function bookmark_(){
 if (window.sidebar) // firefox
 window.sidebar.addPanel(pageName, urlAddress, "");
 else if(window.opera && window.print){ // opera
 var elem = document.createElement('a');
 elem.setAttribute('href',urlAddress);
 elem.setAttribute('title',pageName);
 elem.setAttribute('rel','sidebar');
 elem.click();
 } else if(document.all)// ie
 window.external.AddFavorite(urlAddress, pageName);
}
/* Bookmark */

function cumulativeOffset(element) {
  var valueT = 0, valueL = 0;
  do {
    valueT += element.offsetTop  || 0;
    valueL += element.offsetLeft || 0;
    element = element.offsetParent;
  } while (element);
  return {'top':valueT,'left':valueL};
}



var tempimg;
var loader;
//

function createLoader(m,t,l){
  if(m=='create'){
    loader=document.createElement('img');
    document.body.insertBefore(loader,document.body.firstChild);
    loader.src='/images/loader.gif';
    loader.width='31'; loader.height='31';
    loader.style.position='absolute';
    loader.style.display='none';
    loader.style.top=t+'px';
    loader.style.left=l+'px';
    loader.style.display='block';
    loader.style.zIndex='1010';
  }else{
    if(!loader) return 0;
    document.body.removeChild(loader);
    delete loader;
    loader=null;
  }  
}

function _setStyle(o,st){
  for(var key in st) if(st.hasOwnProperty(key)){
    o.style[key]=st[key];
  }
}
function createCloseBtn(m,forwhat,callback,side){
  if(m=='create'){    
    var closeBtn=document.createElement('div');
    closeBtn.id='closeBtn0';    
    closeBtn.innerHTML='<strong>CLOSE</strong>';
    _setStyle(closeBtn,{
      position:'absolute',
      zIndex:'1010',
      border:'2px outset #B00',
      backgroundColor:'#B00',
      fontFamily:'Arial',
      fontSize:'12px',
      fontWeight:'normal',
      padding:'0 3px',
      color:'#FFF',
      cursor:'pointer'
    });
    closeBtn.onmouseover=function(ev){
      _setStyle(this,{backgroundColor:'#F00',borderColor:'#F00'});
    }
    closeBtn.onmouseout=function(ev){
      _setStyle(this,{backgroundColor:'#B00',borderColor:'#B00'});
    }
    closeBtn.onmousedown=function(ev){
      _setStyle(this,{border:'2px inset #F00'});
    }
    closeBtn.onclick=function(ev){      
      callback(ev);      
    }
    document.body.insertBefore(closeBtn,document.body.firstChild);
    var forwhatOffs=cumulativeOffset(forwhat);
    var t=0,l=0;
    t=forwhatOffs.top+6;
    switch(side){
      case 'left':{
        l=forwhatOffs.left+5;
      }break;
      case 'right':{
        l=forwhatOffs.left+forwhat.offsetWidth-closeBtn.offsetWidth-5;
      }break;
    }    
    _setStyle(closeBtn,{top:t+'px',left:l+'px'});
  }else{
    var closeBtn=by_id('closeBtn0');
    if(closeBtn){
      document.body.removeChild(closeBtn);
      delete closeBtn;
      closeBtn=null;
    }    
  }  
}

function showPhoto(lobj,purl){
  var deleteImg=function(iobj){
    iobj.onload=null;
    iobj.onclick=null;  
    document.body.removeChild(iobj);
    createLoader(0);
    delete iobj;
  }  
  var imgborderw=1;
  var cw=getClientWidth()-imgborderw; var ch=getClientHeight()-imgborderw;
  
  tempimg=by_id('tempimg');  
  if(tempimg){deleteImg(tempimg);} 
  var timg=by_tag('img',lobj);
  var timgOffs=cumulativeOffset(timg);  
  createLoader('create',timgOffs.top+Math.round((timg.offsetHeight-31)/2)+3,timgOffs.left+Math.round((timg.offsetWidth-31)/2)+3);  
  
  
  
  tempimg=document.createElement('img');
  document.body.insertBefore(tempimg,document.body.firstChild);
  tempimg.id='tempimg';  
  tempimg.style.position='absolute';
  tempimg.style.zIndex='1000';  
  
  tempimg.style.visibility='hidden';
  setTimeout('tempimg.src=\''+purl+'\'',20);
  
  
  
  tempimg.onclick=function(ev){
    createCloseBtn(0);
    document.body.removeChild(tempimg);
    createLoader(0,0,0);
    createFade(0);
  }
  
  tempimg.onload=function(ev){
    //alert('aaa');   return false;    
    createLoader(0,0,0);
    createFade('create');
    
    var ih=tempimg.offsetHeight; var iw=tempimg.offsetWidth;
    var cih=ih; var ciw=iw;
    var iar=iw/ih;
    if(cih>ch){tempimg.height=ch;cih=ch;ciw=Math.round(cih*iar);tempimg.width=ciw;}
    if(ciw>cw){tempimg.width=cw;ciw=cw;cih=Math.round(ciw/iar);tempimg.height=cih;}
    var itop=(document.documentElement.scrollTop+Math.round((ch-cih)/2));
    var ileft=Math.round((cw-ciw)/2);
    tempimg.style.visibility='visible';
    tempimg.style.top=itop+'px';
    tempimg.style.left=ileft+'px';    
    tempimg.style.border=imgborderw+'px solid #FFFFFF';    
    createCloseBtn('create',tempimg,tempimg.onclick,'right');
    //alert(fade.style.filter);
  }   
}


var fade;
function createFade(m){
  if(m!='create'){
    if(fade){
      document.body.removeChild(fade);
      delete fade;fade=null;
    }
    return true;
  }
  if(fade){
    delete fade; fade=null;
  }
  var cw=getClientWidth(); var ch=getClientHeight();
  fade=document.createElement('div');
  var st=fade.style;
  st.position='absolute';
  st.zIndex='900';
  st.width='100%'; st.height=document.body.offsetHeight+'px';
  st.opacity='0.8'; st.filter='alpha(opacity=80)';
  st.background='#000';
  document.body.insertBefore(fade,document.body.firstChild);
  /*
  fadeFadein=function(o){
    if(o>=80){      
      return true;
    }
    o+=5;
    st.opacity=(o/100);
    st.filter='alpha(opacity='+o+')';
    this.setTimeout('fadeFadein('+o+')',20);
  }
  this.setTimeout('fadeFadein(0)',300);
  */
  
}

var plctnr,closelink;

function watchMovie(vurl,vscr){  
  if(plctnr){
    createFade(0);
    plctnr.removeChild(closelink);
    document.body.removeChild(plctnr);
    delete closelink; delete plctnr;
    closelink=null; plctnr=null;
  }
  var cw=getClientWidth()-0; var ch=getClientHeight()-0;
  //var vscr=scrobj.src;
  plctnr=document.createElement('div');
  plctnr.style.position='absolute';
  plctnr.style.zIndex='1000'; 
  
  
  var plhtml='<div style=" border:0px solid #1362A0; line-height:0;"><embed src="player.swf" width="512" height="404" bgcolor="#000" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowfullscreen="true" allowscriptaccess="always" flashvars="vfile='+vurl+'&vscreen='+vscr+'" /></div>';
  plctnr.innerHTML=plhtml;
  document.body.insertBefore(plctnr,document.body.firstChild);  
  plctnr.style.top=(Math.round((ch-plctnr.offsetHeight)/2)+document.documentElement.scrollTop)+'px';
  plctnr.style.left=Math.round((cw-plctnr.offsetWidth)/2)+'px';
  plctnr.style.width='512px';
  plctnr.style.height='404px';
  plctnr.style.paddingTop='30px';
  createCloseBtn('create',plctnr,function(){
    createFade(0);
    createCloseBtn(0);    
    document.body.removeChild(plctnr);
    delete closelink; delete plctnr;
    closelink=null; plctnr=null;
  },'right');
  createFade('create');
}