function menuon(x)
{
	x.style.background = "#C4C4C4";
	x.style.border = "1px solid #514C85";
}

function menuoff(x)
{
	x.style.background = "#ffffff";
	x.style.border = "1px solid #a2a2a2";
}

function menuonmessagecenter(x)
{
	//C4C4C4
	//x.style.background-image: url(/images/messagecenter/Orange-BG.jpg);
	x.style.background = '#F5C159';
	//x.style.border = "1px solid #514C85";
}
function menuoffmessagecenter(x)
{
	//x.style.background-image: url(/images/HeaderBG.jpg);
	x.style.background = '';
	//x.style.border = "1px solid #e2e2e2";
}

function menuoffheader(x)
{
	x.style.backgroundColor = "#ffffff";
	x.style.border = "1px solid #000000";
}

function CloseWindow()
{
	self.close();
}

function CloseandRefresh()
{
	opener.location.reload();
	self.close();
}

function CloseandRedirect(location)
{
	opener.location.href = location;
	self.close();
}

function Confirm()
{
	alert('Are You Sure?');
}

function CannotDelete()
{
	alert('You may not delete a category if it contains pictures. Please delete all the pictures first.');
}

function confirm_delete()
{
	if (confirm("Are you sure?")==true)
		return true;
	else
		return false;
}

//Show / Hide JS Functions
function showhide(layer_ref)
{	
	hza = document.getElementById(layer_ref);
	if (hza.style.display == 'block') 
	{
		hza.style.display = 'none'; 
	}
	else 
	{
		hza.style.display = 'block'; 
	}
}

function setHomePageLink()
{
	/*<!-- based on script from http://javascript.internet.com/page-details/set-homepage-link.html -->*/
	if (document.all){
		document.write('<a  rel="nofollow" href=\"#\" onClick="this.style.behavior=\'url(#default#homepage)\';this.setHomePage(\'http://www.toboc.com\');" title=\" IE users: Click here to make TOBOC.com your browser Start Page. (Opera: > Navigation > Set Home Page) \">');
		document.write('Make us your Homepage</a>');
	}
	// If it's Netscape 6, tell user to drag link onto Home button
	else if (document.getElementById){
		document.write('<a  rel="nofollow" style=\'cursor:help\' href="http://www.toboc.com" title=\" Make TOBOC.com your browser Start Page: drag this link onto the browser top-left Home graphic button \" onClick=\'return false\'>Make us your Homepage</a>');
	}
	// If it's Netscape 4 or lower, give instructions to set Home Page
	else if (document.layers){
		document.write('<span  title=\' Make TOBOC.com your browser Start Page: - Go to Preferences in the Edit Menu. Choose Navigator from the list on the left. Click on the Use Current Page button. \'>Make us your Homepage</span>');
	}
	// If it's any other browser, for which I don't know the specifications of home paging, display instructions
	else {
		document.write('<span  title=\' Make TOBOC.com your browser Start Page: - Go to Preferences in the Edit Menu. Choose Navigator from the list on the left. Click on the Use Current Page button. \'>Make us your Homepage</span>');
	}
}

var isIE = false; var navVer = navigator.appVersion; var ver = parseFloat(navVer);
var IEPos = navVer.indexOf('MSIE');
if (IEPos !=-1) { isIE = true; ver = parseFloat(navVer.substring(IEPos+5,navVer.indexOf(';',IEPos))); }
var isIE5up = (isIE && ver >= 5);

function addBookmark(bookmarkurl,bookmarktitle) 
{
	if (isIE5up){
		window.external.AddFavorite (bookmarkurl,bookmarktitle);
	} 
	else if(navigator.appName == "Netscape") {
		alert("Please press (CTRL-D) to bookmark this page.");
	} 
	else {
		alert("Sorry! Your browser doesn't support this function.");
	}
}

function Closebtn(x) {

    document.getElementById(x).style.display = "none";
    return false;
    
}

//BROWSERNAME = "";
//switch (navigator.appName.toLowerCase()) {
//    case "netscape":
//        BROWSERNAME = "ns";
//        break;
//    case "microsoft internet explorer":
//    default:
//        BROWSERNAME = "ie";
//        break;
//}

//switch (BROWSERNAME) {
//    case "ns":
//        window.addEventListener("load", _xScrollStick_init, false);
//        break;
//    case "ie":
//    default:
//        window.attachEvent("onload", _xScrollStick_init);
//}

//function _xScrollStick_init() {
//    var allTheScrollSticks = document.getElementsByTagName("div");
//    for (var i = 0; i < allTheScrollSticks.length; i++) {
//        if (allTheScrollSticks[i].className.match(/^((xScrollStick)|(.+ +xScrollStick)|(xScrollStick +.+)|(.+ +xScrollStick +.+))$/)) _xScrollStick_event_doInit(allTheScrollSticks[i]);
//    }
//    window_event_scroll();
//}

//function _xScrollStick_event_doInit(element) {
//    element.offX = element.offsetLeft;
//    element.offY = element.offsetTop;

//    element.Stick = _xScrollStick_method_Stick;
//    switch (BROWSERNAME) {
//        case "ns":
//            window.addEventListener("scroll", window_event_scroll, false);
//            break;
//        case "ie":
//        default:
//            window.attachEvent("onscroll", window_event_scroll);
//    }
//    document.body.parentNode.onscroll = window_event_scroll;

//}

//function window_event_scroll() {
//    var allTheScrollSticks = document.getElementsByTagName("div");
//    for (var i = 0; i < allTheScrollSticks.length; i++) {
//        if (allTheScrollSticks[i].className.match(/^((xScrollStick)|(.+ +xScrollStick)|(xScrollStick +.+)|(.+ +xScrollStick +.+))$/)) try { allTheScrollSticks[i].Stick(); } catch (e) { }
//    }
//}

//function _xScrollStick_method_Stick() {
//    var x = this.offX, y = this.offY, po = this;
//    this.style.position = "absolute";
//    x += document.body.parentNode.scrollLeft;
//    y += document.body.parentNode.scrollTop;
//    this.style.left = x + "px";
//    this.style.top = y + "px";


//}

function CompanyDescValidation(x) {
  
    var result = true;
    var quote;
    //            alert(x);
    var s = document.getElementById(x).value;
    quote = s.split(" ");

    //for (x = 0; x < quote.length; x++) {
      //  if (quote[x].length > 20) {
        //    result = false;

        //}
    //} 
   
    return result;
}

