var templatename = '_TEMPLATE';
function Top()
{
window.scroll(0,0);
}
function Goto(href) {
window.location.href = href;
}
function CreateBookmarkLink(url,title) {
if (window.sidebar) { window.sidebar.addPanel(title, url,""); }
if (window.external) { window.external.AddFavorite( url, title); }
if ((window.opera) && (window.print)) { return true; }
}
function IsValidObject(objToTest)
{
if (objToTest == null || objToTest == undefined) {
return false;
}
return true;
}
function SubmitForm(formname)
{
var form = document.getElementById(formname);
if (IsValidObject(form)) { form.submit(); }
}
function ShowOrderDetails(oid)
{
var visibility =document.getElementById('secOrderDetails'+oid).style.visibility;
xajax_ShowOrderDetails(visibility,oid);
}
$(document).ready(function(){
$('img[id*="preview"]').noContext();
$('img[id*="show"]').noContext();
$('img[id*="thumb"]').noContext();
$("#thumbBox").noContext();
$('div[id*="secOrderDetails"]').each(function() {
$(this).hide();
});
$('a[id*="orderlnk"]').toggle(function(){
var orderid = $(this).attr('id');
var oid = orderid.replace("orderlnk", "");
if ($("#secOrderDetails"+oid).is(":hidden")) { $("#secOrderDetails"+oid).slideDown('slow'); } else { $("#secOrderDetails"+oid).slideUp('slow'); }
},function(){
var orderid = $(this).attr('id');
var oid = orderid.replace("orderlnk", "");
if ($("#secOrderDetails"+oid).is(":visible")) { $("#secOrderDetails"+oid).slideUp('slow'); } else { $("#secOrderDetails"+oid).slideDown('slow'); }
});
$("#sizetablelnk").css("cursor","pointer");
$("#sizetablelnk").toggle(function(){
$(this).html("[ » ]");
$("#sizetable").hide('slow');
},function(){
$(this).html("[ « ]");
$("#sizetable").show('fast');
});
$('img[id*="preview"]').each(function(){
var max_width = 160;
var width = $(this).width();
var height = $(this).height();
if (width > max_width) {
var ratio = (height / width );
var new_width = max_width;
var new_height = (new_width * ratio);
//alert(new_width);
$(this).height(new_height).width(new_width);
}
});
$('img[id*="preview"]').load(function(){
var max_width = 160;
var width = $(this).width();
var height = $(this).height();
if (width > max_width) {
var ratio = (height / width );
var new_width = max_width;
var new_height = (new_width * ratio);
//alert(new_width);
$(this).height(new_height).width(new_width);
}
});
$('img[id*="show"]').each(function(){
var max_width = 230;
var width = $(this).width();
var height = $(this).height();
if (width > max_width) {
var ratio = (height / width );
var new_width = max_width;
var new_height = (new_width * ratio);
//alert(new_width);
$(this).height(new_height).width(new_width);
}
});
$('img[id*="show"]').load(function(){
var max_width = 230;
var width = $(this).width();
var height = $(this).height();
if (width > max_width) {
var ratio = (height / width );
var new_width = max_width;
var new_height = (new_width * ratio);
//alert(new_width);
$(this).height(new_height).width(new_width);
}
});
$('img[id*="thumb"]').click(function(){
var imgfilename = $(this).attr('src');
$('#imgcontainer').empty();
$('#imgcontainer').append('');
$('#imgcontainer').hide();
$('#imgcontainer').fadeIn("slow");
var title = $(this).attr('title');
var aprev = $('a[class="aprev"]');
aprev.attr("href",title);
aprev.attr("id",title);
});
$('img[id="goTop"]').click(function() {
$(window).scrollTo( {top:'0px', left:'0px'}, 800 );
});
$('td[id="mainpanel"]').click(function() {
document.location = "./";
});
});
function ShowPDF(pdffilename)
{
window.open(pdffilename, "", "width=800px, height=600px, resizable");
}
function checkEnter(e){
var characterCode;
if(e && e.which){ //if which property of event object is supported (NN4)
e = e
characterCode = e.which //character code is contained in NN4's which property
}
else{
e = event
characterCode = e.keyCode //character code is contained in IE's keyCode property
}
if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
return false
}
else{
return true
}
}
function getElementsByClassName(cn){
var arr = new Array();
var els = document.getElementsByTagName("*");
var exp= new RegExp("^(.* )?"+cn+"( .*)?$", "g");
for (var i = 0; i < els.length; i++ ){
if (exp.test(els[i].className)){
arr.push(els[i]);
}
}
return arr;
}
function ShowPicture(imgthumbfilename,imgfilename)
{
var picprev = document.getElementById('imgshow');
var aprev = getElementsByClassName('aprev');
picprev.src = imgthumbfilename;
aprev[0].href = imgfilename;
aprev[0].id = imgfilename;
}
function ShowCriteria(criteria)
{
document.getElementById('secCriteria').innerHTML = criteria;
}
function Goto(url)
{
document.location.href=url;
}
var thumbnailviewer={
enableTitle: false, //Should "title" attribute of link be used as description?
enableAnimation: true, //Enable fading animation?
definefooter: '