//gallery functions
var imagenum = 1;
var galleryset = "Start";
var indexlimit = null;
var eid="gallerywindow";
var faded = false;
var opacity = 100;
var dir = 1;
var lastgallery = null;
var inout=true;
var op = 100;
var op2 = null;
var tim;
var startkey= 0;
var bgcolor= "transparent";
var IE = /*@cc_on!@*/false;

//var playing=true;
//var pp = "play";

//nextimage
function nextimage(){
if (dir==1){
imagenum += 1;}
else if (dir==0){
imagenum -= 1;
}
if (imagenum > indexlimit){
loopgallery();
}
if (imagenum < 1){
imagenum = indexlimit;
imagenum -=1;
}
sleep(300);
var x=document.getElementById(eid).src="Media/"+galleryset+"/"+galleryset+"_"+imagenum+".jpg";
setcopy();
}
//fade
function fadeimageout(d){
if (galleryset=="Start"&&startkey == 0){
return 0;
}
if (galleryset=="Contact"&&startkey == 0){
return 0;
}
if (galleryset=="About"&&startkey == 0){
return 0;
}
startkey=0;
dir = d;
opacity = 100;
fadeout();
}
function fadeimagein(){
opacity = 0;
fadein();
}
function loopgallery(){
imagenum = 1;
}
function indexlimiter(){
if (galleryset=="Logo"){
indexlimit = 16;
}
if (galleryset=="Start"){
indexlimit = 1;
}
if (galleryset=="Advert"){
indexlimit = 8;
}
if (galleryset=="Print"){
indexlimit = 10;
}
if (galleryset=="Pack"){
indexlimit = 6;
}
if (galleryset=="Inter"){
indexlimit = 3;
}
if (galleryset=="About"){
indexlimit = 1;
}
if (galleryset=="Contact"){
indexlimit = 1;
}
nextimage();
}
function fade(){
document.getElementById(eid).style.opacity = (opacity / 100); 
document.getElementById(eid).style.MozOpacity = (opacity / 100); 
document.getElementById(eid).style.KhtmlOpacity = (opacity / 100); 
document.getElementById(eid).style.filter = "alpha(opacity=" + opacity + ")";

//if (galleryset!="Start"){
//document.getElementById('infocopy').style.opacity = (opacity / 100); 
//document.getElementById('infocopy').style.MozOpacity = (opacity / 100); 
//document.getElementById('infocopy').style.KhtmlOpacity = (opacity / 100); 
//document.getElementById('infocopy').style.filter = "alpha(opacity=" + opacity + ")";
//}

document.getElementById('floatcon').style.opacity = (opacity / 100); 
document.getElementById('floatcon').style.MozOpacity = (opacity / 100); 
document.getElementById('floatcon').style.KhtmlOpacity = (opacity / 100); 
document.getElementById('floatcon').style.filter = "alpha(opacity=" + opacity + ")";
if (faded==false){
fadeout();
}
else{
fadein();
}
}
function fadeout(){
opacity=opacity-5;
if (opacity == -10){
faded = true;
indexlimiter();
}
else{
faded = false;
setTimeout('fade()',10);
}
}
function fadein(){
opacity=opacity+5;
if (opacity == 110){
faded = false;
//if (galleryset=="Start"){
//clearTimeout(tim);
//tim=setTimeout('fadeimageout()',7000);
//}
if (galleryset!="Start" && imagenum==indexlimit){
sleep(350);
fadeimageout(1);
}
}
else{
faded = true;
setTimeout('fade()',10);
}
}
function sleep(ms){
var dt = new Date();
dt.setTime(dt.getTime() + ms);
while (new Date().getTime() < dt.getTime());
}
function changegallery(g){
clearTimeout(tim);
lastgallery=galleryset;
if (g==galleryset){
return 0;
}
else{
galleryset=g;
if (lastgallery!="Start"){
document.getElementById(lastgallery).src="Menu/"+lastgallery+".png";
}
imagenum=1;
document.getElementById('galleryframe').style.cursor="pointer";
document.getElementById('mailer').style.visibility="hidden";
if (galleryset == "Start"|| galleryset == "Contact"|| galleryset == "About"){
startkey=1;
document.getElementById('galleryframe').style.cursor="auto";
}
if (galleryset == "About"){
startkey=1;
document.getElementById('galleryframe').style.cursor="auto";
}
if (galleryset == "Contact"){
startkey=1;
document.getElementById('mailer').style.visibility="visible";
document.getElementById('galleryframe').style.cursor="auto";
}
fadeimageout();
}
}
/*function randomstart(){
var rand=Math.round(Math.random()*3);
rand+=1;
imagenum=rand;
document.getElementById(eid).src="Media/"+galleryset+"/"+galleryset+"_"+imagenum+".jpg";
setcopy();
}
function randomstart2(){
var rand=Math.round(Math.random()*3);
changegallery("Start");
rand+=1;
imagenum=rand;
setcopy();
}*/
function onstart(){
if (IE){
bgcolor="white";
}
document.getElementById(eid).src="Media/"+galleryset+"/"+galleryset+"_"+imagenum+".jpg";
document.getElementById('galleryframe').style.cursor="auto";
}
function onrestart(){
fadeimageout();
document.getElementById(eid).src="Media/"+galleryset+"/"+galleryset+"_"+imagenum+".jpg";
}
function mouseover(g){
document.getElementById(g).src="Menu/"+g+"m.png";
}
function mouseout(g){
if (g!=galleryset){
document.getElementById(g).src="Menu/"+g+".png";
}
}
//floater
function floater(v){
if (v==1 && inout==false){
v=0;
}
if (v==0){
op = 100;
document.getElementById('overlay').style.visibility="hidden";
document.getElementById('floatcopy').style.visibility="hidden";
inout=true;
//floaterfadeout();
}
else if (v==1){
op = 0;
document.getElementById('overlay').style.visibility="visible";
document.getElementById('floatcopy').style.visibility="visible";
inout=false;
//floaterfadein();
}
}
/*playpausebutton
function playpause(){
clearTimeout(tim);
if (playing == true){
pp = "pause";
playing = false;
}
else{
pp = "play"
playing = true;
tim=setTimeout('fadeimageout()',1000);
}
setcopy();
}*/
//FLOATER FADE
function floaterfade(){
document.getElementById('overlay').style.opacity = (op2 / 100); 
document.getElementById('overlay').style.MozOpacity = (op2 / 100); 
document.getElementById('overlay').style.KhtmlOpacity = (op2 / 100); 
document.getElementById('overlay').style.filter = "alpha(opacity=" + op2 + ")";
document.getElementById('floatcopy').style.opacity = (op / 100); 
document.getElementById('floatcopy').style.MozOpacity = (op / 100); 
document.getElementById('floatcopy').style.KhtmlOpacity = (op / 100); 
document.getElementById('floatcopy').style.filter = "alpha(opacity=" + op + ")";
if (inout==false){
floaterfadeout();
}
else{
floaterfadein();
}
}
function floaterfadeout(){
op=-50;
op2=op/2;
if (op <= 0){
inout = true;
document.getElementById('overlay').style.visibility="hidden";
document.getElementById('floatcopy').style.visibility="hidden";
}
else{
inout = false;
setTimeout('floaterfade()',1);
}
}
function floaterfadein(){
op=op+50;
op2=op/2;
if (op >=150){
inout = false;}
else{
inout = true;
setTimeout('floaterfade()',1);
}
}
//COPY
function setcopy(){
var copy="";
var mailer="<br />";
if (galleryset=="Logo"){
if (imagenum==1){
copy="Dr. Martens > DM’s Community Support for Youth logo.";
}
if (imagenum==2){
copy="Juice Factory > Surf, skate, snowboard mail order house.";
}
if (imagenum==3){
copy="Dr. Martens > Logo for DM’s alternative-style boot promotion.";
}
if (imagenum==4){
copy="Edge > Men’s designer clothing shop.";
}
if (imagenum==5){
copy="Wahl Surfboards > Logo for custom shaped retro line of surfboards.";
}
if (imagenum==6){
copy="Heirloom Preservation > Museum quality storage solutions for antique and vintage keepsakes.";
}
if (imagenum==7){
copy="Gravity Architecture > Specialty architectural firm.";
}
if (imagenum==8){
copy="Visitor’s Map > City map offering ad space for local retailers.";
}
if (imagenum==9){
copy="The Brotherhood > Christian men’s small group network.";
}
if (imagenum==10){
copy="Brooks Hill > Vintage venue that hosts special events like weddings and concerts.";
}
if (imagenum==11){
copy="Hydration Technologies, Inc. > Compact water filtration packs for wilderness use.";
}
if (imagenum==12){
copy="Daniela > Day spa specializing in facials and skin care for women.";
}
if (imagenum==13){
copy="Sebastian’s Cafe > Proposed logo for popular sandwich shop located in historic Sebastian’s General Store.";
}
if (imagenum==14){
copy="Cambria Pines Tree Service > Expert tree maintenance and tree removal assistance.";
}
if (imagenum==15){
copy="Manta Rey Restaurant > Proposed logo for exceptional steak and seafood restaurant.";
}
if (imagenum==16){
copy="<br/>";
}

}
if (galleryset=="Advert"){
if (imagenum==1){
copy="Hydration Technologies, Inc. > Ad series for water purification systems, specifically targeting the military.";
}
if (imagenum==2){
copy="Dr. Martens > Trade publication ad announcing the new DM’s for kids line.";
}
if (imagenum==3){
copy="WearAer Footwear > Ad series for WearAer awareness campaign.";
}
if (imagenum==4){
copy="The Oregonian > Ad series celebrating the diverse personalities of Portland neighborhoods.";
}
if (imagenum==5){
copy="Intel’s Screamline Rendering Service > Ad announcing launch of online animation rendering service.";
}
if (imagenum==6){
copy="U.S. Bank > Ad series for Private Client Group division of U.S. Bank.";
}
if (imagenum==7){
copy="Contact Lumber > Ad for natural wood wrapped moulding, available in clear 16 foot lengths.";
}
if (imagenum==8){
copy="<br/>";
}
}
if (galleryset=="Print"){
if (imagenum==1){
copy="Dr. Martens > Direct mail invitation for DM’s Open Airwair Sandal launch party.";
}
if (imagenum==2){
copy="Oregon Lottery > Poster series positioning Keno as youthful, fun game.";
}
if (imagenum==3){
copy="Morro Del Mar > Brochures for custom-built home development in Morro Bay.";
}
if (imagenum==4){
copy="Nortec Dental > Awareness brochure.";
}
if (imagenum==5){
copy="Pacific Northwest College of Art > Re:view, PNCA’s quarterly alumni newsletter.";
}
if (imagenum==6){
copy="Portland Spirit > Event Guide brochure for Portland Spirit’s fleet of dinner cruise ships.";
}
if (imagenum==7){
copy="QualMed Health Care > Member Handbook and wellness brochures.";
}
if (imagenum==8){
copy="Digitech Solutions > Brochure for Digitech’s InVision analysis software.";
}
if (imagenum==9){
copy="Contact Lumber > Sales folder and brochures.";
}
if (imagenum==10){
copy="<br/>";
}
}
if (galleryset=="Pack"){
if (imagenum==1){
copy="River Wind Vineyards > Sauvignon Blanc label.";
}
if (imagenum==2){
copy="Mirror Woods Winery > Semillon Ice Wine label.";
}
if (imagenum==3){
copy="The Jade Creek Winery > Cabernet Sauvignon label.";
}
if (imagenum==4){
copy="Craig Melia > Fantom CD packaging.";
}
if (imagenum==5){
copy="Queen Anne > Holiday gift tin for chocolate covered cherries.";
}
if (imagenum==6){
copy="<br/>";
}
}
if (galleryset=="Inter"){
if (imagenum==1){
copy="The Brotherhood > <a target='_blank' href='http://www.thebrotherhood.org'>www.thebrotherhood.org</a>";
}
if (imagenum==2){
copy="Precision Wire Components > <a target='_blank' href='http://www.pwcwire.com'>www.pwcwire.com</a>";
}
if (imagenum==3){
copy="<br/>";
}
}
if (galleryset=="Start"){
copy="<br/>";
}
if (galleryset=="Contact"){
copy="<br/>";
mailer="<br/><form method='post' action='mail.php'><input type=text style='position:absolute;left:154px;top:124px;width:244px;background-color:"+bgcolor+";border:0px solid white;' name='name'></input><input type=text name='email' style='position:absolute;left:154px;top:166px;width:244px;background-color:"+bgcolor+";border:0px solid white;'></input><textarea name='message' rows='5' cols='35' style='resize:none;position:absolute;left:100px;top:232px;background-color:"+bgcolor+";border:0px solid white;'></textarea><input type='image' src='sendbutton.jpg' style='position:absolute;top:333px;left:115px;border:0 solid white;'></input></form>";
}
if (galleryset=="About"){
copy="<br/>";
}
document.getElementById('infocopy').innerHTML=""+copy+"";
document.getElementById('mailer').innerHTML=""+mailer+"";
}
