//--Notice of Copyright --//
/*
Copyright (C) 2003, Juxta Media LLC
All rights reserved.
Reproduction or use of code contained herein is strictly prohibited without
the expressed permission of Juxta Media LLC.

Under no circumstances shall this copyright notice be removed from this file.
*/
//--End Notice --//

function openDimWindow(file, width, height, winname) {
	if (!winname) winname = 'win1';
	dimension="toolbar=yes,status=no,location=no,scrollbars=yes,resizable=yes,width="+width+",height="+height; 
	window.open(file, winname, dimension);
}

function openWindow(file,winname) {
	var width = 600;
	var height = 500;
	openDimWindow(file, width, height, winname);
}

function openFullWindow(file,winname) {
	if (!winname) winname = 'win1';
	dimension="toolbar=no,status=yes,location=no,scrollbars=yes,resizable=yes,width=800,height=600"; 
	window.open(file, winname, dimension);
}

function archiveJob(file) {
	vMsg = 'Was this job filled through Bookjobs.com?\n\nClick Ok for Yes and Cancel for No.';
	if (confirm(vMsg)) 
		location=file+'&prmFilled=1'; 
	else 
		location=file;
}

function deleteConfirm( theURL) {
	if (confirm('Are you absolutely sure you wish to delete this record?  This is not recoverable.')) 
		location.href = theURL;
}

function clearConfirm( theURL) {
	if (confirm('Are you absolutely sure you wish to clear the sent records?  This is not recoverable.')) 
		top.location.href = theURL;
}

function bookmarkThis(url, desc) {
	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4) && (navigator.platform != "MacPPC")) {
		window.external.addFavorite(url, desc);
	}
	else {
		var msg = "Please hit";
		if (navigator.appName == "Netscape") 
			msg += " (CTRL-D) to add to your bookmark.";
		else if (navigator.platform == "MacPPC")
			msg += " (Apple-D) to add to your favorites.";
		else 
			msg += " the \"Favorites\" item in the menu bar to add to your favorites.";
		alert(msg);
	}
}

function ImageLoad( theImageName, theOnSrc, theOffSrc ) {
	if (document.images) {
	  eval(theImageName + "on = new Image()");
	  eval(theImageName + "off = new Image()");
	  eval(theImageName + "on.src = '" + theOnSrc + "'");
	  eval(theImageName + "off.src = '" + theOffSrc + "'");
	}
}
function ImageOn( theImageName ) {
  if (document.images) {
    document.images[theImageName].src = eval(theImageName + "on.src");
  }
}
function ImageOff( theImageName ) {
  if (document.images) {
    document.images[theImageName].src = eval(theImageName + "off.src");
  }
}

var marked_row = new Array;

function setColor (theRow, theRowNum, theColor, theState) {
	rowCellsCnt = theRow.cells.length;
	for (c = 1; c < rowCellsCnt-1; c++) {
		if (theState == 'down') {
			marked_row[theRowNum] = true;
		}
		/*else {
			if (downColor == '')
				theRow.cells[c].setAttribute('bgcolor', theColor, 0);
		}*/
		theRow.cells[c].setAttribute('bgcolor', theColor, 0);
	} 
}

function chooseStyles (browserName) {	
	if (browserName == "Microsoft Internet Explorer"){
		styleSheet = "styles_ie.css";
	}
	if (browserName == "Netscape"){
		styleSheet = "styles_ff.css";
	}
	else{
		styleSheet = "styles_ie.css";
	}
	return styleSheet;
}

/*JS FUNCTIONS ARE USED ACROSS PAGES TO PERFORM THE JS 

ACTIONS.. AS MUCH AS POSSIBLE PLEASE PUT THEM IN THIS FILE... 
*/

function enterApproval (pageid,_zone,itemType,histID,prmid){
	var lenofArgs = enterApproval.arguments.length;
	var _zone = ""
	var gotoURL;
	//gotoURL = "approveArticles.asp"; -- 5/16 changed to sendbackarticles.asp
	gotoURL = "sendBackArticles.asp";
	if (lenofArgs > 1)
		_zone = enterApproval.arguments[1];
	
	if (itemType=='MEDIA'){
		gotoURL = "approvemediaitems.asp"	
	}
	//alert ("/admin/"+gotoURL+"?itemType="+itemType+"&prmHistID="+histID+"&prmzone="+_zone+"&pageid="+pageid+"&prmid="+prmid);
	var _approveItems = window.open ("/admin/"+gotoURL+"?itemType="+itemType+"&prmHistID="+histID+"&prmzone="+_zone+"&pageid="+pageid+"&prmid="+prmid, "_approveItems","location=no,toolbar=no,menubar=no,status=no,resizable=no,width=500,height=300");
	_approveItems.focus();
		
		
}

function previewmediaitem(prmid, prmhistid)
{
var prevType = "&preview=1";
var gotoURL;
try{
if (previewmediaitem.arguments.length ==3){
	prevType="&preview=2";
//	gotoURL="/viewmedia.asp?prmmID="+prmid+"&prmhistid="+prmhistid+prevType
	gotoURL="previewmediaitem.asp?prmID="+prmid+"&prmhistid="+prmhistid+prevType


var _previewItems = window.open (gotoURL, "_previewItems");
_previewItems.focus();
}
else{
	gotoURL="previewmediaitem.asp?prmID="+prmid+"&prmhistid="+prmhistid+prevType


var _previewItems = window.open (gotoURL, "_previewItems","scrollbars=yes,location=no,toolbar=no,menubar=no,status=no,resizable=yes,width=800,height=800");
_previewItems.focus();
}
}catch(e){
}

}

function Runourcompanies()
{
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="359" height="359">\n');
    document.write('<param name="movie" value="/sites/Corporate/images/media/donut.swf" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<embed src="/sites/Corporate/images/media/donut.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="359" height="359" />\n');
    document.write('</object>\n');
}


function Runcareers()
{
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="300" height="300">\n');
    document.write('<param name="movie" value="/sites/Corporate/images/media/culture.swf" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<embed src="/sites/Corporate/images/media/culture.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="300" height="300" />\n');
    document.write('</object>\n');
}

function Runtechnology()
{
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="440" height="278">\n');
    document.write('<param name="movie" value="/sites/Corporate/images/media/chart_diagram.swf" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param name="BGCOLOR" value="#E4EAD1" />\n');
	document.write('<embed src="/sites/Corporate/images/media/chart_diagram.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="426" height="278" />\n');
    document.write('</object>\n');
}

function RunFlash28()
{
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="440" height="278">\n');
    document.write('<param name="movie" value="/sites/Corporate/images/media/472_TechSolutions4.swf" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param name="BGCOLOR" value="#FFFFFF" />\n');
	document.write('<embed src="/sites/Corporate/images/media/472_TechSolutions4.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="426" height="278" />\n');
    document.write('</object>\n');
}

function RunFlash31()
{
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="425" height="330">\n');
    document.write('<param name="movie" value="/sites/Corporate/images/media/486_CompsGraphic3.3.swf" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param name="BGCOLOR" value="#FFFFFF" />\n');
	document.write('<embed src="/sites/Corporate/images/media/486_CompsGraphic3.3.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="425" height="330" />\n');
    document.write('</object>\n');
}

function RunFlash22()
{
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="278" height="278">\n');
    document.write('<param name="movie" value="/sites/Corporate/images/media/281_culture.swf" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param name="BGCOLOR" value="#FFFFFF" />\n');
	document.write('<param name="align" value="center" />\n');
	document.write('<embed src="/sites/Corporate/images/media/281_culture.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="426" height="278" />\n');
    document.write('</object>\n');
}

function RunFlashHome()
{
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="361" height="249">\n');
    document.write('<param name="movie" value="/sites/Corporate/images/media/480_HomePageFlashNoSound3.swf" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<embed src="/sites/Corporate/images/media/480_HomePageFlashNoSound3.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="361" height="249" />\n');
    document.write('</object>\n');
}


function RunFlashVideo()
{
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="361" height="249">\n');
    document.write('<param name="movie" value="/sites/Corporate/videos/WirelessVideo.swf" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<embed src="/sites/Corporate/videos/WirelessVideo.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="361" height="249" />\n');
    document.write('</object>\n');
}


function checkForFlashCookie(){
    var allcookies = document.cookie;
    var pos = allcookies.indexOf("hasSeenFlash=");
    if(pos != -1){
        var start = pos + 13;
        var end = allcookies.indexOf(";", start);
        if(end == -1){
            end = allcookies.length;
        }
        var value = allcookies.substring(start,end);
        if(value==1){
            return true;
        }
        else{
            return false;
        }
    }
    else{
        setFlashCookie();
        return false;
    }    
}
function setFlashCookie(){
    document.cookie = "hasSeenFlash=1";
}


function RunhomewCookie()
{
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="550" height="168"">\n');
    document.write('<param name="movie" value="/sites/corporate/images/media/introb.swf" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param name="BGCOLOR" value="#E4EAD1" />\n');
	document.write('<embed src="/sites/corporate/images/media/introb.swf" play="flase" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="550" height="168" />\n');
    document.write('</object>\n');
}


function RunhomenoCookie()
{
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="550" height="168"">\n');
    document.write('<param name="movie" value="/sites/corporate/images/media/intro.swf" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param name="BGCOLOR" value="#E4EAD1" />\n');
	document.write('<embed src="/sites/corporate/images/media/intro.swf" play="true" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="550" height="168" />\n');
    document.write('</object>\n');
}
