// Photo-Graffix
// Steve Deisley - Ravenart-Graffix 2009
var type = "IE";
//function BrowserSniffer() {
var userAgent = navigator.userAgent.toLowerCase();
if (userAgent.indexOf("opera") > -1) type="OP";//Opera
else if (userAgent.indexOf("firefox") > -1) type="FF";//Firefox
else if (userAgent.indexOf("netscape") > -1) type="NN";//Mozila e.g. Netscape 6 upwards
else if (userAgent.indexOf("msie") > -1) type="IE";//Internet Explorer e.g. IE4 upwards
else if (userAgent.indexOf("chrome") > -1)type="CH";//Google Chrome
	//alert("Your browser is"+type);
//}
//addthis=========
q = top.location.search.substring(1);
get = new Array();
q = q.split("&");
for (part in q) {
    i = q[part];
    i = i.split("=");
    get[i[0]] = i[1];
}
var myRegExp01 = /addthismode=01/;
var myRegExp02 = /addthismode=02/;
var myRegExp03 = /addthismode=03/;
var string = top.location.search;
var match01 = string.search(myRegExp01);
var match02 = string.search(myRegExp02);
var match03 = string.search(myRegExp03);
if(match01 != -1){
	var aName = "";
	var simgName = "";
}
if(match02 != -1){
	var aName = get["album"]
}
if(match03 != -1){
    var aName = get["album"]
	var simgName = get["img"]
}
//addthis=========

function flashmovie(adm) {
var wwxtras = xtras;
var albumName = aName;
var siName = simgName;
var winw = (screen.width);
var winh = (screen.height);

if (opener && !opener.closed){
    var wwName = 1;
	}else{
	    var wwName = 0;
	}

document.write('<embed src="swf/flash_AS_detection.swf?admin='+adm+'&album='+albumName+'&scrw='+winw+'&scrh='+winh+'&simg='+siName+'&popped='+wwName+'&browser='+type+"&xtras="+wwxtras);
document.write('" width="100%" height="100%" align="middle" quality="high"  scale="noscale"  wmode="transparent"  bgcolor="#FFFFFF" name="RavenGallery" allowscriptaccess="sameDomain" ');
document.write('allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/></embed>');
document.write('</object>');
}
function homemovie() {
    flashmovie(0)
}
function home_admin_movie() {
    flashmovie(1)
}
function newWindow(mypage, myname, w, h, scroll, amode) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 4;
//window.amode2 = amode;
//var def1 = amode;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',statusbar=0,toolbar=0,scrollbars='+scroll+'location=0,menubar=0,resizable=1'
win = window.open(mypage, amode, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus();}

}
function refresh() {
    window.location.reload( false );
}
function getFlashMovie(movieName) {   
var isIE = navigator.appName.indexOf("Microsoft") != -1;   
return (isIE) ? window[movieName] : document[movieName];  
}
function check_upload() {
var flashMovie=getFlashMovie("RavenGallery");
flashMovie.SetVariable("uploadresult", "1");
}
function browser_ver() {

if(window.parent.frames.length >= 1){
    if (parent.wid){
	var flashMovie=getFlashMovie("RavenGallery");
    flashMovie.SetVariable("bv", "1");
	}
	
}else{
	var flashMovie=getFlashMovie("RavenGallery");
    flashMovie.SetVariable("bv", "0");
}

}

function upload_more() {
var flashMovie=getFlashMovie("RavenGallery");
flashMovie.SetVariable("upload_more", "1");
}

function setElementVisibility(elementToSet, showItSwitch, keepPlacementSwitch){
 if (showItSwitch) {
   elementToSet.style.display = "inline";
   elementToSet.style.visibility = "visible";
 }
 else{
   if (keepPlacementSwitch) {
     elementToSet.style.display = "inline";
     elementToSet.style.visibility = "hidden";
   }
   else{
     elementToSet.style.display = "none";
   }
 }
}
function showpg(){
 setElementVisibility(document.getElementById("pbpg"), true);
}
//addthis=========
function showAddThis(full_url, addthis_mode, album, img) {
if(addthis_mode == "01"){
    addthisalbum = "";
    addthisimage = "";
}else if(addthis_mode == "02"){
    addthisalbum = "&album="+album;
	addthisimage = "";
}else if(addthis_mode == "03"){
    addthisalbum = "&album="+album;
	addthisimage = "&img="+img;
}

if (top === self) {
final_url = top.location.href+"?"+addthisalbum+addthisimage;
title = "";
} else {
final_url = top.location.href+"?addthismode="+addthis_mode+addthisalbum+addthisimage;
title = top.document.title;
}
addthis_open(document.body, "", final_url, title);
}
//addthis=========
function hideAddThis() {
addthis_close(document.body);
}
function addJavascript(jsname,pos) {
var th = document.getElementsByTagName(pos)[0];
var s = document.createElement('script');
s.setAttribute('type','text/javascript');
s.setAttribute('src',jsname);
th.appendChild(s);
}

addJavascript('http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4db0efd81ea6aa44','head');

//
