// JavaScript Document
function NewWindow(id, type){
var url = '/sendform.php?id=' + id.toString() + '&type=' + type.toString();
var popit = window.open(url, 'Sendform', config='height=200, width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no,	location=no, directories=no, status=no');
}
function postbookmark(url, comment)
{ url = 'http://www.asredas.com' + url
title="AS RED AS ... - " + comment
if (document.all) { window.external.AddFavorite(url, title);} else if (window.sidebar) { window.sidebar.addPanel(title, url, "");}
}
function addbookmark()
{ url="http://www.asredas.com/"
title="As Red As ... Free Daily Links to beautiful Girls"
if (document.all) { window.external.AddFavorite(url, title);} else if (window.sidebar) { window.sidebar.addPanel(title, url, "");}
}
function hidestatus(){
window.status='Welcome to AS RED AS ...'
return true
}
if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)
document.onmouseover=hidestatus
document.onmouseout=hidestatus
if (top != self) top.location=self.document.location;
//////////////////////////////////////////////////////
function HideAndShow(id) {
	stat = $('comments_'+id).style.display;
	if ((stat == '') || (stat == 'none')) { $('comments_'+id).style.display = 'block'; } 
	else { $('comments_'+id).style.display = 'none';}
}
//////////////////////////////////////////////////////
function Hide(id) {	$('comments_'+id).style.display = 'none'; }
function Capital(e) { e.value=e.value.toUpperCase() }
////////////////////////////////////////////////////////
Array.prototype.indexOf=function(n){for(var i=0;i<this.length;i++){if(this[i]===n){return i;}}return -1;}
Array.prototype.lastIndexOf=function(n){var i=this.length;while(i--){if(this[i]===n){return i;}}return -1;}
Array.prototype.forEach=function(f){var i=this.length,j,l=this.length;for(i=0;i<l;i++){if((j=this[i])){f(j);}}};
Array.prototype.insert=function(i,v){if(i>=0){var a=this.slice(),b=a.splice(i);a[i]=value;return a.concat(b);}}
Array.prototype.shuffle=function(){var i=this.length,j,t;while(i--){j=Math.floor((i+1)*Math.random());t=arr[i];arr[i]=arr[j];arr[j]=t;}}
Array.prototype.unique=function(){var a=[],i;this.sort();for(i=0;i<this.length;i++){if(this[i]!==this[i+1]){a[a.length]=this[i];}}return a;}
if(typeof Array.prototype.concat==='undefined'){Array.prototype.concat=function(a){for(var i=0,b=this.copy();i<a.length;i++){b[b.length]=a[i];}return b;};}
if(typeof Array.prototype.copy==='undefined'){Array.prototype.copy=function(a){var a=[],i=this.length;while(i--){a[i]=(typeof this[i].copy!=='undefined')?this[i].copy():this[i];}return a;};}
if(typeof Array.prototype.pop==='undefined'){Array.prototype.pop=function(){var b=this[this.length-1];this.length--;return b;};}
if(typeof Array.prototype.push==='undefined'){Array.prototype.push=function(){for(var i=0,b=this.length,a=arguments;i<a.length;i++){this[b+i]=a[i];}return this.length;};}
if(typeof Array.prototype.shift==='undefined'){Array.prototype.shift=function(){for(var i=0,b=this[0];i<this.length-1;i++){this[i]=this[i+1];}this.length--;return b;};}
if(typeof Array.prototype.slice==='undefined'){Array.prototype.slice=function(a,c){var i=0,b,d=[];if(!c){c=this.length;}if(c<0){c=this.length+c;}if(a<0){a=this.length-a;}if(c<a){b=a;a=c;c=b;}for(i;i<c-a;i++){d[i]=this[a+i];}return d;};}
if(typeof Array.prototype.splice==='undefined'){Array.prototype.splice=function(a,c){var i=0,e=arguments,d=this.copy(),f=a;if(!c){c=this.length-a;}for(i;i<e.length-2;i++){this[a+i]=e[i+2];}for(a;a<this.length-c;a++){this[a+e.length-2]=d[a-c];}this.length-=c-e.length+2;return d.slice(f,f+c);};}
if(typeof Array.prototype.unshift==='undefined'){Array.prototype.unshift=function(a){this.reverse();var b=this.push(a);this.reverse();return b;};}
//////////////////////////////////////////////////////////////
function commentRequest(id) {	
	new Ajax.Request("/includes/ajcomments.php", {
		   method: 'post',
		   postBody: "name="+$F("name_"+id)+"&comment="+$F("comment_"+id)+"&postid="+$F("postid_"+id),
		   onComplete: showComment
	});
}
function showComment(req)
{
   brokenstring=req.responseText.split('~');
   id=brokenstring[0]; 	stringlength=brokenstring.length;	comment="";
   for (i=1; i<stringlength; i++) comment=comment+"~"+brokenstring[i];
   $('comments_'+id).innerHTML = comment.substring(1);
   $('comments_'+id).style.display = 'block';
}
///////////////////////////////////////////////////////////////
function commentShow(id) { 
	new Ajax.Request("/includes/ajshowcomments.php?postid="+id, { 
		onComplete: showComment 
	}); 
} 	
///////////////////////////////////////////////////////////////
function RandomVideos() {	
	new Ajax.Request("/includes/ajrandomvideo.php", {
		   onComplete: Randomvideoshow
	});
}
function Randomvideoshow(req){  $('randomvideos').innerHTML = req.responseText; }
