
var PHOTO_TYPE_ID=30
var COMMENT_TYPE_ID=33
Delegate=function(self,func)
{if(typeof(func)=="string"){func=self[func];}
var im_func=func.im_func;var im_preargs=func.im_preargs;var im_self=func.im_self;if(typeof(func)=="function"&&typeof(func.apply)=="undefined"){}
if(typeof(im_func)!='function'){im_func=func;}
if(typeof(self)!='undefined'){im_self=self;}
if(typeof(im_preargs)=='undefined'){im_preargs=[];}else{im_preargs=im_preargs.slice();}
var newFunc=function(){var args=[];for(var i=0;i<arguments.length;i++){args.push(arguments[i]);}
var me=arguments.callee;if(me.im_preargs.length>0){args=me.im_preargs.concat(args);}
var self=me.im_self;if(!self){self=this;}
return me.im_func.apply(self,args);}
newFunc.im_self=im_self;newFunc.im_func=im_func;newFunc.im_preargs=im_preargs;return newFunc;}
Broadcaster={_subscribers:[],_wrappers:[],_destroy:function(subs,i)
{var rmWrapper=true;var self=Broadcaster;var arr=self._subscribers[subs[i].event];for(var j=0;j<arr.length;j++){if(arr[j].caster==subs[i].caster&&arr[j].subs!=subs[i].subs){rmWrapper=false;}}
if(rmWrapper){if(subs[i].wrapper!=null){var arr=self._wrappers[subs[i].event];for(var j=0;j<arr.length;j++){if(arr[j].evtObj==subs[i].caster&&arr[j].wrapper==subs[i].wrapper){arr[j].wrapper=null;arr[j].evtObj=null;arr.splice(j,1);break;}}
var obj=subs[i].wrapper.evtObj;if(obj.detachEvent){obj.detachEvent(subs[i].event,subs[i].wrapper);}else if(obj.removeEventListener){obj.removeEventListener(subs[i].event,subs[i].wrapper,true);}}}
subs[i].wrapper=null;subs[i].caster=null;subs[i].event=null;subs[i].subs=null;subs[i].funct=null;subs[i]=null;subs.splice(i,1);},_destroyAll:function()
{var self=Broadcaster;var arr=self._subscribers;for(var key in arr){var sub=arr[key];for(var i=sub.length-1;i>-1;i++){self._destroy(sub[i],i);}}},broadcast:function(obj,eventName,params)
{if(!obj||!eventName)return;params=params||[];if(!(params instanceof Array)){params=[params];}
var self=Broadcaster;var arr=self._subscribers[eventName]||[];arr=arr.concat();for(var i=0;i<arr.length;i++){if(arr[i].caster==obj){arr[i].funct.apply(arr[i].sub,params);}}},subscribe:function(obj,event,objOrFunct,functOrStr)
{if(!obj||!event||!objOrFunct){if(typeof(console)!='undefined'){console.log('subscribe was not passed the correct params :');console.log("obj : "+obj);console.log("event : "+event);console.log("objOrFunct : "+objOrFunct);}
return;}
var sub;var funct;var wrapper;var self=Broadcaster;if(typeof(objOrFunct)=='function'){sub=window;funct=objOrFunct;}else if(typeof(objOrFunct)=='object'){sub=objOrFunct;if(typeof(functOrStr)=='function'){funct=functOrStr;}else if(typeof(functOrStr)=='string'){if(typeof(sub[functOrStr])=='function'){funct=sub[functOrStr];}}else{alert('Broadcaster.subscribe: functOrStr was invalid');return;}}else{alert('Broadcaster.subscribe: objOrFunct was invalid');return;}
if(typeof(obj.nodeType)!='undefined'||obj==window){if(obj.attachEvent){if(event.toLowerCase().indexOf('on')!=0){event="on"+event;}}else{if(event.toLowerCase().indexOf('on')==0){event=event.substr(2);}}
if(!self._wrappers[event])self._wrappers[event]=[];var found=false;for(var i=0;i<self._wrappers[event].length;i++){if(self._wrappers[event][i].evtObj==obj){found=self._wrappers[event][i].wrapper;break;}}
if(found!=false){wrapper=found;}
else{wrapper=function(evt){evt=evt||window.event;var foo={};for(var key in evt){foo[key]=evt[key];}
foo['target']=evt.target||evt.srcElement;var me=arguments.callee;Broadcaster.broadcast(me.evtObj,me.event,[foo]);}
wrapper.event=event;wrapper.evtObj=obj;self._wrappers[event].push({'wrapper':wrapper,'evtObj':obj});if(obj.attachEvent){obj.attachEvent(event,wrapper);}else if(obj.addEventListener){obj.addEventListener(event,wrapper,true);}}}
var hash={'caster':obj,'event':event,'sub':sub,'funct':funct,'wrapper':wrapper};for(var key in self._subscribers[event]){obj=self._subscribers[event][key];if(obj.caster==hash.caster&&obj.sub==hash.sub&&obj.funct.toString()==hash.funct.toString()){return obj;}}
if(!self._subscribers[event])self._subscribers[event]=[];self._subscribers[event].push(hash);return hash;},unsubscribe:function(id)
{if(!id.caster||!id.event)return;var self=Broadcaster;var ls=self._subscribers[id.event];for(var i=0;i<ls.length;i++){if(ls[i].caster==id.caster&&ls[i].event==id.event&&ls[i].sub==id.sub&&ls[i].funct==id.funct){self._destroy(ls,i);break;}}},unsubscribeAll:function(obj)
{if(!obj)return;var self=Broadcaster;var arr=self._subscribers;for(var key in arr){var subs=arr[key];if(typeof(subs)=='object'){for(var i=subs.length-1;i>-1;i--){if(subs[i]&&subs[i].sub==obj){self._destroy(subs,i);}}}}}}
function loadJSON(url,queryString,type)
{var headId=document.getElementsByTagName("head")[0];if(typeof(type)=="undefined")type='script';url+=(url.indexOf('?')>=0)?"&":"?";url+="noCacheIE="+(new Date()).getTime()+"&"+queryString;if(type=='link'){var link=document.createElement('link');link.rel='alternate';link.type='application/rss+xml';link.href=url;}else{var link=document.createElement('script');link.type='text/javascript';link.src=url;}
headId.appendChild(link);}
var okProfile={name:"okProfile",cookieName:'sub29oklamain_4',alias:'',profile_id:'',e_id:null,apiURL:"http://api.connectok.com/json/",containerId:'',broadcastLogin:0,initialize:function(params)
{if(typeof(params.apiURL)!='undefined'){this.apiURL=params.apiURL;}
if(typeof(params.containerId)!='undefined'){this.containerId=params.containerId;}
if(typeof(params.e_id)!='undefined')
{this.e_id=params.e_id;}else{this.e_id=this.readCookie();}},onLogin:function(params)
{if(params.profile_id>0){this.alias=params.alias;this.profile_id=params.profile_id;this.e_id=params.e_id;this.loggedIn();this.writeCookie();}
if(this.broadcastLogin==1){if(params.profile_id>0){Broadcaster.broadcast(this,'onLoggedIn');}else{Broadcaster.broadcast(this,'onLoggedInFailure');}
this.broadcastLogin=0;}},callLogin:function(loginURL,email,pass)
{var queryString='';queryString+='&method=Login.GetLogin';queryString+='&login_email='+escape(email);queryString+='&login_password='+escape(pass);loadJSON(loginURL,queryString,'script');},writeCookie:function()
{var today=new Date();var expires=new Date(today.getTime()+(86400*365));var curCookie=this.cookieName+"="+escape(this.e_id)+"; expires="+expires.toGMTString()+"; path=/;";document.cookie=curCookie;},readCookie:function()
{var theCookie=unescape(document.cookie);var allCookies=theCookie.split(";");for(var loop=0;loop<allCookies.length;loop++)
{var aCookie=allCookies[loop];var info=aCookie.split("=");if(info[1]){var key=info[0].replace(/^\s*/,"").replace(/\s*$/,"");var val=info[1].replace(/^\s*/,"").replace(/\s*$/,"");if(key==this.cookieName)return val;}}
return false;},load:function(params)
{loadJSON(this.apiURL,'method=Login.GetLogin&e_id='+escape(this.e_id),'script');},login:function(className)
{Broadcaster.subscribe(this,'onLoggedInFailure',this,'loginFailure')
if(typeof(className)=='undefined')className='loginPrompt';login=document.getElementById(this.containerId)
if(login==undefined){alert("Login container ("+this.containerId+") not found.");return false;}
var html="";html+="<div class='loginBox'>";html+="<a href='javascript:void(0);' onClick='"+this.name+".toggle();' class='loginClose' title='Close Login'>Close Login</a>";html+="<div id='"+this.name+"LoginFailure' class='loginFailure' style='display:none;'>";html+="Login was unsuccessfull, please try again.";html+="</div>";html+="<div class='clear'></div>";html+="<form onSubmit='"+this.name+".runLogin(this); return false;' style='display: inline;'>";html+="<div class='"+className+"Email'>";html+="<label><b>e-mail:</b><br /><input onBlur='Broadcaster.broadcast(okGallery, \"onKeyPressOn\");' onFocus='Broadcaster.broadcast(okGallery, \"onKeyPressOff\");' type='text' id='loginName' name='login_email' width='15' value='' /></label>";html+="</div>";html+="<div class='"+className+"Password'>";html+="<label><b>password:</b><br /><input onBlur='Broadcaster.broadcast(okGallery, \"onKeyPressOn\");' onFocus='Broadcaster.broadcast(okGallery, \"onKeyPressOff\");' type='password' name='login_password' width='15' value='' /></label>";html+="</div>";html+="<div class='submitLogin'>";html+="<input id='loginButton' type='submit' value='SIGN IN' />";html+="<a href='http://www.newsok.com/settings/password/' target='_blank'>Forgot Password?</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href='http://newsok.com/settings' target='_blank'>Sign up</a>";html+="<div class='clear'></div>";html+="</div>";html+="</form>";html+="</div>";login.innerHTML=html;login.style.display='block';document.getElementById('loginName').focus();},loginFailure:function()
{document.getElementById(this.name+'LoginFailure').style.display='block';},runLogin:function(f)
{this.broadcastLogin=1;this.callLogin(this.apiURL,f.login_email.value,f.login_password.value)},toggle:function(showPrompt)
{var loginDiv=document.getElementById(this.containerId);if(typeof(showPrompt)=='undefined'){if(loginDiv)loginDiv.style.display=(loginDiv.style.display!='none'?'none':'block');}else{if(loginDiv)loginDiv.style.display=(showPrompt==1)?'block':'none';}},loggedIn:function()
{this.toggle(0);}}
function getOkRating(params)
{return getOkRating.initialize(params);}
getOkRating.ratings=[]
getOkRating.initialize=function(params)
{if(typeof(params)=='undefined')params={};params.name='getOkRating.ratings['+getOkRating.ratings.length+']';return getOkRating.ratings[getOkRating.ratings.length]=new okRating(params);}
function okRating(params)
{this.initialize(params);}
okRating.names=[];okRating.prototype={name:"okRating",apiURL:"http://api.connectok.com/json/?method=Rating.GetRating",uid:'',containerId:'',login:null,params:null,rateSet:null,userRateSet:null,profile_id:0,initialize:function(params)
{this.params=params;okRating.names[params.name]=this;if(typeof(params.name)!='undefined'){this.name=params.name;}
if(typeof(params.currentPhotoId)!='undefined'){this.currentPhotoId=params.currentPhotoId;}
if(typeof(params.uid)!='undefined'){this.uid=params.uid;}
if(typeof(params.type_id)!='undefined'){this.type_id=params.type_id;}
if(typeof(params.apiURL)!='undefined'){this.apiURL=params.apiURL;}
if(typeof(params.containerId)!='undefined'){this.containerId=params.containerId;}
if(this.login==null)this.login=okProfile;Broadcaster.subscribe(okProfile,'onLoggedIn',this,'loggedIn')},setRating:function(pos)
{if(pos==null)return;queryString="method=Rating.SetRating";queryString+="&uid="+this.uid;queryString+="&e_id="+this.login.e_id;queryString+="&rating="+pos;loadJSON(this.apiURL,'callBack='+this.name+".display&"+queryString,'script');},getRating:function(uid)
{if(typeof(uid)=='undefined')return;this.uid=uid;queryString="method=Rating.GetRating";queryString+="&uid="+uid;queryString+="&e_id="+this.login.e_id;loadJSON(this.apiURL,'callBack='+this.name+".display&"+queryString,'script');},display:function(data)
{},resizeDiv:function(pos)
{findRate=parseInt(pos,10);document.getElementById(this.name+'userHover').style.width=(findRate*16)+'px';},setStars:function(pos)
{if(this.rateSet==null)this.rateSet=pos;this.resizeDiv(pos);document.getElementById(this.name+'userHover').style.backgroundPosition='0 -28px';},setRate:function(pos,callJSON)
{if(typeof(callJSON)=='undefined')callJSON=1;if(this.profile_id==0){this.rateSet=pos;this.loginPrompt(pos);}else{this.rateSet=pos;this.resizeDiv(pos);this.userRateSet=1;document.getElementById(this.name+'userHover').style.backgroundPosition='0 -14px';if(callJSON){this.setRating(pos);}}},resetStars:function()
{if(this.userRateSet>0){this.resizeDiv(this.rateSet);document.getElementById(this.name+'userHover').style.backgroundPosition='0 -14px';}else if(this.rateSet>0){this.resizeDiv(this.rateSet);document.getElementById(this.name+'userHover').style.backgroundPosition='0 -28px';}else{document.getElementById(this.name+'userHover').style.width='0px';}},loggedIn:function()
{this.getRating(this.uid);this.login.toggle(0);this.setRating(this.rateSet);},loginPrompt:function()
{this.login.login();}}
okRating.prototype.display=function(data)
{if(typeof(data.profile_id)=='undefined')return;var container=document.getElementById(this.containerId);if(container==undefined){alert("Photo container ("+this.containerId+") not found.");return false;}
while(container.firstChild)
{container.removeChild(container.firstChild);}
this.profile_id=data.profile_id;html="<div class='userRating' id='"+this.name+"userRating'>";if(this.login.e_id==''){html+="<a id='"+this.name+"rate1' title='Click to Login' href='javascript:void(0);' onclick='showLogin(); window.scrollBy(0,-10000); document.getElementById(\"usernameInput\").focus(); return false' onmouseover='"+this.name+".setStars(1);' onmouseout='"+this.name+".resetStars();'>1 Stars</a>";html+="<a id='"+this.name+"rate2' title='Click to Login' href='javascript:void(0);' onclick='showLogin(); window.scrollBy(0,-10000); document.getElementById(\"usernameInput\").focus(); return false' onmouseover='"+this.name+".setStars(2);' onmouseout='"+this.name+".resetStars();'>2 Stars</a>";html+="<a id='"+this.name+"rate3' title='Click to Login' href='javascript:void(0);' onclick='showLogin(); window.scrollBy(0,-10000); document.getElementById(\"usernameInput\").focus(); return false' onmouseover='"+this.name+".setStars(3);' onmouseout='"+this.name+".resetStars();'>3 Stars</a>";html+="<a id='"+this.name+"rate4' title='Click to Login' href='javascript:void(0);' onclick='showLogin(); window.scrollBy(0,-10000); document.getElementById(\"usernameInput\").focus(); return false' onmouseover='"+this.name+".setStars(4);' onmouseout='"+this.name+".resetStars();'>4 Stars</a>";html+="<a id='"+this.name+"rate5' title='Click to Login' href='javascript:void(0);' onclick='showLogin(); window.scrollBy(0,-10000); document.getElementById(\"usernameInput\").focus(); return false' onmouseover='"+this.name+".setStars(5);' onmouseout='"+this.name+".resetStars();'>5 Stars</a>";}else{html+="<a id='"+this.name+"rate1' title='Click to Rate 1 Star or Press 1' href='javascript:void(0);' onclick='"+this.name+".setRate(1);' onmouseover='"+this.name+".setStars(1);' onmouseout='"+this.name+".resetStars();'>1 Stars</a>";html+="<a id='"+this.name+"rate2' title='Click to Rate 2 Star or Press 2' href='javascript:void(0);' onclick='"+this.name+".setRate(2);' onmouseover='"+this.name+".setStars(2);' onmouseout='"+this.name+".resetStars();'>2 Stars</a>";html+="<a id='"+this.name+"rate3' title='Click to Rate 3 Star or Press 3' href='javascript:void(0);' onclick='"+this.name+".setRate(3);' onmouseover='"+this.name+".setStars(3);' onmouseout='"+this.name+".resetStars();'>3 Stars</a>";html+="<a id='"+this.name+"rate4' title='Click to Rate 4 Star or Press 4' href='javascript:void(0);' onclick='"+this.name+".setRate(4);' onmouseover='"+this.name+".setStars(4);' onmouseout='"+this.name+".resetStars();'>4 Stars</a>";html+="<a id='"+this.name+"rate5' title='Click to Rate 5 Star or Press 5' href='javascript:void(0);' onclick='"+this.name+".setRate(5);' onmouseover='"+this.name+".setStars(5);' onmouseout='"+this.name+".resetStars();'>5 Stars</a>";}
html+="</div>";html+="<div id='"+this.name+"userHover' class='userHover'></div>";html+="<div id='"+this.name+"ratingBase' class='ratingBase'></div>";html+="<div class='clear'></div>";container.innerHTML=html;if(data.user_rating>0){this.setRate(data.user_rating,0);}else{this.rateSet=data.average;this.setStars(data.average);}}
function getOkComment(params)
{return getOkComment.initialize(params);}
getOkComment.comments=[]
getOkComment.initialize=function(params)
{if(typeof(params)=='undefined')params={};params.name='getOkComment.comments['+getOkComment.comments.length+']';return getOkComment.comments[getOkComment.comments.length]=new okComment(params);}
function okComment(params)
{this.initialize(params);}
okComment.names=[];okComment.prototype={name:"okComment",apiURL:"http://stage-api.connectok.com/json/",uid:0,containerId:'',login:null,params:null,profile_id:0,data:null,initialize:function(params)
{this.params=params;okComment.names[params.name]=this;if(typeof(params.name)!='undefined'){this.name=params.name;}
if(typeof(params.currentPhotoId)!='undefined'){this.currentPhotoId=params.currentPhotoId;}
if(typeof(params.id)!='undefined'){this.id=params.id;}
if(typeof(params.type_id)!='undefined'){this.type_id=params.type_id;}
if(typeof(params.apiURL)!='undefined'){this.apiURL=params.apiURL;}
if(typeof(params.containerId)!='undefined'){this.containerId=params.containerId;}
if(this.login==null)this.login=okProfile;Broadcaster.subscribe(okProfile,'onLoggedIn',this,'loggedIn')},objectComment:function(comment_id,reason)
{queryString="method=Objection.MakeObjection";queryString+="&uid="+"Comment_"+comment_id;queryString+="&reason="+escape(reason);queryString+="&e_id="+this.login.e_id;loadJSON(this.apiURL,'callBack='+this.name+".iObjectDisplay&"+queryString,'script');},addComment:function(comment)
{queryString="method=Comment.AddComment";queryString+="&uid="+this.uid;queryString+="&comment="+escape(comment);queryString+="&e_id="+this.login.e_id;loadJSON(this.apiURL,'callBack='+this.name+".display&"+queryString,'script');},twitProfile:function(commentId)
{queryString="method=Comment.GetComments";queryString+="&uid="+this.uid;queryString+="&twitCommentId="+commentId;queryString+="&e_id="+this.login.e_id;loadJSON(this.apiURL,'callBack='+this.name+".display&"+queryString,'script');},unTwitProfile:function(commentId)
{queryString="method=Comment.GetComments";queryString+="&uid="+this.uid;queryString+="&unTwitCommentId="+commentId;queryString+="&e_id="+this.login.e_id;loadJSON(this.apiURL,'callBack='+this.name+".display&"+queryString,'script');},getComments:function(uid,showAll)
{if(typeof(uid)=='undefined')return;this.uid=uid;if(typeof(showAll)=='undefined')showAll=0;queryString="method=Comment.GetComments";queryString+="&uid="+this.uid;queryString+="&e_id="+this.login.e_id;queryString+="&showAllComments="+showAll;loadJSON(this.apiURL,'callBack='+this.name+".display&"+queryString,'script');},toggle:function(id)
{c=document.getElementById(id)
if(c)c.style.display=(c.style.display=='block')?'none':'block';},loggedIn:function()
{this.profile_id=this.login.profile_id;if(this.data)this.data.profile_id=this.profile_id;if(this.data)this.display(this.data);},loginPrompt:function()
{this.login.login();},display:function(data)
{}}
okComment.prototype.display=function(data)
{this.data=data;var container=document.getElementById(this.containerId);if(container==undefined){alert("Comment container ("+this.containerId+") not found.");return false;}
while(container.firstChild)
{container.removeChild(container.firstChild);}
this.profile_id=data.profileId;html="<div id='commentsPage' class='articleBody'>";html+="<h3 class='color bar'>Comments</h3>";html+="<div class='comments'>";html+="<div class='commentsContainer'>";html+="<div class='' id='"+this.name+"userComment'>";html+="<div class='addComment' id='"+this.name+"addComment' style='display:"+((this.login.e_id!='')?'block':'none')+"'>";html+="<p style='font-weight: normal;'>Thank you for joining our conversations on NewsOK.com.  We encourage your discussions but ask that you stay within the bounds of our terms and conditions.  Please help us by reporting comments that violate these guidelines.  To review our rules of engagement, go to <a href='http://newsok.com/commenting-policy'>Commenting and posting policy</a>.  <br/><br/><em>Editor's note: It is not our intent to offer comments on local crime or fatality stories.</em></p>";html+="<b>Leave a comment</b>";html+="<div class='commentForm' id='"+this.name+"addCommentForm'>";html+="<form onSubmit='"+this.name+".addComment(this.comment.value); return false;' style='display:inline'>";html+="<textarea id='"+this.name+"Comment' onBlur='Broadcaster.broadcast(okGallery, \"onKeyPressOn\");' onFocus='Broadcaster.broadcast(okGallery, \"onKeyPressOff\");' name='comment' rows='5' cols='30' class='commentArea' ></textarea>";html+="<input class='submitComment' type='submit' value='POST'/>";html+="</form>";html+="</div>";if(data.blockedComments>0){html+="<span><i>You are ignoring "+data.blockedComments+" comment";if(data.blockedComments>1){html+="s";}
if(data.blockedProfiles>0){html+=" from "+data.blockedProfiles+" user";}
if(data.blockedProfiles>1){html+="s";}
html+="</i> </span>";html+="<a href='javascript:void(0);' onclick='"+this.name+".getComments(\""+this.uid+"\", 1); return false;'><b>View all Comments</b></a>"
html+="&nbsp;<a href='http://newsok.com/database/whatsthis?KeepThis=true&TB_iframe=true&height=300&width=400' class='thickbox' title='What is this?'>";html+="<img src='http://s3.amazonaws.com/content.newsok.com/newsok/images/whats_this.gif' border='0' /></a>";}
html+="</div>";html+="<div id='"+this.name+"loginForm' style='display:"+((this.login.e_id!='')?'none':'block')+"'>";html+="<a href='javascript:void(0);' onClick='showLogin(); window.scrollBy(0,-10000); document.getElementById(\"usernameInput\").focus(); return false'>Login to comment</a>";html+="</div>";for(i=0;i<data.comments.length;i++)
{html+="<div class='comment'>"
html+=(this.profile_id==data.comments[i].profileId)?"<div class='myComment'>":"<div class=''>";html+="<div class='commentBody'>"+data.comments[i].body+"</div>";html+="<div class='attribute'><b>"+data.comments[i].fname+", "+data.comments[i].city+"</b> - "+data.comments[i].createDate;html+="</div>";if(data.profileId!=data.comments[i].profileId&&data.comments[i].objectionable!=0){html+="<span id='"+this.name+"IObject"+data.comments[i].id+"' class='object'><span class='dark'>Report as</span> <a href='javascript:void(0);' style='font-weight: normal;' onClick='"+this.name+".iObjectTemplate("+data.comments[i].id+"); return false;'><b>inappropriate</b></a> <span class='dark'>or </span></span>";}
if(data.profileId!=data.comments[i].profileId){if(data.comments[i].filteredProfile==0){html+="<span id='"+this.name+"Twit"+data.comments[i].id+"' class='object'><a href='javascript:void(0);' style='font-weight: normal;' onClick='"+this.name+".twitProfile("+data.comments[i].id+"); return false;'><b>ignore "+data.comments[i].fname+"</b></a></span>";}else{html+="<span id='"+this.name+"Twit"+data.comments[i].id+"' class='object'><a href='javascript:void(0);' style='font-weight: normal;' onClick='"+this.name+".unTwitProfile("+data.comments[i].id+"); return false;'><b>unignore</b></a> <span class='dark'>"+data.comments[i].fname+"</span></spaspann>";}}
html+="</div>";html+="<div id='"+this.name+data.comments[i].id+"CommentsObjection'></div>";html+="</div>";}
html+="</div>";html+="</div>";html+="</div>";html+="<div class='clear'></div>";container.innerHTML=html;}
okComment.prototype.iObjectDisplay=function(data)
{objection=document.getElementById(this.name+data.result.id+'CommentsObjection')
objectLink=document.getElementById(this.name+'IObject'+data.result.id)
if(objection)objection.style.display='none';if(objectLink)objectLink.style.display='none';}
okComment.prototype.iObjectTemplate=function(comment_id)
{if(typeof(className)=='undefined')className='objectionPrompt';objection=document.getElementById(this.name+comment_id+'CommentsObjection')
if(objection==undefined){alert("Login container ("+this.name+"CommentsObjection) not found.");return false;}
var html="";html+="<div class='objectionBoxContainer'>";html+="<div class='objectionBox'>";html+="<a href='javascript:void(0);' onClick='"+this.name+".toggle(\""+this.name+comment_id+"CommentsObjection\");' class='loginClose' title='Close Objection'>Close Objection</a>";html+="<div class='clear'></div>";html+="<form onSubmit='"+this.name+".objectComment("+comment_id+",this.objection.value); return false;'>";html+="<div class='"+className+"Email'>";html+="<label><b>Reason:</b><br /><input type='text' id='objection' name='objection' width='15' /></label>";html+="</div>";html+="<input id='objectButton' type='submit' id='objectButton' value='Report' />";html+="</form>";html+="</div>";html+="</div>";objection.innerHTML=html;objection.style.display='block';document.getElementById('objection').focus();}
var ptpServer="www.pictopia.com";var ptpNameSpace='oklahoman';var ptpPhoto='/2/showimage';function goPtp(title,photo_id)
{name='newsok_'+photo_id;t_url=ptpPhoto+'/'+photo_id+"/gallery_photo";var loc='http://'+ptpServer+'/perl/ptp/'+ptpNameSpace;loc+='?photo_name='+name+'&title='+escape(title)
loc+='&t_url='+escape(t_url)+'&time='+new Date().getTime();var win=window.open(loc,'ptp_'+ptpNameSpace,'width=1024, height=800, scrollbars=yes, resizable=yes, toolbar=no, '+'status=yes, menubar=no');win.focus();}
var PHOTO_TYPE_ID=30
function getPhotoGallery(params)
{return getPhotoGallery.initialize(params);}
getPhotoGallery.galleries=[];getPhotoGallery.initialize=function(params)
{if(typeof(params)=='undefined')params={};params.name='getPhotoGallery.galleries['+getPhotoGallery.galleries.length+']';return getPhotoGallery.galleries[getPhotoGallery.galleries.length]=new okGallery(params);}
function okGallery(params)
{this.initialize(params);}
okGallery.names=[];okGallery.overFullSizeNav=false;okGallery.prototype={name:"photoGallery",title:"",body:"",pub_date:"",thumbsPerPage:30,loadingImg:"http://static.newsok.biz/sites/newsok/images/n_loading.gif",photos:[],relatedArticlesContainer:"relatedArticles",relatedArticles:[],relatedArticleURL:"http://newsok.com/article/",currentPhoto:0,currentPhotoId:0,containerId:'photoGallery',apiURL:"http://api.connectok.com/json/",rssURL:"http://api.connectok.com/rss/",closeHTML:"X",id:null,type_id:null,pageUrl:null,playInterval:null,tags:null,logoSrc:null,timeOut:null,login:null,rating:null,comment:null,e_id:null,keybordShortCutsEnabled:true,initialize:function(params)
{okGallery.names[params.name]=this;if(typeof(params.name)!='undefined'){this.name=params.name;}
if(typeof(params.currentPhotoId)!='undefined'){this.currentPhotoId=params.currentPhotoId;}
if(typeof(params.photoId)!='undefined'){this.currentPhotoId=params.photoId;}
if(typeof(params.apiURL)!='undefined'){this.apiURL=params.apiURL;}
if(typeof(params.relatedArticlesContainer)!='undefined'){this.relatedArtilesContainer=params.relatedArticlesContainer;}
if(typeof(params.keyboardShortCutsEnabled)!='undefined'){this.keyboardShortCutsEnabled=params.keyboardShortCutsEnabled;}
if(typeof(params.pageUrl)!='undefined'){this.pageUrl=params.pageUrl;}
if(typeof(params.thumbsPerPage)!='undefined'){this.thumbsPerPage=params.thumbsPerPage;}
if(typeof(params.containerId)!='undefined'){this.containerId=params.containerId;}
if(typeof(params.thumbsPerPage)!='undefined'){this.thumbsPerPage=params.thumbsPerPage;}
loginParams=params;loginParams.containerId=this.name+"GalleryLogin";this.login=okProfile;this.login.initialize(params);ratingParams=params;ratingParams.containerId=this.name+"Rating";this.rating=getOkRating(ratingParams);this.rating.login=this.login;if(this.keyboardShortCutsEnabled){Broadcaster.subscribe(okGallery,'onKeyPressOff',this,'keyPressOff')
Broadcaster.subscribe(okGallery,'onKeyPressOn',this,'keyPressOn')
this.login.load();Broadcaster.broadcast(okGallery,'onKeyPressOn');}
this.clicks=0;},keyPressOff:function(e)
{document.onkeyup=function(){}},keyPressOn:function(e)
{document.onkeyup=okGallery.Delegate(this,this.keyPress);},keyPress:function(e)
{var keyId=(window.event)?event.keyCode:e.keyCode;switch(keyId)
{case 32:(this.playInterval!=null)?this.stopPlayPhotos():this.startPlayPhotos();break;case 37:this.changePhoto('prev');break;case 39:this.changePhoto('next');break;case 49:this.rating.setRate(1);break;case 50:this.rating.setRate(2);break;case 51:this.rating.setRate(3);break;case 52:this.rating.setRate(4);break;case 53:this.rating.setRate(5);break;}},getPhotos:function(params)
{this.id=(typeof(params.id)!='undefined')?params.id:0;this.type_id=(typeof(params.type_id)!='undefined')?params.type_id:0;search=(typeof(params.search)!='undefined')?params.search:'';tags=(typeof(params.tags)!='undefined')?params.tags:'';this.currentPhotoId=(typeof(params.photo_id)!='undefined')?params.photo_id:0;this.e_id=(typeof(params.e_id)!='undefined')?params.e_id:null;queryString="method=Photos.GetPhotos";queryString+="&id="+this.id;queryString+="&type_id="+this.type_id;queryString+="&search="+search;queryString+="&tags="+tags;queryString+="&show_id="+this.currentPhotoId;queryString+="&e_id="+this.e_id;loadJSON(this.apiURL,'callBack='+this.name+".display&"+queryString,'script');loadJSON(this.rssURL,queryString,'link');},display:function(data)
{var i=0;var container=document.getElementById(this.containerId);if(container==undefined){alert("Photo container ("+this.containerId+") not found.");return false;}
while(container.firstChild)
{container.removeChild(container.firstChild);}
this.title=data.title;if(data.body!=null)this.body=data.body;this.photos=data.photos;if(data.pub_date!=undefined)this.pub_date=data.pub_date;this.photos=data.photos;this.relatedArticles=(typeof(data.rels.article)=='undefined')?[]:data.rels.article;this.currentPhotoId=data.show;if(this.photos[0].commentLevelId==0){document.getElementById("photoComments").innerHTML="";}
if(!this.photos.length){return alert('There are no photos found.');}else if(this.currentPhotoId>0){for(i=0;i<this.photos.length;i++)
{if(this.photos[i].photo_id==this.currentPhotoId)this.currentPhoto=i;}
html=this.displayTemplate('photoView');}else{html=this.displayTemplate('thumbView');}
container.innerHTML=html;if(this.rating!=null)this.rating.getRating("Photo_"+this.currentPhotoId);if(this.comment!=null&&this.currentPhotoId>0)this.comment.getComments("Photo_"+this.currentPhotoId);if(this.relatedArticles.length>0)document.getElementById(this.relatedArticlesContainer).innerHTML=this.displayRelatedArticles();this.setPageUrl();this.omnitureEvent(this.title,this.currentPhoto+1,'Open Gallery');},setPageUrl:function()
{if(document.getElementById('pageUrl')&&this.pageUrl!=null){var pageUrl=document.getElementById('pageUrl');pageUrl.value=this.pageUrl+'/'+this.id;if(this.type_id!=null){pageUrl.value+='/'+this.type_id;}
if(this.currentPhotoId!=null&&this.currentPhotoId>0){pageUrl.value+='/'+this.currentPhotoId;}
if(document.getElementById('userloginForm')){document.getElementById('userloginForm').action=pageUrl.value}}},transitionPage:function(currentPage,nextPage)
{currentPageId=document.getElementById(this.name+"Page"+currentPage);currNavId=document.getElementById(this.name+"PageNo"+currentPage);nextPageId=document.getElementById(this.name+"Page"+nextPage);nextNavId=document.getElementById(this.name+"PageNo"+nextPage);resultsId=document.getElementById(this.name+"Results");if(currentPageId)currentPageId.style.display='none';if(nextPageId)nextPageId.style.display='block';if(currNavId)currNavId.className='navPhotos';if(nextNavId)nextNavId.className='navPhotosSelected';if(resultsId)resultsId.innerHTML=this.computeTnResultsText(nextPage);},transitionPhoto:function()
{var fullSizeImgId=document.getElementById(this.name+"FullSizeImg");var fullSizeCaptionTxt=document.getElementById(this.name+"FullSizeCaptionTxt");var photoImgId=document.getElementById(this.name+"MainImg");var photoPurchaseURL=document.getElementById(this.name+"PurchaseURL");var photoCaptionId=document.getElementById(this.name+"CaptionTxt");var logoId=document.getElementById('galleryLogo');resultsId=document.getElementById(this.name+"PhotoResults");if(logoId){logoId.style.display='block';photoImgId.onload=function(){logoId.style.display='none';}}
if(fullSizeCaptionTxt)fullSizeCaptionTxt.innerHTML=this.photos[this.currentPhoto].body;if(photoCaptionId)photoCaptionId.innerHTML=this.photos[this.currentPhoto].body;fullSizeURL=this.photos[this.currentPhoto].gallery_large_url;fullSizeURL+=(this.photos[this.currentPhoto].gallery_large_url.indexOf('?')>=0)?"&":"?";fullSizeURL+="recordView=0";if(photoImgId)photoImgId.src=this.photos[this.currentPhoto].gallery_photo_url;if(fullSizeImgId)fullSizeImgId.src=fullSizeURL;if(resultsId)resultsId.innerHTML=this.computePhotoResultsText();if(photoPurchaseURL){if(this.photos[this.currentPhoto].for_sale_url==''){photoPurchaseURL.style.display='none';}else{photoPurchaseURL.style.display='inline';photoPurchaseURL.href=this.photos[this.currentPhoto].for_sale_url}}
if(this.rating!=null)this.rating.getRating("Photo_"+this.photos[this.currentPhoto].photo_id);if(this.comment!=null)this.comment.getComments("Photo_"+this.photos[this.currentPhoto].photo_id);this.currentPhotoId=this.photos[this.currentPhoto].photo_id;this.setPageUrl();},changePhoto:function(nextOrPrev,repeat)
{currentPage=parseInt(this.currentPhoto/this.thumbsPerPage,10);repeating=(typeof(repeat)=="number")?repeat:0;if((nextOrPrev=='prev')&&(this.currentPhoto>0)){this.currentPhoto--;this.transitionPhoto();if((repeating==0)&&(this.playInterval>0))this.stopPlayPhotos(0);if(this.photos[this.currentPhoto].commentLevelId>0){commentView.style.display='block';}else{commentView.style.display='none';}}else if((nextOrPrev=='next')&&(this.currentPhoto+1<this.photos.length)){this.currentPhoto++;this.transitionPhoto();if((repeating==0)&&(this.playInterval>0))this.stopPlayPhotos(0);if(this.photos[this.currentPhoto].commentLevelId>0){commentView.style.display='block';}else{commentView.style.display='none';}}else if((nextOrPrev=='next')&&(repeating==1)){this.currentPhoto=0;this.transitionPhoto();}
nextPage=parseInt(this.currentPhoto/this.thumbsPerPage,10);if(nextPage!=currentPage)this.transitionPage(currentPage,nextPage);if(document.getElementById(this.name+"GalleryFullSize").style.display=='block'){trackSize='Large';}else{trackSize='';}
this.omnitureEvent(this.title,this.currentPhoto+1,'Photo View '+trackSize);},changePage:function(nextOrPrev,repeat)
{currentPage=parseInt(this.currentPhoto/this.thumbsPerPage,10);lastPage=parseInt(this.photos.length/this.thumbsPerPage,10);if((nextOrPrev=='prev')&&(currentPage>0)){nextPage=currentPage-1;this.currentPhoto=nextPage*this.thumbsPerPage;this.transitionPage(currentPage,nextPage);}else if((nextOrPrev=='next')&&(currentPage<lastPage)){nextPage=currentPage+1;this.currentPhoto=nextPage*this.thumbsPerPage;this.transitionPage(currentPage,nextPage);}else if(typeof(nextOrPrev)=="number"){this.currentPhoto=nextOrPrev*this.thumbsPerPage;this.transitionPage(currentPage,nextOrPrev);}
this.omnitureEvent(this.title,'Set-'+(parseInt(this.currentPhoto/this.thumbsPerPage,10)+1),'Thumbnail Page View');},changeView:function(view,currentPhotoId)
{thumbView=document.getElementById(this.name+"ThumbnailView");photoView=document.getElementById(this.name+"PhotoView");commentView=document.getElementById(this.name+"Comments");if(view=='thumbsView'){if(document.getElementById(this.name+"MainImg"))document.getElementById(this.name+"MainImg").src=this.loadingImg;if(document.getElementById(this.name+"CaptionTxt"))document.getElementById(this.name+"CaptionTxt").innerHTML=this.body;photoView.style.display='none';thumbView.style.display='block';commentView.style.display='none';this.currentPhotoId=null;}else if(view=='photoView'){if(typeof(currentPhotoId)=='number'){this.currentPhoto=currentPhotoId;this.transitionPhoto();}
thumbView.style.display='none';photoView.style.display='block';if(this.photos[this.currentPhoto].commentLevelId>0){commentView.style.display='block';}else{commentView.style.display='none';}}
this.setPageUrl();this.omnitureEvent(this.title,this.currentPhoto+1,'Switch to - '+view);},stopPlayPhotos:function(noSwapButtons)
{if(noSwapButtons!=1){if(document.getElementById(this.name+"ContentPlay"))document.getElementById(this.name+"ContentPlay").style.display="block";if(document.getElementById(this.name+"ContentPlay"))document.getElementById(this.name+"ContentStop").style.display="none";if(document.getElementById(this.name+"ContentFullSizePlay"))document.getElementById(this.name+"ContentFullSizePlay").style.display="block";if(document.getElementById(this.name+"ContentFullSizeStop"))document.getElementById(this.name+"ContentFullSizeStop").style.display="none";}
clearInterval(this.playInterval);this.playInterval=null;},startPlayPhotos:function()
{if(document.getElementById(this.name+"ContentPlay"))document.getElementById(this.name+"ContentPlay").style.display="none";if(document.getElementById(this.name+"ContentPlay"))document.getElementById(this.name+"ContentStop").style.display="block";if(document.getElementById(this.name+"ContentFullSizePlay"))document.getElementById(this.name+"ContentFullSizePlay").style.display="none";if(document.getElementById(this.name+"ContentFullSizeStop"))document.getElementById(this.name+"ContentFullSizeStop").style.display="block";this.changeView('photoView');this.stopPlayPhotos(1);this.playInterval=setInterval(this.name+".changePhoto('next', 1)",4000);},computePhotoResultsText:function(currentPage)
{start=this.currentPhoto+1;if(end>this.photos.length)end=this.photos.length;return start+" of "+this.photos.length+" photos";},computeTnResultsText:function(currentPage)
{start=((currentPage*this.thumbsPerPage)+1);end=start+this.thumbsPerPage-1;if(end>this.photos.length)end=this.photos.length;return"Results "+start+"-"+end+" of "+this.photos.length+" photos";},swapFullSize:function()
{gc=document.getElementById(this.name+"GalleryContent");gf=document.getElementById(this.name+"GalleryFullSize");if(gc&&gf){gf.style.display=(gf.style.display=='block')?"none":"block";gc.style.display=(gf.style.display=='block')?"none":"block";if(gf.style.display=='block'){document.onmousemove=okGallery.Delegate(this,this.showFullSizeNav);okGallery.Delegate(this,this.showFullSizeNav);this.omnitureEvent(this.title,this.currentPhoto+1,'Switch to - enlarge view');}else{document.onmousemove=function(){};if(document.getElementById(this.name+"PhotoView").style.display=='block'){this.omnitureEvent(this.title,this.currentPhoto+1,'Switch to - photoView');}}}},showFullSizeNav:function()
{if(document.getElementById(this.name+"FullSizeNav"))document.getElementById(this.name+"FullSizeNav").style.display="block";clearTimeout(this.timeOut);if(okGallery.overFullSizeNav==false)this.timeOut=setTimeout(this.name+".hideFullSizeNav()",2000);},showLargeNavOver:function()
{if(fullSizeImgId=document.getElementById(this.name+"FullSizeImg")){fullSizeImgId.onmouseover=okGallery.Delegate(this,this.hideLargeNavOut);}
okGallery.overFullSizeNav=true;clearTimeout(this.timeOut);},hideLargeNavOut:function()
{if(fullSizeImgId=document.getElementById(this.name+"FullSizeImg")){fullSizeImgId.onmouseover=function(){}}
okGallery.overFullSizeNav=false;clearTimeout(this.timeOut);this.timeOut=setTimeout(this.name+".hideFullSizeNav()",2000);},hideFullSizeNav:function()
{if(document.getElementById(this.name+"FullSizeNav"))document.getElementById(this.name+"FullSizeNav").style.display="none";},toggleCaption:function()
{var captionDiv=document.getElementById('captionOnOff');captionDiv.style.display=(captionDiv.style.display!='none'?'none':'block');},login:function()
{},displayTemplate:function()
{},displayRelatedArticles:function()
{},omnitureEvent:function(titleName,photoID,viewType)
{this.clicks++;var YWATracker=YWA.getTracker("1000942893616");YWATracker.submit();}}
okGallery.Delegate=function(self,func)
{if(typeof(func)=="string"){func=self[func];}
var im_func=func.im_func;var im_preargs=func.im_preargs;var im_self=func.im_self;if(typeof(func)=="function"&&typeof(func.apply)=="undefined"){}
if(typeof(im_func)!='function'){im_func=func;}
if(typeof(self)!='undefined'){im_self=self;}
if(typeof(im_preargs)=='undefined'){im_preargs=[];}else{im_preargs=im_preargs.slice();}
var newFunc=function(){var args=[];for(var i=0;i<arguments.length;i++){args.push(arguments[i]);}
var me=arguments.callee;if(me.im_preargs.length>0){args=me.im_preargs.concat(args);}
var self=me.im_self;if(!self){self=this;}
return me.im_func.apply(self,args);}
newFunc.im_self=im_self;newFunc.im_func=im_func;newFunc.im_preargs=im_preargs;return newFunc;}
okGallery.prototype.displayTemplate=function(viewType)
{var i=0;var html="";if(this.login!='null'){html+="<div id='"+this.name+"GalleryLogin' class='loginPrompt' style='display: none'></div>";}
html+="<div class='galleryTitles'>"+this.title+"</div>";html+="<div style='border-bottom:2px solid #DDDDDD; margin-bottom: 20px;'>";html+="<div class='container padding gray' id='galleryPage' style='margin-bottom: 0; border-top: 1px solid #CCC;'>";html+="<div id='"+this.name+"GalleryFullSize' class='fullSizePage' style='display: none'>";html+="<div id='captionOnOff' class='fullSizeCaption' style='display: none;'><div id='"+this.name+"FullSizeCaptionTxt' class='fullSizeCaptionHolder'>"+this.photos[this.currentPhoto].body+"</div></div>";html+="<div style='background: #5680AA; position: relative; z-index: 200000000; height: 27px;'><a onclick='"+this.name+".swapFullSize(); return false;' href='javascript:void(0);' title='Close' style='color: white; float: right; padding: 7px'><b>CLOSE</b></a></div>";html+="<div class='fullSize'>";html+="<table cellpadding='0' cellspacing='0' border='0' height='609' width='985'><tr><td align='center'>";html+="<a href='javascript:void(0);' title='Show/Hide Caption' onclick='"+this.name+".toggleCaption(); return false;'><img id='"+this.name+"FullSizeImg' src='"+this.photos[this.currentPhoto].gallery_large_url+"' />";html+="</td></tr></table>";html+="</div>";html+="<div class='largeControls' id='"+this.name+"FullSizeNav' align='center' style='display: block;' onMouseOver='"+this.name+".showLargeNavOver()' >";html+="<div class='largeControls_holder'>";html+="<a class='viewThumbs' href='javascript:void(0);' title='View Thumbnails' onClick='"+this.name+".changeView(\"thumbsView\"); "+this.name+".swapFullSize(); return false;'>Thumbs</a>";html+="<a class='prevPhoto' href='javascript:void(0);' title='Previous - Left Arrow' onClick='"+this.name+".changePhoto(\"prev\"); return false;'>Previous</a>";html+="<a class='playPhoto' href='javascript:void(0);' title='Play - Space Bar' id='"+this.name+"ContentFullSizePlay' onClick='"+this.name+".startPlayPhotos(); return false;'>Play</a>";html+="<a class='stopPhoto' href='javascript:void(0);' title='Pause - Space Bar' id='"+this.name+"ContentFullSizeStop' onClick='"+this.name+".stopPlayPhotos(); return false;' style='display: none;'>Pause</a>";html+="<a class='nextPhoto' href='javascript:void(0);' title='Next - Right Arrow' onClick='"+this.name+".changePhoto(\"next\"); return false;'>Next</a>";html+="<a class='enlargeClose' href='javascript:void(0);' title='Shrink' onClick='"+this.name+".swapFullSize(); return false;'>Close</a>";html+="<div class='clear'></div>";html+="</div>";html+="</div>";html+="<div class='clear'></div>";html+="<div id='TB_overlay' class='TB_overlayMacFFBGHack'></div>";html+="</div>";html+="<div id='"+this.name+"GalleryContent' style='display: block'>";html+="<div class='galleryPaddings'>";if(this.currentPhotoId){html+="<div class='galleryTnContainers' id='"+this.name+"ThumbnailView' style='display:none'>"}else{html+="<div class='galleryTnContainers' id='"+this.name+"ThumbnailView'>"}
html+="<div class='leftRails'>";html+="<div class='ratingBar'><div style='color: #CCC; padding: 10px 0 0 12px; font-weight: bold;'>Published: "+this.pub_date+"</div></div>";html+="<div class='galleryTnPhotos' style='height: auto;'>";html+="<div class='galleryTnPhotosPadding'>";for(i=0;i<this.photos.length;i++)
{pageNumber=parseInt(i/this.thumbsPerPage,10);if(((i%this.thumbsPerPage)==0)&&(i==0))html+="<div id='"+this.name+"Page"+pageNumber+"'>";if(((i%this.thumbsPerPage)==0)&&(i>0))html+="<div id='"+this.name+"Page"+pageNumber+"' style='display: none'>";html+="<a href='javascript:void(0);' title='View Thumbnails' onClick='"+this.name+".changeView(\"photoView\", "+i+"); return false'>";html+="<img height='78' width='78' class='galleryThumbnail' src='"+this.photos[i].sq73_url+"' /></a>";if(((i+1)==this.photos.length)||((i+1)%this.thumbsPerPage)==0)html+="</div>";}
html+="<div class='clear' style='padding-top:10px;'></div>";html+="</div>";html+="</div>";pages=parseInt(this.photos.length/this.thumbsPerPage,10);currentPage=parseInt(this.currentPhoto/this.thumbsPerPage,10);html+="<div class='controls'>";html+="<div class='galleryResults' id='"+this.name+"Results'>"+this.computeTnResultsText(currentPage)+"</div>";html+="<div class='galleryNavigation'>";if(this.photos.length>this.thumbsPerPage){html+="<a class='navPhotos' href='javascript:void(0);' title='Previous' onClick='"+this.name+".changePage(\"prev\"); return false'>&lt;</a>";for(i=0;i<=pages;i++)
{html+="<a href='javascript:void(0);' title='Go to page "+(i+1)+"'";html+=(i==currentPage)?"class='navPhotosSelected'":"class='navPhotos'";html+=" id='"+this.name+"PageNo"+i+"' onClick='"+this.name+".changePage("+i+"); return false'>"+(i+1)+"</a>";}
html+="<a href='javascript:void(0);' class='navPhotos' title='Next' onClick='"+this.name+".changePage(\"next\"); return false;'>&gt;</a>";html+="<select id='thumbNails' style='margin-left: 10px;' onChange='window.open(this.options[this.selectedIndex].value,\"_top\")'>";html+="<option ";if(this.thumbsPerPage==21){html+="selected='selected'";}
html+=" value='?thumbsPerPage=21'>3 Rows</option>";html+="<option ";if(this.thumbsPerPage==28){html+="selected='selected'";}
html+=" value='?thumbsPerPage=28'>4 Rows</option>";html+="<option ";if(this.thumbsPerPage==35){html+="selected='selected'";}
html+=" value='?thumbsPerPage=35'>5 Rows</option>";html+="<option ";if(this.thumbsPerPage==42){html+="selected='selected'";}
html+=" value='?thumbsPerPage=42'>6 Rows</option>";html+="<option ";if(this.thumbsPerPage==63){html+="selected='selected'";}
html+=" value='?thumbsPerPage=63'>9 Rows</option>";html+="<option ";if(this.thumbsPerPage==84){html+="selected='selected'";}
html+=" value='?thumbsPerPage=84'>12 Rows</option>";html+="</select>";}
html+="</div>";html+="</div>";html+="</div>";html+="<div class='rightRails'>";html+="<div class='galleryPhotoCaptions'>";html+="<br />";html+="<span id='"+this.name+"ThumbsCaptionTxt'>"+this.body+"</span>";html+="</div>";html+="<div class='commentForm' style='border-bottom: 0;'>";html+="<div style='float: left; width: 200px; font-size: 11px; font-family: Arial, Helvetica, sans-serif; text-align: left;'><a href='/multimedia/photos' style='font-weight: normal; color: #114477;'><img src='http://s3.amazonaws.com/content.newsok.com/newsok/images/backhome.gif' align='absmiddle' /> return to photo home</a></div>";var addthis_pub="jduncan@newsok.com";html+="<div style='float: left; width: 198px; text-align: center;'>&nbsp;</div>";html+="<div style='float: left; width: 200px;'>";html+="<a href='http://www.addthis.com/bookmark.php' onmouseover='return addthis_open(this, \"\", \""+this.pageUrl+"\", \""+encodeURIComponent(this.title)+"\")' onmouseout='addthis_close()' onclick='return addthis_sendto()'><img src='http://s7.addthis.com/static/btn/lg-share-en.gif' width='125' height='16' border='0' alt='' /></a>";html+="</div>";html+="<div class='clear'></div></div>";html+="</div>";html+="</div>";if(this.currentPhotoId){html+="<div class='galleryPhotoContainers' id='"+this.name+"PhotoView'>"}else{html+="<div class='galleryPhotoContainers' style='display:none;' id='"+this.name+"PhotoView'>"}
html+="<div class='leftRails'>";html+="<div class='ratingBar'>";html+="<div style='float: left; color: #CCC; padding: 10px 0 0 12px; font-weight: bold;'>Published: "+this.pub_date+"</div>";if(this.rating!='null'){html+="<div id='"+this.name+"Rating' class='galleryRating'></div>";}
html+="</div>";html+="<div class='galleryPhotoImg'>";html+="<div class='logoHolder'><div class='staticLogo'></div><img id='galleryLogo' src='http://static.newsok.biz/sites/newsok/images/n_loading2.gif' style='display: none;' alt='NewsOK' class='logo' /></div>";html+="<table cellpadding='0' cellspacing='0' border='0' height='454' width='100%'><tr><td align='center'>";html+="<a class='nextPhoto' title='Next Photo' href='javascript:void(0);' onClick='"+this.name+".changePhoto(\"next\"); return false;'><img id='"+this.name+"MainImg' src='"+this.photos[this.currentPhoto].gallery_photo_url+"' /></a>";html+="</td></tr></table>";html+=" </div>";if(this.photos.length>1){html+="<div style='position: absolute;'>";html+="<div class='thumbView' title='View Thumbnails' onClick='"+this.name+".changeView(\"thumbsView\"); return false;'>Thumbs</div>";html+="<div class='enlargeView' style='left:547px;' title='Enlarge Photo' onClick='"+this.name+".swapFullSize(); return false;'>Enlarge</div>";html+="</div>";}
if(this.photos.length>1){html+="<div class='controls'>";html+="<div class='galleryResults'><span id='"+this.name+"PhotoResults'>"+this.computePhotoResultsText(currentPage)+"</span> | <a href='javascript:void(0);' onClick='"+this.name+".changeView(\"thumbsView\"); return false'>display thumbs</a></div>";html+="<div class='controls_holder'>";html+="<a class='prevPhoto' title='Previous - Left Arrow' href='javascript:void(0);' onClick='"+this.name+".changePhoto(\"prev\"); return false;'>&laquo; PREV</a>";html+="<a id='"+this.name+"ContentPlay' class='playPhoto' title='Play - Space Bar' href='javascript:void(0);' onClick='"+this.name+".startPlayPhotos(); return false;'>> PLAY</a>";html+="<a id='"+this.name+"ContentStop' class='stopPhoto' title='Pause - Space Bar' href='javascript:void(0);'onClick='"+this.name+".stopPlayPhotos(); return false;' style='display: none;'>ll PAUSE</a>";html+="<a class='nextPhoto' title='Next - Right Arrow' href='javascript:void(0);'onClick='"+this.name+".changePhoto(\"next\"); return false;'>NEXT &raquo;</a></div><div class='clear'></div></div>";}
html+="</div>";html+="<div class='rightRails'>";html+="<div class='galleryPhotoCaptions'>";html+="<br />";html+="<span id='"+this.name+"CaptionTxt'>"+this.photos[this.currentPhoto].body+"</span>";html+="</div>";html+="<div class='commentForm' style='border-bottom: 0;'>";html+="<div style='float: left; width: 200px; font-size: 11px; font-family: Arial, Helvetica, sans-serif; text-align: left;'><a href='/multimedia/photos' style='font-weight: normal; color: #114477;'><img src='http://s3.amazonaws.com/content.newsok.com/newsok/images/backhome.gif' align='absmiddle' /> return to photo home</a></div>";var addthis_pub="jduncan@newsok.com";html+="<div style='float: left; width: 198px; text-align: center;'>";html+="&nbsp;</div>";html+="<div style='float: left; width: 200px;'>";html+="<a href='http://www.addthis.com/bookmark.php' onmouseover='return addthis_open(this, \"\", \""+this.pageUrl+"\", \""+encodeURIComponent(this.title)+"\")' onmouseout='addthis_close()' onclick='return addthis_sendto()'><img src='http://s7.addthis.com/static/btn/lg-share-en.gif' width='125' height='16' border='0' alt='' /></a>";html+="</div>";html+="<div class='clear'></div></div>";html+="</div>";html+="<div class='clear'></div>";html+=" </div>";html+="</div>";html+="</div>";html+="</div>";html+="</div>";if((this.comment!=null)&&(this.photos[this.currentPhoto].commentLevelId>0)){html+="<div id='"+this.name+"Comments' style='display: block'></div>";}else{html+="<div id='"+this.name+"Comments' style='display: none'></div>";}
return html;}
okGallery.prototype.displayRelatedArticles=function()
{var i=0;var html="";if(this.relatedArticles.length){html+="<h3 class='arrow bar'>Related Articles</h3>";html+="<div class='headlines'>";html+="<ul class='top_headlines'>";for(i=0;i<this.relatedArticles.length;i++)
{html+="<li class='";if(i||2){html+="odd";}else{html+="even";}
html+="'><a href='"+this.relatedArticleURL+this.relatedArticles[i].id+"'>"+this.relatedArticles[i].title+"</a></li>";}
html+="</ul>";html+="<br />";}
return html;}