if (navigator.appName=="Netscape"){ //Netscape 4.x 
  document.write("<link rel='stylesheet' href='../css/ad_netscape.css' type='text/css'>"); 
} else {
  document.write("<link rel='stylesheet' href='../css/ad.css' type='text/css'>"); 
}

var bookmarkurl="http://www.gangstasparty.com";
var bookmarktitle="GANGSTASPARTY.com - Daily Hip Hop News, Audio, Video, Mixtapes";

function preferiti(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function home() {  
if(document.all)
document.body.style.behavior='url(#default#homepage)';
document.body.setHomePage('http://www.gangstasparty.com');
}

document.oncontextmenu = nocontextmenu; 
document.onmousedown = norightclick; 
if (window.Event) 
document.captureEvents(Event.MOUSEUP); 


function norightclick(e) 
{ if (window.Event) 
{ if (e.which == 2 || e.which == 3) 
{ return false; } 
} 
else 
{ if (event.button == 2 || event.button == 3) 
{ event.cancelBubble = true 
event.returnValue = false; 
return false; 
} 
} 
} 

function nocontextmenu() 
{ event.cancelBubble = true 
event.returnValue = false; 
return false; 
} 

function apriTerm(val){
		linkk= "term.php"
		window.open(linkk,"blank","toolbar=no,width=630,height=320,top=0,left=0")
}

function apriad(val){
		linkk= "ad.html"
		window.open(linkk,"blank","toolbar=no,width=550,height=720")
}

//NEWSLETTER
function inviaDati(){
	if (document.frmEmail.FEmail.value=="" || document.frmEmail.FEmail.value=="Your Email"){
		alert("Inserisci la tua email");
	}else{
		document.frmEmail.FInviaN.value="true"
		document.frmEmail.submit();
	}
}

//Controllo Email 
function controlloEmail(t) { 
 	var pos=0;
	var alfabeto = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
	var numeri = "0123456789";	
	var caratteri = alfabeto + numeri;
	for (i=0; i<(t.value.length); i++)
	{
		stringa = t.value.substring(i,i+1);
		pos = caratteri.indexOf(stringa);
	}
	if (t.value.length>0){
		if (t.value.indexOf ('@',0) == -1 || t.value.indexOf ('.',0) == -1 || 
			t.value.indexOf ('.',0) == 0 || t.value.indexOf ('@',0) == 0 || 
			t.value.indexOf ('.',0) == t.value.length-1 || t.value.indexOf ('@',0) == t.value.length-1) 
			pos = -1;
	}
	if (pos == -1){
		alert("Formato email non corretto") 
		t.select(); 
		return false; 
	}
}

function apriinvioart(idnot){
	linkk= "../gen/emailarticle.php?idnot="+idnot
	window.open(linkk,"blank","toolbar=no,width=400,height=350")
}

function inviaCommento(f)
 {
	var strErr = "";
	if (f.FRes.value.length==0)
		strErr = strErr +  "Your Name?\n";

	if (strErr.length>0)
	{ 
		alert (strErr);
	}else{
		f.FInviaCom.value=true;
		f.submit();
	}
}
function inviaCommentoMul(f)
 {
	var strErr = "";

	if (f.FRes.value.length==0)
		strErr = strErr +  "Name\n";

	if (f.FDes.value.length==0)
		strErr = strErr +  "Comment\n";
		
	
	if (strErr.length>0)
	{ 
		alert (strErr);
	}else{
		f.FInviaComm.value=true;
		f.submit();
	}
}
function inviaDedica(f)
 {
	var strErr = "";
	if (f.FRes.value.length==0)
		strErr = strErr +  "Scrivere il nome\n";

	if (f.FDes.value.length==0)
		strErr = strErr +  "Scrivere il commento\n";

	if (strErr.length>0)
	{ 
		alert (strErr);
	}else{
		f.FInviaDed.value=true;
		f.submit();
	}
}

function inviaLink(f)
 {
	var strErr = "";

	if (f.FRes.value.length==0)
		strErr = strErr +  "Error: Title\n";

	if (f.FDes.value.length==0)
		strErr = strErr +  "Error: Description\n";

	if (f.FUrl.value.length==0)
		strErr = strErr +  "Error: Url\n";

	if (strErr.length>0)
	{ 
		alert (strErr);
	}else{
		f.FInviaCom.value=true;
		f.submit();
	}
}

function inviaModels(f)
{
	var strErr = "";

	if (f.FName.value.length==0)
		strErr = strErr +  "Error: Name\n";

	if (f.FSta.value.length==0)
		strErr = strErr +  "Error: State\n";

	if (f.FDet.value.length==0)
		strErr = strErr +  "Error: Description\n";

	if (strErr.length>0)
	{ 
		alert (strErr);
	}else{
		f.FInviaMod.value=true;
		f.submit();
	}
}

// **** GENERALE ****
// mode => 	T : Testo
//	   			N : Numerico	
// Controllo contenuto testuale / numerico
function controlloTestoNumero(t,mode)
{
 	var pos=0;
	var alfabeto = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ "
	var caratteriSpeciali = "'|!£$%&/()?^" + "\x5C" 
	var caratteri = alfabeto + caratteriSpeciali;
	var numeri = "0123456789";	

	for (i=0; i<(t.value.length); i++)
	{
		stringa = t.value.substring(i,i+1);
		switch (mode){
			case "T" : pos = caratteri.indexOf(stringa);
			break;
			case "N" : pos = numeri.indexOf(stringa);
			break;
		}
		if (pos==-1)
			break;
	}
	if (mode == "T" && pos==-1) 
	{
		alert ("ONLY TEXT");
		t.select();
		return false;
	}
	if (mode == "N" && pos==-1)
	{
		alert ("NO TEXT");
		t.select();
		return false;
	}
	return true;
}

function votaPlayer(val){
	linkk= "votomultimedia.php?id="+val
	window.open(linkk,"blank","toolbar=no,width=250,height=250")
}

//bottone lista
function mouseover_lista(menu,page){
menu.style.background='#F3CB09';
menu.style.color='#F3CB09';
} 

function mouseover_listaCommunity(menu,page){
menu.style.background='#990500';
} 

function mouseover_listamy(menu,page){
menu.style.background='#eeeeee';
menu.style.color='#aaaaaa';
} 

function mouseout_listaCommunity(menu,page){
menu.style.background='#F9C300';
} 

function mouseout_lista(menu){
menu.style.background='#FFFFFF'
menu.style.color='#990500';
} 

//Lista in homepage
function mouseout_listahp(menu){
menu.style.background='#993639'
} 

//Lista in homepage per la gallery
function mouseout_listahpGallery(menu){
menu.style.background='#000000'
} 

//Lista in my
function mouseout_listamy(menu){
menu.style.background='#bbbbbb'
} 

//fine bottone lista

function open_exclusive(val){
	linkk= "slideshow/index.php?id="+val
	window.open(linkk,"blank","toolbar=no,width=642,height=390,top=0,left=0")
}

function open_radio(){
	linkk= "http://www.shoutcast.com/shoutcast_player?stationid=268&Genre=hip&ContentFlag=1&uc=U&isCallInternal=NO&related=yes"
	window.open(linkk,"blank","toolbar=no,width=840,height=620,top=0,left=0")
}
