var agt = navigator.userAgent.toLowerCase();
var isIE = ( agt.indexOf('msie') != -1 );
var isNS = ( agt.indexOf('mozilla') != -1 );
var isNS6 = ( agt.indexOf('netscape6') != -1 ); 
var d = document;

function reSize() {
  self.resizeTo( 500, 500 );
  self.scrollbars.visibility = false;
}

function poetWin( x ) {
  var w = window.open( x, "res", "width=300,height=500,scrollbars=yes,resizable=yes,menubar=no,statusbar=0" );
}

function siteWin( x, y ) {
	var topWin = open( x, "topWin", "width=600,height=100,toolbar=no,scrollbars=no,resizable=yes,menubar=no,screenX=10,screenY=10,left=10,top=10" );
}

function closeLyric() {
  var myFrame = parent.d.getElementById('myFrame'); 
  myFrame.style.display = "none";
}

function openLyric( page ) {
  var myFrame = d.getElementById('myFrame'); 
  if (page != "" ) {
    if( page == "none" )
      myFrame.style.display = "none";
    else {
      myFrame.src = page;
      myFrame.style.display = "block";
	  yshp_setPageX(myFrame,yg_getPageX(d.getElementById('frameCont')));
	  yshp_setPageY(myFrame,85);
    }
  }
  return false;
}

if (d.images) {
	bio = new Image;
	blog = new Image;
	music = new Image;
	video = new Image;
	lyrics = new Image;
	contact = new Image;
    subscribe = new Image;
    calendar = new Image;
	photos = new Image;
	press = new Image;
	links = new Image;
	art = new Image;
	bioo = new Image;
	blogo = new Image;
	musico = new Image;
	videoo = new Image;
	lyricso = new Image;
	contacto = new Image;
    subscribeo = new Image;
    calendaro = new Image;
	photoso = new Image;
	presso = new Image;
	linkso = new Image;
	arto = new Image;
	bioon = new Image;
	blogon = new Image;
	musicon = new Image;
	videoon = new Image;
	lyricson = new Image;
	contacton = new Image;
    subscribeon = new Image;
    calendaron = new Image;
	photoson = new Image;
	presson = new Image;
	linkson = new Image;
	arton = new Image;	
	
	bio.src = '/images/nav/bio.gif';
	blog.src = '/images/nav/blog.gif';
	music.src = '/images/nav/music.gif';
	video.src = '/images/nav/video.gif';
	lyrics.src = '/images/nav/lyrics.gif';
	contact.src = '/images/nav/contact.gif';
    subscribe.src = '/images/nav/subscribe.gif';
    calendar.src = '/images/nav/calendar.gif';
	photos.src = '/images/nav/photos.gif';
	press.src = '/images/nav/press.gif';
	links.src = '/images/nav/links.gif';
	art.src = '/images/nav/art.gif';
	bioo.src = '/images/nav/bioo.gif';
	blogo.src = '/images/nav/blogo.gif';
	musico.src = '/images/nav/musico.gif';
	videoo.src = '/images/nav/videoo.gif';
	lyricso.src = '/images/nav/lyricso.gif';
	contacto.src = '/images/nav/contacto.gif';
    subscribeo.src = '/images/nav/subscribeo.gif';
    calendaro.src = '/images/nav/calendaro.gif';
	photoso.src = '/images/nav/photoso.gif';
	presso.src = '/images/nav/presso.gif';
	linkso.src = '/images/nav/linkso.gif';
	arto.src = '/images/nav/arto.gif';	
	bioon.src = '/images/nav/bioon.gif';
	blogon.src = '/images/nav/blogon.gif';
	musicon.src = '/images/nav/musicon.gif';
	videoon.src = '/images/nav/videoon.gif';
	lyricson.src = '/images/nav/lyricson.gif';
	contacton.src = '/images/nav/contacton.gif';
    subscribeon.src = '/images/nav/subscribeon.gif';
    calendaron.src = '/images/nav/calendaron.gif';
	photoson.src = '/images/nav/photoson.gif';
	presson.src = '/images/nav/presson.gif';
	linkson.src = '/images/nav/linkson.gif';
	arton.src = '/images/nav/arton.gif';		
}

function imgOn(x,y) {
	eval( "d." + x + ".src=" + y + ".src" );
}

function imgOff(x,y) {
	eval( "d." + x + ".src=" + y + ".src" );
}

function imgSwap(x,y) {
	eval( "d." + x + ".src=" + y + "on.src" );
}

function validate(divName) {
	var errMsg = '';
	if( d.forms[0].topic.value == '' )
		errMsg += "- You must enter a Topic for your Post.<br>";
	if( d.forms[0].name.value == '' )
		errMsg += "- You must enter a Name for your Post.<br>";
	if( d.forms[0].getmail.checked == 1 && d.forms[0].email.value == '' )
		errMsg += "- You must enter an Email address to receive reply notifications to<br><span style=width:30px></span>your Post. Otherwise, uncheck the \"Send replies...\" checkbox.<br>";
	if( d.forms[0].msg.value == '' )
		errMsg += "- You must enter a Message for your Post.";

	if( errMsg == '' )
		return true;
	else
		writeErr(errMsg,divName);	
}
function writeErr( str, elmnt ) {
	if( isIE )
		d.all[elmnt].innerHTML = str;
	else if( isNS6 )
		d.getElementById(elmnt).innerHTML = str;
	else {
		str = '<span class=error><b>' + str + '</b></span>'; 
		lyr = eval('d.' + elmnt);
		lyrAlt = eval('d.' + elmnt + 'Vh'); 
		lyrAlt.pageX = lyr.pageX;
    	lyrAlt.pageY = lyr.pageY;		
		lyrAlt.d.open();
		lyrAlt.d.write(str);
		lyrAlt.d.close();
		lyrAlt.visibility = 'visible';
	}	
}

function email() {
  Rot13.write('<n uers="znvygb:frna@eulguzn.pbz">frna@eulguzn.pbz</n>');
}

function email_nav() {
  d.location = Rot13.convert('znvygb:frna@eulguzn.pbz');
}

function email_order() {
  Rot13.write('<n uers="znvygb:beqre@eulguzn.pbz">Rznvy</n>');
}

Rot13 = {
    map: null,
    convert: function(a) {
        Rot13.init();
        var s = "";
        for (i=0; i < a.length; i++) {
            var b = a.charAt(i);
            s += ((b>='A' && b<='Z') || (b>='a' && b<='z') ? Rot13.map[b] : b);
        }
        return s;
    },
    init: function() {
        if (Rot13.map != null)
            return;
        var map = new Array();
        var s   = "abcdefghijklmnopqrstuvwxyz";
        for (i=0; i<s.length; i++)
            map[s.charAt(i)] = s.charAt((i+13)%26);
        for (i=0; i<s.length; i++)
            map[s.charAt(i).toUpperCase()] = s.charAt((i+13)%26).toUpperCase();
        Rot13.map = map;
    },
    write: function(a) {
        d.write(Rot13.convert(a));
    }
}
